cash-detail.vue 6.5 KB

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