|
@@ -2,19 +2,24 @@
|
|
<view class="my-box">
|
|
<view class="my-box">
|
|
<view class="my-content">
|
|
<view class="my-content">
|
|
<view class="my-top"></view>
|
|
<view class="my-top"></view>
|
|
- <image class="my-avatar" @tap="$navigateTo('/subPages/myPage/myDetail/myDetail')" :src="user.portrait" mode="aspectFill"></image>
|
|
|
|
- <view class="name" @tap="$navigateTo('/subPages/myPage/myDetail/myDetail')">{{user.userName || '登录/注册'}}</view>
|
|
|
|
- <view class="organization" v-if="user.organizedName">{{user.organizedName}}</view>
|
|
|
|
|
|
+ <image class="my-avatar" @tap="$navigateTo('/subPages/myPage/myDetail/myDetail')" :src="user.portrait"
|
|
|
|
+ mode="aspectFill"></image>
|
|
|
|
+ <view class="name" @tap="$navigateTo('/subPages/myPage/myDetail/myDetail')">{{user.userName || '登录/注册'}}
|
|
|
|
+ </view>
|
|
|
|
+ <view class="organization" v-if="user.organizedName"
|
|
|
|
+ @tap="$navigateTo('/subPages/myPage/changeOrganization/changeOrganization')">
|
|
|
|
+ {{user.organizedName}}
|
|
|
|
+ </view>
|
|
<view class="my-list">
|
|
<view class="my-list">
|
|
<view class="my-list-box">
|
|
<view class="my-list-box">
|
|
<view class="my-item" @tap="$navigateTo('/subPages/myPage/organization/organization')">
|
|
<view class="my-item" @tap="$navigateTo('/subPages/myPage/organization/organization')">
|
|
- <view class="my-icon bg3">
|
|
|
|
|
|
+ <view class="my-icon bg3">
|
|
<uv-icon name="home-fill" color="#fff" size="56"></uv-icon>
|
|
<uv-icon name="home-fill" color="#fff" size="56"></uv-icon>
|
|
</view>
|
|
</view>
|
|
<view class="item-content">
|
|
<view class="item-content">
|
|
我的公司
|
|
我的公司
|
|
</view>
|
|
</view>
|
|
- <view class="my-forward">
|
|
|
|
|
|
+ <view class="my-forward">
|
|
<uv-icon name="arrow-right" color="#c1c0c8" size="32"></uv-icon>
|
|
<uv-icon name="arrow-right" color="#c1c0c8" size="32"></uv-icon>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -39,43 +44,27 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- fansCount: {
|
|
|
|
- attentionCount: 0,
|
|
|
|
- fansCount: 0,
|
|
|
|
- roomCount: 0
|
|
|
|
- },
|
|
|
|
user: {}
|
|
user: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
if (!uni.getStorageSync('token')) {
|
|
if (!uni.getStorageSync('token')) {
|
|
this.user = {};
|
|
this.user = {};
|
|
- this.fansCount = {
|
|
|
|
- attentionCount: 0,
|
|
|
|
- fansCount: 0,
|
|
|
|
- roomCount: 0
|
|
|
|
- }
|
|
|
|
} else {
|
|
} else {
|
|
this.user = this.$store.getters.user;
|
|
this.user = this.$store.getters.user;
|
|
this.user.organizedName = this.$store.getters.organization && this.$store.getters.organization.name;
|
|
this.user.organizedName = this.$store.getters.organization && this.$store.getters.organization.name;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- init() {
|
|
|
|
- getMyCount().then(res => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- this.fansCount = res.data;
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- getUserInfoById(this.user.userId).then(res => {
|
|
|
|
- if (res.code === 200) {
|
|
|
|
- this.user = res.data;
|
|
|
|
- this.user['userName'] = res.data.name;
|
|
|
|
- this.user['userId'] = res.data.id;
|
|
|
|
- this.user.organizedName = res.data.mgrOrganization && res.data.mgrOrganization.name;
|
|
|
|
- this.$store.dispatch('app/changeUser', res.data);
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ async init() {
|
|
|
|
+ let userInfo = await getUserInfoById(this.user.userId);
|
|
|
|
+ if (userInfo.state) {
|
|
|
|
+ this.user = userInfo;
|
|
|
|
+ this.user['userName'] = userInfo.name;
|
|
|
|
+ this.user['userId'] = userInfo.id;
|
|
|
|
+ this.user.organizedName = userInfo.mgrOrganization && userInfo.mgrOrganization.name;
|
|
|
|
+ this.$store.dispatch('app/changeUser', userInfo);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|