record-recharge.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <view class="record-box">
  3. <Navbar title="充值明细" background-color="#fff" color="#333"></NavBar>
  4. <view class="container">
  5. <view class="top">
  6. <view class="title">
  7. 充值明细
  8. </view>
  9. <view class="status" @click="openSearch">
  10. {{typeMap[status] || '全部'}}
  11. <IconText :code="`\ue84a`" :size="8" color="#666" class="icon"></IconText>
  12. </view>
  13. </view>
  14. <view class="noData" v-if="!list.length && !isLoading">
  15. <NoData :show="!list.length" topNum="10"></NoData>
  16. </view>
  17. <view class="list" v-else>
  18. <view class="item" v-for="item in list" :key="item.id">
  19. <view class="left" :class="{reject: item.status === 2}">
  20. <!-- <text>{{item.describe}}</text> -->
  21. <text>{{typeMap[item.status]}}</text>
  22. {{item.created}}
  23. </view>
  24. <view class="right" v-if="item.status !== 2">
  25. <text v-if="item.direction === 1" style="color: #FA402B;">-{{item.amount | moneyFormat}}</text>
  26. <text v-else style="color: #409763;">+{{item.amount | moneyFormat}}</text>
  27. </view>
  28. </view>
  29. <view class="data-tips">
  30. <text v-if="final">没有更多了</text>
  31. <text v-else>加载更多</text>
  32. </view>
  33. </view>
  34. </view>
  35. <BottomPopup ref="bottom_popup" title="请选择" :dataList="typeList" @selected="popupSelected" keyName="name">
  36. </BottomPopup>
  37. </view>
  38. </template>
  39. <script lang='ts'>
  40. import {
  41. Component,
  42. Vue
  43. } from 'vue-property-decorator';
  44. import {
  45. namespace
  46. } from 'vuex-class';
  47. const baeModule = namespace('base');
  48. import {
  49. types
  50. } from '@/common/store';
  51. @Component({
  52. filters: {
  53. moneyFormat(val: any) {
  54. if (!+val) return '0.00';
  55. return (+val).toFixed(2);
  56. }
  57. }
  58. })
  59. export default class RechargeRecord extends Vue {
  60. img: string = this.$oss_url + 'zwdd.png';
  61. isLoading: boolean = false;
  62. list: any[] = [];
  63. sum: number = 0;
  64. isLoad: boolean = false;
  65. final: boolean = false;
  66. current: number = 1;
  67. size: number = 20;
  68. status: any = '';
  69. typeList: any[] = [
  70. {
  71. name: '全部',
  72. value: ''
  73. },{
  74. name: '待审核',
  75. value: 0
  76. },{
  77. name: '审核通过',
  78. value: 1
  79. },{
  80. name: '审核拒绝',
  81. value: 2
  82. }
  83. ];
  84. typeMap: any = {
  85. 0: '线下汇款(待审核)',
  86. 1: '线下汇款(已审核)',
  87. 2: '线下汇款(平台已拒绝)'
  88. };
  89. type: number = 0;
  90. onShow() {
  91. this.list = [];
  92. this.current = 1;
  93. this.final = false;
  94. this.getList();
  95. }
  96. onReachBottom() {
  97. if (this.final) return;
  98. this.current++;
  99. this.getList();
  100. }
  101. getList() {
  102. uni.showLoading({
  103. title: '加载中',
  104. });
  105. this.isLoading = true;
  106. return this.$http.get({
  107. url: this.$api.xxRechargeRecord,
  108. data: {
  109. page: this.current,
  110. size: this.size,
  111. status: this.status
  112. }
  113. }).then((res: any) => {
  114. this.list = [...this.list, ...res.list];
  115. this.isLoading = false;
  116. if (!res.list || (res.list.length < this.size)) {
  117. this.final = true;
  118. }
  119. uni.hideLoading();
  120. }).catch((err: any) => {
  121. console.log(err)
  122. uni.hideLoading();
  123. this.isLoading = false;
  124. })
  125. }
  126. openSearch() {
  127. (this.$refs.bottom_popup as any).open();
  128. }
  129. popupSelected(val: any) {
  130. this.status = val.value;
  131. this.list = [];
  132. this.current = 1;
  133. this.final = false;
  134. this.getList();
  135. }
  136. }
  137. </script>
  138. <style lang='scss' scoped>
  139. .record-box {
  140. min-height: 100%;
  141. @include flex-y();
  142. background: #F6F6F6;
  143. .container {
  144. flex: 1;
  145. width: 100%;
  146. box-sizing: border-box;
  147. overflow-y: auto;
  148. .top {
  149. @include flex-x();
  150. background: #fff;
  151. position: fixed;
  152. width: 100%;
  153. z-index: 20;
  154. height: vw(55);
  155. padding: 0 vw(18);
  156. box-sizing: border-box;
  157. margin-top: vw(1);
  158. }
  159. .noData {
  160. padding-top: vw(55);
  161. }
  162. .status {
  163. /* padding-right: vw(18); */
  164. @include word-vw(14, #666);
  165. @include flex-x(flex-start);
  166. .icon {
  167. margin-left: vw(6);
  168. }
  169. }
  170. .list {
  171. box-sizing: border-box;
  172. margin-top: vw(10);
  173. padding-top: vw(55);
  174. .item {
  175. /* box-shadow: 0px 1px 5px rgba(225, 225, 225, 0.5); */
  176. background: #fff;
  177. margin-top: vw(1);
  178. /* border-radius: vw(10); */
  179. height: vw(60);
  180. @include flex-x();
  181. view {
  182. padding: 0 vw(18);
  183. @include flex-y(center, flex-start);
  184. @include word-vw(12, #999);
  185. &.reject {
  186. text {
  187. color: #FA402B;
  188. }
  189. }
  190. text {
  191. margin-bottom: vw(5);
  192. @include word-vw(14, #333);
  193. font-weight: 450;
  194. }
  195. &.right {
  196. align-items: flex-end;
  197. }
  198. }
  199. }
  200. }
  201. }
  202. .data-tips {
  203. width: 100%;
  204. text-align: center;
  205. @include word-vw(12, $gray9);
  206. margin-top: 10px;
  207. }
  208. }
  209. </style>