index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <view>
  3. <view class='commission-details'>
  4. <view class='promoterHeader bg-color'>
  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. <!-- #ifdef MP -->
  76. <!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
  77. <!-- #endif -->
  78. <home></home>
  79. </view>
  80. </template>
  81. <script>
  82. import {
  83. getCommissionInfo,
  84. getRecordApi,
  85. } from '@/api/user.js';
  86. import {
  87. toLogin
  88. } from '@/libs/login.js';
  89. import {
  90. mapGetters
  91. } from "vuex";
  92. // #ifdef MP
  93. import authorize from '@/components/Authorize';
  94. // #endif
  95. import emptyPage from '@/components/emptyPage.vue'
  96. import home from '@/components/home';
  97. export default {
  98. components: {
  99. // #ifdef MP
  100. authorize,
  101. // #endif
  102. emptyPage,
  103. home
  104. },
  105. filters: {
  106. statusFilter(status) {
  107. const statusMap = {
  108. '-1': '未通过',
  109. '0': '审核中',
  110. '1': '已提现'
  111. }
  112. return statusMap[status]
  113. }
  114. },
  115. data() {
  116. return {
  117. name: '',
  118. type: 0,
  119. page: 1,
  120. limit: 10,
  121. recordList: [],
  122. recordType: 0,
  123. statuss: false,
  124. isAuto: false, //没有授权的不会自动授权
  125. isShowAuth: false, //是否隐藏授权
  126. extractCount: 0
  127. };
  128. },
  129. computed: mapGetters(['isLogin']),
  130. onLoad(options) {
  131. if (this.isLogin) {
  132. this.type = options.type;
  133. this.extractCount = options.extractCount;
  134. this.commissionCount = options.commissionCount;
  135. } else {
  136. toLogin();
  137. }
  138. },
  139. onShow: function() {
  140. let type = this.type;
  141. if (type == 1) {
  142. uni.setNavigationBarTitle({
  143. title: "提现记录"
  144. });
  145. this.name = '提现总额';
  146. this.recordType = 4;
  147. this.getList();
  148. } else if (type == 2) {
  149. uni.setNavigationBarTitle({
  150. title: "佣金记录"
  151. });
  152. this.name = '佣金明细';
  153. this.recordType = 3;
  154. this.getRecordList();
  155. } else {
  156. uni.showToast({
  157. title: '参数错误',
  158. icon: 'none',
  159. duration: 1000,
  160. mask: true,
  161. success: function(res) {
  162. setTimeout(function() {
  163. // #ifndef H5
  164. uni.navigateBack({
  165. delta: 1,
  166. });
  167. // #endif
  168. // #ifdef H5
  169. history.back();
  170. // #endif
  171. }, 1200)
  172. },
  173. });
  174. }
  175. },
  176. methods: {
  177. onLoadFun() {
  178. this.getRecordList();
  179. },
  180. // 授权关闭
  181. authColse: function(e) {
  182. this.isShowAuth = e
  183. },
  184. getList: function() {
  185. let that = this;
  186. let recordList = that.recordList;
  187. let recordListNew = [];
  188. if (that.statuss == true) return;
  189. getRecordApi({
  190. page: that.page,
  191. limit: that.limit
  192. }).then(res => {
  193. let len = res.data.list ? res.data.list.length : 0;
  194. let recordListData = res.data.list || [];
  195. recordListNew = recordList.concat(recordListData);
  196. that.statuss = that.limit > len;
  197. that.page = that.page + 1;
  198. that.$set(that, 'recordList', recordListNew);
  199. });
  200. },
  201. getRecordList: function() {
  202. let that = this;
  203. let page = that.page;
  204. let limit = that.limit;
  205. let statuss = that.statuss;
  206. let recordType = that.recordType;
  207. let recordList = that.recordList;
  208. let recordListNew = [];
  209. if (statuss == true) return;
  210. getCommissionInfo({
  211. page: page,
  212. limit: limit
  213. }).then(res => {
  214. if (res.data.list) {
  215. let len = res.data.list ? res.data.list.length : 0;
  216. let recordListData = res.data.list || [];
  217. recordListNew = recordList.concat(recordListData);
  218. that.statuss = limit > len;
  219. that.page = page + 1;
  220. that.$set(that, 'recordList', recordListNew);
  221. }
  222. });
  223. }
  224. },
  225. onReachBottom: function() {
  226. this.getRecordList();
  227. }
  228. }
  229. </script>
  230. <style scoped lang="scss">
  231. .commission-details .promoterHeader .headerCon .money {
  232. font-size: 36rpx;
  233. }
  234. .commission-details .promoterHeader .headerCon .money .num {
  235. font-family: 'Guildford Pro';
  236. }
  237. </style>