help-records.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view>
  3. <mescroll-body ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" @up="upCallback">
  4. <view @click="jump(item)" class="card" v-for="(item,index) in list" :key="index">
  5. <view class="card-left">
  6. <view class="title">
  7. <text v-if="item.heatType=='HEAT_VALUE_EXCHANGE'">热力值兑换</text>
  8. <text v-if="item.heatType=='HEAT_VALUE_SEND'">热力值赠送</text>
  9. </view>
  10. <view class="time">
  11. <text>{{item.createTime}}</text>
  12. </view>
  13. </view>
  14. <view class="card-right">
  15. <view class="center">
  16. <image src="/static/icon/remen.png" style="width: 36rpx;height: 36rpx;margin-right: 6rpx;">
  17. </image>
  18. </view>
  19. <view class="center padding-top-10">
  20. <text v-if="item.heatType=='HEAT_VALUE_EXCHANGE'"
  21. class="center reduce">{{item.voteCount}}</text>
  22. <text v-if="item.heatType=='HEAT_VALUE_SEND'" class="center plus">{{item.voteCount}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </mescroll-body>
  27. </view>
  28. </template>
  29. <script>
  30. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  31. export default {
  32. mixins: [MescrollMixin],
  33. data() {
  34. return {
  35. downOption: {
  36. auto: false
  37. },
  38. top: 0,
  39. list: []
  40. }
  41. },
  42. methods: {
  43. jump(item) {
  44. if (this.$isNotEmpty(item.activeProductId)) {
  45. uni.navigateTo({
  46. url: '/pages/activity/activityDetail?id=' + item.activeProductId
  47. })
  48. }
  49. },
  50. downCallback() {
  51. setTimeout(() => {
  52. this.mescroll.resetUpScroll();
  53. }, 1000)
  54. },
  55. upCallback(mescroll) {
  56. try {
  57. let params = {
  58. phone: this.vuex_phone,
  59. current: mescroll.num,
  60. size: mescroll.size,
  61. }
  62. this.$api.heatrecord.list(params).then(res => {
  63. let data = res.data.data.records
  64. let total = res.data.data.total
  65. mescroll.endBySize(data.length, total);
  66. if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
  67. this.list = this.list.concat(data); //追加新数据
  68. })
  69. } catch (e) {
  70. console.error(e);
  71. this.mescroll.endErr()
  72. }
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. .card {
  79. background-color: #FFFFFF;
  80. margin: 20rpx 0;
  81. padding: 35rpx;
  82. display: flex;
  83. justify-content: space-between;
  84. .card-left {
  85. .title {
  86. color: #353535;
  87. font-size: 32rpx;
  88. margin-bottom: 20rpx;
  89. font-family: PingFang-SC-Bold;
  90. }
  91. .time {
  92. margin-top: 20rpx;
  93. color: #999999;
  94. font-size: 26rpx;
  95. font-weight: 400;
  96. }
  97. }
  98. .card-right {
  99. display: flex;
  100. }
  101. }
  102. </style>