You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

237 lines
6.3 KiB

3 months ago
  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 pad30'>
  17. <view class='item'>
  18. <view class='data'>{{item.date}}</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>
  23. <view class='name line1'>{{child.status | statusFilter}}</view>
  24. <view>{{child.createTime}}</view>
  25. </view>
  26. <view class='num font_color' v-if="child.status == -1">+{{child.extractPrice}}
  27. </view>
  28. <view class='num' v-else>-{{child.extractPrice}}</view>
  29. <!-- <view>
  30. <view class='name line1'>{{child.status === -1 ? '提现失败' : '提现成功'}}<span
  31. v-show="child.status === -1"
  32. style="font-size: 12px;color: red;">{{'('+child.failMsg+')'}}</span>
  33. </view>
  34. <view>{{child.createTime}}</view>
  35. </view>
  36. <view class='num font-color' v-if="child.status == -1">+{{child.extractPrice}}
  37. </view>
  38. <view class='num' v-else>-{{child.extractPrice}}</view> -->
  39. </view>
  40. </block>
  41. </view>
  42. </view>
  43. </view>
  44. </block>
  45. <view v-if="recordList.length == 0">
  46. <emptyPage title='暂无提现记录~'></emptyPage>
  47. </view>
  48. </view>
  49. <view class='sign-record' v-else>
  50. <block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
  51. <view class='list pad30'>
  52. <view class='item'>
  53. <view class='data'>{{item.date}}</view>
  54. <view class='listn borRadius14'>
  55. <block v-for="(child,indexn) in item.list" :key="indexn">
  56. <view class='itemn acea-row row-between-wrapper'>
  57. <view>
  58. <view class='name line1'>{{child.title}}</view>
  59. <view>{{child.updateTime}}</view>
  60. </view>
  61. <view class='num font_color' v-if="child.type == 1">+{{child.price}}
  62. </view>
  63. <view class='num' v-else>-{{child.price}}</view>
  64. </view>
  65. </block>
  66. </view>
  67. </view>
  68. </view>
  69. </block>
  70. <view v-if="recordList.length == 0">
  71. <emptyPage title='暂无佣金记录~'></emptyPage>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import {
  79. getCommissionInfo,
  80. getRecordApi,
  81. } from '@/api/user.js';
  82. import {
  83. toLogin
  84. } from '@/libs/login.js';
  85. import {
  86. mapGetters
  87. } from "vuex";
  88. import emptyPage from '@/components/emptyPage.vue'
  89. import {setThemeColor} from '@/utils/setTheme.js'
  90. const app = getApp();
  91. export default {
  92. components: {
  93. emptyPage
  94. },
  95. filters: {
  96. statusFilter(status) {
  97. const statusMap = {
  98. '-1': '未通过',
  99. '0': '审核中',
  100. '1': '已提现'
  101. }
  102. return statusMap[status]
  103. }
  104. },
  105. data() {
  106. return {
  107. name: '',
  108. type: 0,
  109. page: 1,
  110. limit: 10,
  111. recordList: [],
  112. recordType: 0,
  113. statuss: false,
  114. extractCount: 0,
  115. theme:app.globalData.theme,
  116. commissionCount:0,
  117. bgColor:'#e93323'
  118. };
  119. },
  120. computed: mapGetters(['isLogin']),
  121. onLoad(options) {
  122. if (this.isLogin) {
  123. this.type = options.type;
  124. this.extractCount = options.extractCount;
  125. this.commissionCount = options.commissionCount;
  126. } else {
  127. toLogin();
  128. }
  129. let that = this;
  130. that.bgColor = setThemeColor();
  131. uni.setNavigationBarColor({
  132. frontColor: '#ffffff',
  133. backgroundColor:that.bgColor,
  134. });
  135. },
  136. onShow: function() {
  137. let type = this.type;
  138. if (type == 1) {
  139. uni.setNavigationBarTitle({
  140. title: "提现记录"
  141. });
  142. this.name = '提现总额';
  143. this.recordType = 4;
  144. this.getList();
  145. } else if (type == 2) {
  146. uni.setNavigationBarTitle({
  147. title: "佣金记录"
  148. });
  149. this.name = '佣金明细';
  150. this.recordType = 3;
  151. this.getRecordList();
  152. } else {
  153. uni.showToast({
  154. title: '参数错误',
  155. icon: 'none',
  156. duration: 1000,
  157. mask: true,
  158. success: function(res) {
  159. setTimeout(function() {
  160. // #ifndef H5
  161. uni.navigateBack({
  162. delta: 1,
  163. });
  164. // #endif
  165. // #ifdef H5
  166. history.back();
  167. // #endif
  168. }, 1200)
  169. },
  170. });
  171. }
  172. },
  173. methods: {
  174. getList: function() {
  175. let that = this;
  176. let recordList = that.recordList;
  177. let recordListNew = [];
  178. if (that.statuss == true) return;
  179. getRecordApi({
  180. page: that.page,
  181. limit: that.limit
  182. }).then(res => {
  183. let len = res.data.list ? res.data.list.length : 0;
  184. let recordListData = res.data.list || [];
  185. recordListNew = recordList.concat(recordListData);
  186. that.statuss = that.limit > len;
  187. that.page = that.page + 1;
  188. that.$set(that, 'recordList', recordListNew);
  189. });
  190. },
  191. getRecordList: function() {
  192. let that = this;
  193. let page = that.page;
  194. let limit = that.limit;
  195. let statuss = that.statuss;
  196. let recordType = that.recordType;
  197. let recordList = that.recordList;
  198. let recordListNew = [];
  199. if (statuss == true) return;
  200. getCommissionInfo({
  201. page: page,
  202. limit: limit
  203. }).then(res => {
  204. if (res.data.list) {
  205. let len = res.data.list ? res.data.list.length : 0;
  206. let recordListData = res.data.list || [];
  207. recordListNew = recordList.concat(recordListData);
  208. that.statuss = limit > len;
  209. that.page = page + 1;
  210. that.$set(that, 'recordList', recordListNew);
  211. }
  212. });
  213. }
  214. },
  215. onReachBottom: function() {
  216. this.getRecordList();
  217. }
  218. }
  219. </script>
  220. <style scoped lang="scss">
  221. .commission-details .promoterHeader .headerCon .money {
  222. font-size: 36rpx;
  223. }
  224. .promoterHeader{
  225. @include main_bg_color(theme);
  226. }
  227. .commission-details .promoterHeader .headerCon .money .num {
  228. font-family: 'Guildford Pro';
  229. }
  230. .font_color{
  231. color: #E93323 !important;
  232. }
  233. </style>