index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view class="ni" v-if="item" @click="toDetail(item)">
  3. <view class="ni-top adfacjb">
  4. <view class="ni-top-left adfac">
  5. <image class="avatar" src="https://oss.familydaf.cn/sxsnfile/20251218/2b822605d8d04cffb53b8521478ec2f9.png"></image>
  6. <view class="name">{{item?.memberName||''}}</view>
  7. <image class="sex" v-if="item?.gender==1" src="https://oss.familydaf.cn/sxsnfile/20251218/473d5677fbdb4106acdb9a163377d27f.png"></image>
  8. <image class="sex" v-else-if="item?.gender==0" src="https://oss.familydaf.cn/sxsnfile/20251218/02bc40a1c47b40f1a36b55cd0553211c.png"></image>
  9. <view class="age" :class="{'women':item?.gender==1,'man':item?.gender==0}">{{item?.age||0}}岁</view>
  10. </view>
  11. <view class="ni-top-right" :class="{'grey':item.signupState==-1||item.signupState==3}">{{statusDict[item?.signupState]||''}}</view>
  12. </view>
  13. <view class="ni-info adfacjb">
  14. <view class="ni-info-left">
  15. <image :src="item?.coverFile||''"></image>
  16. </view>
  17. <view class="ni-info-right">
  18. <view class="title">{{item?.activityName||''}}</view>
  19. <view class="tip adf">
  20. <view class="tip-left adfac">
  21. <image src="https://oss.familydaf.cn/sxsnfile/20251218/762878799914422d835e505291b9d4c6.png"></image>
  22. <text>活动时间:</text>
  23. </view>
  24. <view class="tip-right">{{item?.activityStartTime||''}} ~ {{item?.activityEndTime||''}}</view>
  25. </view>
  26. <view class="tip adf">
  27. <view class="tip-left adfac">
  28. <image src="https://oss.familydaf.cn/sxsnfile/20251218/57539643ab974aef9401d76818e1bf3b.png"></image>
  29. <text>活动地点:</text>
  30. </view>
  31. <view class="tip-right">{{item?.provinceName||''}}{{item?.cityName||''}}</view>
  32. </view>
  33. <view class="bottom">
  34. <view class="btn" v-if="item.activeState==1&&item.signupState==1">取消报名</view>
  35. <view class="btn" v-if="item.activeState==1&&item.signupState==-1">立即报名</view>
  36. <view class="btn" v-if="item.activeState==2&&item.signupState==1">去签到</view>
  37. <view class="btn" v-if="item.activeState==3&&item.signupState==2">写档案</view>
  38. <view class="btn" v-if="item.activeState==3&&item.signupState==3">查看档案</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script setup name="NonprofitItem">
  45. import { ref } from 'vue'
  46. const props = defineProps({
  47. item:{
  48. typeof:Object,
  49. default:null
  50. }
  51. })
  52. const statusDict = ref({
  53. '-1':'已取消',
  54. 1:'已报名',
  55. 2:'已签到',
  56. 3:'已完成'
  57. })
  58. const btnTextDict = ref({
  59. 1:'取消报名',
  60. 2:'去签到',
  61. 3:'填写公益档案'
  62. })
  63. const toDetail = item => {
  64. uni.navigateTo({
  65. url:'/pagesNonprofit/nonprofitDetail?memberSignupId='+item?.memberSignupId
  66. })
  67. }
  68. </script>
  69. <style scoped lang="scss">
  70. .ni{
  71. background: #FFFFFF;
  72. border-radius: 24rpx;
  73. padding: 40rpx 24rpx 32rpx;
  74. margin-top: 20rpx;
  75. &-top{
  76. &-left{
  77. .avatar{
  78. width: 48rpx;
  79. height: 48rpx;
  80. }
  81. .name{
  82. font-family: PingFang-SC, PingFang-SC;
  83. font-weight: bold;
  84. font-size: 32rpx;
  85. color: #151B29;
  86. line-height: 32rpx;
  87. margin-left: 16rpx;
  88. }
  89. .sex{
  90. width: 44rpx;
  91. height: 32rpx;
  92. margin-left: 10rpx;
  93. }
  94. .age{
  95. border-radius: 13rpx;
  96. font-family: PingFangSC, PingFang SC;
  97. font-weight: 400;
  98. font-size: 20rpx;
  99. line-height: 24rpx;
  100. padding: 4rpx 10rpx;
  101. margin-left: 13rpx;
  102. &.women{
  103. background: rgba(244,101,122,0.14);
  104. color: #F4657A;
  105. }
  106. &.man{
  107. background: rgba(5,169,254,0.12);
  108. color: #05A9FE;
  109. }
  110. }
  111. }
  112. &-right{
  113. background: rgba(183, 243, 88, .2);
  114. border-radius: 27rpx;
  115. padding: 12rpx 18rpx;
  116. font-family: PingFangSC, PingFang SC;
  117. font-weight: 400;
  118. font-size: 24rpx;
  119. color: #70CF52;
  120. line-height: 24rpx;
  121. &.grey{
  122. background: #F0F2F8;
  123. color: #646464;
  124. }
  125. }
  126. }
  127. &-info{
  128. margin-top: 40rpx;
  129. &-left{
  130. width: 158rpx;
  131. height: 214rpx;
  132. image{
  133. width: 100%;
  134. height: 100%;
  135. border-radius: 16rpx;
  136. }
  137. }
  138. &-right{
  139. width: calc(100% - 158rpx);
  140. padding-left: 20rpx;
  141. box-sizing: border-box;
  142. .title{
  143. font-family: PingFang-SC, PingFang-SC;
  144. font-weight: bold;
  145. font-size: 32rpx;
  146. color: #151B29;
  147. line-height: 40rpx;
  148. margin-bottom: 5rpx;
  149. }
  150. .tip{
  151. align-items: flex-start;
  152. margin-top: 25rpx;
  153. &-left{
  154. width: 150rpx;
  155. image{
  156. width: 24rpx;
  157. height: 24rpx;
  158. }
  159. text{
  160. font-family: PingFangSC, PingFang SC;
  161. font-weight: 400;
  162. font-size: 24rpx;
  163. color: #676775;
  164. line-height: 24rpx;
  165. padding-left: 10rpx;
  166. box-sizing: border-box;
  167. }
  168. }
  169. &-right{
  170. width: calc(100% - 150rpx);
  171. font-family: PingFangSC, PingFang SC;
  172. font-weight: 400;
  173. font-size: 24rpx;
  174. color: #676775;
  175. line-height: 24rpx;
  176. }
  177. }
  178. .bottom{
  179. margin-top: 30rpx;
  180. display: flex;
  181. justify-content: flex-end;
  182. }
  183. .btn{
  184. background: #B7F358;
  185. border-radius: 27rpx;
  186. padding: 12rpx 26rpx;
  187. font-family: PingFang-SC, PingFang-SC;
  188. font-weight: bold;
  189. font-size: 24rpx;
  190. color: #252525;
  191. line-height: 30rpx;
  192. }
  193. }
  194. }
  195. }
  196. </style>