cash-detail.vue 7.6 KB

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