个人主页关注,跳转到指定tab

This commit is contained in:
zhaofang
2022-10-22 11:40:51 +08:00
parent 5d947a555d
commit 0879df5fe2
7 changed files with 22 additions and 20 deletions

View File

@@ -26,7 +26,7 @@
<svg-icon style="margin-right: 10px;font-size:22px;padding-top: 4px;" icon-class="eyes"></svg-icon>隐藏
</div>
<div class="btn-right">
<el-button class="btn" type="primary" @click="jumpDetail(item.info)">继续学习</el-button>
<el-button class="btn" type="primary" @click="jumpDetail(item.info)">{{pageId == userInfo.aid || isFollow? '继续学习' : '我也去学'}}</el-button>
</div>
</div>
</div>
@@ -43,6 +43,7 @@
<script>
import { toScore} from '@/utils/tools.js';
import courseImage from "@/components/Course/courseImage.vue";
import { mapGetters } from 'vuex'
export default{
data(){
return{
@@ -50,6 +51,9 @@
courseList:[]
}
},
computed:{
...mapGetters(['curIdentity','identity','userInfo']),
},
components: {
courseImage,
},
@@ -71,6 +75,9 @@
default:false,
}
},
mounted() {
this.pageId = this.$xpage.getHomeId(this.$route);
},
methods:{
emitHide(id) {
this.$emit('hideIndex',id)

View File

@@ -142,6 +142,10 @@ import apiUser from "@/api/system/user.js";
},
mounted() {
this.pageId = this.$xpage.getHomeId(this.$route);
this.$bus.$on('followIndex',(num)=>{
console.log(num,'num');
this.active = num;
})
},
methods:{
resetActive(){

View File

@@ -11,7 +11,6 @@ const getters = {
orgId: state => state.user.orgId,
permissions: state => state.user.permissions,
identity: state => state.user.identity,
attention: state => state.user.attention,
intTimeNote: state => state.user.intTimeNote,
curIdentity: state => state.user.curIdentity,
permission_routes: state => state.permission.routes,

View File

@@ -17,7 +17,6 @@ const user = {
curIdentity: sessionStorage.getItem("curIdentity") == null ? 1 : sessionStorage.getItem("curIdentity"), // 用户当前选择的身份 1学员 2教师 3管理员
permissions: [],
intTimeNote:0,
attention:false,
},
mutations: {
SET_IntTimeNote: (state, u) => {
@@ -45,15 +44,8 @@ const user = {
SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions
},
SET_Attention: (state, m)=>{
state.attention = m
}
},
actions: {
// /用户触发事件
setAttention({ commit }, iden) {
commit('SET_Attention', iden);
},
// /用户触发事件
userTrigger({ commit }, event) {
event.source='page';

View File

@@ -7,11 +7,11 @@
<router-view />
<div class="home-page-right">
<ul class="total-per">
<li class="per-li pointer" @click="jumpAttention()">
<li class="per-li pointer" @click="jumpAttention(2)">
<span class="per-info">{{follow.passive}}</span>
<span class="per-text">关注{{self?'我':'他'}}的人</span>
</li>
<li class="per-li pointer" @click="jumpAttention()">
<li class="per-li pointer" @click="jumpAttention(1)">
<span class="per-info">{{follow.initiative}}</span>
<span class="per-text">{{self?'我':'他'}}关注的人</span>
</li>
@@ -94,8 +94,9 @@
toHome(ava) {
this.$router.push({path:this.$xpage.getHomePath(ava.aid)})
},
jumpAttention() {// 点击事件跳转关注
this.$store.dispatch("setAttention", true);
jumpAttention(num) {// 点击事件跳转关注
// this.$store.dispatch("setAttention", true);
this.$bus.$emit('followIndex',num)
},
init(){
this.getMedal();

View File

@@ -93,7 +93,7 @@
export default{
components:{top,UcHeader,CaseList,CourseList,NoteList,PutList,AnswerList,ArticleList,FollowList,BookList},
computed: {
...mapGetters(['userInfo','majorTypeMap','orgDomainMap','attention']),
...mapGetters(['userInfo','majorTypeMap','orgDomainMap']),
},
data(){
return{
@@ -137,12 +137,11 @@
location.href=urlPre+process.env.VUE_APP_PUBLIC_PATH+this.$xpage.getHomePath(this.pageId);
}
},
attention(val) {
this.activeName = "7";
},
},
mounted() {
this.$bus.$on('followIndex',(num)=>{
this.activeName = "7";
})
},
methods:{
init(){

View File

@@ -121,7 +121,7 @@
}
},
computed: {
...mapGetters(['userInfo','majorTypeMap','orgDomainMap','attention']),
...mapGetters(['userInfo','majorTypeMap','orgDomainMap']),
},
created() {
apiFollow.list().then(res=>{