|
@@ -10,7 +10,7 @@
|
|
|
<view class="jiedianbackground"><image src="../../static/img/myJ-bg.png" mode=""></image></view>
|
|
|
<view class="number-box">
|
|
|
<view class="number">
|
|
|
- <text>{{ 100 }}</text>
|
|
|
+ <text>{{ count }}</text>
|
|
|
人
|
|
|
</view>
|
|
|
<view class="renshu">我的互助团队人数</view>
|
|
@@ -19,16 +19,16 @@
|
|
|
<view class="message">
|
|
|
<view class="yeji">
|
|
|
<view class="yeji-a">
|
|
|
- <view class="yeji-buttom">8000</view>
|
|
|
+ <view class="yeji-buttom">{{ shouru * 1 || 0 }}</view>
|
|
|
<view class="yeji-top">收益</view>
|
|
|
</view>
|
|
|
<view class="border"></view>
|
|
|
<view class="yeji-a">
|
|
|
- <view class="yeji-buttom">8000</view>
|
|
|
+ <view class="yeji-buttom">{{ zhichu * 1 || 0 }}</view>
|
|
|
<view class="yeji-top">支出</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="back" @click="navBack()" v-if="parentList.length > 0">
|
|
|
+ <view class="back" @click="navBack()" v-if="fatherList.length > 0">
|
|
|
<image src="../../static/img/zhengyi10.png" mode=""></image>
|
|
|
返回
|
|
|
</view>
|
|
@@ -45,32 +45,19 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="sanchaji"><image src="../../static/img/sanchaji.png" mode=""></image></view>
|
|
|
- <view class="subordinate">
|
|
|
- <view class="headbox" v-if="listA" @click="nav('a')">
|
|
|
- <view class="head">
|
|
|
- <view class="photo"><image v-if="listA.avatar" :src="listA.avatar" mode="scaleToFill"></image></view>
|
|
|
- </view>
|
|
|
- <view class="head-name">{{ listA.nickname }}</view>
|
|
|
- <view class="head-phone">{{ listA.phone }}</view>
|
|
|
+ <view class="subordinate flex">
|
|
|
+ <view class="subordinate-box" v-for="(item, index) in childList" @click="findChildren(item)">
|
|
|
+ <view class="head1"><image :src="item.avatar || '/static/error/missing-face.png'" mode=""></image></view>
|
|
|
+ <view class="name clamp">{{ item.nickname }}</view>
|
|
|
+ <view class="phone clamp">{{ item.mobile }}</view>
|
|
|
</view>
|
|
|
- <view class="zhuce" v-else @click="open('A')"><view class="jia"></view></view>
|
|
|
- <view class="headbox" v-if="listB" @click="nav('b')">
|
|
|
- <view class="head">
|
|
|
- <view class="photo"><image :key="listB.id" :src="listB.avatar" mode="scaleToFill"></image></view>
|
|
|
+ <template v-if="childList.length < 3">
|
|
|
+ <view class="subordinate-box" v-for="item in 3 - childList.length">
|
|
|
+ <view class="head1"></view>
|
|
|
+ <view class="name clamp"></view>
|
|
|
+ <view class="phone clamp"></view>
|
|
|
</view>
|
|
|
- <view class="head-name">{{ listB.nickname }}</view>
|
|
|
- <view class="head-phone">{{ listB.phone }}</view>
|
|
|
- </view>
|
|
|
- <view class="zhuce" v-else @click="open('B')"><view class="jia"></view></view>
|
|
|
-
|
|
|
- <view class="headbox" v-if="listC" @click="nav('c')">
|
|
|
- <view class="head">
|
|
|
- <view class="photo"><image v-if="listC.avatar" :src="listC.avatar" mode="scaleToFill"></image></view>
|
|
|
- </view>
|
|
|
- <view class="head-name">{{ listC.nickname }}</view>
|
|
|
- <view class="head-phone">{{ listC.phone }}</view>
|
|
|
- </view>
|
|
|
- <view class="zhuce" v-else @click="open('C')"><view class="jia"></view></view>
|
|
|
+ </template>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -78,26 +65,20 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getjiedian, getReferralList, addJiedian } from '@/api/user.js';
|
|
|
+import { myActivity, activityDetail } from '@/api/market.js';
|
|
|
import { mapState, mapMutations } from 'vuex';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- bianhao: '1',
|
|
|
- a: 1,
|
|
|
- b: 2,
|
|
|
- c: 3,
|
|
|
- listA: '', //节点A
|
|
|
- listB: '', //节点B
|
|
|
- listC: '', //节点C
|
|
|
+ count: '', //互助人数
|
|
|
+ shouru: '', //我的收入
|
|
|
+ zhichu: '', //我的支持
|
|
|
name: '', //当前节点姓名
|
|
|
phone: '', //当前节点手机号
|
|
|
avatar: '', //当前节点头像
|
|
|
id: '',
|
|
|
- uid: '',
|
|
|
- jiedianList: [],
|
|
|
- parentList: [], //保存打开层级用户数据
|
|
|
- parent_area: ''
|
|
|
+ childList: [], //当前节点的下级
|
|
|
+ fatherList: []
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -108,35 +89,49 @@ export default {
|
|
|
this.phone = this.userInfo.phone;
|
|
|
this.avatar = this.userInfo.avatar;
|
|
|
this.id = this.userInfo.uid;
|
|
|
- // this.loadData();
|
|
|
+ activityDetail({}, 1).then(({ data }) => {
|
|
|
+ if (data.expend.length != 0) {
|
|
|
+ this.zhichu = data.expend[0].money;
|
|
|
+ } else {
|
|
|
+ this.zhichu = 0;
|
|
|
+ }
|
|
|
+ if (data.income.length != 0) {
|
|
|
+ this.shouru = data.income[0].money;
|
|
|
+ } else {
|
|
|
+ this.shouru = 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.loadData();
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
// 点击返回 我的页面
|
|
|
toBack() {
|
|
|
- uni.navigateBack({
|
|
|
-
|
|
|
- })
|
|
|
+ uni.navigateBack({});
|
|
|
},
|
|
|
- //切换按钮
|
|
|
- radio(e) {
|
|
|
- this.bianhao = e;
|
|
|
+ async findChildren(item) {
|
|
|
+ //存father
|
|
|
+ this.fatherList.push({
|
|
|
+ name: this.name,
|
|
|
+ phone: this.phone,
|
|
|
+ avatar: this.avatar,
|
|
|
+ id: this.id
|
|
|
+ });
|
|
|
+ //设置新father
|
|
|
+
|
|
|
+ this.id = item.id;
|
|
|
+ await this.loadData();
|
|
|
+ this.name = item.nickname;
|
|
|
+ this.phone = item.mobile;
|
|
|
+ this.avatar = item.avatar;
|
|
|
},
|
|
|
- //返回
|
|
|
- navBack() {
|
|
|
- const obj = this;
|
|
|
- // 删除
|
|
|
- let parent = obj.parentList.pop();
|
|
|
- console.log(parent);
|
|
|
- console.log(obj.parentList, 'navBack');
|
|
|
- // 保存回退后数据对象
|
|
|
- obj.name = parent.name;
|
|
|
-
|
|
|
- obj.avatar = parent.avatar;
|
|
|
- obj.id = parent.id;
|
|
|
- obj.listA = obj.listB = obj.listC = '';
|
|
|
- console.log(parent, '对象');
|
|
|
- obj.loadData();
|
|
|
+ back() {
|
|
|
+ let father = this.fatherList.pop();
|
|
|
+ this.name = father.name;
|
|
|
+ this.phone = father.phone;
|
|
|
+ this.avatar = father.avatar;
|
|
|
+ this.id = father.id;
|
|
|
+ this.loadData();
|
|
|
},
|
|
|
loadData() {
|
|
|
const obj = this;
|
|
@@ -144,8 +139,10 @@ export default {
|
|
|
title: '加载中。。。',
|
|
|
mask: true
|
|
|
});
|
|
|
- getjiedian({}, this.id)
|
|
|
+ myActivity({ uid: obj.id }, 1)
|
|
|
.then(({ data }) => {
|
|
|
+ obj.count = data.count;
|
|
|
+ console.log(data);
|
|
|
uni.hideLoading();
|
|
|
if (data.list.length != 0) {
|
|
|
data.list.forEach(e => {
|
|
@@ -168,38 +165,6 @@ export default {
|
|
|
.catch(e => {
|
|
|
uni.hideLoading();
|
|
|
});
|
|
|
- },
|
|
|
- nav(type) {
|
|
|
- const obj = this;
|
|
|
- // 保存当前选中的对象
|
|
|
- let item = '';
|
|
|
- if (type == 'a') {
|
|
|
- item = 'listA';
|
|
|
- } else {
|
|
|
- if (type == 'b') {
|
|
|
- item = 'listB';
|
|
|
- } else if (type == 'c') {
|
|
|
- item = 'listC';
|
|
|
- }
|
|
|
- }
|
|
|
- obj.parentList.push({
|
|
|
- name: obj.name,
|
|
|
- phone: obj.phone,
|
|
|
- avatar: obj.avatar,
|
|
|
- id: obj.id
|
|
|
- });
|
|
|
- console.log(obj.parentList, 's');
|
|
|
- obj.name = obj[item].nickname;
|
|
|
- obj.phone = obj[item].phone;
|
|
|
- obj.avatar = '';
|
|
|
- obj.$nextTick(function() {
|
|
|
- obj.avatar = obj[item].avatar;
|
|
|
- obj.id = obj[item].uid;
|
|
|
- obj.listA = '';
|
|
|
- obj.listB = '';
|
|
|
- obj.listC = '';
|
|
|
- obj.loadData();
|
|
|
- });
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -409,95 +374,54 @@ page {
|
|
|
.subordinate {
|
|
|
width: 750rpx;
|
|
|
display: flex;
|
|
|
- justify-content: space-around;
|
|
|
-
|
|
|
- .zhuce {
|
|
|
- width: 154rpx;
|
|
|
- height: 154rpx;
|
|
|
-
|
|
|
- .jia {
|
|
|
- width: 154rpx;
|
|
|
- height: 154rpx;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
-
|
|
|
- background: #e8e8e8;
|
|
|
- box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
|
|
|
- border-radius: 50%;
|
|
|
- overflow: hidden;
|
|
|
-
|
|
|
- .jia_photo {
|
|
|
- font-size: 80rpx;
|
|
|
- line-height: 1;
|
|
|
- color: #a3a3a3;
|
|
|
- }
|
|
|
-
|
|
|
- .font {
|
|
|
- font-size: 22rpx;
|
|
|
- font-weight: 500;
|
|
|
- color: #999999;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .headbox {
|
|
|
- width: 33.3%;
|
|
|
- // height: 154rpx;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: flex-start;
|
|
|
+
|
|
|
+ .subordinate-box {
|
|
|
+ flex: 1;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- // flex-wrap: nowrap;
|
|
|
align-items: center;
|
|
|
- padding: 0 10rpx;
|
|
|
-
|
|
|
- .head {
|
|
|
- width: 154rpx;
|
|
|
- height: 154rpx;
|
|
|
- background: #2e58ff;
|
|
|
- box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
|
|
|
+
|
|
|
+ .head1 {
|
|
|
+ position: relative;
|
|
|
border-radius: 50%;
|
|
|
- overflow: hidden;
|
|
|
-
|
|
|
- .photo {
|
|
|
- width: 154rpx;
|
|
|
- height: 154rpx;
|
|
|
-
|
|
|
+ background: #f1f1f1;
|
|
|
+ width: 120rpx;
|
|
|
+ height: 120rpx;
|
|
|
+ .vip {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ left: 10%;
|
|
|
+ width: 94rpx;
|
|
|
+ height: 32rpx;
|
|
|
image {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ border-radius: 0;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- .head-title {
|
|
|
- margin: -30rpx 30rpx 0 30rpx;
|
|
|
- width: 94rpx;
|
|
|
- height: 32rpx;
|
|
|
-
|
|
|
image {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ border-radius: 50%;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .head-name {
|
|
|
- margin-top: 20rpx;
|
|
|
- white-space: nowrap;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
- width: 150rpx;
|
|
|
- padding-top: 10rpx;
|
|
|
- text-align: center;
|
|
|
- // margin: 30rpx 0 0 0;
|
|
|
- font-size: 32rpx;
|
|
|
+
|
|
|
+ .name {
|
|
|
+ max-width: 120rpx;
|
|
|
+ margin-top: 10rpx;
|
|
|
+ font-size: 26rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
font-weight: bold;
|
|
|
- color: #333333;
|
|
|
+ color: #ffffff;
|
|
|
}
|
|
|
-
|
|
|
- .head-phone {
|
|
|
- margin: 15rpx 0 0 0;
|
|
|
- font-size: 26rpx;
|
|
|
+
|
|
|
+ .phone {
|
|
|
+ max-width: 120rpx;
|
|
|
+ margin-top: 10rpx;
|
|
|
+ font-size: 22rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
font-weight: 500;
|
|
|
color: #999999;
|
|
|
}
|