index.vue 4.3 KB

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