cash-detail.vue 6.4 KB

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