running.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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">{{ type(item.type_id) }}</view>
  20. <view :class="['head_price',item.act == '+' ? '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.create_time }}</view>
  24. <view class="list_balance">余额{{ item.after }}</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. import { post } from "@/request/api.js";
  35. import notGoods from "@/components/not-goods/index.vue";
  36. export default {
  37. components: {
  38. notGoods,
  39. },
  40. data() {
  41. return {
  42. haveGoods: false, // 是否有商品
  43. current: 0,
  44. TabList: [
  45. { title: "全部", sauts: 0 },
  46. { title: "收益", sauts: 1 },
  47. { title: "支出", sauts: 2 },
  48. ],
  49. list: [],
  50. page:1
  51. };
  52. },
  53. onShow() {
  54. this.page = 1;
  55. this.list = [];
  56. this.loadData();
  57. },
  58. methods: {
  59. loadData: function () {
  60. let data = {
  61. page: this.page,
  62. rows:20,
  63. type: this.current,
  64. };
  65. uni.showLoading({ mask: true });
  66. post("v1/my/moneylog", data).then((res) => {
  67. uni.hideLoading();
  68. if (res.code === 0) {
  69. if (res.data.data.data.length > 0) {
  70. this.list = this.list.concat(res.data.data.data);
  71. } else {
  72. if (this.page == 1) {
  73. this.haveGoods = true;
  74. this.page = -1;
  75. } else {
  76. this.page = -1;
  77. this.$toast("暂无更多");
  78. }
  79. }
  80. } else {
  81. if (page == 1) {
  82. this.haveGoods = true;
  83. this.page = -1;
  84. } else {
  85. this.page = -1;
  86. this.$toast("暂无更多");
  87. }
  88. }
  89. });
  90. },
  91. SetStatus: function (i) {
  92. this.current = i;
  93. this.page = 1;
  94. this.list = [];
  95. this.haveGoods = false;
  96. this.loadData();
  97. },
  98. },
  99. computed: {
  100. type() {
  101. return (va) => {
  102. switch (va) {
  103. case 1: return "充值";
  104. case 2: return "提现";
  105. case 3: return "购买产品支出";
  106. case 4: return "社区消费奖励";
  107. case 5: return "合伙人分红收益";
  108. case 6: return "寄卖成功收益";
  109. case 7: return "退款到云宝";
  110. case 8: return "赠送支出";
  111. case 9: return "转化支出";
  112. case 10: return "联合创始人分红收益";
  113. case 11: return "创始股东分红收益";
  114. case 12: return "节点服务津贴";
  115. case 13: return "赠送收入";
  116. case 14: return "区域节点收益";
  117. default: return "";
  118. }
  119. }
  120. }
  121. },
  122. /**
  123. * 页面上拉触底事件的处理函数
  124. */
  125. onReachBottom: function () {
  126. if (this.page != -1) {
  127. setTimeout(function () {
  128. ++this.page;
  129. this.loadData();
  130. }, 800);
  131. }
  132. },
  133. };
  134. </script>
  135. <style lang="scss">
  136. // 页面配置
  137. // 页面配置-end
  138. // 顶部列表
  139. .tab_list {
  140. height: 100%;
  141. box-sizing: border-box;
  142. font-size: 30rpx;
  143. color: #808080;
  144. }
  145. .Tab_con {
  146. width: 100%;
  147. height: 92rpx;
  148. background: #fff;
  149. padding: 0 30rpx;
  150. box-sizing: border-box;
  151. }
  152. .active {
  153. color: #1bbd89;
  154. border-bottom: 6rpx solid #1bbd89;
  155. }
  156. // 顶部列表-end
  157. // 资金列表
  158. .con {
  159. border-top: 16rpx solid #f4f4f4;
  160. }
  161. .list_con {
  162. width: 100%;
  163. overflow: hidden;
  164. }
  165. .list_head {
  166. width: 100%;
  167. overflow: hidden;
  168. margin-bottom: 5rpx;
  169. }
  170. .list_time {
  171. font-size: 24rpx;
  172. color: #a1a1a1;
  173. }
  174. .list_balance {
  175. font-size: 24rpx;
  176. color: #a1a1a1;
  177. }
  178. .head_price {
  179. font-size: 32rpx;
  180. font-family: "SourceHanSansCN-Medium";
  181. }
  182. .head_name {
  183. font-size: 30rpx;
  184. color: #212121;
  185. font-family: "SourceHanSansCN-Medium";
  186. }
  187. .list {
  188. width: 100%;
  189. overflow: hidden;
  190. padding: 30rpx;
  191. box-sizing: border-box;
  192. border-bottom: 3rpx solid #f4f4f4;
  193. }
  194. // 资金列表-end
  195. // 状态颜色
  196. .g_color {
  197. color: #1bbd89;
  198. }
  199. .y_color {
  200. color: #f15b21;
  201. }
  202. // 状态颜色-end
  203. </style>