running.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="container">
  3. <!-- 顶部导航 -->
  4. <view class="Tab_con flex_r flex_ac flex_jb">
  5. <view
  6. class="tab_list flex_r flex_ac"
  7. :class="current == index ? 'active' : ''"
  8. v-for="(item, index) in TabList"
  9. :key="index"
  10. @tap="SetStatus(index)"
  11. >{{ item.title }}</view
  12. >
  13. </view>
  14. <!-- 顶部导航-end -->
  15. <!-- 资金列表 -->
  16. <view class="con">
  17. <view class="list" v-for="(item, index) in list" :key="index">
  18. <view class="list_head flex_r flex_ac flex_jb">
  19. <view class="head_name">{{ item.type_id == 1 ? '收益' : '支出'}}</view>
  20. <view class="head_price g_color">{{ item.act }}{{item.num }}</view>
  21. </view>
  22. <view class="list_con flex_r flex_ac flex_jb">
  23. <view class="list_time">{{ item.remark }}</view>
  24. <view class="list_balance">{{ item.create_time }}</view>
  25. </view>
  26. </view>
  27. <not-goods v-if="haveGoods" textStr="暂无流水资金信息"></not-goods>
  28. </view>
  29. <!-- 资金列表 -->
  30. </view>
  31. </template>
  32. <script>
  33. let page = 1;
  34. let app = getApp();
  35. var appEv = app.$vm.$options;
  36. // let reqApi = new ReqApi();
  37. // import { ReqApi } from "@/utils/reqTools.js";
  38. import { get, post, u_post } from "@/request/api.js";
  39. import notGoods from "@/components/not-goods/index.vue";
  40. export default {
  41. components: {
  42. notGoods,
  43. },
  44. data() {
  45. return {
  46. haveGoods: false, // 是否有商品
  47. current: 0,
  48. TabList: [
  49. { title: "全部", sauts: "" },
  50. { title: "收益", sauts: 1 },
  51. { title: "支出", sauts: 2 },
  52. ],
  53. list: [],
  54. page:1
  55. };
  56. },
  57. onShow: function () {
  58. this.page = 1;
  59. this.list = [];
  60. this.loadData();
  61. },
  62. methods: {
  63. loadData: function () {
  64. let data = {
  65. page: page,
  66. rows:20,
  67. type: this.current,
  68. };
  69. uni.showLoading({ mask: true });
  70. post("my/moneylog", data).then((res) => {
  71. uni.hideLoading();
  72. uni.hideLoading();
  73. if (res.code === 0) {
  74. if (res.data.data.data.length > 0) {
  75. this.list = this.list.concat(res.data.data.data);
  76. } else {
  77. if (this.page == 1) {
  78. this.haveGoods = true;
  79. this.page = -1;
  80. } else {
  81. this.page = -1;
  82. appEv.errTips("暂无更多");
  83. }
  84. }
  85. } else {
  86. if (page == 1) {
  87. this.haveGoods = true;
  88. this.page = -1;
  89. } else {
  90. this.page = -1;
  91. appEv.errTips("暂无更多");
  92. }
  93. }
  94. });
  95. },
  96. SetStatus: function (i) {
  97. this.current = i;
  98. this.page = 1;
  99. this.list = [];
  100. this.haveGoods = false;
  101. this.loadData();
  102. },
  103. },
  104. /**
  105. * 页面上拉触底事件的处理函数
  106. */
  107. onReachBottom: function () {
  108. if (this.page != -1) {
  109. setTimeout(function () {
  110. ++this.page;
  111. this.loadData();
  112. }, 800);
  113. }
  114. },
  115. };
  116. </script>
  117. <style lang="scss">
  118. // 页面配置
  119. // 页面配置-end
  120. // 顶部列表
  121. .tab_list {
  122. height: 100%;
  123. box-sizing: border-box;
  124. font-size: 30rpx;
  125. color: #808080;
  126. }
  127. .Tab_con {
  128. width: 100%;
  129. height: 92rpx;
  130. background: #fff;
  131. padding: 0 30rpx;
  132. box-sizing: border-box;
  133. }
  134. .active {
  135. color: #1bbd89;
  136. border-bottom: 6rpx solid #1bbd89;
  137. }
  138. // 顶部列表-end
  139. // 资金列表
  140. .con {
  141. border-top: 16rpx solid #f4f4f4;
  142. }
  143. .list_con {
  144. width: 100%;
  145. overflow: hidden;
  146. }
  147. .list_head {
  148. width: 100%;
  149. overflow: hidden;
  150. }
  151. .list_time {
  152. font-size: 24rpx;
  153. color: #a1a1a1;
  154. }
  155. .list_balance {
  156. font-size: 24rpx;
  157. color: #a1a1a1;
  158. }
  159. .head_price {
  160. font-size: 32rpx;
  161. font-family: "SourceHanSansCN-Medium";
  162. }
  163. .head_name {
  164. font-size: 30rpx;
  165. color: #212121;
  166. font-family: "SourceHanSansCN-Medium";
  167. }
  168. .list {
  169. width: 100%;
  170. overflow: hidden;
  171. padding: 30rpx;
  172. box-sizing: border-box;
  173. border-bottom: 3rpx solid #f4f4f4;
  174. }
  175. // 资金列表-end
  176. // 状态颜色
  177. .g_color {
  178. color: #1bbd89;
  179. }
  180. .y_color {
  181. color: #f15b21;
  182. }
  183. // 状态颜色-end
  184. </style>