index.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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-ic_search"></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="item.extract_status == -1">原因:{{item.extract_msg}}</view>
  33. <view>{{item.add_time}}</view>
  34. </view>
  35. <view>
  36. <view class='num' :class="recordType == 4 && item.status == 0?'on':''" v-if="item.pm == 1">+{{item.number}}</view>
  37. <view class='num' v-else>-{{item.number}}</view>
  38. <view class="fail" v-if="item.extract_status == -1">审核未通过</view>
  39. <view class="wait" v-if="item.extract_status == 0">待审核</view>
  40. </view>
  41. </view>
  42. <!-- </block> -->
  43. </view>
  44. </view>
  45. </view>
  46. </block>
  47. </view>
  48. <view class='loadingicon acea-row row-center-wrapper' v-if="recordList.length">
  49. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  50. </view>
  51. <view class="empty" v-if="!recordList.length">
  52. <emptyPage title='暂无数据~' src="/statics/images/noOrder.gif"></emptyPage>
  53. </view>
  54. </view>
  55. </view>
  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. };
  100. },
  101. computed: mapGetters(['isLogin']),
  102. onLoad(options) {
  103. if (this.isLogin) {
  104. this.type = options.type;
  105. } else {
  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. } else if (type == 2) {
  120. uni.setNavigationBarTitle({
  121. title: "佣金记录"
  122. });
  123. this.name = '佣金明细';
  124. this.recordType = 3;
  125. this.getRecordList();
  126. } else if (type == 4) {
  127. uni.setNavigationBarTitle({
  128. title: "提现记录"
  129. });
  130. this.name = '提现明细';
  131. this.recordType = 4;
  132. this.getRecordList();
  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.$set(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. .empty{
  233. margin: 0 20rpx 20rpx 20rpx;
  234. }
  235. .commission-details .search {
  236. width: 100%;
  237. background-color: #fff;
  238. padding: 24rpx 20rpx;
  239. box-sizing: border-box;
  240. }
  241. .commission-details .search .input {
  242. width: 100%;
  243. height: 72rpx;
  244. border-radius: 50rpx;
  245. background-color: #f5f5f5;
  246. position: relative;
  247. }
  248. .commission-details .search .input input {
  249. height: 100%;
  250. font-size: 26rpx;
  251. padding-left: 70rpx;
  252. }
  253. .box {
  254. border-radius: 24rpx;
  255. margin: 0 20rpx;
  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. .top_num {
  276. padding: 10rpx 30rpx 30rpx 30rpx;
  277. font-size: 24rpx;
  278. color: #999;
  279. }
  280. .radius15 {
  281. border-radius: 14rpx 14rpx 0 0;
  282. }
  283. .sign-record .list .item .listn .itemn1{border-bottom:1rpx solid #eee;padding:22rpx 24rpx;}
  284. .sign-record .list .item .listn .itemn1 .name{width:390rpx;font-size:28rpx;color:#333;margin-bottom:12rpx;}
  285. .sign-record .list .item .listn .itemn1 .num{font-size:36rpx;color:#333333;font-family:'Regular';text-align: right;}
  286. .sign-record .list .item .listn .itemn1 .num.font-color{color:#e93323!important;}
  287. .sign-record .list .item .listn .itemn1 .fail{
  288. color: #E93323;
  289. margin-top: 14rpx;
  290. text-align: right;
  291. }
  292. .sign-record .list .item .listn .itemn1 .wait{
  293. color: #FF7D00;
  294. margin-top: 14rpx;
  295. text-align: right;
  296. }
  297. .mark{
  298. margin-bottom: 10rpx;
  299. }
  300. .status_badge{
  301. display: inline-block;
  302. height: 40rpx;
  303. border-radius: 8rpx;
  304. font-size: 24rpx;
  305. line-height: 40rpx;
  306. font-family: PingFangSC-Regular, PingFang SC;
  307. font-weight: 400;
  308. margin-left:16rpx;
  309. padding:0 12rpx 0;
  310. }
  311. .success{
  312. background: rgba(24, 144, 255, .1);
  313. color: #1890FF;
  314. }
  315. .default{
  316. background: #FFF1E5;
  317. color: #FF7D00;
  318. }
  319. .error{
  320. background: #FDEBEB;
  321. color: #F53F3F;
  322. }
  323. </style>