awardList.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <view class="content">
  3. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  4. <!-- 空白页 -->
  5. <empty v-if="navList[0].loaded === true && navList[0].orderList.length === 0"></empty>
  6. <!-- 订单列表 -->
  7. <view class="momBox" v-for="(list, index) in navList[0].orderList" :key="index">
  8. <view class="topMon">
  9. <view>
  10. <text class="mon">{{list.time}}</text>
  11. <!-- <text class="font-size-sm margin-l-10">月</text> -->
  12. <image class="iconRight margin-l-10" src="../../../static/icon/dom.png" mode="widthFix"></image>
  13. </view>
  14. <!-- <view class="textSm font-color-gray">
  15. <text>支出:{{list.out}}</text>
  16. <text class="margin-l-20">支出:{{list.get}}</text>
  17. </view> -->
  18. </view>
  19. <view v-for="(item,index) in list.list" class="order-item flex">
  20. <view class="title-box">
  21. <view class="title">
  22. <text>{{ item.title }}</text>
  23. </view>
  24. <view class="time">
  25. <text>{{ item.add_time }}</text>
  26. </view>
  27. </view>
  28. <view class="money">
  29. <text>{{ (item.pm == 0 ? '-' : '+') + item.number }}</text>
  30. </view>
  31. </view>
  32. </view>
  33. <uni-load-more :status="navList[0].loadingType"></uni-load-more>
  34. </scroll-view>
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. spreadCommission,
  40. } from '@/api/wallet.js';
  41. import {
  42. getMoneyStyle
  43. } from '@/utils/rocessor.js';
  44. export default {
  45. filters: {
  46. getMoneyStyle
  47. },
  48. data() {
  49. return {
  50. // 头部图高度
  51. maxheight: '',
  52. tabCurrentIndex: 0,
  53. navList: [{
  54. state: 3,
  55. text: '全部',
  56. loadingType: 'more',
  57. orderList: [],
  58. page: 1, //当前页数
  59. limit: 10 //每次信息条数
  60. }, ],
  61. money: ''
  62. };
  63. },
  64. onLoad(options) {},
  65. onShow() {
  66. this.loadData();
  67. },
  68. methods: {
  69. // 页面跳转
  70. navto(e) {
  71. uni.navigateTo({
  72. url: e
  73. });
  74. },
  75. //获取收入支出信息
  76. async loadData(source) {
  77. //这里是将订单挂载到tab列表下
  78. let index = this.tabCurrentIndex;
  79. let navItem = this.navList[index];
  80. let state = navItem.state;
  81. if (source === 'tabChange' && navItem.loaded === true) {
  82. //tab切换只有第一次需要加载数据
  83. return;
  84. }
  85. if (navItem.loadingType === 'loading') {
  86. //防止重复加载
  87. return;
  88. }
  89. // 修改当前对象状态为加载中
  90. navItem.loadingType = 'loading';
  91. spreadCommission({
  92. page: navItem.page,
  93. limit: navItem.limit
  94. },
  95. state
  96. )
  97. .then(({
  98. data
  99. }) => {
  100. if (data.length > 0) {
  101. navItem.orderList = navItem.orderList.concat(data);
  102. navItem.page++;
  103. }
  104. if (navItem.limit == data.length) {
  105. //判断是否还有数据, 有改为 more, 没有改为noMore
  106. navItem.loadingType = 'more';
  107. return;
  108. } else {
  109. //判断是否还有数据, 有改为 more, 没有改为noMore
  110. navItem.loadingType = 'noMore';
  111. }
  112. uni.hideLoading();
  113. this.$set(navItem, 'loaded', true);
  114. })
  115. .catch(e => {
  116. console.log(e);
  117. });
  118. }
  119. }
  120. };
  121. </script>
  122. <style lang="scss">
  123. page {
  124. height: 100%;
  125. }
  126. .money-box {
  127. padding-top: var(--status-bar-height);
  128. text-align: center;
  129. color: $font-color-dark;
  130. font-weight: bold;
  131. .text {
  132. padding-top: 85rpx;
  133. font-size: 24rpx;
  134. }
  135. .money {
  136. font-size: 60rpx;
  137. }
  138. }
  139. // 列表
  140. .order-item {
  141. padding: 20rpx 30rpx;
  142. line-height: 1.5;
  143. border-bottom: 1px solid $page-color-light;
  144. margin-left: 20rpx;
  145. .title-box {
  146. .title {
  147. font-size: $font-lg;
  148. color: $font-color-base;
  149. }
  150. .time {
  151. font-size: $font-base;
  152. color: $font-color-light;
  153. }
  154. }
  155. .money {
  156. font-size: $font-lg;
  157. }
  158. }
  159. .list-scroll-content {
  160. height: 100%;
  161. padding-top: 30rpx;
  162. .momBox{
  163. background-color: #FFFFFF;
  164. margin: $page-row-spacing;
  165. margin-top: 0rpx;
  166. border-radius: 20rpx;
  167. overflow: hidden;
  168. .topMon{
  169. padding: 30rpx 20rpx;
  170. border-bottom: 1px solid $page-color-light;
  171. .iconRight{
  172. width: 22rpx;
  173. }
  174. .mon{
  175. font-size: 36rpx;
  176. font-weight: 400;
  177. }
  178. .textSm{
  179. color: $font-color-light;
  180. font-size: 22rpx;
  181. }
  182. }
  183. }
  184. }
  185. .content {
  186. height: 100%;
  187. }
  188. </style>