dengrui/pagesB/record/record.vue

99 lines
2.8 KiB
Vue

<template>
<view v-if="pageShow">
<!-- 使用标题栏 -->
<status-nav :statusBackw="true" :statusTitle="true" :title-val="titlename" :tabcolor="'#ffffff'"></status-nav>
<view :style="{marginTop:(statusHNH+10)+'px'}">
<view v-if="dataArr.length!=0" class="padding20 fon28 bacb margin-zy20 margin-x20" style="border-radius: 5rpx;" v-for="(item,index) in dataArr" :key="index">
<view class="disba">
<view>{{item.title}}</view>
<view class="colorf78">-{{item.price}}</view>
</view>
<view class="fon24 color9 margin-s10">{{item.time}}</view>
</view>
<view v-if="dataArr.length==0" class="zanwu">暂无更多提现记录</view>
</view>
<backTop :showTop="showTop" @backTop="backTop"></backTop>
</view>
</template>
<script>
import backTop from '@/components/backTop.vue';
export default {
components:{
backTop
},
data() {
return {
dataArr:[],
showTop:false,
titlename:'提现记录',
page:1,
size:10,
total:'',
isZanw:true,
statusHNH:uni.getStorageSync('statusHNH'),
pageShow:false,
guanKey:''
}
},
onLoad(options) {
let num = options.index
if(num==0){
// 直卖提现记录
this.titlename = '直卖提现记录'
this.checkFenZhiList('sale')
this.guanKey = 'sale'
} else {
// 分红提现记录
this.titlename = '分红提现记录'
this.checkFenZhiList('bonus')
this.guanKey = 'bonus'
}
},
onShow() {
this.$toolAll.tools.guoq()
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {
if(this.total!=this.dataArr.length){
this.page++
this.checkFenZhiList(this.guanKey)//调用自主预约列表事件
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多商品列表','none',1000)
this.isZanw = false
}
},
methods: {
checkFenZhiList(newtype){
this.$requst.post('user/withdraw-list',{page:this.page,size:this.size,type:newtype}).then(res=>{
// console.log('提现记录:',res);
this.pageShow = true
this.total = res.data.total
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let fenObj = {
title:'微信提现',
time:item.created_at,
price:item.amount/100
}
this.dataArr.push(fenObj)
})
}
},error=>{})
},
backTop(){
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
}
}
</script>
<style>
</style>