暂存代码
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
</view>
|
||||
<scroll-view scroll-y="true" @scrolltolower="loadMore" :style="{'height': 'calc(100vh - 500rpx)'}">
|
||||
<view class="team_item" v-for="(item,index) in listData" :key="item.id" v-if="listData && listData.length">
|
||||
<view class="team_header" @click="jumpNextLevel(item)">
|
||||
<view class="team_header" @click="queryLowerFun(item,index)">
|
||||
<view class="header_left_">
|
||||
<view style="margin-top: 10rpx;">
|
||||
<up-image :src="item.userUrl || '/static/logo.png'" width="50" height="50" bgColor="#f1f6ff00" shape="circle" radius='16'></up-image>
|
||||
@@ -49,7 +49,31 @@
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<up-image src="/static/common/right_x.png" width="20" height="20" bgColor="#f1f6ff00" radius='16'></up-image>
|
||||
<up-image src="/static/common/right_x.png" width="20" height="20" bgColor="#f1f6ff00" radius='16' v-if="!item.isOpen"></up-image>
|
||||
<up-image src="/static/common/buttom_x.png" width="20" height="20" bgColor="#f1f6ff00" radius='16' v-else></up-image>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding: 10rpx;" v-if="item.isOpen && item.lowerData">
|
||||
<view class="team_lower">
|
||||
<view class="team_lower_item">
|
||||
<view class="title_">总订单金额</view>
|
||||
<view class="val_">{{item.lowerData.teamAmount}}</view>
|
||||
</view>
|
||||
<view class="team_lower_fg"></view>
|
||||
<view class="team_lower_item">
|
||||
<view class="title_">直推人数</view>
|
||||
<view class="val_">{{item.lowerData.ztCount}}</view>
|
||||
</view>
|
||||
<view class="team_lower_fg"></view>
|
||||
<view class="team_lower_item">
|
||||
<view class="title_">间推人数</view>
|
||||
<view class="val_">{{item.lowerData.jtCount}}</view>
|
||||
</view>
|
||||
<view class="team_lower_fg"></view>
|
||||
<view class="team_lower_item">
|
||||
<view class="title_">总人数</view>
|
||||
<view class="val_">{{item.lowerData.teamCount}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -141,7 +165,8 @@
|
||||
// 模拟异步获取数据,实际应用中应该替换为你的数据获取逻辑,例如API调用
|
||||
const newData = await this.fetchData();
|
||||
if(newData.entitys && newData.entitys.length !==0){
|
||||
this.listData = [...this.listData, ...newData.entitys]; // 将新数据添加到列表中
|
||||
const data = newData.entitys.map(item=>({...item,isOpen:false}));
|
||||
this.listData = [...this.listData, ...data]; // 将新数据添加到列表中
|
||||
this.form.page++; // 页码加1
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -165,6 +190,26 @@
|
||||
// 当滚动到底部时触发的方法
|
||||
loadMore() {
|
||||
this.loadData(); // 加载更多数据
|
||||
},
|
||||
/**
|
||||
* 查询团队下级数据
|
||||
* @param {Object} item
|
||||
* @param {Object} index
|
||||
*/
|
||||
async queryLowerFun(item,index){
|
||||
const data = this.listData[index];
|
||||
const type = !data.isOpen
|
||||
if(type){
|
||||
const params={
|
||||
userId : item.userId,
|
||||
}
|
||||
const resp = await getJuniorSummary(params);
|
||||
if(resp && resp.bizcode === 100){
|
||||
data.lowerData = resp.data;
|
||||
}
|
||||
}
|
||||
data.isOpen = type;
|
||||
this.listData[index] = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,9 +289,6 @@
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.team_item{
|
||||
padding: 20rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.team_header{
|
||||
@@ -254,7 +296,9 @@
|
||||
align-content: center;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 10rpx;
|
||||
border-radius: 8rpx;
|
||||
background: #FFFFFF;
|
||||
padding: 20rpx;
|
||||
.header_left_{
|
||||
display: flex;
|
||||
align-items: inherit;
|
||||
@@ -276,7 +320,31 @@
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.team_lower{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #E9E9E9;
|
||||
border-radius: 4px;
|
||||
padding: 30rpx 20rpx;
|
||||
.team_lower_fg{
|
||||
border-right: 1px solid rgba(0,0,0,0.26);
|
||||
height: 36rpx;
|
||||
}
|
||||
.team_lower_item{
|
||||
text-align: center;
|
||||
}
|
||||
.title_{
|
||||
font-size: 10px;
|
||||
color: rgba(0,0,0,0.6);
|
||||
}
|
||||
.val_{
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
color: rgba(0,0,0,0.9);
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
.team_content{
|
||||
border-top: 1rpx solid #EEEEEE;
|
||||
padding: 20rpx 0 0;
|
||||
|
||||
Reference in New Issue
Block a user