mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 20:06:44 +08:00
资料编辑
This commit is contained in:
@@ -6,27 +6,27 @@
|
||||
<img src="../../../public/images/Avatarwoman.png" alt="">
|
||||
</div> -->
|
||||
<div class="uesr-avaer">
|
||||
<img :src="userInfo.avatar" v-if="userInfo.avatar !== '' ">
|
||||
<img :src="fileBaseUrl+userData.data.avatar" v-if="userData.data.avatar !== '' ">
|
||||
<div v-else class="uavatar">
|
||||
<div v-if="sex === 1 "><img src="../../../public/images/Avatarman.png" alt=""></div>
|
||||
<div v-if="userData.data.sex === 1 "><img src="../../../public/images/Avatarman.png" alt=""></div>
|
||||
<div v-else><img src="../../../public/images/Avatarwoman.png" alt=""></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="user-content">
|
||||
<div class="content-top">
|
||||
<h6 content-bottom><router-link to="/homePage"> {{userInfo.name}}</router-link>
|
||||
<h6 content-bottom><router-link to="/homePage"> {{userData.data.name}}</router-link>
|
||||
</h6>
|
||||
<div class="grade">
|
||||
<div>LV.1</div>
|
||||
<span style="color: #A3680A;margin-left:12px;line-height: 24px;">经验值:367</span>
|
||||
<div>{{userData.level}}</div>
|
||||
<span style="color: #A3680A;margin-left:12px;line-height: 24px;">经验值:{{userData.evalue}}</span>
|
||||
</div>
|
||||
<el-button round plain class="btn-user" size="small" v-if="pageId != userInfo.aid && !isFollowHas" @click="toFollow()">关注TA</el-button>
|
||||
<el-button round plain class="btn-user" size="small" v-if="isFollowHas">已关注</el-button>
|
||||
<el-button round plain class="btn-user" size="small"><router-link :to="'/homePage/leavingMessage?id='+pageId">去留言</router-link></el-button>
|
||||
</div>
|
||||
<div class="content-bottom">
|
||||
<p class="portal-summary-text">你必须非常努力才能看起来毫不费力</p>
|
||||
<p class="portal-summary-text">{{userData.data.sign}}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -67,6 +67,7 @@
|
||||
import { mapGetters } from 'vuex'
|
||||
import apiStart from '@/api/phase2/stat.js';
|
||||
import apiFollow from "@/api/phase2/userfollow.js"
|
||||
import apiUser from "@/api/system/user.js";
|
||||
export default {
|
||||
name: 'UcHeader',
|
||||
computed:{
|
||||
@@ -89,6 +90,20 @@
|
||||
sex:'',
|
||||
pageId:'',
|
||||
isFollowHas:false,
|
||||
userData:{
|
||||
evalue: 0,
|
||||
level: "",
|
||||
data:{
|
||||
aid: "",
|
||||
avatar: "",
|
||||
code: "",
|
||||
name: "",
|
||||
orgInfo: "",
|
||||
sex: 2,
|
||||
sign: "",
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -100,12 +115,28 @@
|
||||
}
|
||||
this.orgInfo=cutFullName(this.userInfo.departFullName,1);
|
||||
this.getInfo();
|
||||
this.getLevel();
|
||||
if(this.pageId !== this.userInfo.aid) {
|
||||
this.followHas();
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
followHas() {
|
||||
getLevel(){//获取经验值和等级
|
||||
apiStart.getUserEValueAndLevel(this.pageId).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.userData.evalue = res.result.evalue;
|
||||
this.userData.level = res.result.level;
|
||||
}
|
||||
});
|
||||
apiUser.getByIds([this.pageId]).then(res => {
|
||||
if (res.status == 200) {
|
||||
this.userData.data = res.result[0];
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
followHas() {//他人主页,判断关注状态
|
||||
apiFollow.has(this.pageId).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.isFollowHas = res.result;
|
||||
|
||||
Reference in New Issue
Block a user