index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. <template>
  2. <view :style="colorStyle">
  3. <view class='commission-details'>
  4. <view class='sign-record'>
  5. <view class="box">
  6. <block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
  7. <view class='list'>
  8. <view class='item'>
  9. <view class='listn'>
  10. <view class='itemn1 acea-row row-between-wrapper'>
  11. <view class="flex-g">
  12. <view class='name line2'>
  13. {{item.mark}}
  14. </view>
  15. <view>
  16. <view class="">
  17. 修改时间:{{getTimeStr( item.add_time )}}
  18. </view>
  19. </view>
  20. </view>
  21. <view class='status font-colorss' v-if="type == 1">
  22. {{item.number}}
  23. </view>
  24. <view class='status font-colorss' :class="{'font-color': item.pm == 0}" v-if="type == 0">
  25. {{item.pm == 0? '-': '+'}}{{item.number}}
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </block>
  32. </view>
  33. </view>
  34. <view v-if="recordList.length == 0 && !loading">
  35. <emptyPage title="暂无记录~"></emptyPage>
  36. </view>
  37. </view>
  38. <home v-if="navigation"></home>
  39. <!-- #ifdef MP -->
  40. <!-- <authorize v-if="isShowAuth" @authColse="authColse" @onLoadFun="onLoadFun"></authorize> -->
  41. <!-- #endif -->
  42. </view>
  43. </template>
  44. <script>
  45. import {
  46. moneyList,
  47. getSpreadInfo,
  48. getGqList,
  49. getStaffInfo,
  50. getUserInfo,
  51. getYjList,
  52. getJt,
  53. getTxList,
  54. passTx,
  55. errTx,
  56. getQzList,
  57. getJcList
  58. } from '@/api/user.js';
  59. import {
  60. toLogin
  61. } from '@/libs/login.js';
  62. import {
  63. mapGetters
  64. } from "vuex";
  65. import emptyPage from '@/components/emptyPage.vue'
  66. import home from '@/components/home';
  67. import colors from '@/mixins/color.js';
  68. import timeSlot from '@/components/timeSlot/index.vue'
  69. export default {
  70. components: {
  71. emptyPage,
  72. home,
  73. timeSlot
  74. },
  75. mixins: [colors],
  76. data() {
  77. return {
  78. txitem: {},
  79. mark: '',
  80. sevenType: 51,
  81. sixType: 0,
  82. sale_sum: 0,
  83. craft_sum: 0,
  84. timer: '',
  85. userInfo: {},
  86. staffInfo: {},
  87. name: '',
  88. keyword: '',
  89. type: 0,
  90. page: 1,
  91. limit: 10,
  92. loading: false,
  93. loadend: false,
  94. loadTitle: '加载更多',
  95. recordList: [],
  96. recordType: 0,
  97. recordCount: 0,
  98. extractCount: 0,
  99. times: [],
  100. start: 0,
  101. stop: 0,
  102. income: '',
  103. expend: '',
  104. isShowAuth: false
  105. };
  106. },
  107. computed: mapGetters(['isLogin']),
  108. onLoad(options) {
  109. this.type =options.type
  110. if(this.type == 1) {
  111. uni.setNavigationBarTitle({
  112. title:'奖池变更记录'
  113. })
  114. }
  115. this.getYjList('re', 0)
  116. },
  117. onShow: function(opt) {
  118. },
  119. methods: {
  120. getYjList(type, sixType) {
  121. let that = this;
  122. that.sixType = sixType;
  123. if (type == 're') {
  124. console.log('ze')
  125. that.page = 1
  126. that.loading = false
  127. that.loadend = false
  128. this.recordList = []
  129. }
  130. if (that.loading) return;
  131. if (that.loadend) return;
  132. let getList;
  133. if(that.type == 0) {
  134. getList = getQzList
  135. }else {
  136. getList = getJcList
  137. }
  138. getList({
  139. page: that.page,
  140. limit: that.limit,
  141. // status: that.sixType
  142. }).then(res => {
  143. let arr = res.data.list
  144. this.recordList = this.recordList.concat(arr);
  145. let loadend = arr.length < that.limit;
  146. that.loadend = loadend;
  147. that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
  148. that.page++;
  149. console.log(that.page, 'that.page')
  150. that.loading = false;
  151. }).catch(err => {
  152. that.loading = false;
  153. that.loadTitle = '加载更多';
  154. })
  155. },
  156. navto(url) {
  157. uni.navigateTo({
  158. url
  159. })
  160. },
  161. onLoadFun() {
  162. this.isShowAuth = false
  163. },
  164. // 授权关闭
  165. authColse: function(e) {
  166. this.isShowAuth = e
  167. },
  168. getTimeStr(timestamp) {
  169. let date;
  170. if (timestamp) {
  171. date = new Date(timestamp * 1000);
  172. } else {
  173. date = new Date();
  174. }
  175. const year = date.getFullYear();
  176. const month = date.getMonth() + 1; // 月份从 0 开始,所以需要加 1
  177. const day = date.getDate();
  178. return year + '/' + (month > 9 ? month : '0' + month) + '/' + (day > 9 ? day : '0' + day)
  179. },
  180. changeTime(time) {
  181. console.log(time, 'time')
  182. if (this.recordType == 6) {
  183. let times = ''
  184. if (time.start == 0 && time.stop == 0) {
  185. console.log('全部')
  186. this.timer = '2020/01/01-' + this.getTimeStr()
  187. } else {
  188. this.timer = this.getTimeStr(time.start) + '-' + this.getTimeStr(time.stop)
  189. }
  190. console.log(this.timer, 'timer')
  191. this.getYjList()
  192. } else {
  193. this.start = time.start
  194. this.stop = time.stop
  195. this.page = 1;
  196. // this.loading = false;
  197. this.loadend = false;
  198. this.$set(this, 'recordList', []);
  199. this.getRecordList();
  200. }
  201. },
  202. getGqList() {
  203. let that = this;
  204. let page = that.page;
  205. let limit = that.limit;
  206. if (that.loading) return;
  207. if (that.loadend) return;
  208. getGqList({
  209. page: page,
  210. limit: limit,
  211. uid: that.userInfo.uid
  212. }).then(res => {
  213. this.recordList = this.recordList.concat(res.data.list)
  214. let loadend = res.data.list.length < that.limit;
  215. that.loadend = loadend;
  216. that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
  217. that.page += 1;
  218. that.loading = false;
  219. }).catch(err => {
  220. that.loading = false;
  221. that.loadTitle = '加载更多';
  222. })
  223. },
  224. getStaffInfo() {
  225. let that = this
  226. getUserInfo().then(res => {
  227. that.userInfo = res.data
  228. if (this.recordType == 5) {
  229. that.getGqList();
  230. }
  231. getStaffInfo({
  232. uid: res.data.uid
  233. }).then(ress => {
  234. that.staffInfo = ress.data;
  235. if (that.recordType == 6) {
  236. that.getYjList()
  237. }
  238. if (that.recordType == 7) {
  239. that.getJt('re', 51)
  240. }
  241. })
  242. })
  243. },
  244. getRecordList: function() {
  245. let that = this;
  246. let page = that.page;
  247. let limit = that.limit;
  248. let recordType = that.recordType;
  249. if (that.loading) return;
  250. if (that.loadend) return;
  251. that.loading = true;
  252. that.loadTitle = '';
  253. moneyList({
  254. keyword: this.keyword,
  255. start: this.start,
  256. stop: this.stop,
  257. page: page,
  258. limit: limit
  259. }, recordType).then(res => {
  260. // this.expend = res.data.expend;
  261. // this.income = res.data.income;
  262. // for (let i = 0; i < res.data.time.length; i++) {
  263. // // if (!this.times.includes(res.data.time[i])) {
  264. // this.times.push(res.data.time[i])
  265. // this.recordList.push({
  266. // time: res.data.time[i],
  267. // child: []
  268. // })
  269. // // }
  270. // }
  271. // // for (let x = 0; x < this.times.length; x++) {
  272. // for (let j = 0; j < res.data.list.length; j++) {
  273. // // if (this.times[x] === res.data.list[j].time_key) {
  274. // // }
  275. // this.recordList[j].child.push(res.data.list[j])
  276. // }
  277. // // }
  278. // console.log()
  279. if (res.data.list && res.data.list.list) {
  280. this.recordList = this.recordList.concat(res.data.list.list)
  281. let loadend = res.data.list.length.length < that.limit;
  282. that.loadend = loadend;
  283. that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
  284. that.page += 1;
  285. }
  286. that.loading = false;
  287. }).catch(err => {
  288. that.loading = false;
  289. that.loadTitle = '加载更多';
  290. })
  291. },
  292. getRecordListCount: function() {
  293. let that = this;
  294. getSpreadInfo().then(res => {
  295. that.recordCount = res.data.commissionCount;
  296. that.extractCount = res.data.extractCount;
  297. });
  298. }
  299. },
  300. onReachBottom: function() {
  301. this.getYjList('', this.sixType)
  302. }
  303. }
  304. </script>
  305. <style scoped lang="scss">
  306. .commission-details .search {
  307. width: 100%;
  308. background-color: var(--view-theme);
  309. border-bottom: 1px solid #f2f2f2;
  310. height: 86rpx;
  311. padding: 0 30rpx;
  312. box-sizing: border-box;
  313. .input {
  314. width: 100%;
  315. height: 60rpx;
  316. border-radius: 50rpx;
  317. background-color: #f5f5f5;
  318. position: relative;
  319. input {
  320. height: 100%;
  321. font-size: 26rpx;
  322. width: 100%;
  323. padding-left: 60rpx;
  324. }
  325. .placeholder {
  326. color: #bbb;
  327. }
  328. .iconfont {
  329. position: absolute;
  330. left: 28rpx;
  331. color: #999;
  332. font-size: 28rpx;
  333. top: 50%;
  334. transform: translateY(-50%);
  335. }
  336. }
  337. }
  338. .box {
  339. border-radius: 14rpx;
  340. margin: 0 30rpx;
  341. overflow: hidden;
  342. }
  343. .sign-record {
  344. // margin-top: 20rpx;
  345. }
  346. .commission-details {
  347. .promoterHeader {
  348. .headerCon {
  349. .money {
  350. font-size: 36rpx;
  351. .num {
  352. font-family: 'Guildford Pro';
  353. }
  354. }
  355. }
  356. }
  357. }
  358. .top_num {
  359. padding: 30rpx;
  360. font-size: 26rpx;
  361. color: #666;
  362. }
  363. .top_num_2 {
  364. display: flex;
  365. justify-content: space-around;
  366. position: sticky;
  367. top: 0;
  368. background-color: rgba(245, 245, 245, 1);
  369. }
  370. .tx {
  371. background-color: #1890FF;
  372. color: #fff;
  373. position: fixed;
  374. bottom: 0;
  375. left: 0;
  376. right: 0;
  377. text-align: center;
  378. line-height: 80rpx;
  379. font-size: $uni-font-size-lg;
  380. }
  381. .radius15 {
  382. border-radius: 14rpx 14rpx 0 0;
  383. }
  384. .sign-record {
  385. .list {
  386. .item {
  387. .listn {
  388. .itemn1 {
  389. border-bottom: 1rpx solid #eee;
  390. padding: 22rpx 24rpx;
  391. flex-wrap: nowrap;
  392. .flex-g {
  393. flex-grow: 1;
  394. padding-right: 30rpx;
  395. .status {
  396. font-size: 28rpx;
  397. }
  398. }
  399. .name {
  400. font-size: 28rpx;
  401. color: #282828;
  402. margin-bottom: 10rpx;
  403. }
  404. .num {
  405. font-size: 36rpx;
  406. font-family: 'Guildford Pro';
  407. color: #16ac57;
  408. }
  409. }
  410. }
  411. }
  412. }
  413. }
  414. .mark {
  415. margin-bottom: 10rpx;
  416. }
  417. .status_badge {
  418. display: inline-block;
  419. height: 30rpx;
  420. border-radius: 4rpx;
  421. font-size: 20rpx;
  422. line-height: 30rpx;
  423. font-family: PingFangSC-Regular, PingFang SC;
  424. font-weight: 400;
  425. margin-left: 12rpx;
  426. padding: 0 6rpx 0;
  427. }
  428. .success {
  429. background: rgba(24, 144, 255, .1);
  430. color: #1890FF;
  431. }
  432. .default {
  433. background: #f5f5f5;
  434. color: #282828;
  435. ;
  436. }
  437. .error {
  438. background: rgba(233, 51, 35, .1);
  439. color: #E93323;
  440. }
  441. .nav {
  442. display: flex;
  443. justify-content: space-evenly;
  444. position: fixed;
  445. top: 0;
  446. width: 750rpx;
  447. .nav-item {
  448. width: 50%;
  449. line-height: 60rpx;
  450. text-align: center;
  451. color: #1890FF;
  452. border: 1px solid #1890FF;
  453. font-size: 28rpx;
  454. background-color: #fff;
  455. }
  456. .action {
  457. background-color: #1890FF;
  458. color: #fff;
  459. font-weight: bold;
  460. }
  461. }
  462. .font-color {
  463. color: #e93323 !important;
  464. }
  465. .font-colors {
  466. color: #16ac57 !important;
  467. }
  468. .font-colorss {
  469. color: #1890FF ;
  470. }
  471. .ds-wrap {
  472. width: 623rpx;
  473. height: 334rpx;
  474. border-radius: 20rpx;
  475. background-color: #fff;
  476. display: flex;
  477. justify-content: space-around;
  478. align-items: center;
  479. flex-direction: column;
  480. input {
  481. width: 575rpx;
  482. height: 73rpx;
  483. background-color: #f5f5f5;
  484. color: #000;
  485. padding-left: 20rpx;
  486. }
  487. .btn-wrap {
  488. width: 575rpx;
  489. display: flex;
  490. justify-content: space-between;
  491. align-items: center;
  492. .btn {
  493. width: 277rpx;
  494. height: 82rpx;
  495. // background-color: ;
  496. color: #000;
  497. display: flex;
  498. justify-content: center;
  499. align-items: center;
  500. background-color: #f5f5f5;
  501. border-radius: 15rpx;
  502. }
  503. .s-btn {
  504. color: #fff;
  505. background-color: #16ac57
  506. }
  507. }
  508. }
  509. </style>