integralDet.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view>
  3. <view style="text-align: left; padding-bottom: 10rpx">
  4. <view v-for="(item, index) in list" :key="index" class="item">
  5. <view>
  6. <view style="color: #999999; font-size: 28upx">
  7. <view style="margin-bottom: 8upx">{{ item.title }}</view>
  8. <view style="margin-bottom: 8upx">{{ item.content }}</view>
  9. <view style="margin-bottom: 8upx" v-if="classify == 1 && item.orderNumber">订单号:{{ item.orderNumber }}</view>
  10. <view style="margin-bottom: 8upx">获取时间:{{ item.createTime }}</view>
  11. <!-- <view style="margin-bottom: 8upx" v-if="classify == 1">有效期:{{ item.expTime ? item.expTime : '无时间限制' }}</view> -->
  12. <view style="margin-bottom: 8upx; text-align: right">
  13. <text v-if="item.type == 1" style="color: #ecd4b4; font-size: 32upx; font-weight: 600">
  14. <text style="color: #000000">+</text>
  15. {{ item.num }}积分
  16. </text>
  17. <text v-if="item.type == 2" style="color: #ecd4b4; font-size: 32upx; font-weight: 600">
  18. <text style="color: #000000">-</text>
  19. {{ item.num }}积分
  20. </text>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <empty v-if="list.length == 0" content="暂无数据"></empty>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import empty from '@/components/empty.vue'
  31. export default {
  32. components: {
  33. empty
  34. },
  35. data() {
  36. return {
  37. list: [],
  38. page: 1,
  39. limit: 10,
  40. classify: '',
  41. totalCount: 0
  42. }
  43. },
  44. onLoad(option) {
  45. this.classify = option.classify
  46. if (this.classify == 2) {
  47. uni.setNavigationBarTitle({
  48. title: '兑换记录'
  49. })
  50. }
  51. this.$queue.showLoading('加载中...')
  52. this.getList()
  53. },
  54. methods: {
  55. getList() {
  56. let data = {
  57. page: this.page,
  58. limit: this.limit,
  59. classify: this.classify == 2 ? this.classify : ''
  60. }
  61. this.$Request.getT('/app/userintegraldetails/selectIntegraldetailsList', data).then((res) => {
  62. // console.log(res, '999')
  63. if (res.code === 0) {
  64. this.totalCount = res.data.totalCount
  65. if (this.page === 1) {
  66. this.list = res.data.list
  67. } else {
  68. this.list = [...this.list, ...res.data.list]
  69. }
  70. }
  71. uni.stopPullDownRefresh()
  72. uni.hideLoading()
  73. })
  74. }
  75. },
  76. onReachBottom: function () {
  77. // this.page = this.page + 1;
  78. // this.getList();
  79. if (this.list.length < this.totalCount) {
  80. this.page = this.page + 1
  81. this.getList()
  82. } else {
  83. uni.showToast({
  84. title: '已经到底了',
  85. icon: 'none'
  86. })
  87. }
  88. },
  89. onPullDownRefresh: function () {
  90. this.page = 1
  91. this.getList()
  92. }
  93. }
  94. </script>
  95. <style lang="less">
  96. page {
  97. // background: #1c1b20;
  98. }
  99. .tui-tab-item-title {
  100. // color: #ffffff;
  101. font-size: 30rpx;
  102. height: 80rpx;
  103. line-height: 80rpx;
  104. flex-wrap: nowrap;
  105. white-space: nowrap;
  106. }
  107. .tui-tab-item-title-active {
  108. border-bottom: 1px solid #5e81f9;
  109. color: #5e81f9;
  110. font-size: 32upx;
  111. font-weight: bold;
  112. border-bottom-width: 6upx;
  113. text-align: center;
  114. }
  115. .item {
  116. background: #ffffff;
  117. padding: 32rpx;
  118. margin: 32rpx;
  119. font-size: 28rpx;
  120. box-shadow: 7px 9px 34px rgba(0, 0, 0, 0.1);
  121. border-radius: 16upx;
  122. }
  123. </style>