123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391 |
- <template>
- <view class="content">
- <!-- 头部 -->
- <view class="container">
- <view class="jiedianbackground"><image src="../../static/img/jiedian.png" mode=""></image></view>
- <view class="number-box">
- <view class="number">
- <text>{{ childList.length }}</text>
- {{ $t('hea.ren') }}
- </view>
- <view class="renshu">{{ $t('hea.wdtdrs') }}</view>
- </view>
- </view>
- <view class="message">
- <view class="back-box" @click="back()" v-if="id != userInfo.id">{{ $t('hea.fh') }}</view>
- <view class="relation-box">
- <view class="relation">
- <view class="headbox">
- <view class="head">
- <view class="photo"><image v-if="avatar" :src="avatar || '/static/error/missing-face.png'"></image></view>
- </view>
- </view>
- <view class="information">
- <view class="name clamp">{{ name }}</view>
- <view class="cell clamp">{{ phone }}</view>
- </view>
- </view>
- <view class="sanchaji"><image src="../../static/img/sanchaji.png" mode=""></image></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 class="" v-if="item.activity[0].my_join != null">
- <view class="vip" v-if="item.activity[0].my_join.status == '1'"><image src="../../static/img/cjyg.png" mode=""></image></view>
- </view>
- <view class="" v-if="item.activity[1].my_join != null">
- <view class="vip" v-if="item.activity[1].my_join.status == '1'"><image src="../../static/img/v1.png" mode=""></image></view>
- <view class="vip" v-if="item.activity[1].my_join.status == '2'"><image src="../../static/img/v2.png" mode=""></image></view>
- </view>
-
- </view>
- <view class="name clamp">{{ item.nickname }}</view>
- <view class="phone clamp">{{ item.mobile }}</view>
- </view>
- <template v-if="childList.length < 5">
- <view class="subordinate-box" v-for="item in 5 - childList.length">
- <view class="head1"></view>
- <view class="name clamp"></view>
- <view class="phone clamp"></view>
- </view>
- </template>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import uniPopup from '@/components/uni-popup/uni-popup.vue';
- import { children } from '@/api/user.js';
- import { mapState, mapMutations } from 'vuex';
- export default {
- components: {
- uniPopup
- },
- data() {
- return {
- name: '', //当前节点姓名
- phone: '', //当前节点手机号
- avatar: '', //当前节点头像
- id: '',
- childList: [], //当前节点的下级
- fatherList: []
- };
- },
- computed: {
- ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
- },
- onLoad() {
- uni.setNavigationBarTitle({
- title: this.$t('foo.wdtd')
- });
- console.log(this.userInfo);
- this.name = this.userInfo.nickname;
- this.phone = this.userInfo.mobile;
- this.avatar = this.userInfo.avatar;
- this.id = this.userInfo.id;
- this.loadData();
- },
- methods: {
- //返回
- loadData() {
- uni.showLoading({
- title: '加载中。。。',
- mask: true
- });
- const obj = this;
- children({}, this.id).then(({ data }) => {
- this.childList = data;
- console.log(data);
- uni.hideLoading()
- });
- },
- 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;
- },
- back() {
- let father = this.fatherList.pop();
- this.name = father.name;
- this.phone = father.phone;
- this.avatar = father.avatar;
- this.id = father.id;
- this.loadData();
- }
- }
- };
- </script>
- <style lang="scss">
- page {
- padding: 0;
- margin: 0;
- height: 100%;
- background-color: #000;
- }
- .container {
- width: 750rpx;
- height: 400rpx;
- position: relative;
- .jiedianbackground {
- position: absolute;
- width: 750rpx;
- height: 400rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .number-box {
- width: 750rpx;
- height: 400rpx;
- position: absolute;
- display: flex;
- justify-content: center;
- flex-direction: column;
- align-items: center;
- .number {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #fad6b0;
- text {
- font-size: 72rpx;
- font-family: PingFang SC;
- font-weight: bold;
- line-height: 86rpx;
- }
- }
- .renshu {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #fad6b0;
- }
- }
- }
- .message {
- padding: 0 30rpx;
- position: relative;
- .back-box {
- width: 100rpx;
- height: 50rpx;
- border: 1px solid #fad6b0;
- // background-color: red;
- position: absolute;
- top: 0;
- right: 20rpx;
- color: #fad6b0;
- line-height: 50rpx;
- text-align: center;
- border-radius: 10rpx;
- font-size: 28rpx;
- z-index: 9;
- }
- .relation-box {
- margin-top: 100rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- .relation {
- position: relative;
- display: flex;
- align-items: center;
- .headbox {
- position: absolute;
- // width: 154rpx;
- // height: 154rpx;
- .head {
- width: 154rpx;
- height: 154rpx;
- background: #fff;
- box-shadow: 5rpx 0rpx 5rpx 0rpx rgba(110, 171, 78, 0.26);
- border-radius: 50%;
- overflow: hidden;
- .photo {
- width: 154rpx;
- height: 154rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .head-title {
- margin: -30rpx 30rpx 0 30rpx;
- width: 94rpx;
- height: 32rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- // .head-name{
- // max-width: 100%;
- // font-size: 32rpx;
- // font-weight: bold;
- // color: #333333;
- // }
- // .head-phone{
- // font-size: 26rpx;
- // font-weight: 500;
- // color: #999999;
- // }
- }
- .information {
- margin-left: 77rpx;
- display: flex;
- padding: 20rpx 10rpx;
- flex-direction: column;
- width: 297rpx;
- height: 137rpx;
- background: linear-gradient(90deg, #393326, #27221d);
- border: 4rpx solid #fad6b0;
- border-radius: 10rpx;
- .name {
- text-align: left;
- margin-left: 70rpx;
- font-size: 32rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #fad6b0;
- }
- .cell {
- text-align: left;
- margin-left: 70rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #fad6b0;
- }
- }
- }
- .sanchaji {
- margin: 30rpx 0;
- width: 90%;
- height: 91rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .subordinate {
- width: 750rpx;
- display: flex;
- justify-content: flex-start;
- align-items: flex-start;
- .subordinate-box {
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: center;
- .head1 {
- position: relative;
- border-radius: 50%;
- background: #fff;
- width: 120rpx;
- height: 120rpx;
- .vip {
- position: absolute;
- bottom: 0;
- left: 10%;
- width: 94rpx;
- height: 32rpx;
- image {
- width: 100%;
- height: 100%;
- border-radius: 0;
- }
- }
- image {
- width: 100%;
- height: 100%;
- border-radius: 50%;
- }
- }
- .name {
- max-width: 120rpx;
- margin-top: 10rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- }
- .phone {
- max-width: 120rpx;
- margin-top: 10rpx;
- font-size: 22rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- }
- }
- }
- }
- .back {
- float: right;
- margin-top: 40rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- image {
- width: 24rpx;
- height: 23rpx;
- }
- width: 104rpx;
- height: 39rpx;
- border: 2rpx solid #6eab4e;
- border-radius: 7rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #6eab4e;
- }
- }
- </style>
|