ExchangeLog.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view :class="['qn-page-' + theme]">
  3. <view class="nav-view">
  4. <u-tabs-swiper
  5. ref="tabs"
  6. font-size="28"
  7. :current="tab_current"
  8. inactive-color="#2A2A2A"
  9. :active-color="primaryColor"
  10. :bar-style="{ borderRadius: '0', height: '4rpx', backgroundColor: primaryColor }"
  11. :list="navList"
  12. :is-scroll="false"
  13. @change="tabClick"
  14. ></u-tabs-swiper>
  15. </view>
  16. <view class="list-ul">
  17. <view class="list-li" @click="goPage('/pagesT/pointsMall/ExchangeOrderDetail?id=' + item.id)" v-for="(item, index) in goods_list" :key="index">
  18. <view class="top-view clearfix">
  19. <view class="time float_left">{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  20. <view class="status float_right">{{ item.status === 5 ? '已完成' : item.status === 4 ? '待发货' : item.status === 6 ? '已关闭' : '其他' }}</view>
  21. </view>
  22. <view class="clearfix cont">
  23. <view class="float_left goods-img"><image :src="item.images[0]" mode="aspectFill"></image></view>
  24. <view class="float_left">
  25. <view class="ellipsis goods-name">{{ item.integralGoodsName }}</view>
  26. <view class="points-num primary-color">{{ item.amount }}股权</view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <!-- 空白页 -->
  32. <Aempty text="暂无数据" v-if="goods_list.length === 0" src="https://onlineimg.qianniao.vip/data.png"></Aempty>
  33. <u-loadmore v-if="goods_list.length" :status="loading_status"></u-loadmore>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. loading_status: 'nomore',
  41. goods_list: [],
  42. status: 4,
  43. tab_current: 0,
  44. page: 1,
  45. pageSize: 10,
  46. total: 0,
  47. navList: [
  48. {
  49. name: '待发货'
  50. },
  51. {
  52. name: '已完成'
  53. },
  54. {
  55. name: '已关闭'
  56. }
  57. ]
  58. };
  59. },
  60. onReachBottom() {
  61. if (this.total / this.pageSize > this.page) {
  62. this.page += 1;
  63. this.getAllIntegralGoodsExchange();
  64. }
  65. },
  66. onLoad() {
  67. this.getAllIntegralGoodsExchange();
  68. },
  69. onPullDownRefresh() {
  70. this.page = 1;
  71. this.getAllIntegralGoodsExchange();
  72. },
  73. methods: {
  74. tabClick(index) {
  75. this.tab_current = index;
  76. switch (index) {
  77. case 0:
  78. this.status = 4;
  79. break;
  80. case 1:
  81. this.status = 5;
  82. break;
  83. case 2:
  84. this.status = 6;
  85. break;
  86. }
  87. this.page = 1;
  88. this.goods_list = [];
  89. this.getAllIntegralGoodsExchange();
  90. },
  91. getAllIntegralGoodsExchange() {
  92. this.loading_status = 'loading';
  93. this.$u.api
  94. .getAllIntegralGoodsExchange({
  95. status: this.status,
  96. page: this.page,
  97. pageSize: this.pageSize
  98. })
  99. .then(res => {
  100. uni.stopPullDownRefresh();
  101. if (this.page !== 1) {
  102. this.goods_list = thiis.goods_list.concat(res.data);
  103. } else {
  104. this.goods_list = res.data;
  105. }
  106. this.total = res.pageTotal;
  107. this.loading_status = this.$_utils.loadStatus(this.page, this.pageSize, this.total);
  108. })
  109. .catch(res => {
  110. this.load_status = 'nomore';
  111. uni.stopPullDownRefresh();
  112. });
  113. }
  114. }
  115. };
  116. </script>
  117. <style lang="scss" scoped>
  118. .nav-view {
  119. position: fixed;
  120. top: 0;
  121. left: 0;
  122. width: 100%;
  123. }
  124. .list-ul {
  125. padding-top: 80rpx;
  126. .list-li {
  127. width: 710rpx;
  128. margin: 20rpx auto;
  129. background-color: #ffffff;
  130. border-radius: 16rpx;
  131. padding: 24rpx;
  132. .top-view {
  133. font-size: 24rpx;
  134. padding-bottom: 20rpx;
  135. .time {
  136. color: #999999;
  137. }
  138. }
  139. .cont {
  140. .goods-img {
  141. width: 100rpx;
  142. height: 100rpx;
  143. margin-right: 20rpx;
  144. image {
  145. display: block;
  146. width: 100%;
  147. height: 100%;
  148. border-radius: 10rpx;
  149. }
  150. }
  151. .goods-name {
  152. width: 540rpx;
  153. font-size: 24rpx;
  154. padding-bottom: 16rpx;
  155. }
  156. .points-num {
  157. font-size: 26rpx;
  158. font-family: DIN-Medium;
  159. }
  160. }
  161. }
  162. }
  163. </style>