cash-detail.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. f<template>
  2. <app-layout>
  3. <app-tab-nav :tabList="tabList" background="#f7f7f7" padding="0" :border="noBorder" :activeItem="activeTab" @click="tabStatus" :theme="theme"></app-tab-nav>
  4. <view v-if="list.length == 0" class="tip main-center cross-center">暂无数据</view>
  5. <view v-else class="list" v-for="item in list" :key="item.id">
  6. <view class="item-header">{{item.date}}</view>
  7. <view class="item" v-for="list in item.list" :key="list.id">
  8. <view class="type">
  9. <text v-if="list.pay_type == 'auto'">自动打款</text>
  10. <text v-if="list.pay_type == 'balance'">提现至余额</text>
  11. <text v-if="list.pay_type == 'wechat'">提现至微信</text>
  12. <text v-if="list.pay_type == 'alipay'">提现至支付宝</text>
  13. <text v-if="list.pay_type == 'bank'">提现至银行卡</text>
  14. <text :class="[`status`]">{{list.status_text}}</text></view>
  15. <view>提现账户:{{list.extra.mobile}}</view>
  16. <view>提现时间:{{list.time.created_at}}</view>
  17. <view v-if="list.content.reject_content">驳回理由:<text style="word-wrap:break-word;">{{list.content.reject_content}}</text></view>
  18. <view class="cash">
  19. <view class="cash-price">{{list.cash.price}}</view>
  20. <view>手续费{{list.cash.service_charge}}</view>
  21. </view>
  22. </view>
  23. </view>
  24. </app-layout>
  25. </template>
  26. <script>
  27. import appTabNav from "../../../components/basic-component/app-tab-nav/app-tab-nav.vue";
  28. import { mapState } from "vuex";
  29. export default {
  30. data() {
  31. return {
  32. theme: {
  33. color: '#ff4544'
  34. },
  35. tabList: [
  36. {id:-1, name: '全部'},
  37. {id:0, name: '待审核'},
  38. {id:1, name: '待打款'},
  39. {id:2, name: '已打款'},
  40. {id:3, name: '无效'},
  41. ],
  42. loading: null,
  43. list: [],
  44. activeTab: -1,
  45. noBorder: false,
  46. id: null,
  47. page: 2
  48. }
  49. },
  50. components: {
  51. "app-tab-nav": appTabNav,
  52. },
  53. computed: {
  54. ...mapState({
  55. mall: state => state.mallConfig.mall,
  56. custom_setting: state => state.mallConfig.share_setting_custom,
  57. share_setting: state => state.mallConfig.share_setting,
  58. })
  59. },
  60. methods: {
  61. open(e) {
  62. this.id = e;
  63. },
  64. tabStatus(e) {
  65. uni.showLoading({
  66. mask: true,
  67. title: '加载中...'
  68. });
  69. this.list = [];
  70. this.page = 2;
  71. this.activeTab = e.currentTarget.dataset.id;
  72. this.getList();
  73. },
  74. getList() {
  75. let that = this;
  76. that.$request({
  77. url: that.$api.bonus.detail,
  78. data: {
  79. status: that.activeTab
  80. },
  81. }).then(response=>{
  82. that.$hideLoading();
  83. uni.hideLoading();
  84. if(response.code == 0) {
  85. that.list = response.data.list;
  86. }else {
  87. uni.showToast({
  88. title: response.msg,
  89. icon: 'none',
  90. duration: 1000
  91. });
  92. }
  93. }).catch(response => {
  94. that.$hideLoading();
  95. uni.hideLoading();
  96. that.$event.on(that.$const.EVENT_USER_LOGIN).then(()=>{
  97. that.getSetting();
  98. });
  99. });
  100. },
  101. getMore() {
  102. let that = this;
  103. uni.showLoading({
  104. mask: true,
  105. title: '加载中...'
  106. });
  107. that.$request({
  108. url: that.$api.bonus.detail,
  109. data: {
  110. status: that.activeTab,
  111. page: that.page
  112. },
  113. }).then(response=>{
  114. uni.hideLoading();
  115. if(response.code == 0) {
  116. that.loading = null;
  117. let more = response.data.list;
  118. if (more.length > 0) {
  119. if (that.list[that.list.length - 1].date == more[0].date) {
  120. that.list[that.list.length - 1].list = that.list[that.list.length - 1].list.concat(more[0].list);
  121. more.shift();
  122. that.list = that.list.concat(more)
  123. }else {
  124. that.list = that.list.concat(more)
  125. }
  126. that.page++;
  127. }
  128. }else {
  129. uni.showToast({
  130. title: response.msg,
  131. icon: 'none',
  132. duration: 1000
  133. });
  134. }
  135. }).catch(e => {
  136. uni.hideLoading();
  137. });
  138. },
  139. toGoods(id) {
  140. uni.navigateTo({
  141. url: '/pages/goods/goods?id=' + id
  142. });
  143. },
  144. },
  145. onLoad(options) { this.$commonLoad.onload(options);
  146. let that = this;
  147. that.$showLoading({
  148. type: 'global',
  149. text: '加载中...'
  150. });
  151. that.getList();
  152. },
  153. onReachBottom() {
  154. this.getMore();
  155. }
  156. }
  157. </script>
  158. <style scoped lang="scss">
  159. .list {
  160. background-color: #fff;
  161. margin: #{24rpx} #{24rpx} 0;
  162. border-radius: #{8rpx};
  163. box-shadow: rgba(0, 0, 0, .1) 0 0 #{20rpx};
  164. }
  165. .item-header {
  166. color: #999999;
  167. font-size: #{32rpx};
  168. height: #{96rpx};
  169. line-height: #{96rpx};
  170. padding: 0 #{32rpx};
  171. }
  172. .list .item {
  173. padding: #{32rpx};
  174. font-size: #{24rpx};
  175. color: #999999;
  176. border-top: 1px solid #e2e2e2;
  177. position: relative;
  178. }
  179. .type {
  180. font-size: #{32rpx};
  181. color: #353535;
  182. margin-bottom: #{8rpx};
  183. }
  184. .status {
  185. margin-left: #{20rpx};
  186. font-size: #{24rpx};
  187. padding: 0 #{10rpx};
  188. border-radius: #{16rpx};
  189. border: 1px solid #ff4544;
  190. color: #ff4544;
  191. }
  192. .cash {
  193. position: absolute;
  194. top: #{50rpx};
  195. right: #{32rpx};
  196. text-align: right;
  197. }
  198. .cash-price {
  199. font-size: #{40rpx};
  200. color: #353535;
  201. }
  202. .tip {
  203. width: 100%;
  204. color: #999999;
  205. height: #{500rpx};
  206. }
  207. </style>