amassScoreRecord.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view>
  3. <scroll-list ref="list" :option="option" @load="load" @refresh="refresh" @loadSuccess="loadSuccess"
  4. @scrolltolower="scrolltolower">
  5. <view v-for="(item, index) in list" :key="index" @click="handleTest(item)">
  6. <view class="infoBody">
  7. <view>
  8. <view style="border-bottom: 1px #b8b8b8 solid;">
  9. <uni-row class="demo-uni-row">
  10. <uni-col :span="20">
  11. <view class="demo-uni-col dark"
  12. style="font-size: 36rpx;margin: -20rpx 0 0 0;font-weight: bold;letter-spacing:5rpx;">
  13. {{changeTypes [parseInt(item.changeType)-1] }}
  14. </view>
  15. </uni-col>
  16. <uni-col :span="4">
  17. <view v-if="item.changeType != '2'" class="demo-uni-col light"
  18. style="color: rgb(55,186,189);margin-bottom: 10rpx;">
  19. {{"+ "+item.amassScore}}
  20. </view>
  21. <view v-else class="demo-uni-col light"
  22. style="color: rgb(55,186,189);margin-bottom: 10rpx;">
  23. {{"- "+item.amassScore}}
  24. </view>
  25. </uni-col>
  26. </uni-row>
  27. </view>
  28. <uni-row class="demo-uni-row">
  29. <uni-col>
  30. <view class="demo-uni-col light" style="padding: 8rpx;color: #b1b1b1;">
  31. </view>
  32. </uni-col>
  33. </uni-row>
  34. <uni-row class="demo-uni-row">
  35. <uni-col :span="11">
  36. <view class="demo-uni-col light" style="color: #727272;">
  37. {{userName}}
  38. </view>
  39. </uni-col>
  40. <uni-col :span="13">
  41. <view class="demo-uni-col light" style="color: #727272;">
  42. {{item.changeDate}}
  43. </view>
  44. </uni-col>
  45. </uni-row>
  46. </view>
  47. </view>
  48. </view>
  49. </scroll-list>
  50. </view>
  51. </template>
  52. <style lang="scss">
  53. .page-wrap {}
  54. .infoBody {
  55. background-color: #ffffff;
  56. padding: 40rpx 40rpx 20rpx 40rpx;
  57. border-radius: 20rpx;
  58. margin: 20rpx;
  59. box-shadow: 0px 2px 10px #cccccc;
  60. }
  61. </style>
  62. <script>
  63. export default {
  64. data() {
  65. return {
  66. option: {
  67. page: 1,
  68. size: 5,
  69. auto: true
  70. },
  71. userName: uni.getStorageSync("userInfo").nickName,
  72. page: 1,
  73. list: [],
  74. total: 0,
  75. changeTypes: ['使用积分卡', '兑换礼品', '退还', '平台操作']
  76. }
  77. },
  78. onLoad() {},
  79. onShow() {
  80. this.refresh({
  81. page: 1,
  82. size: 5
  83. })
  84. },
  85. methods: {
  86. handleTest(item) {
  87. item.pageType = 1
  88. uni.setStorageSync("approval", item)
  89. this.$goto('../ge/geApproval')
  90. },
  91. async taskList(paging) {
  92. // 发送请求
  93. const {
  94. data: res
  95. } = await this.$httpRequest({
  96. url: '/app/asl?uc=' + uni.getStorageSync("userInfo").userName + '&pageNum=' + paging.page +
  97. '&pageSize=' + paging.size,
  98. method: 'get',
  99. urlType: 2
  100. });
  101. if (res.code === 200) {
  102. setTimeout(() => {
  103. if (paging.page === 1) {
  104. //this.list = res.rows
  105. this.total = res.total
  106. this.$refs.list.loadSuccess({
  107. list: res.rows,
  108. total: this.total
  109. });
  110. } else if (paging.page > 1) {
  111. for (var i = 0; i < res.rows.length; i++) {
  112. this.list.push(res.rows[i])
  113. }
  114. this.$refs.list.loadSuccess({
  115. list: this.list,
  116. total: this.total
  117. });
  118. }
  119. }, 300)
  120. }
  121. },
  122. // 刷新刷剧
  123. refresh(paging) {
  124. this.taskList(paging)
  125. },
  126. scrolltolower(e) {
  127. console.log(e)
  128. },
  129. load(paging) {
  130. console.log(2, paging)
  131. this.taskList(paging)
  132. },
  133. loadSuccess(list) {
  134. console.log(3, list)
  135. this.list = list
  136. }
  137. }
  138. }
  139. </script>