index.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view class="nonprofit-activety" @click.self="handleDetail(item)" v-if="item" :style="{'margin-top':index===0?0:'20rpx'}">
  3. <view class="na-top adf">
  4. <view class="na-top-left">
  5. <image :src="item.coverFile"></image>
  6. <view class="na-top-left-status">{{statusCfg[item.activeState]}}</view>
  7. </view>
  8. <view class="na-top-right">
  9. <view class="p">{{item.activityName||''}}</view>
  10. <view class="tip adf">
  11. <view class="tip-left adfac">
  12. <image src="https://oss.familydaf.cn/sxsnfile/20251218/762878799914422d835e505291b9d4c6.png"></image>
  13. <text>截止报名:</text>
  14. </view>
  15. <!-- <view class="tip-right">{{item.endTimeText}}</view> -->
  16. <view class="tip-right">{{item.signupEndTime||''}}</view>
  17. </view>
  18. <view class="tip adf">
  19. <view class="tip-left adfac">
  20. <image src="https://oss.familydaf.cn/sxsnfile/20251218/57539643ab974aef9401d76818e1bf3b.png"></image>
  21. <text>活动地点:</text>
  22. </view>
  23. <view class="tip-right">{{item.provinceName||''}}{{item.cityName||''}}</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="na-bottom adfacjb">
  28. <view class="na-bottom-left adf" v-if="item.activeState===0||item.activeState===1">
  29. <text>报名中</text>
  30. <text class="na-bottom-count" v-if="item.recruitmentMax"> · 已报{{ item.recruitmentNow || 0 }}/{{ item.recruitmentMax }}人</text>
  31. <text class="na-bottom-count" v-else> · 已报{{ item.recruitmentNow || 0 }}人</text>
  32. </view>
  33. <!-- <view class="na-bottom-right" @click.stop="toApply">立即报名</view> -->
  34. </view>
  35. </view>
  36. </template>
  37. <script setup name="nonprofitActivety">
  38. defineProps({
  39. item:{
  40. typeof:Object,
  41. default:null
  42. },
  43. index:{
  44. typeof:Number,
  45. default:0
  46. }
  47. })
  48. import { ref } from 'vue'
  49. import { useUserStore } from '@/common/stores/user';
  50. const userStore = useUserStore();
  51. import { useGlobalShare } from '@/common/composables/useGlobalShare';
  52. const { isLogin } = useGlobalShare();
  53. const statusCfg = ref({
  54. '-1': '已取消',
  55. 0:'未开始',
  56. 1:'报名中',
  57. 2:'进行中',
  58. 3:'已结束'
  59. })
  60. const handleDetail = item => {
  61. if(!isLogin()) return
  62. uni.navigateTo({
  63. url:'/pagesHome/activityDetail?id='+item.id
  64. })
  65. }
  66. const toApply = () => {
  67. userStore.openLoginModal();
  68. }
  69. </script>
  70. <style scoped lang="scss">
  71. .nonprofit-activety{
  72. background: linear-gradient( 45deg, #FFFFFF 80%, #F2FFE8 100%);
  73. border-radius: 16rpx;
  74. padding: 36rpx 24rpx 32rpx;
  75. margin-top: 20rpx;
  76. .na-top{
  77. &-left{
  78. width: 158rpx;
  79. height: 214rpx;
  80. position: relative;
  81. border-radius: 16rpx;
  82. image{
  83. width: 100%;
  84. height: 100%;
  85. border-radius: 16rpx;
  86. }
  87. &-status{
  88. width: 108rpx;
  89. height: 40rpx;
  90. background: url('https://oss.familydaf.cn/sxsnfile/20251218/c2a2c624e39e4c719841c9c13b0836be.png') no-repeat;
  91. background-size: 100% 100%;
  92. background-position: -1rpx -1rpx;
  93. font-family: PingFang-SC, PingFang-SC;
  94. font-weight: bold;
  95. font-size: 24rpx;
  96. color: #151B29;
  97. line-height: 39rpx;
  98. position: absolute;
  99. left: 0;
  100. top: 0;
  101. border-radius: 16rpx 0 0 0;
  102. text-indent: 12rpx;
  103. }
  104. }
  105. &-right{
  106. width: calc(100% - 158rpx);
  107. padding-left: 20rpx;
  108. box-sizing: border-box;
  109. .p{
  110. font-family: PingFang-SC, PingFang-SC;
  111. font-weight: bold;
  112. font-size: 32rpx;
  113. color: #151B29;
  114. line-height: 40rpx;
  115. margin-bottom: 5rpx;
  116. }
  117. .tip{
  118. margin-top: 25rpx;
  119. &-left{
  120. width: 160rpx;
  121. image{
  122. width: 24rpx;
  123. height: 24rpx;
  124. }
  125. text{
  126. font-family: PingFangSC, PingFang SC;
  127. font-weight: 400;
  128. font-size: 24rpx;
  129. color: #676775;
  130. line-height: 24rpx;
  131. padding-left: 10rpx;
  132. box-sizing: border-box;
  133. }
  134. }
  135. &-right{
  136. width: calc(100% - 160rpx);
  137. font-family: PingFangSC, PingFang SC;
  138. font-weight: 400;
  139. font-size: 24rpx;
  140. color: #676775;
  141. line-height: 24rpx;
  142. box-sizing: border-box;
  143. }
  144. }
  145. }
  146. }
  147. .na-bottom{
  148. margin-top: 24rpx;
  149. &-left{
  150. font-family: PingFangSC, PingFang SC;
  151. font-weight: 400;
  152. font-size: 24rpx;
  153. color: #676775;
  154. line-height: 24rpx;
  155. }
  156. &-count{
  157. color: #70CF52;
  158. }
  159. &-right{
  160. background: #B7F358;
  161. border-radius: 27rpx;
  162. padding: 12rpx 30rpx;
  163. font-family: PingFang-SC, PingFang-SC;
  164. font-weight: bold;
  165. font-size: 24rpx;
  166. color: #151B29;
  167. line-height: 30rpx;
  168. }
  169. }
  170. }
  171. </style>