pointsDetails.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="points-details">
  3. <navbar ref="navbar" :config="config" backColor="#999999"></navbar>
  4. <view class="middle">
  5. <view class="item" v-for="(item, index) in pointsList" :key="index">
  6. <view class="left">
  7. <view class="day">
  8. <!-- <text v-if="item.model_type == 0">作品</text>
  9. <text v-if="item.model_type == 1">文章</text>
  10. <text v-if="item.model_type == 2">商品</text>
  11. <text v-if="item.model_type == 3">订单</text>
  12. <text v-if="item.model_type == 4">维权订单</text>
  13. <text v-if="item.inner_mode == 1">被浏览</text>
  14. <text v-if="item.inner_mode == 2">被点赞</text>
  15. <text v-if="item.inner_mode == 3">被评论</text>
  16. <text v-if="item.inner_mode == 4">被分享</text>
  17. <text v-if="item.inner_mode == 5">浏览</text>
  18. <text v-if="item.inner_mode == 6">点赞</text>
  19. <text v-if="item.inner_mode == 7">评论</text>
  20. <text v-if="item.inner_mode == 8">分享</text>
  21. <text v-if="item.inner_mode == 9">购买商品</text>
  22. <text v-if="item.inner_mode == 10">积分商品支付过期退还</text>
  23. <text v-if="item.inner_mode == 11">取消订单退还</text> -->
  24. <text>{{item.integralNote}}</text>
  25. </view>
  26. <view class="time">
  27. {{ item.createTime }}
  28. </view>
  29. </view>
  30. <view class="right" :class="{red:item.billType==1}">
  31. {{item.billType==1?'+':'-'}}{{item.value}}
  32. </view>
  33. </view>
  34. <loadMore v-if="pointsList.length>0" :status="status"></loadMore>
  35. <nodata v-else :config="{ top: 1, content: '暂无数据~' }"></nodata>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. detailedInfo
  42. } from "@/api/notice.js";
  43. import {
  44. getIntegralList
  45. } from "@/api/government.js"
  46. export default {
  47. data() {
  48. return {
  49. config: {
  50. back: true, //false是tolbar页面 是则不写
  51. title: "积分明细",
  52. color: "#1A1A1A",
  53. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  54. backgroundColor: [1, "#FFFFFF"],
  55. statusBarFontColor: "#1A1A1A",
  56. },
  57. pointsList: [],
  58. params: {
  59. page: 1,
  60. pageSize: 10
  61. },
  62. status: 'more', //more|loading|noMore
  63. };
  64. },
  65. onLoad() {
  66. this.pointsList = [];
  67. this.getMydetailed();
  68. },
  69. onReachBottom() {
  70. this.params.page++
  71. this.getMydetailed()
  72. },
  73. onPullDownRefresh() {
  74. this.params.page = 1
  75. this.pointsList = []
  76. this.getMydetailed()
  77. },
  78. methods: {
  79. getMydetailed() {
  80. getIntegralList(this.params).then(res => {
  81. this.pointsList = this.pointsList.concat(res.rows);
  82. if (this.pointsList >= res.total) {
  83. this.status = 'noMore'
  84. } else {
  85. this.status = 'more'
  86. }
  87. }).finally(() => {
  88. uni.stopPullDownRefresh()
  89. })
  90. // this.$http.get(detailedInfo, this.params).then((res) => {
  91. // if (res && res.code == 200) {
  92. // uni.stopPullDownRefresh()
  93. // this.pointsList = this.pointsList.concat(res.page.list);
  94. // if (res.page.totalPage <= res.page.currPage) {
  95. // this.status = 'noMore'
  96. // } else {
  97. // this.status = 'more'
  98. // }
  99. // }
  100. // });
  101. },
  102. },
  103. };
  104. </script>
  105. <style lang="scss" scoped>
  106. .middle {
  107. padding: 0 30rpx;
  108. .item {
  109. display: flex;
  110. align-items: center;
  111. justify-content: space-between;
  112. border-bottom: 1rpx solid #e6e6e6;
  113. padding-bottom: 36rpx;
  114. .left {
  115. line-height: 1.3;
  116. .day {
  117. // opacity: 0.9;
  118. margin: 34rpx 0 18rpx 0;
  119. font-size: 28rpx;
  120. color: #1a1a1a;
  121. font-weight: 500;
  122. }
  123. .time {
  124. font-size: 24rpx;
  125. color: #999999;
  126. font-weight: 400;
  127. }
  128. }
  129. .right {
  130. flex-shrink: 0;
  131. padding-left: 20rpx;
  132. font-size: 28rpx;
  133. font-weight: 500;
  134. }
  135. .red {
  136. color: #ff0000;
  137. }
  138. }
  139. .item:nth-last-child(2) {
  140. border-bottom: none;
  141. }
  142. }
  143. </style>