index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <view class="nonprofit-activety" @tap.self="handleDetail(item)" v-if="item">
  3. <div class="na-top adf">
  4. <div class="na-top-left">
  5. <image :src="item.coverFile"></image>
  6. <div class="na-top-left-status">{{statusCfg[item.activeState]}}</div>
  7. </div>
  8. <div class="na-top-right">
  9. <p>{{item.activityName||''}}</p>
  10. <div class="tip adf">
  11. <div 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. </div>
  15. <!-- <div class="tip-right">{{item.endTimeText}}</div> -->
  16. <div class="tip-right">{{item.signupEndTime||'暂无'}}</div>
  17. </div>
  18. <div class="tip adf">
  19. <div 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. </div>
  23. <div class="tip-right">{{item.provinceName||''}}{{item.cityName||''}}</div>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="na-bottom adfacjb">
  28. <div class="na-bottom-left adf">
  29. 已报名&nbsp;&nbsp;<strong>{{item.recruitmentNow}}</strong>/{{item.recruitmentMax===0?'无限制':(item.recruitmentMax+'&nbsp;&nbsp;人')}}
  30. </div>
  31. <!-- <div class="na-bottom-right" @tap.stop="toApply">立即报名</div> -->
  32. </div>
  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. const statusCfg = ref({
  46. 0:'未开始',
  47. 1:'报名中',
  48. 2:'进行中',
  49. 3:'已结束'
  50. })
  51. const handleDetail = item => {
  52. uni.navigateTo({
  53. url:'/pagesHome/activityDetail?id='+item.id
  54. })
  55. }
  56. const toApply = () => {
  57. userStore.openLoginModal();
  58. }
  59. </script>
  60. <style scoped lang="scss">
  61. .nonprofit-activety{
  62. background: linear-gradient( 45deg, #FFFFFF 80%, #F2FFE8 100%);
  63. border-radius: 24rpx;
  64. padding: 36rpx 24rpx 32rpx;
  65. margin-top: 20rpx;
  66. .na-top{
  67. &-left{
  68. width: 158rpx;
  69. height: 214rpx;
  70. position: relative;
  71. image{
  72. width: 100%;
  73. height: 100%;
  74. }
  75. &-status{
  76. width: 108rpx;
  77. height: 40rpx;
  78. background: url('https://transcend.ringzle.com/xiaozhi-app/profile/2025/11/17/301153c2-1142-48cd-be9e-26c97220436c.png') no-repeat;
  79. background-size: 100% 100%;
  80. font-family: PingFang-SC, PingFang-SC;
  81. font-weight: bold;
  82. font-size: 24rpx;
  83. color: #151B29;
  84. line-height: 36rpx;
  85. padding-left: 12rpx;
  86. position: absolute;
  87. left: 0;
  88. top: 0;
  89. }
  90. }
  91. &-right{
  92. width: calc(100% - 158rpx);
  93. padding-left: 20rpx;
  94. box-sizing: border-box;
  95. &>p{
  96. font-family: PingFang-SC, PingFang-SC;
  97. font-weight: bold;
  98. font-size: 32rpx;
  99. color: #151B29;
  100. line-height: 40rpx;
  101. margin-bottom: 5rpx;
  102. }
  103. .tip{
  104. margin-top: 25rpx;
  105. &-left{
  106. width: 160rpx;
  107. image{
  108. width: 24rpx;
  109. height: 24rpx;
  110. }
  111. text{
  112. font-family: PingFangSC, PingFang SC;
  113. font-weight: 400;
  114. font-size: 24rpx;
  115. color: #676775;
  116. line-height: 24rpx;
  117. margin-left: 10rpx;
  118. }
  119. }
  120. &-right{
  121. width: calc(100% - 160rpx);
  122. font-family: PingFangSC, PingFang SC;
  123. font-weight: 400;
  124. font-size: 24rpx;
  125. color: #676775;
  126. line-height: 24rpx;
  127. margin-left: 10rpx;
  128. }
  129. }
  130. }
  131. }
  132. .na-bottom{
  133. margin-top: 24rpx;
  134. &-left{
  135. font-family: PingFangSC, PingFang SC;
  136. font-weight: 400;
  137. font-size: 24rpx;
  138. color: #676775;
  139. line-height: 24rpx;
  140. }
  141. &-right{
  142. background: #B7F358;
  143. border-radius: 27rpx;
  144. padding: 12rpx 30rpx;
  145. font-family: PingFang-SC, PingFang-SC;
  146. font-weight: bold;
  147. font-size: 24rpx;
  148. color: #151B29;
  149. line-height: 30rpx;
  150. }
  151. }
  152. }
  153. </style>