heartNumber.vue 5.3 KB

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