cash-detail.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. f<template>
  2. <app-layout>
  3. <app-tab-nav :tabList="tabList" background="#f7f7f7" padding="0" :shadow="noBorder" :border="noBorder" :activeItem="activeTab" @click="tabStatus"></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. 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.region.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.getList();
  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.region.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. if(options.name) {
  148. uni.setNavigationBarTitle({
  149. title: options.name,
  150. })
  151. }
  152. that.$showLoading({
  153. type: 'global',
  154. text: '加载中...'
  155. });
  156. that.getList();
  157. },
  158. onReachBottom() {
  159. this.getMore();
  160. }
  161. }
  162. </script>
  163. <style scoped lang="scss">
  164. .list {
  165. background-color: #fff;
  166. margin: #{24rpx} #{24rpx} #{12rpx};
  167. border-radius: #{8rpx};
  168. box-shadow: rgba(0, 0, 0, .1) 0 0 #{20rpx};
  169. }
  170. .item-header {
  171. color: #999999;
  172. font-size: #{32rpx};
  173. height: #{96rpx};
  174. line-height: #{96rpx};
  175. padding: 0 #{32rpx};
  176. }
  177. .list .item {
  178. padding: #{32rpx};
  179. font-size: #{24rpx};
  180. color: #999999;
  181. border-top: 1px solid #e2e2e2;
  182. position: relative;
  183. }
  184. .type {
  185. font-size: #{32rpx};
  186. color: #353535;
  187. margin-bottom: #{8rpx};
  188. }
  189. .status {
  190. margin-left: #{20rpx};
  191. font-size: #{24rpx};
  192. padding: 0 #{10rpx};
  193. border-radius: #{16rpx};
  194. border: 1px solid #ff4544;
  195. color: #ff4544;
  196. }
  197. .cash {
  198. position: absolute;
  199. top: #{50rpx};
  200. right: #{32rpx};
  201. text-align: right;
  202. }
  203. .cash-price {
  204. font-size: #{40rpx};
  205. color: #353535;
  206. }
  207. .no-list {
  208. text-align: center;
  209. margin-top: #{200rpx};
  210. font-size: #{24rpx};
  211. color: #666666;
  212. image {
  213. width: #{240rpx};
  214. height: #{240rpx};
  215. margin-bottom: #{20rpx};
  216. }
  217. }
  218. </style>