118 lines
3.9 KiB
Vue
118 lines
3.9 KiB
Vue
<template>
|
||
<view>
|
||
<status-container titlet="我的推广" returnc="#FFFFFF">
|
||
<view slot="content" style="margin-top: -20rpx;">
|
||
<view class="bacf pad-zy20 boxshow2">
|
||
<view class="disjcac pad-sx30 bbot">
|
||
<view v-if="personCode" class="">
|
||
<image :src="personCode" mode="aspectFill" style="width: 124px;height: 124px;" lazy-load></image>
|
||
</view>
|
||
<view class="" v-else>
|
||
<yz-qr @update:qrPath="getPath" ref="qrPath" :text="textstr" :size="124" :colorDark="'#000000'" :colorLight="'#FFFFFF'"></yz-qr>
|
||
</view>
|
||
</view>
|
||
<view class="disjbac fon24 col26 pad-sx20 pad-zy10">
|
||
<view class="">代理登记</view>
|
||
<view class="">{{['','一','二'][levelIndex]}}级</view>
|
||
</view>
|
||
<view class="disjbac pad-x20 pad-zy10">
|
||
<view class="fon22 col26">我的佣金</view>
|
||
<view class="fon26 bold col-e42417">{{scoreInfo.commission || 0}}</view>
|
||
</view>
|
||
</view>
|
||
<view class="mar-s30 pad-zy20 bacf boxshow2 fon24">
|
||
<view class="col26 pad-s30 pad-x10 pad-zy10 disjbac borbot" style="color: #6d6d6d;">
|
||
<view class="">我的代理商</view>
|
||
<view class="">佣金记录</view>
|
||
</view>
|
||
<view class=" col26 pad-sx20 pad-zy10 disjbac borbot" v-for="(item,index) in dataList" :key="index">
|
||
<image :src="item.account.headimgurl" class="flexs radius_100 mar-y20" style="width: 78rpx;height: 78rpx;" mode="aspectFill" lazy-load></image>
|
||
<!-- <view class="width100"> -->
|
||
<!-- <view class="disjbac"> -->
|
||
<view class="colb clips1">{{item.account.nickname}}</view>
|
||
<!-- <view class="col-e42417">+{{item.num}}</view> -->
|
||
<!-- </view> -->
|
||
<!-- <view class="disjbac" style="margin-top: 6rpx;">
|
||
<view class="fon20" style="color: #747474;" v-if="item.created_at">{{item.created_at.split('-').join('.')}}</view>
|
||
<view class="">{{item.name}}</view>
|
||
</view> -->
|
||
<!-- </view> -->
|
||
</view>
|
||
</view>
|
||
<pitera :textStr="`${noMore && total > dataList.length?'上滑加载更多':'到底了'}~~`" textColor="#b0aaa9" paddingStr="40rpx 0 20rpx 0"></pitera>
|
||
</view>
|
||
</status-container>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import pitera from '@/components/nothing/pitera.vue';
|
||
import yzQr from '@/components/yz-qr/yz-qr.vue';
|
||
export default {
|
||
components:{
|
||
pitera,
|
||
yzQr
|
||
},
|
||
data() {
|
||
return {
|
||
dataList:[],
|
||
page:1,
|
||
size:20,
|
||
total:0,
|
||
noMore:false,
|
||
personCode:'',
|
||
//二维码相关参数
|
||
textstr:`https://chuanwujia.com/share?invite_code=${uni.getStorageSync('invite_code')}`,
|
||
scoreInfo:'',
|
||
levelIndex:1
|
||
}
|
||
},
|
||
onLoad(op) {
|
||
this.levelIndex = op.level*1;
|
||
this.getExtend();
|
||
},
|
||
onReachBottom() {
|
||
if(this.total!=this.dataList.length){
|
||
this.page++;
|
||
this.getExtend();
|
||
}
|
||
},
|
||
onShareAppMessage(res) {
|
||
var shareObj = {
|
||
title: ``, // 默认是小程序的名称(可以写slogan等)
|
||
path: `${uni.getStorageSync('page-path-options')}?invite_code=${uni.getStorageSync('invite_code')}`, // 默认是当前页面,必须是以‘/’开头的完整路径
|
||
imageUrl: ``//自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
|
||
};
|
||
return shareObj;
|
||
},
|
||
methods: {
|
||
getPath(path){
|
||
this.personCode = path;
|
||
},
|
||
// 获取推广人
|
||
getExtend(){
|
||
let params = {
|
||
action:'order',
|
||
page:this.page,
|
||
size:this.size
|
||
}
|
||
this.$requst.get('/api/user/sales',params).then(res=>{
|
||
if(res.code==0){
|
||
this.scoreInfo = res.data.account;
|
||
this.total = res.data.list.total;
|
||
if(this.page==1){this.dataList=[];}
|
||
this.dataList = [...this.dataList,...res.data.list.list];
|
||
if(this.total==this.dataList.length && this.page!=1){
|
||
this.noMore = true;
|
||
}
|
||
}
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style>
|
||
|
||
</style>
|