110 lines
3.0 KiB
Vue
110 lines
3.0 KiB
Vue
<template>
|
|
<view>
|
|
<status-container titlet="我的推广" returnc="#FFFFFF">
|
|
<view slot="content" style="margin-top: -20rpx;" v-if="loading">
|
|
<view class="bacf pad-zy20 boxshow2">
|
|
<view class="disjcac pad-sx30 bbot">
|
|
<image :src="personCode" mode="aspectFill" style="width: 242rpx;height: 242rpx;" lazy-load></image>
|
|
</view>
|
|
<view class="disjbac pad-sx20 pad-zy10">
|
|
<view class="fon22 col26">推广获取积分</view>
|
|
<view class="fon26 bold col-e42417">500</view>
|
|
</view>
|
|
</view>
|
|
<view class="mar-s30 pad-zy20 bacf boxshow2">
|
|
<view @tap="$toolAll.tools.goPage(`/pagesB/second-level/second-level?id=${0}`)" class=" col26 pad-sx20 pad-zy10 disac borbot" v-for="(item,index) in 20" :key="index">
|
|
<image src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" class="flexs radius_100 mar-y20" style="width: 78rpx;height: 78rpx;" mode="aspectFill" lazy-load></image>
|
|
<view class="width100">
|
|
<view class="disjbac">
|
|
<view class="fon24 colb">爱健身房</view>
|
|
<view class="col-e42417 fon24">10</view>
|
|
</view>
|
|
<view class="disjbac" style="margin-top: 6rpx;">
|
|
<view class="fon20" style="color: #747474;">2022.07.03 12:03:03</view>
|
|
<view class="fon24">扫码注册</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="" v-if="noMore">
|
|
<pitera textStr="上滑加载更多/到底了~~" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera>
|
|
</view>
|
|
</view>
|
|
</status-container>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import pitera from '@/components/nothing/pitera.vue';
|
|
import {base64ToPath} from '@/jsFile/base64-src.js';
|
|
export default {
|
|
components:{
|
|
pitera
|
|
},
|
|
data() {
|
|
return {
|
|
dataList:[],
|
|
page:1,
|
|
size:20,
|
|
total:0,
|
|
noMore:false,
|
|
personCode:'',
|
|
loading:false
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.getCode();
|
|
this.getExtend();
|
|
},
|
|
onReachBottom() {
|
|
if(this.total!=this.dataList.lenght){
|
|
this.page++;
|
|
this.getExtend();
|
|
}
|
|
},
|
|
methods: {
|
|
// 获取一级推广人
|
|
getExtend(){
|
|
let params = {
|
|
grade:'first',
|
|
page:this.page,
|
|
size:this.size
|
|
}
|
|
this.$requst.get('/api/user/share-users',params).then(res=>{
|
|
if(res.code==0){
|
|
this.total = res.data.total;
|
|
if(this.page==1){this.dataList=[];}
|
|
this.dataList = [...this.dataList,...res.data.list];
|
|
if(this.total==this.dataList.length && this.page!=1){
|
|
this.noMore = true;
|
|
}
|
|
}
|
|
})
|
|
},
|
|
// 获取推广码
|
|
getCode(){
|
|
if(uni.getStorageSync('personCode')){
|
|
this.loading = true;
|
|
this.personCode = uni.getStorageSync('personCode');
|
|
} else {
|
|
this.$toolAll.tools.showToast('加载中...');
|
|
this.$requst.get('/api/user/personal-qr').then(res=>{
|
|
if(res.code==0){
|
|
base64ToPath(res.data.qr).then(result=>{
|
|
this.personCode = result;
|
|
uni.setStorageSync('personCode',this.personCode);
|
|
this.loading = true;
|
|
uni.hideToast();
|
|
})
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style>
|