heartNumber.vue 5.2 KB

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