index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. <template>
  2. <view :style="colorStyle">
  3. <view class='commission-details'>
  4. <view class='search acea-row row-between-wrapper' v-if="recordType != 1 && recordType != 4">
  5. <view class='input'>
  6. <text class="iconfont icon-sousuo4"></text>
  7. <input placeholder='搜索用户名称' placeholder-class='placeholder' v-model="keyword" @confirm="submitForm"
  8. confirm-type='search' name="search"></input>
  9. </view>
  10. </view>
  11. <timeSlot @changeTime="changeTime"></timeSlot>
  12. <view class='sign-record'>
  13. <view class="top_num" v-if="recordType != 4 && recordList.length">
  14. 支出:¥{{expend || 0}} &nbsp;&nbsp;&nbsp; 收入:¥{{income || 0}}
  15. </view>
  16. <view class="box">
  17. <block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
  18. <view class='list'>
  19. <view class='item'>
  20. <!-- <view class='data'>{{item.time}}</view> -->
  21. <view class='listn'>
  22. <!-- <block v-for="(child,indexn) in item.child" :key="indexn"> -->
  23. <view class='itemn1 acea-row row-between-wrapper'>
  24. <view>
  25. <view class='name line1'>
  26. {{item.title}}
  27. <!-- <text class="status_badge success" v-if="recordType == 4 && item.status == 1">审核通过</text> -->
  28. <text class="status_badge default" v-if="recordType == 4 && item.status == 0">待审核</text>
  29. <text class="status_badge error" v-if="recordType == 4 && item.status == 2">未通过</text>
  30. <!-- 提现记录: 0 待审核 1 通过 2 未通过 -->
  31. </view>
  32. <view class="mark" v-if="recordType == 4 && item.mark && item.status !== 1">{{item.mark}}</view>
  33. <view>{{item.add_time}}</view>
  34. </view>
  35. <view class='num font-color' v-if="item.pm == 1">+{{item.number}}</view>
  36. <view class='num' v-else>-{{item.number}}</view>
  37. </view>
  38. <!-- </block> -->
  39. </view>
  40. </view>
  41. </view>
  42. </block>
  43. </view>
  44. <view class='loadingicon acea-row row-center-wrapper' v-if="recordList.length">
  45. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  46. </view>
  47. <view v-if="recordList.length < 1 && page > 1">
  48. <emptyPage title='暂无数据~'></emptyPage>
  49. </view>
  50. </view>
  51. </view>
  52. <home v-if="navigation"></home>
  53. </view>
  54. </template>
  55. <script>
  56. import {
  57. moneyList,
  58. getSpreadInfo
  59. } from '@/api/user.js';
  60. import {
  61. toLogin
  62. } from '@/libs/login.js';
  63. import {
  64. mapGetters
  65. } from "vuex";
  66. import emptyPage from '@/components/emptyPage.vue'
  67. import home from '@/components/home';
  68. import colors from '@/mixins/color.js';
  69. import timeSlot from '../components/timeSlot/index.vue'
  70. export default {
  71. components: {
  72. emptyPage,
  73. home,
  74. timeSlot
  75. },
  76. mixins: [colors],
  77. data() {
  78. return {
  79. name: '',
  80. keyword: '',
  81. type: 0,
  82. page: 1,
  83. limit: 15,
  84. loading: false,
  85. loadend: false,
  86. loadTitle: '加载更多',
  87. recordList: [],
  88. recordType: 0,
  89. recordCount: 0,
  90. extractCount: 0,
  91. times: [],
  92. start: 0,
  93. stop: 0,
  94. income: '',
  95. expend: ''
  96. };
  97. },
  98. computed: mapGetters(['isLogin']),
  99. onLoad(options) {
  100. if (this.isLogin) {
  101. this.type = options.type;
  102. } else {
  103. toLogin();
  104. }
  105. },
  106. onShow: function() {
  107. uni.removeStorageSync('form_type_cart');
  108. let type = this.type;
  109. if (type == 1) {
  110. uni.setNavigationBarTitle({
  111. title: "佣金记录"
  112. });
  113. this.name = '提现总额';
  114. this.recordType = 3;
  115. this.getRecordList();
  116. // this.getRecordListCount();
  117. } else if (type == 2) {
  118. uni.setNavigationBarTitle({
  119. title: "佣金记录"
  120. });
  121. this.name = '佣金明细';
  122. this.recordType = 3;
  123. this.getRecordList();
  124. // this.getRecordListCount();
  125. } else if (type == 4) {
  126. uni.setNavigationBarTitle({
  127. title: "提现记录"
  128. });
  129. this.name = '提现明细';
  130. this.recordType = 4;
  131. this.getRecordList();
  132. // this.getRecordListCount();
  133. } else {
  134. uni.showToast({
  135. title: '参数错误',
  136. icon: 'none',
  137. duration: 1000,
  138. mask: true,
  139. success: function(res) {
  140. setTimeout(function() {
  141. // #ifndef H5
  142. uni.navigateBack({
  143. delta: 1,
  144. });
  145. // #endif
  146. // #ifdef H5
  147. history.back();
  148. // #endif
  149. }, 1200)
  150. },
  151. });
  152. }
  153. },
  154. methods: {
  155. submitForm() {
  156. this.page = 1;
  157. this.limit = 20;
  158. this.loadend = false;
  159. this.status = false;
  160. this.$set(this, 'recordList', []);
  161. this.$set(this, 'times', []);
  162. this.getRecordList();
  163. },
  164. changeTime(time) {
  165. this.start = time.start
  166. this.stop = time.stop
  167. this.page = 1;
  168. this.loading = false;
  169. this.loadend = false;
  170. this.recordList = [];
  171. this.getRecordList();
  172. },
  173. getRecordList: function() {
  174. let that = this;
  175. let page = that.page;
  176. let limit = that.limit;
  177. let recordType = that.recordType;
  178. if (that.loading) return;
  179. if (that.loadend) return;
  180. that.loading = true;
  181. that.loadTitle = '';
  182. moneyList({
  183. keyword: this.keyword,
  184. start: this.start,
  185. stop: this.stop,
  186. page: page,
  187. limit: limit
  188. }, recordType).then(res => {
  189. this.expend = res.data.expend;
  190. this.income = res.data.income;
  191. // for (let i = 0; i < res.data.time.length; i++) {
  192. // // if (!this.times.includes(res.data.time[i])) {
  193. // this.times.push(res.data.time[i])
  194. // this.recordList.push({
  195. // time: res.data.time[i],
  196. // child: []
  197. // })
  198. // // }
  199. // }
  200. // // for (let x = 0; x < this.times.length; x++) {
  201. // for (let j = 0; j < res.data.list.length; j++) {
  202. // // if (this.times[x] === res.data.list[j].time_key) {
  203. // // }
  204. // this.recordList[j].child.push(res.data.list[j])
  205. // }
  206. // // }
  207. this.recordList = this.recordList.concat(res.data.list)
  208. let loadend = res.data.list.length < that.limit;
  209. that.loadend = loadend;
  210. that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
  211. that.page += 1;
  212. that.loading = false;
  213. }).catch(err => {
  214. that.loading = false;
  215. that.loadTitle = '加载更多';
  216. })
  217. },
  218. getRecordListCount: function() {
  219. let that = this;
  220. getSpreadInfo().then(res => {
  221. that.recordCount = res.data.commissionCount;
  222. that.extractCount = res.data.extractCount;
  223. });
  224. }
  225. },
  226. onReachBottom: function() {
  227. this.getRecordList();
  228. }
  229. }
  230. </script>
  231. <style scoped lang="scss">
  232. .commission-details .search {
  233. width: 100%;
  234. background-color: var(--view-theme);
  235. border-bottom: 1px solid #f2f2f2;
  236. height: 86rpx;
  237. padding: 0 30rpx;
  238. box-sizing: border-box;
  239. }
  240. .commission-details .search .input {
  241. width: 100%;
  242. height: 60rpx;
  243. border-radius: 50rpx;
  244. background-color: #f5f5f5;
  245. position: relative;
  246. }
  247. .commission-details .search .input input {
  248. height: 100%;
  249. font-size: 26rpx;
  250. width: 100%;
  251. padding-left: 60rpx;
  252. }
  253. .box {
  254. border-radius: 14rpx;
  255. margin: 0 30rpx;
  256. overflow: hidden;
  257. }
  258. .commission-details .search .input .placeholder {
  259. color: #bbb;
  260. }
  261. .commission-details .search .input .iconfont {
  262. position: absolute;
  263. left: 28rpx;
  264. color: #999;
  265. font-size: 28rpx;
  266. top: 50%;
  267. transform: translateY(-50%);
  268. }
  269. .sign-record {
  270. margin-top: 20rpx;
  271. }
  272. .commission-details .promoterHeader .headerCon .money {
  273. font-size: 36rpx;
  274. }
  275. .commission-details .promoterHeader .headerCon .money .num {
  276. font-family: 'Guildford Pro';
  277. }
  278. .top_num {
  279. padding: 10rpx 30rpx 30rpx 30rpx;
  280. font-size: 26rpx;
  281. color: #666;
  282. }
  283. .radius15 {
  284. border-radius: 14rpx 14rpx 0 0;
  285. }
  286. .sign-record .list .item .listn .itemn1{border-bottom:1rpx solid #eee;padding:22rpx 24rpx;}
  287. .sign-record .list .item .listn .itemn1 .name{width:390rpx;font-size:28rpx;color:#282828;margin-bottom:10rpx;}
  288. .sign-record .list .item .listn .itemn1 .num{font-size:36rpx;font-family: 'Guildford Pro';color:#16ac57;}
  289. .sign-record .list .item .listn .itemn1 .num.font-color{color:#e93323!important;}
  290. .mark{
  291. margin-bottom: 10rpx;
  292. }
  293. .status_badge{
  294. display: inline-block;
  295. height: 30rpx;
  296. border-radius: 4rpx;
  297. font-size: 20rpx;
  298. line-height: 30rpx;
  299. font-family: PingFangSC-Regular, PingFang SC;
  300. font-weight: 400;
  301. margin-left:12rpx;
  302. padding:0 6rpx 0;
  303. }
  304. .success{
  305. background: rgba(24, 144, 255, .1);
  306. color: #1890FF;
  307. }
  308. .default{
  309. background: #f5f5f5;
  310. color: #282828;;
  311. }
  312. .error{
  313. background: rgba(233, 51, 35, .1);
  314. color: #E93323;
  315. }
  316. </style>