index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view :data-theme="theme">
  3. <view class='commission-details'>
  4. <view class='promoterHeader'>
  5. <view class='headerCon acea-row row-between-wrapper'>
  6. <view>
  7. <view class='name'>{{name}}</view>
  8. <view class='money' v-if="recordType == 4">¥<text class='num'>{{extractCount}}</text></view>
  9. <view class='money' v-else>¥<text class='num'>{{commissionCount}}</text></view>
  10. </view>
  11. <view class='iconfont icon-jinbi1'></view>
  12. </view>
  13. </view>
  14. <view class='sign-record' v-if="recordType == 4">
  15. <block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
  16. <view class='list borderPad'>
  17. <view class='item'>
  18. <view class='data'>{{item.month}}</view>
  19. <view class='listn borRadius14'>
  20. <block v-for="(child,indexn) in item.list" :key="indexn">
  21. <view class='itemn acea-row row-between-wrapper'>
  22. <view style="width: 70%;">
  23. <view v-if="child.auditStatus!==1" class='name line1'>
  24. {{child.auditStatus | statusFilter}}
  25. </view>
  26. <view class='name line1' v-else>审核成功 / {{child.accountStatus==0?'待结算':'已结算'}}
  27. </view>
  28. <view v-show="child.auditStatus==2 && child.refusalReason" class="font-color-red mb8">{{child.refusalReason}}</view>
  29. <view>{{child.createTime}}</view>
  30. </view>
  31. <view class='num font_color'>{{child.closingPrice}}</view>
  32. </view>
  33. </block>
  34. </view>
  35. </view>
  36. </view>
  37. </block>
  38. <view v-if="recordList.length == 0">
  39. <emptyPage title='暂无结算记录~' :imgSrc="urlDomain+'crmebimage/presets/noJilu.png'"></emptyPage>
  40. </view>
  41. </view>
  42. <view class='sign-record' v-else>
  43. <block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
  44. <view class='list borderPad'>
  45. <view class='item'>
  46. <view class='data'>{{item.month}}</view>
  47. <view class='listn borRadius14'>
  48. <block v-for="(child,indexn) in item.list" :key="indexn">
  49. <view class='itemn acea-row row-between-wrapper'>
  50. <view>
  51. <view class='name line1'>{{child.title}}</view>
  52. <view>{{child.updateTime}}</view>
  53. </view>
  54. <view class='num font_color' v-if="child.type == 1">+{{child.price}}
  55. </view>
  56. <view class='num' v-else>-{{child.price}}</view>
  57. </view>
  58. </block>
  59. </view>
  60. </view>
  61. </view>
  62. </block>
  63. <view v-if="recordList.length == 0">
  64. <emptyPage title='暂无佣金记录~' :imgSrc="urlDomain+'crmebimage/presets/noJilu.png'"></emptyPage>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. // +----------------------------------------------------------------------
  72. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  73. // +----------------------------------------------------------------------
  74. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  75. // +----------------------------------------------------------------------
  76. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  77. // +----------------------------------------------------------------------
  78. // | Author: CRMEB Team <admin@crmeb.com>
  79. // +----------------------------------------------------------------------
  80. import {
  81. getCommissionInfo,
  82. getClosingRecordApi,
  83. } from '@/api/user.js';
  84. import {
  85. toLogin
  86. } from '@/libs/login.js';
  87. import {
  88. mapGetters
  89. } from "vuex";
  90. import emptyPage from '@/components/emptyPage.vue'
  91. import {
  92. setThemeColor
  93. } from '@/utils/setTheme.js'
  94. const app = getApp();
  95. export default {
  96. components: {
  97. emptyPage
  98. },
  99. filters: {
  100. statusFilter(status) {
  101. const statusMap = {
  102. '2': '已拒绝',
  103. '0': '待审核',
  104. '1': '审核成功'
  105. }
  106. return statusMap[status]
  107. }
  108. },
  109. data() {
  110. return {
  111. urlDomain: this.$Cache.get("imgHost"),
  112. name: '',
  113. type: 0,
  114. page: 1,
  115. limit: 20,
  116. recordList: [],
  117. recordType: 0,
  118. loadend: false,
  119. extractCount: 0,
  120. theme: app.globalData.theme,
  121. commissionCount: 0,
  122. bgColor: '#e93323'
  123. };
  124. },
  125. computed: mapGetters(['isLogin']),
  126. onLoad(options) {
  127. if (this.isLogin) {
  128. this.type = options.type;
  129. this.extractCount = options.extractCount;
  130. this.commissionCount = options.commissionCount;
  131. } else {
  132. toLogin();
  133. }
  134. let that = this;
  135. that.bgColor = setThemeColor();
  136. uni.setNavigationBarColor({
  137. frontColor: '#ffffff',
  138. backgroundColor: that.bgColor,
  139. });
  140. },
  141. onShow: function() {
  142. let type = this.type;
  143. if (type == 1) {
  144. uni.setNavigationBarTitle({
  145. title: "结算记录"
  146. });
  147. this.name = '结算总额';
  148. this.recordType = 4;
  149. this.getList();
  150. } else if (type == 2) {
  151. uni.setNavigationBarTitle({
  152. title: "佣金记录"
  153. });
  154. this.name = '佣金记录';
  155. this.recordType = 3;
  156. this.getRecordList();
  157. } else {
  158. uni.showToast({
  159. title: '参数错误',
  160. icon: 'none',
  161. duration: 1000,
  162. mask: true,
  163. success: function(res) {
  164. setTimeout(function() {
  165. // #ifndef H5
  166. uni.navigateBack({
  167. delta: 1,
  168. });
  169. // #endif
  170. // #ifdef H5
  171. history.back();
  172. // #endif
  173. }, 1200)
  174. },
  175. });
  176. }
  177. },
  178. methods: {
  179. getList: function() {
  180. let that = this;
  181. let recordList = that.recordList;
  182. let recordListNew = [];
  183. if (that.loadend == true) return;
  184. getClosingRecordApi({
  185. page: that.page,
  186. limit: that.limit
  187. }).then(res => {
  188. that.page = that.page + 1;
  189. let len = that.page > res.data.totalPage;
  190. let recordListData = res.data || [];
  191. recordListNew = recordList.concat(recordListData);
  192. that.loadend = len;
  193. that.$set(that, 'recordList', recordListNew);
  194. });
  195. },
  196. getRecordList: function() {
  197. let that = this;
  198. let page = that.page;
  199. let limit = that.limit;
  200. let loadend = that.loadend;
  201. let recordType = that.recordType;
  202. let recordList = that.recordList;
  203. let recordListNew = [];
  204. if (loadend == true) return;
  205. getCommissionInfo({
  206. page: page,
  207. limit: limit
  208. }).then(res => {
  209. if (res.data.list) {
  210. that.page = page + 1;
  211. let len = that.page > res.data.totalPage;
  212. let recordListData = res.data.list || [];
  213. recordListNew = recordList.concat(recordListData);
  214. that.loadend = len;
  215. that.$set(that, 'recordList', recordListNew);
  216. }
  217. });
  218. }
  219. },
  220. onReachBottom: function() {
  221. if (this.type == 1) {
  222. this.getList();
  223. } else {
  224. this.getRecordList();
  225. }
  226. }
  227. }
  228. </script>
  229. <style scoped lang="scss">
  230. .commission-details .promoterHeader .headerCon .money {
  231. font-size: 36rpx;
  232. }
  233. .promoterHeader {
  234. @include main_bg_color(theme);
  235. }
  236. .commission-details .promoterHeader .headerCon .money .num {
  237. font-family: 'Guildford Pro';
  238. }
  239. .font_color {
  240. color: #E93323 !important;
  241. }
  242. </style>