index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. <p>{{item.activityName||''}}</p>
  10. <view class="tip adf">
  11. <view class="tip-left adfac">
  12. <image src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/09/11/201a4250-24a4-412d-9ec9-fc58071d10ea.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://transcend.ringzle.com/xiaozhi-app/profile/2025/09/11/e9025f86-a59e-4f82-92f0-9d22e846193c.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. }
  78. &-status{
  79. width: 108rpx;
  80. height: 40rpx;
  81. background: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/11/17/301153c2-1142-48cd-be9e-26c97220436c.png') no-repeat;
  82. background-size: 100% 100%;
  83. font-family: PingFang-SC, PingFang-SC;
  84. font-weight: bold;
  85. font-size: 24rpx;
  86. color: #151B29;
  87. line-height: 36rpx;
  88. padding-left: 12rpx;
  89. position: absolute;
  90. left: 0;
  91. top: 0;
  92. }
  93. }
  94. &-right{
  95. width: calc(100% - 158rpx);
  96. padding-left: 20rpx;
  97. box-sizing: border-box;
  98. &>p{
  99. font-family: PingFang-SC, PingFang-SC;
  100. font-weight: bold;
  101. font-size: 32rpx;
  102. color: #151B29;
  103. line-height: 40rpx;
  104. margin-bottom: 5rpx;
  105. }
  106. .tip{
  107. margin-top: 25rpx;
  108. &-left{
  109. width: 160rpx;
  110. image{
  111. width: 24rpx;
  112. height: 24rpx;
  113. }
  114. text{
  115. font-family: PingFangSC, PingFang SC;
  116. font-weight: 400;
  117. font-size: 24rpx;
  118. color: #676775;
  119. line-height: 24rpx;
  120. margin-left: 10rpx;
  121. }
  122. }
  123. &-right{
  124. width: calc(100% - 160rpx);
  125. font-family: PingFangSC, PingFang SC;
  126. font-weight: 400;
  127. font-size: 24rpx;
  128. color: #676775;
  129. line-height: 24rpx;
  130. margin-left: 10rpx;
  131. }
  132. }
  133. }
  134. }
  135. .na-bottom{
  136. margin-top: 24rpx;
  137. &-left{
  138. font-family: PingFangSC, PingFang SC;
  139. font-weight: 400;
  140. font-size: 24rpx;
  141. color: #676775;
  142. line-height: 24rpx;
  143. }
  144. &-right{
  145. background: #B7F358;
  146. border-radius: 27rpx;
  147. padding: 12rpx 30rpx;
  148. font-family: PingFang-SC, PingFang-SC;
  149. font-weight: bold;
  150. font-size: 24rpx;
  151. color: #151B29;
  152. line-height: 30rpx;
  153. }
  154. }
  155. }
  156. </style>