This commit is contained in:
zhaofang
2022-09-21 19:59:30 +08:00
parent 6ff4c51444
commit 8dc374cb65
11 changed files with 401 additions and 59 deletions

View File

@@ -21,8 +21,9 @@
<div>LV.1</div>
<span style="color: #A3680A;margin-left:12px;line-height: 24px;">经验值367</span>
</div>
<el-button round plain class="btn-user" size="small">关注TA</el-button>
<el-button round plain class="btn-user" size="small"><router-link to="/homePage/leavingMessage">去留言</router-link></el-button>
<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>
@@ -64,7 +65,8 @@
<script>
import {userAvatarText,cutFullName} from "@/utils/tools.js";
import { mapGetters } from 'vuex'
import apiStart from '@/api/phase2/stat.js'
import apiStart from '@/api/phase2/stat.js';
import apiFollow from "@/api/phase2/userfollow.js"
export default {
name: 'UcHeader',
computed:{
@@ -85,20 +87,43 @@
},
orgInfo:'',
sex:'',
pageId:'',
isFollowHas:false,
}
},
mounted() {
this.pageId = this.$route.query.id;
this.sex = this.userInfo.sex;
// 判断路由是进入的学员默认页面就重置setCurIdentity
if(this.$route.path == '/uc/study/task' || this.$route.path == '/study/index'){
this.setCurIdentity(1);
}
//let testName='京东方科技集团股份有限公司/北京中祥英科技有限公司/技术中心';
//this.orgInfo=cutFullName(testName,1);
this.orgInfo=cutFullName(this.userInfo.departFullName,1);
this.getInfo();
if(this.pageId !== this.userInfo.aid) {
this.followHas();
}
},
methods:{
followHas() {
apiFollow.has(this.pageId).then(res=>{
if(res.status == 200) {
this.isFollowHas = res.result;
} else {
this.$message.error(res.message);
}
})
},
toFollow() {
apiFollow.save(this.pageId).then(res=>{
if(res.status == 200) {
this.$message.success(res.message);
this.followHas();
} else {
this.$message.error(res.message);
}
})
},
getInfo(){
apiStart.userTotal(this.userInfo.aid,[10,11,30]).then(res=>{
if(res.status == 200 && res.result.length > 0) {