Commit c2ed937e by yanju

Merge branch 'fix-issue#4' into 'master'

fix-issue#4

See merge request pigbigbig/beyond-clouds-front!88
parents 52e6a1f4 b8554fac
<template> <template>
<transition name="fade-transform" mode="out-in"> <transition name="fade-transform" mode="out-in">
<div class="answer-card__wrap" v-if="showCard"> <div class="answer-card__wrap" v-if="showCard">
<div class="answer-card" @click="$router.push('/answer/detail/'+questionId)"> <div class="answer-card" @click="changeRoute(questionId)">
<div class="answer-card__left" v-if="!solved"> <div class="answer-card__left" v-if="!solved">
<div> <div>
<p>{{replyNumber}}</p> <p>{{replyNumber}}</p>
...@@ -146,6 +146,14 @@ ...@@ -146,6 +146,14 @@
}) })
}, },
changeRoute(r){
let routeUrl = this.$router.resolve({
path: "/answer/detail/"+r
});
window.open(routeUrl.href,'_blank')
}
} }
} }
</script> </script>
......
<template> <template>
<card-container width="302px" title="话题热搜榜" label="实时更新" more="更多" @listenCardConMore="$router.push('/topic/rank')" > <card-container width="302px" title="话题热搜榜" label="实时更新" more="更多" @listenCardConMore="$router.push('/topic/rank')" >
<nuxt-link tag="div" :to="'/topic/detail/'+val.topicName" class="topic-content__c" v-for="(val,index) in topicList" :key="val.topicId" > <div @click="changeRoute2('/topic/detail/'+val.topicName)" class="topic-content__c" v-for="(val,index) in topicList" :key="val.topicId" >
<p>#{{val.topicName}}#</p> <p>#{{val.topicName}}#</p>
<h6>{{val.degree}}</h6> <h6>{{val.degree}}</h6>
</nuxt-link> </div>
</card-container> </card-container>
</template> </template>
...@@ -34,6 +34,12 @@ ...@@ -34,6 +34,12 @@
this.topicList = response.data.dataList; this.topicList = response.data.dataList;
}); });
}, },
changeRoute2(r){
let routeUrl = this.$router.resolve({
path: r
});
window.open(routeUrl.href,'_blank')
},
}, },
} }
......
...@@ -251,15 +251,27 @@ ...@@ -251,15 +251,27 @@
changeRoute(r){ changeRoute(r){
if(this.cardType===1){ if(this.cardType===1){
this.$router.push('/project/detail/'+r); let routeUrl = this.$router.resolve({
path: "/project/detail/"+r
});
window.open(routeUrl.href,'_blank')
} }
if(this.cardType===2){ if(this.cardType===2){
this.$router.push('/blog/detail/'+r); let routeUrl = this.$router.resolve({
path: "/blog/detail/"+r
});
window.open(routeUrl.href,'_blank')
} }
if(this.cardType===3){ if(this.cardType===3){
this.$router.push('/news/detail/'+r); let routeUrl = this.$router.resolve({
path: "/news/detail/"+r
});
window.open(routeUrl.href,'_blank')
} }
} }
......
<template> <template>
<div class="topic-card__wrap" v-if="cardId"> <div class="topic-card__wrap" v-if="cardId">
<div class="topic-card" @click="activeRouteFunc?changeRoute('/topic/detail/'+cardName):null"> <div class="topic-card" @click="activeRouteFunc?changeRoute(cardName):null">
<div class="topic-card-left"> <div class="topic-card-left">
<div class="square1" v-if="!topicIcon"></div> <div class="square1" v-if="!topicIcon"></div>
<div class="square2" v-if="!topicIcon"></div> <div class="square2" v-if="!topicIcon"></div>
...@@ -121,7 +121,10 @@ ...@@ -121,7 +121,10 @@
} }
}, },
changeRoute(r){ changeRoute(r){
this.$router.push(r); let routeUrl = this.$router.resolve({
path: "/topic/detail/"+r
});
window.open(routeUrl.href,'_blank')
}, },
dataPostFollowTopic(){ dataPostFollowTopic(){
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
</div> </div>
<div class="home-container__r"> <div class="home-container__r">
<card-container style="margin-top: 40px" title="最新资讯" more="更多" @listenCardConMore="changeRoute('/news')"> <card-container style="margin-top: 40px" title="最新资讯" more="更多" @listenCardConMore="changeRoute('/news')">
<nuxt-link tag="div" :to="'/news/detail/'+val.contentId" class="information-wrap" v-for="(val,index) in newsList" :key="val.contentId"> <div @click.stop="changeRoute2('/news/detail/'+val.contentId)" class="information-wrap" v-for="(val,index) in newsList" :key="val.contentId">
<p class="information-time">{{dateConvert(val.createTime)}}</p> <p class="information-time">{{dateConvert(val.createTime)}}</p>
<p class="information-content">{{val.title}}</p> <p class="information-content">{{val.title}}</p>
</nuxt-link> </div>
</card-container> </card-container>
<hot-topic-list style="margin-top: 16px"></hot-topic-list> <hot-topic-list style="margin-top: 16px"></hot-topic-list>
<card-container style="margin-top: 16px;padding-bottom:15px" title="社区精英" > <card-container style="margin-top: 16px;padding-bottom:15px" title="社区精英" >
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
</card-container> </card-container>
<card-container style="margin-top: 16px" title="热门问答" more="更多" @listenCardConMore="changeRoute('/answer?type=all')"> <card-container style="margin-top: 16px" title="热门问答" more="更多" @listenCardConMore="changeRoute('/answer?type=all')">
<nuxt-link tag="div" :to="'/answer/detail/'+val.questionId" class="topic-content__c" v-for="(val,index) in answerList" :key="val.questionId" > <div @click="changeRoute2('/answer/detail/'+val.questionId)" class="topic-content__c" v-for="(val,index) in answerList" :key="val.questionId" >
<p>{{val.questionTitle}}</p> <p>{{val.questionTitle}}</p>
<h6>{{val.replyNumber}}</h6> <h6>{{val.replyNumber}}</h6>
</nuxt-link> </div>
</card-container> </card-container>
</div> </div>
...@@ -87,6 +87,12 @@ ...@@ -87,6 +87,12 @@
changeRoute(r){ changeRoute(r){
return this.$router.push(r); return this.$router.push(r);
}, },
changeRoute2(r){
let routeUrl = this.$router.resolve({
path: r
});
window.open(routeUrl.href,'_blank')
},
dateConvert(time) { dateConvert(time) {
return dateConvert(time); return dateConvert(time);
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment