index.vue 8.6 KB

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