pointsDetail.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="safe-area-inset-bottom">
  3. <back v-if="backShow" :title="title"></back>
  4. <u-navbar v-else title-color="#fff" :border-bottom="false" title="积分明细" back-icon-color="#fff"
  5. :background="{'backgroundColor': vuex_theme.shopBg}"></u-navbar>
  6. <view class="" >
  7. <view class="bg-img flex justify-center align-center"
  8. style="background-image: url('https://music.nanyue6688.com/obsfile/29a50aaf357d45cc96033d470eb2b971-bg_mingxi@2x.png');height: 340upx;z-index: 9999999999999;">
  9. <view class="text-center" style="margin-top: 150upx;">
  10. <view style="font-size: 26upx;color: #FFFFFF;font-weight: 400;">可用积分</view>
  11. <view style="font-size: 58upx;margin-top: 7rpx;color: #ffffff;">
  12. {{$cache.get('userInfo').pufaPoint}}
  13. </view>
  14. </view>
  15. </view>
  16. <mescroll-body-diy ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback"
  17. @up="upCallback">
  18. <view class="flex justify-between align-center container " v-for="(item, index) in list" :key="index">
  19. <view class="padding">
  20. <view class="type">活动助力</view>
  21. <view class="time">{{item.createTime}}</view>
  22. </view>
  23. <view class="padding">
  24. <view class="points plus">{{item.point}} 积分</view>
  25. </view>
  26. </view>
  27. </mescroll-body-diy>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import back from "@/components/back.vue"
  33. import MescrollBodyDiy from "@/uni_modules/mescroll-uni/components/mescroll-diy/xinlang/mescroll-body.vue";
  34. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  35. export default {
  36. mixins: [MescrollMixin],
  37. components: {
  38. back,
  39. MescrollBodyDiy,
  40. },
  41. data() {
  42. return {
  43. title: '积分明细',
  44. backShow: true,
  45. downOption: {
  46. auto: false
  47. },
  48. upOption:{
  49. auto:false
  50. },
  51. list: []
  52. }
  53. },
  54. onPageScroll(res) {
  55. if (res.scrollTop > 0) {
  56. this.title = ''
  57. } else {
  58. this.title = '积分明细'
  59. }
  60. if (res.scrollTop > 100) {
  61. this.backShow = false
  62. } else {
  63. this.backShow = true
  64. }
  65. },
  66. onLoad() {
  67. this.mescroll.resetUpScroll();
  68. },
  69. methods: {
  70. downCallback() {
  71. setTimeout(() => {
  72. this.mescroll.resetUpScroll();
  73. }, 800)
  74. },
  75. upCallback(mescroll) {
  76. try {
  77. let params = {
  78. current: mescroll.num,
  79. size: mescroll.size,
  80. }
  81. this.$api.points.list(params).then(res => {
  82. let data = res.data.data.records
  83. let total = res.data.data.total
  84. mescroll.endBySize(data.length, total);
  85. if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
  86. this.list = this.list.concat(data); //追加新数据
  87. })
  88. } catch (e) {
  89. this.mescroll.endErr()
  90. }
  91. }
  92. }
  93. }
  94. </script>
  95. <style>
  96. .container {
  97. background-color: #FFFFFF;
  98. border-radius: 10upx;
  99. margin: 20upx;
  100. }
  101. .type {
  102. font-size: 30upx;
  103. font-family: PingFang-SC-Heavy;
  104. font-weight: bold;
  105. margin-bottom: 20upx;
  106. color: #111111;
  107. }
  108. .time {
  109. font-size: 24upx;
  110. font-family: PingFang-SC-Medium;
  111. font-weight: 400;
  112. color: #999999;
  113. }
  114. .points {
  115. font-size: 28upx;
  116. font-family: PingFang-SC-Bold;
  117. color: #111111;
  118. }
  119. </style>