fenxiaomyteam.vue
2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<template>
<view class="content">
<view class="tapnav tapnavk flextwo">
<view class="tapnavitem" :class="order==0?'tapnavactive':''" @click="ordersel" :data-id="0">一级分销员({{onetotal}})</view>
<view class="tapnavitem" :class="order==1?'tapnavactive':''" @click="ordersel" :data-id="1">二级分销员({{twototal}})</view>
</view>
<view class="nodata" v-if="fenxiaolist.length==0">暂无数据</view>
<view class="listk" v-else>
<view class="fenxiaoti flextwo" v-for="(item,index) in fenxiaolist" :key="index">
<view class="flexone">
<view class="tiimg">
<image :src="item.avatar" mode=""></image>
</view>
<view class="fenxiaotileft">{{item.nickname}}</view>
</view>
<view class="fenxiaotir">{{item.createtime}}</view>
</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
order: 0,
page: 1,
fenxiaolist: [],
onetotal:0,
twototal:0
}
},
onLoad() {
console.log(33493)
this.getoneyuan();
},
methods: {
ordersel(e) {
this.order = e.currentTarget.dataset.id;
this.page = 1;
this.fenxiaolist = []
if (this.order == 0) {
this.getoneyuan()
} else {
this.geterji()
}
},
// 一级分销员
getoneyuan() {
let that = this;
console.log(44747)
var url = 'distribution/get_team1';
var params = {
page: this.page,
pageNum: 10
}
console.log('7766554', params)
app.post(url, params).then((res) => {
console.log(res);
that.onetotal=res.data.data.total;
that.fenxiaolist = that.fenxiaolist.concat(res.data.data.list)
}).catch((err) => {
})
},
geterji() {
let that = this;
var url = 'distribution/get_team2';
var params = {
page: this.page,
pageNum: 10
}
console.log('7766554', params)
app.post(url, params).then((res) => {
console.log(res);
that.twototal=res.data.data.total
that.fenxiaolist = that.fenxiaolist.concat(res.data.data.list)
}).catch((err) => {
})
}
},
onReachBottom() {
let newpage = this.page;
newpage++;
this.page = newpage;
if (this.order == 0) {
this.getoneyuan()
} else {
this.geterji()
}
}
}
</script>
<style>
@import url('../../base/homepage');
page {
background: #F7F7F7;
}
.tapnavk{
padding: 24rpx 92rpx;
box-sizing: border-box;
}
.tapnav {
background: #fff;
}
.tiimg {
width: 88rpx;
height: 88rpx;
border-radius: 50%;
margin-right: 36rpx;
}
.tiimg image {
border-radius: 50%;
}
.fenxiaotileft {
color: #08121F;
font-size: 28rpx;
}
.fenxiaotir {
color: #8C9198;
font-size: 22rpx;
}
.fenxiaoti {
padding: 34rpx 40rpx;
box-sizing: border-box;
background: #fff;
margin-top: 16rpx;
}
</style>