heartNumber.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="common_page adffc" :style="{'height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title="我的爱心值" bgColor="transparent"></cus-header>
  4. <image src="https://oss.familydaf.cn/sxsnfile/20251218/812f9cd7c1cf4c1b82853f3a6266e93a.png" class="top_bg_img" mode="widthFix"></image>
  5. <view class="top">
  6. <view class="num">{{loveValue}}</view>
  7. <view class="text">我的爱心值</view>
  8. </view>
  9. <view class="list" v-if="list.length">
  10. <up-list @scrolltolower="scrolltolower" style="height: 100%;">
  11. <up-list-item v-for="(item, index) in list" :key="index">
  12. <view class="list-item">
  13. <view class="time">{{item.createDate||''}}</view>
  14. <view class="content adfacjb">
  15. <view class="left adfac">
  16. <image src="https://oss.familydaf.cn/sxsnfile/20251218/9ac66362a57b4c6d94ddbc9538735be7.png"></image>
  17. <view class="texts">
  18. <view class="p">{{transactionTypeDict[item.transactionType]||''}}</view>
  19. <view class="p tip">{{'报名参与公益实践活动'}}</view>
  20. </view>
  21. </view>
  22. <view class="right adfac">
  23. <image src="https://oss.familydaf.cn/sxsnfile/20251218/cdb8e97d40e44618ac38ad0e96f25cc0.png" v-if="item.type==2"></image>
  24. <image src="https://oss.familydaf.cn/sxsnfile/20251218/b349d32d69ab4b0eb70d6731d37197f8.png" v-else></image>
  25. <text :class="{'black':item.type==2,'red':item.type==1}">{{item.type==2?'':'+'}}</text>
  26. <text :class="{'black':item.type==2,'red':item.type==1}">{{item.loveQuantity||0}}</text>
  27. </view>
  28. </view>
  29. </view>
  30. </up-list-item>
  31. </up-list>
  32. </view>
  33. <view class="dataEmpty" v-else>
  34. <page-empty text="暂无爱心值记录"></page-empty>
  35. </view>
  36. </view>
  37. </template>
  38. <script setup name="">
  39. import CusHeader from '@/components/CusHeader/index.vue'
  40. import PageEmpty from '@/components/pageEmpty/index.vue'
  41. import { onLoad } from '@dcloudio/uni-app'
  42. import { ref, getCurrentInstance } from 'vue'
  43. const { proxy } = getCurrentInstance()
  44. const queryParams = ref({
  45. page:1,
  46. limit:10,
  47. userId:''
  48. })
  49. const transactionTypeDict = ref({
  50. 1:'渠道导入',
  51. 2:'公益捐赠'
  52. })
  53. const loveValue = ref(0)
  54. const isOver = ref(false)
  55. const list = ref([])
  56. const scrolltolower = () => {
  57. if(isOver.value) return
  58. getList()
  59. }
  60. const getList = () => {
  61. proxy.$api.get('/core/love/value/record/loveValueList',queryParams.value).then(({data:res})=>{
  62. if(res.code!==0) return proxy.$showToast(res.msg)
  63. list.value= [...list.value,...res.data.list];
  64. list.value.forEach(l=>{
  65. l.type = l.loveQuantity>=0?1:2 //1增加 2减少
  66. })
  67. queryParams.value.page++
  68. if(res.data.list.length===0) isOver.value = true;
  69. })
  70. }
  71. onLoad(options=>{
  72. loveValue.value = options.loveValue??0;
  73. queryParams.value.userId = uni.getStorageSync('userInfo')&&JSON.parse(uni.getStorageSync('userInfo')).id;
  74. getList()
  75. })
  76. </script>
  77. <style scoped lang="scss">
  78. .common_page{
  79. padding-bottom: 20rpx;
  80. box-sizing: border-box;
  81. .top{
  82. padding: 93rpx 64rpx 0;
  83. height: 296rpx;
  84. box-sizing: border-box;
  85. position: relative;
  86. .num{
  87. font-family: DINAlternate, DINAlternate;
  88. font-weight: bold;
  89. font-size: 88rpx;
  90. color: #151B29;
  91. line-height: 103rpx;
  92. }
  93. .text{
  94. font-family: PingFangSC, PingFang SC;
  95. font-weight: 400;
  96. font-size: 28rpx;
  97. color: #151B29;
  98. line-height: 30rpx;
  99. margin-top: 11rpx;
  100. }
  101. }
  102. .list{
  103. position: relative;
  104. flex: 1;
  105. overflow-y: auto;
  106. width: calc(100% - 48rpx);
  107. margin: 0 auto;
  108. background: #FFFFFF;
  109. border-radius: 24rpx;
  110. padding: 6rpx 24rpx 40rpx;
  111. box-sizing: border-box;
  112. &-item{
  113. padding: 36rpx 0;
  114. border-bottom: 1rpx solid #E7E7E7;
  115. .time{
  116. font-family: PingFangSC, PingFang SC;
  117. font-weight: 400;
  118. font-size: 24rpx;
  119. color: #989998;
  120. line-height: 24rpx;
  121. }
  122. .content{
  123. margin-top: 36rpx;
  124. .left{
  125. flex: 1;
  126. image{
  127. width: 64rpx;
  128. height: 64rpx;
  129. }
  130. .texts{
  131. margin-left: 20rpx;
  132. .p{
  133. font-family: PingFangSC, PingFang SC;
  134. font-weight: 400;
  135. font-size: 32rpx;
  136. color: #151B29;
  137. line-height: 32rpx;
  138. &.tip{
  139. font-size: 24rpx;
  140. color: #676775;
  141. line-height: 24rpx;
  142. margin-top: 20rpx;
  143. }
  144. }
  145. }
  146. }
  147. .right{
  148. width: 200rpx;
  149. justify-content: flex-end;
  150. image{
  151. width: 24rpx;
  152. height: 22rpx;
  153. margin-right: 10rpx;
  154. }
  155. text{
  156. font-family: DINAlternate, DINAlternate;
  157. font-weight: bold;
  158. font-size: 36rpx;
  159. line-height: 42rpx;
  160. &.black{
  161. color: #151B29;
  162. }
  163. &.red{
  164. color: #F4657A;
  165. }
  166. }
  167. }
  168. }
  169. }
  170. }
  171. }
  172. </style>