record.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <template>
  2. <view class="content">
  3. <view class="box-top">
  4. <view class="goback-box" @click="goback('/pages/wallet/withdrawal')"><image class="goback" src="https://37shop.liuniu946.com/front/img/fanhui.png" mode=""></image></view>
  5. <view class="header">提现记录</view>
  6. </view>
  7. <!-- class组件动态表 -->
  8. <view class="navbar">
  9. <view class="nav-item" v-for="(item, index) in navList" :key="index" :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
  10. </view>
  11. <swiper :current="tabCurrentIndex" class="swiper-box" :style="{ height: maxheight + 'px' }" :duration="300" @change="changeTab">
  12. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  13. <scroll-view scroll-y class="list-scroll-content" @scrolltolower="loadData">
  14. <!-- 空白页 empty 标签用来判断模板变量是否为空值 ,若果列表没有数据则触发空白页-->
  15. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  16. <!-- 提现列表 -->
  17. <view v-for="(items, index) in tabItem.orderList" :key="index">
  18. <view class="title-box">
  19. <view class="img"><image :src="items.img" mode=""></image></view>
  20. <view class="text">
  21. <view class="left">
  22. <view class="content">
  23. <text>{{ items.content }}</text>
  24. </view>
  25. <view class="time">
  26. <text>{{ items.time }}</text>
  27. </view>
  28. </view>
  29. <view class="right">
  30. <view class="money">
  31. <text>{{ items.money }}</text>
  32. </view>
  33. <view class="status" >
  34. <text>{{ items.status }}</text>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <uni-load-more :status="tabItem.loadingType"></uni-load-more>
  41. </scroll-view>
  42. </swiper-item>
  43. </swiper>
  44. </view>
  45. </template>
  46. <script>
  47. import { spreadCommission, userBalance } from '@/api/wallet.js';
  48. import { mapState, mapMutations } from 'vuex';
  49. import { getMoneyStyle } from '@/utils/rocessor.js';
  50. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  51. import empty from '@/components/empty';
  52. export default {
  53. data() {
  54. return {
  55. //头部图高度
  56. maxheight: '',
  57. tabCurrentIndex: 0,
  58. navList: [
  59. {
  60. state: 0,
  61. text: '审核中',
  62. loadingType: 'more',
  63. orderList: [
  64. {
  65. img: 'https://zhibo.liuniu946.com/img/money.png', //图片
  66. content: '提现到微信',
  67. time: '2021-3-31 23:59:07', //时间
  68. status: '审核中', //审核状态
  69. money: '+200' //提现金额
  70. },
  71. {
  72. img: 'https://zhibo.liuniu946.com/img/money.png', //图片
  73. content: '提现到微信',
  74. time: '2021-3-31 23:59:59', //时间
  75. status: '审核中', //审核状态
  76. money: '+200' //提现金额
  77. }
  78. ],
  79. page: 1, //当前页面
  80. limit: 10 //,每次信息条数
  81. },
  82. {
  83. state: 1,
  84. text: '已通过',
  85. loadingType: 'more',
  86. orderList: [
  87. {
  88. img: 'https://zhibo.liuniu946.com/img/money.png', //图片
  89. content: '提现到微信',
  90. time: '2021-3-31 23:59:59', //时间
  91. status: '已通过', //审核状态
  92. money: '-200' //提现金额
  93. }
  94. ],
  95. page: 1, //当前页面
  96. limit: 10 //,每次信息条数
  97. },
  98. {
  99. state: 2,
  100. text: '未通过',
  101. loadingType: 'more',
  102. orderList: [
  103. {
  104. img: 'https://zhibo.liuniu946.com/img/money.png', //图片
  105. content: '提现到微信',
  106. time: '2021-3-31 23:59:59', //时间
  107. status: '未通过', //审核状态
  108. money: '-200.00' //提现金额
  109. }
  110. ],
  111. page: 1, //当前页面
  112. limit: 10 //,每次信息条数
  113. }
  114. ]
  115. };
  116. },
  117. //页面加载好就执行
  118. onLoad(options) {
  119. this.loadData();
  120. },
  121. methods: {
  122. //页面跳转
  123. goback(e) {
  124. console.log('=======',e)
  125. uni.navigateTo({
  126. url: e
  127. });
  128. },
  129. //获取审核信息
  130. async loadData(source) {
  131. //这里是将订单挂载到tab列表下
  132. let index = this.tabCurrentIndex;
  133. let navItem = this.navList[index];
  134. let state = navItem.state;
  135. if (source === 'tabChange' && navItem.loaded === true) {
  136. //tab切换只有第一次需要加载数据
  137. return;
  138. }
  139. if (navItem.loadingType === 'noMore') {
  140. //防止重复加载
  141. return;
  142. }
  143. // 修改当前对象状态为加载中
  144. navItem.loadingType = 'loading';
  145. spreadCommission(
  146. {
  147. page: navItem.page,
  148. limit: navItem.limit
  149. },
  150. state
  151. )
  152. .then(({ data }) => {
  153. navItem.orderList = navItem.orderList.concat(data);
  154. navItem.page++;
  155. if (navItem.limit == data.length) {
  156. //判断是否还有数据, 有改为 more, 没有改为noMore
  157. navItem.loadingType = 'more';
  158. return;
  159. } else {
  160. //判断是否还有数据, 有改为 more, 没有改为noMore
  161. navItem.loadingType = 'noMore';
  162. }
  163. uni.hideLoading();
  164. this.$set(navItem, 'loaded', true);
  165. })
  166. .catch(e => {
  167. console.log(e);
  168. });
  169. },
  170. //顶部tab点击
  171. tabClick(index) {
  172. this.tabCurrentIndex = index;
  173. },
  174. //swiper 切换
  175. changeTab(e) {
  176. this.tabCurrentIndex = e.target.current;
  177. this.loadData('tabChange');
  178. }
  179. //点击返回
  180. // toBack(){
  181. // uni.navigateTo({
  182. // url:''
  183. // })
  184. // }
  185. }
  186. }
  187. </script>
  188. <style lang="scss">
  189. .content {
  190. height: 100%;
  191. width: 100%;
  192. .box-top {
  193. width: 750rpx;
  194. height: 80rpx;
  195. background: linear-gradient(180deg, #fd4646, #ff3535);
  196. .goback-box {
  197. position: absolute;
  198. left: 30rpx;
  199. height: 80rpx;
  200. display: flex;
  201. align-items: center;
  202. .goback {
  203. z-index: 100;
  204. width: 34rpx;
  205. height: 34rpx;
  206. }
  207. }
  208. .header {
  209. position: absolute;
  210. left: 0;
  211. width: 100%;
  212. height: 80rpx;
  213. font-size: 36rpx;
  214. font-weight: 500;
  215. z-index: 99;
  216. display: flex;
  217. justify-content: center;
  218. align-items: center;
  219. color: #ffffff;
  220. }
  221. }
  222. .navbar {
  223. width: 100%;
  224. display: flex;
  225. margin-bottom: 15rpx;
  226. height: 40px;
  227. padding: 0 5px;
  228. background: #fff;
  229. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  230. position: relative;
  231. z-index: 10;
  232. .nav-item {
  233. flex: 1;
  234. display: flex;
  235. justify-content: center;
  236. align-items: center;
  237. height: 100%;
  238. font-size: 28rpx;
  239. color: $font-color-dark;
  240. position: relative;
  241. &.current {
  242. color: #ff0000;
  243. &::after {
  244. content: '';
  245. position: absolute;
  246. left: 50%;
  247. bottom: 0;
  248. transform: translateX(-50%);
  249. width: 44rpx;
  250. height: 0;
  251. border-bottom: 2rpx solid #ff0000;
  252. }
  253. }
  254. }
  255. }
  256. .swiper-box {
  257. width: 100%;
  258. height: calc(100vh - 130rpx - 84rpx);
  259. background: #ffffff;
  260. .title-box {
  261. display: flex;
  262. width: 100%;
  263. .img {
  264. margin: 28rpx 0 36rpx 30rpx;
  265. width: 54rpx;
  266. height: 54rpx;
  267. image{
  268. width: 54rpx;
  269. height: 54rpx;
  270. }
  271. }
  272. .text {
  273. margin:0 30rpx 0 17rpx ;
  274. width: 100%;
  275. font-size: 30rpx;
  276. font-family: PingFangSC;
  277. font-weight: 500;
  278. color: #333333;
  279. display: flex;
  280. align-items: center;
  281. justify-content: space-between;
  282. border-bottom: 1rpx solid #F0F0F0;
  283. .left {
  284. display: flex;
  285. flex-direction: column;
  286. justify-content: center;
  287. .content {
  288. font-size: 30rpx;
  289. font-weight: 500;
  290. color: #333333;
  291. padding-bottom:10rpx;
  292. }
  293. .time {
  294. font-size: 22rpx;
  295. font-family: PingFang SC;
  296. font-weight: 400;
  297. color: #999999;
  298. }
  299. }
  300. .right {
  301. display: flex;
  302. flex-direction: column;
  303. justify-content: flex-end;
  304. .money {
  305. font-size: 30rpx;
  306. font-weight: bold;
  307. color: #333333;
  308. padding-bottom: 10rpx;
  309. }
  310. .status {
  311. font-size: 24rpx;
  312. font-weight: 500;
  313. color: #fc4141;
  314. display: flex;
  315. justify-content: flex-end;
  316. }
  317. }
  318. }
  319. }
  320. }
  321. }
  322. </style>