inviteCode.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <!-- 佣金明细 -->
  2. <template>
  3. <view>
  4. <view style="color: #000000;">
  5. <tn-nav-bar backgroundColor="#ffffff" :bottomShadow="false">邀请码</tn-nav-bar>
  6. <!-- <view :style="{height: tobheight+'px'}"></view> -->
  7. </view>
  8. <z-paging ref="paging" refresher-complete-delay="200" v-model="rewardLog" @query="queryList">
  9. <view slot="top" class="z_tabs" :style="{marginTop: tobheight+'px'}"></view>
  10. <view class="commission-log-wrap">
  11. 邀请码<button>复制</button>
  12. </view>
  13. </z-paging>
  14. <wike-loading-page :isLoading="isLoading"></wike-loading-page>
  15. </view>
  16. </template>
  17. <script>
  18. import {
  19. mapMutations,
  20. mapActions,
  21. mapState,
  22. mapGetters
  23. } from 'vuex';
  24. export default {
  25. data() {
  26. return {
  27. isLoading: true,
  28. tobheight: 45,
  29. platform: this.$platform.get(),
  30. stateCurrent: 'all', //默认
  31. stateMap: {
  32. all: '全部收入',
  33. waiting: '待入账',
  34. accounted: '已入账',
  35. back: '已退回',
  36. cancel: '已取消'
  37. },
  38. classType: {
  39. '-1': '#EB2B3D',
  40. '0': '#05C3A1',
  41. '1': '#7063D2',
  42. '-2': '#EEEEEE'
  43. },
  44. statusList: [{
  45. name: '全部',
  46. value: 'all'
  47. },
  48. {
  49. name: '待入账',
  50. value: 'waiting'
  51. },
  52. {
  53. name: '已入账',
  54. value: 'accounted'
  55. },
  56. // {
  57. // name: '已退回',
  58. // value: 'back'
  59. // },
  60. // {
  61. // name: '已取消',
  62. // value: 'cancel'
  63. // }
  64. ],
  65. incomeLog: [],
  66. showMoney: true, //是否显示金额
  67. //日期选择
  68. showCalendar: false,
  69. selDateText: '',
  70. rewardLog: [{}], //佣金记录
  71. propsDate: '', //日期参数
  72. totalMoney: '', //收入
  73. loadStatus: 'loadmore', //loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
  74. currentPage: 1,
  75. lastPage: 1,
  76. isEmpty: false,
  77. on_cashout_money: '0.00',
  78. money_total: '0.00',
  79. money: '0.00'
  80. };
  81. },
  82. computed: {
  83. ...mapGetters(['appInfo', 'isLogin', 'userInfo'])
  84. },
  85. onLoad() {
  86. const that = this;
  87. if (this.platform == 'wxMiniProgram') {
  88. var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight
  89. var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop
  90. this.tobheight = (menumtop + paddingtop + uni.getMenuButtonBoundingClientRect().height)
  91. }
  92. this.getToday();
  93. this.getCommissionLog();
  94. },
  95. onShow() {
  96. this.getCheck()
  97. },
  98. methods: {
  99. queryList(pageNo, pageSize) {
  100. //这里的pageNo和pageSize会自动计算好,直接传给服务器即可
  101. const params = {
  102. page: pageNo,
  103. limit: pageSize,
  104. // level: this.level,
  105. };
  106. this.$http('commission.incomeLog', params).then(res => {
  107. if (res.code == 0) {
  108. this.$refs.paging.complete(res.data.data);
  109. }
  110. });
  111. },
  112. getCheck() {
  113. var that = this;
  114. that.$http('commission.auth').then(res => {
  115. if (res.code == 0) {
  116. uni.setNavigationBarTitle({
  117. title: this.appInfo.site_name
  118. });
  119. that.on_cashout_money = res.data.on_cashout_money > 0 ? res.data.on_cashout_money : '0.00'
  120. that.money_total = res.data.money_total > 0 ? res.data.money_total : '0.00'
  121. that.money = res.data.money
  122. that.isLoading = false
  123. }
  124. })
  125. },
  126. jump(path, parmas) {
  127. this.$Router.push({
  128. path: path,
  129. query: parmas
  130. });
  131. },
  132. // 切换分类
  133. onTab(state) {
  134. if (this.stateCurrent !== state) {
  135. this.rewardLog = [];
  136. this.currentPage = 1;
  137. this.lastPage = 1;
  138. this.stateCurrent = state;
  139. this.getCommissionLog();
  140. }
  141. },
  142. // 今日
  143. getToday() {
  144. let now = new Date();
  145. this.selDateText = `${now.getFullYear()}.${now.getMonth() + 1}.${now.getDate()}`;
  146. let dateText = `${now.getFullYear()}/${now.getMonth() + 1}/${now.getDate()}`;
  147. this.propsDate = `${dateText}-${dateText}`;
  148. },
  149. // 选择日期
  150. selDate(e) {
  151. this.rewardLog = [];
  152. this.currentPage = 1;
  153. this.lastPage = 1;
  154. this.selDateText = `${e.startYear}.${e.startMonth}.${e.startDay}-${e.endYear}.${e.endMonth}.${e.endDay}`;
  155. let dateText = `${e.startYear}/${e.startMonth}/${e.startDay}-${e.endYear}/${e.endMonth}/${e.endDay}`;
  156. this.propsDate = dateText;
  157. this.getCommissionLog();
  158. this.$refs.uCalendar.init();
  159. },
  160. // 佣金明细
  161. getCommissionLog() {
  162. let that = this;
  163. that.loadStatus = 'loading';
  164. that.$http(
  165. 'commission.incomeLog', {
  166. // date: that.propsDate,
  167. // type: that.stateCurrent,
  168. page: that.currentPage
  169. },
  170. '加载中...'
  171. ).then(res => {
  172. uni.stopPullDownRefresh();
  173. if (res.code === 0) {
  174. // that.totalMoney = res.data.total_money;
  175. that.rewardLog = [...that.rewardLog, ...res.data.data];
  176. that.lastPage = res.data.last_page;
  177. that.isEmpty = !that.rewardLog.length;
  178. that.loadStatus = that.currentPage < res.data.last_page ? 'loadmore' : 'nomore';
  179. }
  180. });
  181. },
  182. // 加载更多
  183. loadMore() {
  184. if (this.currentPage < this.lastPage) {
  185. this.currentPage += 1;
  186. this.getCommissionLog();
  187. }
  188. }
  189. }
  190. };
  191. </script>
  192. <style lang="scss">
  193. // 分类
  194. .state-item {
  195. height: 100%;
  196. display: flex;
  197. flex-direction: column;
  198. align-items: center;
  199. justify-content: center;
  200. background-color: #fff;
  201. border-bottom: 1rpx solid rgba(#999, 0.5);
  202. .state-title {
  203. color: #666;
  204. font-weight: 500;
  205. font-size: 28rpx;
  206. line-height: 90rpx;
  207. }
  208. .title-active {
  209. color: #333;
  210. }
  211. .underline {
  212. display: block;
  213. width: 68rpx;
  214. height: 4rpx;
  215. background: #fff;
  216. border-radius: 2rpx;
  217. }
  218. .underline-active {
  219. background: #5e49c3;
  220. display: block;
  221. width: 68rpx;
  222. height: 4rpx;
  223. border-radius: 2rpx;
  224. }
  225. }
  226. // 钱包卡片
  227. .wallet-wrap {
  228. background-color: #fff;
  229. padding: 30rpx;
  230. }
  231. .wallet-card {
  232. width: 690rpx;
  233. height: 301rpx;
  234. background: url('http://file.shopro.top/imgs/commission/commission_card_bg.png') no-repeat;
  235. background-size: 100% 100%;
  236. border-radius: 20rpx;
  237. padding: 30rpx;
  238. position: relative;
  239. box-shadow: 1rpx 5rpx 16rpx 0px rgba(94, 73, 195, 0.81);
  240. .head-box {
  241. margin-bottom: 20rpx;
  242. .head-title {
  243. font-size: 24rpx;
  244. font-weight: 400;
  245. color: #ffffff;
  246. }
  247. .look-btn {
  248. color: #fff;
  249. font-size: 30rpx;
  250. background: none;
  251. padding: 0;
  252. margin-left: 20rpx;
  253. }
  254. }
  255. .card-num {
  256. font-size: 40rpx;
  257. font-weight: 500;
  258. color: #fefefe;
  259. margin-bottom: 30rpx;
  260. }
  261. .card-bottom {
  262. .card-item {
  263. .item-title {
  264. font-size: 24rpx;
  265. font-weight: 400;
  266. color: #ffffff;
  267. margin-bottom: 10rpx;
  268. }
  269. .item-value {
  270. font-size: 30rpx;
  271. font-weight: 500;
  272. color: #fefefe;
  273. }
  274. }
  275. }
  276. .draw-btn {
  277. position: absolute;
  278. top: 35rpx;
  279. right: 35rpx;
  280. width: 121rpx;
  281. line-height: 58rpx;
  282. background: #ffffff;
  283. border-radius: 29rpx;
  284. padding: 0;
  285. font-size: 24rpx;
  286. font-weight: 500;
  287. color: #5848c4;
  288. }
  289. }
  290. // 表头
  291. .head_box {
  292. height: 120rpx;
  293. padding: 0 30rpx;
  294. background-color: #f6f6f6;
  295. .date-btn {
  296. background-color: #fff;
  297. line-height: 54rpx;
  298. border-radius: 27rpx;
  299. padding: 0 20rpx;
  300. font-size: 24rpx;
  301. font-weight: 500;
  302. color: #666666;
  303. }
  304. .total-box {
  305. font-size: 24rpx;
  306. font-weight: 500;
  307. color: #666666;
  308. }
  309. }
  310. // 佣金明细列表
  311. .item-box {
  312. margin: 20rpx 0;
  313. }
  314. .log-item {
  315. height: 142rpx;
  316. background-color: #fff;
  317. padding: 0 60rpx;
  318. border-bottom: 1rpx solid #eee;
  319. .item-left {
  320. .log-img {
  321. width: 50rpx;
  322. height: 50rpx;
  323. border-radius: 50%;
  324. margin-right: 24rpx;
  325. }
  326. .log-name {
  327. font-size: 28rpx;
  328. font-weight: 500;
  329. color: #333333;
  330. margin-bottom: 12rpx;
  331. }
  332. .log-notice {
  333. font-size: 22rpx;
  334. font-weight: 500;
  335. color: #c0c0c0;
  336. }
  337. }
  338. .item-right {
  339. .log-num {
  340. font-size: 28rpx;
  341. font-weight: 500;
  342. color: #05c3a1;
  343. }
  344. .log-date {
  345. font-size: 24rpx;
  346. font-weight: 400;
  347. color: #c0c0c0;
  348. }
  349. }
  350. }
  351. </style>