money.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view :style="colorStyle">
  3. <view class='commission-details'>
  4. <view class='sign-record'>
  5. <view class='promoterHeader bg-color'>
  6. <view class='headerCon acea-row row-between-wrapper'>
  7. <view>
  8. <view class='name'>{{$t(name)}}</view>
  9. <view class='money'>{{$t(`¥`)}}<text class='num'>{{recordCount}}</text></view>
  10. </view>
  11. <view class='iconfont icon-jinbi1'></view>
  12. </view>
  13. </view>
  14. <block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
  15. <view class='list'>
  16. <view class='item'>
  17. <view class='listn'>
  18. <view class='itemn acea-row row-between-wrapper'>
  19. <view class="title">
  20. <view class='name line1'>{{$t(item.title)}}</view>
  21. <view>{{item.add_time}}</view>
  22. <view class="fail-msg" v-if="item.mark">
  23. {{$t(`原因`)}}:{{item.mark}}
  24. </view>
  25. </view>
  26. <view class='num font-color' v-if="item.pm == 1">+{{item.number}}</view>
  27. <view class='num' v-else>-{{item.number}}</view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </block>
  33. <view class='loadingicon acea-row row-center-wrapper' v-if="recordList.length">
  34. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  35. </view>
  36. <view v-if="recordList.length < 1 && page > 1">
  37. <emptyPage :title='$t(`暂无数据~`)'></emptyPage>
  38. </view>
  39. </view>
  40. </view>
  41. <navigator url="./draw">
  42. <view class="logOut cartcolor acea-row row-center-wrapper">{{$t(`提现`)}}</view>
  43. </navigator>
  44. <!-- #ifdef H5 -->
  45. <home></home>
  46. <!-- #endif -->
  47. </view>
  48. </template>
  49. <script>
  50. import {
  51. getStoreBill,
  52. postStoreMy
  53. } from '@/api/rent.js';
  54. import {
  55. toLogin
  56. } from '@/libs/login.js';
  57. import {
  58. mapGetters
  59. } from "vuex";
  60. import emptyPage from '@/components/emptyPage.vue'
  61. import home from '@/components/home';
  62. import colors from '@/mixins/color.js';
  63. export default {
  64. components: {
  65. emptyPage,
  66. home
  67. },
  68. mixins: [colors],
  69. data() {
  70. return {
  71. name: '',
  72. type: 0,
  73. page: 1,
  74. limit: 15,
  75. loading: false,
  76. loadend: false,
  77. loadTitle: this.$t(`加载更多`),
  78. recordList: [],
  79. recordCount: 0,
  80. };
  81. },
  82. computed: mapGetters(['isLogin']),
  83. onLoad(options) {
  84. if (this.isLogin) {
  85. this.type = options.type;
  86. } else {
  87. toLogin();
  88. }
  89. },
  90. onShow: function() {
  91. this.getRecordList()
  92. this.getStore()
  93. },
  94. methods: {
  95. getRecordList: function() {
  96. let that = this;
  97. let page = that.page;
  98. let limit = that.limit;
  99. if (that.loading) return;
  100. if (that.loadend) return;
  101. that.loading = true;
  102. that.loadTitle = '';
  103. getStoreBill({
  104. page: page,
  105. limit: limit
  106. }).then(res => {
  107. that.recordList.push(...res.data.data)
  108. let loadend = res.data.data.length < that.limit;
  109. that.loadend = loadend;
  110. that.loadTitle = loadend ? that.$t(`我也是有底线的`) : that.$t(`加载更多`);
  111. that.page += 1;
  112. that.loading = false;
  113. }).catch(err => {
  114. that.loading = false;
  115. that.loadTitle = that.$t(`加载更多`);
  116. })
  117. },
  118. // 获取门店信息
  119. getStore() {
  120. let that = this;
  121. postStoreMy({}).then(res => {
  122. this.name = res.data.name;
  123. this.recordCount = res.data.now_money
  124. }).catch(err => {
  125. uni.showToast({
  126. title: err,
  127. icon:'error'
  128. });
  129. })
  130. },
  131. },
  132. onReachBottom: function() {
  133. this.getRecordList();
  134. }
  135. }
  136. </script>
  137. <style scoped lang="scss">
  138. .list {
  139. margin-bottom: 30rpx;
  140. }
  141. .commission-details {
  142. padding-bottom: 120rpx;
  143. .promoterHeader {
  144. .headerCon {
  145. .money {
  146. font-size: 36rpx;
  147. .num {
  148. font-family: 'Guildford Pro';
  149. }
  150. }
  151. }
  152. }
  153. }
  154. .sign-record .list .item .listn .itemn .name {
  155. width: 100%;
  156. // max-width: 100%;
  157. white-space: break-spaces;
  158. }
  159. .sign-record .list .item .listn .itemn .title {
  160. padding-right: 30rpx;
  161. flex: 1;
  162. }
  163. .logOut {
  164. font-size: 32rpx;
  165. text-align: center;
  166. width: 690rpx;
  167. height: 90rpx;
  168. border-radius: 45rpx;
  169. position: fixed;
  170. bottom: 30rpx;
  171. left: 30rpx;
  172. }
  173. .cartcolor {
  174. color: var(--view-theme);
  175. border: 1px solid var(--view-theme);
  176. }
  177. </style>