index.vue 4.2 KB

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