cash-detail.vue 7.3 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" :theme="getTheme"></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>{{list.pay_type}}</text>
  13. <text class="status" :style="{'color': getTheme.color, 'border-color': getTheme.border}">{{list.status_text}}</text></view>
  14. <view>提现账户:{{list.extra.mobile?list.extra.mobile:'无'}}</view>
  15. <view>提现时间:{{list.time.created_at}}</view>
  16. <view v-if="list.content.reject_content">驳回理由:<text style="word-wrap:break-word;">{{list.content.reject_content}}</text></view>
  17. <view class="cash">
  18. <view class="cash-price">{{list.cash.price}}</view>
  19. <view>手续费{{list.cash.service_charge}}</view>
  20. </view>
  21. </view>
  22. </view>
  23. </app-layout>
  24. </template>
  25. <script>
  26. import appTabNav from "../../../components/basic-component/app-tab-nav/app-tab-nav.vue";
  27. import {mapGetters, mapState} from 'vuex';
  28. export default {
  29. data() {
  30. return {
  31. tabList: [
  32. {id:-1, name: '全部'},
  33. {id:0, name: '待审核'},
  34. {id:1, name: '待打款'},
  35. {id:2, name: '已打款'},
  36. {id:3, name: '已驳回'},
  37. ],
  38. loading: null,
  39. list: [],
  40. activeTab: -1,
  41. noBorder: false,
  42. id: null,
  43. page: 2
  44. }
  45. },
  46. components: {
  47. "app-tab-nav": appTabNav,
  48. },
  49. computed: {
  50. ...mapGetters('mallConfig', {
  51. getTheme: 'getTheme',
  52. }),
  53. ...mapState({
  54. mall: state => state.mallConfig.mall,
  55. custom_setting: state => state.mallConfig.share_setting_custom,
  56. share_setting: state => state.mallConfig.share_setting,
  57. })
  58. },
  59. methods: {
  60. open(e) {
  61. this.id = e;
  62. },
  63. tabStatus(e) {
  64. uni.showLoading({
  65. mask: true,
  66. title: '加载中...'
  67. });
  68. this.list = [];
  69. this.page = 2;
  70. this.activeTab = e.currentTarget.dataset.id;
  71. this.getList();
  72. },
  73. getList() {
  74. let that = this;
  75. that.$request({
  76. url: that.$api.finance.list,
  77. data: {
  78. status: that.activeTab,
  79. model: 'community',
  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.stock.detail,
  109. data: {
  110. status: that.activeTab,
  111. model: 'community',
  112. page: that.page
  113. },
  114. }).then(response=>{
  115. uni.hideLoading();
  116. if(response.code == 0) {
  117. that.loading = null;
  118. let more = response.data.list;
  119. if (more.length > 0) {
  120. if (that.list[that.list.length - 1].date == more[0].date) {
  121. that.list[that.list.length - 1].list = that.list[that.list.length - 1].list.concat(more[0].list);
  122. more.shift();
  123. that.list = that.list.concat(more)
  124. }else {
  125. that.list = that.list.concat(more)
  126. }
  127. that.page++;
  128. }
  129. }else {
  130. uni.showToast({
  131. title: response.msg,
  132. icon: 'none',
  133. duration: 1000
  134. });
  135. }
  136. }).catch(e => {
  137. uni.hideLoading();
  138. });
  139. },
  140. toGoods(id) {
  141. uni.navigateTo({
  142. url: '/pages/goods/goods?id=' + id
  143. });
  144. },
  145. },
  146. onLoad(options) { this.$commonLoad.onload(options);
  147. let that = this;
  148. if(options.name) {
  149. uni.setNavigationBarTitle({
  150. title: options.name,
  151. })
  152. }
  153. that.$showLoading({
  154. type: 'global',
  155. text: '加载中...'
  156. });
  157. that.getList();
  158. },
  159. onReachBottom() {
  160. this.getMore();
  161. }
  162. }
  163. </script>
  164. <style scoped lang="scss">
  165. .list {
  166. background-color: #fff;
  167. margin: #{24rpx} #{24rpx} #{12rpx};
  168. border-radius: #{8rpx};
  169. box-shadow: rgba(0, 0, 0, .1) 0 0 #{20rpx};
  170. }
  171. .item-header {
  172. color: #999999;
  173. font-size: #{32rpx};
  174. height: #{96rpx};
  175. line-height: #{96rpx};
  176. padding: 0 #{32rpx};
  177. }
  178. .list .item {
  179. padding: #{32rpx};
  180. font-size: #{24rpx};
  181. color: #999999;
  182. border-top: 1px solid #e2e2e2;
  183. position: relative;
  184. }
  185. .type {
  186. font-size: #{32rpx};
  187. color: #353535;
  188. margin-bottom: #{8rpx};
  189. }
  190. .status {
  191. margin-left: #{20rpx};
  192. font-size: #{24rpx};
  193. padding: 0 #{10rpx};
  194. border-radius: #{16rpx};
  195. border: 1px solid;
  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>