index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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 && recordType!=5">
  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" v-if="recordType!=5"></timeSlot>
  12. <view class='sign-record'>
  13. <view class="top_num" v-if="recordType != 4 && recordList.length && recordType!=5">
  14. 支出:¥{{expend || 0}} &nbsp;&nbsp;&nbsp; 收入:¥{{income || 0}}
  15. </view>
  16. <view class="top_num top_num_2" v-if="recordType == 5">
  17. 当前股权:{{staffInfo.shareholding}}
  18. <view class="tx" @click="navto('/pages/users/user_payment/index?is_gq=1')">
  19. 提现
  20. </view>
  21. </view>
  22. <view class="box">
  23. <block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
  24. <view class='list'>
  25. <view class='item'>
  26. <!-- <view class='data'>{{item.time}}</view> -->
  27. <view class='listn'>
  28. <!-- <block v-for="(child,indexn) in item.child" :key="indexn"> -->
  29. <view class='itemn1 acea-row row-between-wrapper'>
  30. <view>
  31. <view class='name line1'>
  32. <text v-if="recordType!=5">{{item.title}}</text>
  33. <text v-else>{{item.content}}</text>
  34. <!-- <text class="status_badge success" v-if="recordType == 4 && item.status == 1">审核通过</text> -->
  35. <text class="status_badge default" v-if="recordType == 4 && item.status == 0">待审核</text>
  36. <text class="status_badge error" v-if="recordType == 4 && item.status == 2">未通过</text>
  37. <!-- 提现记录: 0 待审核 1 通过 2 未通过 -->
  38. </view>
  39. <view class="mark" v-if="recordType == 4 && item.mark && item.status !== 1">{{item.mark}}</view>
  40. <view v-if="recordType!=5">{{item.add_time}}</view>
  41. <view v-else>{{item.create_time}}</view>
  42. </view>
  43. <template v-if="recordType!=5">
  44. <view class='num font-color' v-if="item.pm == 1">+{{item.number}}</view>
  45. <view class='num' v-else>-{{item.number}}</view>
  46. </template>
  47. <template v-else>
  48. <view class='num font-color' v-if="item.pm == 1">+{{item.shareholding}}</view>
  49. <view class='num' v-else>-{{item.shareholding}}</view>
  50. </template>
  51. </view>
  52. <!-- </block> -->
  53. </view>
  54. </view>
  55. </view>
  56. </block>
  57. </view>
  58. <view class='loadingicon acea-row row-center-wrapper' v-if="recordList.length">
  59. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  60. </view>
  61. <view v-if="recordList.length < 1 && page > 1">
  62. <emptyPage title='暂无数据~'></emptyPage>
  63. </view>
  64. </view>
  65. </view>
  66. <home v-if="navigation"></home>
  67. <!-- #ifdef MP -->
  68. <!-- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize> -->
  69. <!-- #endif -->
  70. </view>
  71. </template>
  72. <script>
  73. import {
  74. moneyList,
  75. getSpreadInfo,
  76. getGqList,
  77. getStaffInfo,
  78. getUserInfo
  79. } from '@/api/user.js';
  80. import {
  81. toLogin
  82. } from '@/libs/login.js';
  83. import {
  84. mapGetters
  85. } from "vuex";
  86. import emptyPage from '@/components/emptyPage.vue'
  87. import home from '@/components/home';
  88. import colors from '@/mixins/color.js';
  89. import timeSlot from '@/components/timeSlot/index.vue'
  90. export default {
  91. components: {
  92. emptyPage,
  93. home,
  94. timeSlot
  95. },
  96. mixins: [colors],
  97. data() {
  98. return {
  99. userInfo: {},
  100. staffInfo: {},
  101. name: '',
  102. keyword: '',
  103. type: 0,
  104. page: 1,
  105. limit: 15,
  106. loading: false,
  107. loadend: false,
  108. loadTitle: '加载更多',
  109. recordList: [],
  110. recordType: 0,
  111. recordCount: 0,
  112. extractCount: 0,
  113. times: [],
  114. start: 0,
  115. stop: 0,
  116. income: '',
  117. expend: '',
  118. isShowAuth: false
  119. };
  120. },
  121. computed: mapGetters(['isLogin']),
  122. onLoad(options) {
  123. this.type = options.type;
  124. if (!this.isLogin) {
  125. toLogin();
  126. }
  127. },
  128. onShow: function() {
  129. uni.removeStorageSync('form_type_cart');
  130. let type = this.type;
  131. if (type == 1) {
  132. uni.setNavigationBarTitle({
  133. title: "佣金记录"
  134. });
  135. this.name = '提现总额';
  136. this.recordType = 3;
  137. this.getRecordList();
  138. // this.getRecordListCount();
  139. } else if (type == 2) {
  140. uni.setNavigationBarTitle({
  141. title: "佣金记录"
  142. });
  143. this.name = '佣金明细';
  144. this.recordType = 3;
  145. this.getRecordList();
  146. // this.getRecordListCount();
  147. } else if (type == 4) {
  148. uni.setNavigationBarTitle({
  149. title: "提现记录"
  150. });
  151. this.name = '提现明细';
  152. this.recordType = 4;
  153. this.getRecordList();
  154. // this.getRecordListCount();
  155. } else if(type == 5) {
  156. uni.setNavigationBarTitle({
  157. title: "股权记录"
  158. });
  159. this.recordType = 5;
  160. this.name = '股权明细';
  161. this.getStaffInfo()
  162. } else {
  163. uni.showToast({
  164. title: '参数错误',
  165. icon: 'none',
  166. duration: 1000,
  167. mask: true,
  168. success: function(res) {
  169. setTimeout(function() {
  170. // #ifndef H5
  171. uni.navigateBack({
  172. delta: 1,
  173. });
  174. // #endif
  175. // #ifdef H5
  176. history.back();
  177. // #endif
  178. }, 1200)
  179. },
  180. });
  181. }
  182. },
  183. methods: {
  184. // 显示详细
  185. showDetail(item){
  186. uni.showModal({
  187. title: '详细说明',
  188. content: item.mark,
  189. showCancel: false,
  190. });
  191. },
  192. navto(url) {
  193. uni.navigateTo({
  194. url
  195. })
  196. },
  197. onLoadFun(){
  198. this.isShowAuth = false
  199. },
  200. // 授权关闭
  201. authColse: function(e) {
  202. this.isShowAuth = e
  203. },
  204. submitForm() {
  205. this.page = 1;
  206. this.limit = 20;
  207. this.loadend = false;
  208. this.status = false;
  209. this.$set(this, 'recordList', []);
  210. this.$set(this, 'times', []);
  211. this.getRecordList();
  212. },
  213. changeTime(time) {
  214. this.start = time.start
  215. this.stop = time.stop
  216. this.page = 1;
  217. // this.loading = false;
  218. this.loadend = false;
  219. this.$set(this, 'recordList', []);
  220. this.getRecordList();
  221. },
  222. getGqList() {
  223. let that = this;
  224. let page = that.page;
  225. let limit = that.limit;
  226. if (that.loading) return;
  227. if (that.loadend) return;
  228. getGqList({
  229. page: page,
  230. limit: limit,
  231. uid: that.userInfo.uid
  232. }).then(res => {
  233. this.recordList = this.recordList.concat(res.data.list)
  234. let loadend = res.data.list.length < that.limit;
  235. that.loadend = loadend;
  236. that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
  237. that.page += 1;
  238. that.loading = false;
  239. }).catch(err => {
  240. that.loading = false;
  241. that.loadTitle = '加载更多';
  242. })
  243. },
  244. getStaffInfo() {
  245. let that = this
  246. getUserInfo().then(res => {
  247. that.userInfo = res.data
  248. that.getGqList();
  249. getStaffInfo({
  250. uid: res.data.uid
  251. }).then(ress => {
  252. console.log(ress)
  253. that.staffInfo = ress.data.list[0]
  254. })
  255. })
  256. },
  257. getRecordList: function() {
  258. let that = this;
  259. let page = that.page;
  260. let limit = that.limit;
  261. let recordType = that.recordType;
  262. if (that.loading) return;
  263. if (that.loadend) return;
  264. that.loading = true;
  265. that.loadTitle = '';
  266. moneyList({
  267. keyword: this.keyword,
  268. start: this.start,
  269. stop: this.stop,
  270. page: page,
  271. limit: limit
  272. }, recordType).then(res => {
  273. this.expend = res.data.expend;
  274. this.income = res.data.income;
  275. // for (let i = 0; i < res.data.time.length; i++) {
  276. // // if (!this.times.includes(res.data.time[i])) {
  277. // this.times.push(res.data.time[i])
  278. // this.recordList.push({
  279. // time: res.data.time[i],
  280. // child: []
  281. // })
  282. // // }
  283. // }
  284. // // for (let x = 0; x < this.times.length; x++) {
  285. // for (let j = 0; j < res.data.list.length; j++) {
  286. // // if (this.times[x] === res.data.list[j].time_key) {
  287. // // }
  288. // this.recordList[j].child.push(res.data.list[j])
  289. // }
  290. // // }
  291. this.recordList = this.recordList.concat(res.data.list)
  292. let loadend = res.data.list.length < that.limit;
  293. that.loadend = loadend;
  294. that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
  295. that.page += 1;
  296. that.loading = false;
  297. }).catch(err => {
  298. that.loading = false;
  299. that.loadTitle = '加载更多';
  300. })
  301. },
  302. getRecordListCount: function() {
  303. let that = this;
  304. getSpreadInfo().then(res => {
  305. that.recordCount = res.data.commissionCount;
  306. that.extractCount = res.data.extractCount;
  307. });
  308. }
  309. },
  310. onReachBottom: function() {
  311. this.getRecordList();
  312. }
  313. }
  314. </script>
  315. <style scoped lang="scss">
  316. .commission-details .search {
  317. width: 100%;
  318. background-color: var(--view-theme);
  319. border-bottom: 1px solid #f2f2f2;
  320. height: 86rpx;
  321. padding: 0 30rpx;
  322. box-sizing: border-box;
  323. }
  324. .commission-details .search .input {
  325. width: 100%;
  326. height: 60rpx;
  327. border-radius: 50rpx;
  328. background-color: #f5f5f5;
  329. position: relative;
  330. }
  331. .commission-details .search .input input {
  332. height: 100%;
  333. font-size: 26rpx;
  334. width: 100%;
  335. padding-left: 60rpx;
  336. }
  337. .box {
  338. border-radius: 14rpx;
  339. margin: 0 30rpx;
  340. overflow: hidden;
  341. }
  342. .commission-details .search .input .placeholder {
  343. color: #bbb;
  344. }
  345. .commission-details .search .input .iconfont {
  346. position: absolute;
  347. left: 28rpx;
  348. color: #999;
  349. font-size: 28rpx;
  350. top: 50%;
  351. transform: translateY(-50%);
  352. }
  353. .sign-record {
  354. margin-top: 20rpx;
  355. }
  356. .commission-details .promoterHeader .headerCon .money {
  357. font-size: 36rpx;
  358. }
  359. .commission-details .promoterHeader .headerCon .money .num {
  360. font-family: 'Guildford Pro';
  361. }
  362. .top_num {
  363. padding: 10rpx 30rpx 30rpx 30rpx;
  364. font-size: 26rpx;
  365. color: #666;
  366. }
  367. .top_num_2 {
  368. display: flex;
  369. justify-content: space-between;
  370. }
  371. .tx {
  372. padding: 5rpx 15rpx;
  373. background-color:#1890FF;
  374. color: #fff;
  375. border-radius: 10rpx;
  376. }
  377. .radius15 {
  378. border-radius: 14rpx 14rpx 0 0;
  379. }
  380. .sign-record .list .item .listn .itemn1{border-bottom:1rpx solid #eee;padding:22rpx 24rpx;}
  381. .sign-record .list .item .listn .itemn1 .name{width:390rpx;font-size:28rpx;color:#282828;margin-bottom:10rpx;}
  382. .sign-record .list .item .listn .itemn1 .num{font-size:36rpx;font-family: 'Guildford Pro';color:#16ac57;}
  383. .sign-record .list .item .listn .itemn1 .num.font-color{color:#e93323!important;}
  384. .mark{
  385. margin-bottom: 10rpx;
  386. }
  387. .status_badge{
  388. display: inline-block;
  389. height: 30rpx;
  390. border-radius: 4rpx;
  391. font-size: 20rpx;
  392. line-height: 30rpx;
  393. font-family: PingFangSC-Regular, PingFang SC;
  394. font-weight: 400;
  395. margin-left:12rpx;
  396. padding:0 6rpx 0;
  397. }
  398. .success{
  399. background: rgba(24, 144, 255, .1);
  400. color: #1890FF;
  401. }
  402. .default{
  403. background: #f5f5f5;
  404. color: #282828;;
  405. }
  406. .error{
  407. background: rgba(233, 51, 35, .1);
  408. color: #E93323;
  409. }
  410. </style>