dengrui/pagesB/zIncome/zIncome.vue

120 lines
3.4 KiB
Vue
Raw Normal View History

2021-08-26 01:49:06 +00:00
<template>
<view v-if="pageShow">
<!-- 使用标题栏 -->
<status-nav :statusBackw="true" :statusTitle="true" :title-val="titleName+'收益'" :tabcolor="'#ffffff'"></status-nav>
<view :style="{paddingTop:statusHNH+'px'}">
<view class="disba padding20 borbot" style="font-size: 30rpx;">
<view>商品内容</view>
<view>{{titleName}}收益</view>
</view>
<view v-if="dataArr.length!=0" class="disba padding20 borbot fon28" v-for="(item,index) in dataArr" :key="index">
<view>
<view class="clips1">{{item.title}}</view>
<view class="fon24 color9 margin-s10">{{item.time}}</view>
</view>
<view class="colorf78">{{item.price}}</view>
</view>
<view v-if="dataArr.length==0" class="zanwu">{{titleName}}</view>
</view>
<backTop :showTop="showTop" @backTop="backTop"></backTop>
</view>
</template>
<script>
import backTop from '@/components/backTop.vue';
export default {
components:{
backTop
},
data() {
return {
dataArr:[],
titleName:'',
whereCome:'',
showTop:false,
page:1,
2021-08-29 01:35:35 +00:00
size:10,
total:'',
isZanw:true,
2021-08-26 01:49:06 +00:00
statusHNH:uni.getStorageSync('statusHNH'),
pageShow:false
}
},
onLoad(options) {
this.whereCome = options.index
if(this.whereCome==0) {
this.titleName = '直卖'
this.checkZhiList()//查询直卖收益列表
}
if(this.whereCome==1) {
this.titleName = '分红'
this.checkFenList()//查询分红收益
}
},
onShow() {
this.$toolAll.tools.guoq()
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
2021-08-29 01:35:35 +00:00
onReachBottom() {
if(this.total!=this.dataArr.length){
this.page++
this.checkFenList()//调用自主预约列表事件
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多商品列表','none',1000)
this.isZanw = false
}
},
2021-08-26 01:49:06 +00:00
methods: {
checkFenList(){//分红收益明细列表
this.$requst.post('user/bonus-income-list',{page:this.page,size:this.size}).then(res=>{
// console.log('分红收益记录:',res);
if(res.code==0){
this.pageShow = true
2021-08-29 01:35:35 +00:00
this.total = res.data.total
2021-08-26 01:49:06 +00:00
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let fenObj = {
title:item.income_text,
time:item.created_at,
price:item.income/100
}
this.dataArr.push(fenObj)
})
}
}
},error=>{})
},
checkZhiList(){
this.$requst.post('user/sale-income-list',{page:this.page,size:this.size}).then(res=>{
// console.log('直卖收益记录:',res);
if(res.code==0){
this.pageShow = true
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let zhiObj = {
title:item.income_text,
time:item.created_at,
price:item.income/100
}
this.dataArr.push(zhiObj)
})
}
}
},error=>{})
},
backTop(){
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
}
}
</script>
<style>
page{background-color: #FFFFFF;}
</style>