heartNumber.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. if(!l._formatted) {
  69. l.createDate = new Date(l.createDate).Format('yyyy.MM.dd hh:mm:ss')
  70. l.type = l.loveQuantity>=0?1:2 //1增加 2减少
  71. l._formatted = true
  72. }
  73. })
  74. queryParams.value.page++
  75. if(res.data.list.length===0) isOver.value = true;
  76. })
  77. }
  78. onLoad(options=>{
  79. isFamilyMember.value = uni.getStorageSync('isFamilyMember')?true:false;
  80. loveValue.value = options.loveValue??0;
  81. queryParams.value.userId = uni.getStorageSync('userInfo')&&JSON.parse(uni.getStorageSync('userInfo')).id;
  82. if(uni.getStorageSync('familyMemberInfo')) queryParams.value.memberId = JSON.parse(uni.getStorageSync('familyMemberInfo')).id;
  83. getList()
  84. })
  85. </script>
  86. <style scoped lang="scss">
  87. .common_page{
  88. padding-bottom: 20rpx;
  89. box-sizing: border-box;
  90. .top{
  91. padding: 93rpx 64rpx 0;
  92. height: 296rpx;
  93. box-sizing: border-box;
  94. position: relative;
  95. .num{
  96. font-family: DINAlternate, DINAlternate;
  97. font-weight: bold;
  98. font-size: 88rpx;
  99. color: #151B29;
  100. line-height: 103rpx;
  101. }
  102. .text{
  103. font-family: PingFangSC, PingFang SC;
  104. font-weight: 400;
  105. font-size: 28rpx;
  106. color: #151B29;
  107. line-height: 30rpx;
  108. margin-top: 11rpx;
  109. }
  110. }
  111. .list{
  112. position: relative;
  113. flex: 1;
  114. overflow-y: auto;
  115. width: calc(100% - 48rpx);
  116. margin: 0 auto;
  117. background: #FFFFFF;
  118. border-radius: 24rpx;
  119. padding: 6rpx 24rpx 40rpx;
  120. box-sizing: border-box;
  121. &-item{
  122. padding: 36rpx 0;
  123. border-bottom: 1rpx solid #E7E7E7;
  124. .time{
  125. font-family: PingFangSC, PingFang SC;
  126. font-weight: 400;
  127. font-size: 24rpx;
  128. color: #989998;
  129. line-height: 24rpx;
  130. }
  131. .content{
  132. margin-top: 36rpx;
  133. .left{
  134. flex: 1;
  135. image{
  136. width: 64rpx;
  137. height: 64rpx;
  138. }
  139. .texts{
  140. margin-left: 20rpx;
  141. .p{
  142. font-family: PingFangSC, PingFang SC;
  143. font-weight: 400;
  144. font-size: 32rpx;
  145. color: #151B29;
  146. &.tip{
  147. font-size: 24rpx;
  148. color: #676775;
  149. line-height: 24rpx;
  150. margin-top: 20rpx;
  151. }
  152. }
  153. }
  154. }
  155. .right{
  156. width: 200rpx;
  157. justify-content: flex-end;
  158. image{
  159. width: 24rpx;
  160. height: 22rpx;
  161. margin-right: 10rpx;
  162. }
  163. text{
  164. font-family: DINAlternate, DINAlternate;
  165. font-weight: bold;
  166. font-size: 36rpx;
  167. line-height: 42rpx;
  168. &.black{
  169. color: #151B29;
  170. }
  171. &.red{
  172. color: #F4657A;
  173. }
  174. }
  175. }
  176. }
  177. }
  178. }
  179. }
  180. </style>