Commit 37fcca44 by yanju

采纳回答

parent cd087891
......@@ -21,10 +21,10 @@
{{userNick}}<span>·</span>{{createTime}}
</div>
<div class="info-right">
<div class="icon-box">
<yun-icon name="star" size="10px" vertical="middle" color="#ccc"></yun-icon>
<span>12</span>
</div>
<!-- <div class="icon-box">-->
<!-- <yun-icon name="star" size="10px" vertical="middle" color="#ccc"></yun-icon>-->
<!-- <span>12</span>-->
<!-- </div>-->
<div class="icon-box">
<yun-icon name="view" size="10px" vertical="middle" color="#ccc"></yun-icon>
<span>{{viewNumber}}</span>
......
......@@ -5,13 +5,15 @@
<div class="comment-card1" v-if="type!=='dynamic'">
<div class="comment-card1__l">
<yun-avatar :userId="info.userId" :src="info.userAvatar"></yun-avatar>
<p class="abs1" v-if="info.replyStatus===1||solved===true">已采纳</p>
<p class="abs2" @click="dataPostToSolve" v-if="info.replyStatus===0&&questionUser===$store.state.userProfile.userId">采纳</p>
</div>
<div class="comment-card1__r">
<div class="header">
<h6>{{info.userNick}}</h6>
<!-- <p>{{floor}}</p>-->
<p class="abs1" v-if="info.replyStatus===1||solved===true">已采纳</p>
<p class="abs2" @click="dataPostToSolve" v-if="info.replyStatus===0&&questionUser===$store.state.userProfile.userId">采纳该回答</p>
<!-- <p>{{floor}}</p>-->
</div>
<p class="comment-box" v-if="type!=='question'">{{info.comment}}</p>
<p class="comment-box" v-if="type==='question'">{{info.reply}}</p>
......@@ -329,24 +331,12 @@
.comment-card1__l{
width:48*$length;
position:relative;
.abs1{
@extend %cursorPointer;
position: absolute;
top:58*$length;
left:5*$length;
@include fontStyle(12,19,500,#75D098,left);
}
.abs2{
@extend %cursorPointer;
position: absolute;
top:58*$length;
left:10*$length;
@include fontStyle(12,19,500,#909399,left);
}
}
.comment-card1__r{
width:826*$length;
position:relative;
.header{
@extend %flex-row-spb;
h6{
......@@ -355,6 +345,21 @@
p{
@include fontStyle(12,16,500,#999,left)
}
.abs1{
@extend %cursorPointer;
position: absolute;
top:0*$length;
right:0*$length;
@include fontStyle(12,19,500,#75D098,left);
}
.abs2{
@extend %cursorPointer;
position: absolute;
top:0*$length;
right:0*$length;
@include fontStyle(12,19,500,#909399,left);
}
}
.comment-box{
......
......@@ -73,7 +73,7 @@
import SelectCard from "../../../components/pc/select/selectCard";
import config from "../../../action/config";
export default {
async asyncData({$axios, query}) {
async asyncData({$axios, query,redirect}) {
const questionListRes = await $axios.$get(config.api.get.Question.myCreated, {
params: {
page: 1,
......@@ -82,6 +82,11 @@
});
const questionClass = await $axios.$get(config.api.get.QuestionCategory.list);
let classList = [];
if(questionListRes.code!==0){
redirect('/login');
}
questionClass.data.forEach(item => {
classList.push({
tag: item.category,
......@@ -89,6 +94,7 @@
})
});
if (query.hasOwnProperty('id')) {
const response = await $axios.$get(config.api.get.Question.detail + query.id);
return {
......
......@@ -137,7 +137,7 @@ import SelectCard from "../../../components/pc/select/selectCard";
import config from "../../../action/config";
export default {
async asyncData({$axios, query}) {
async asyncData({$axios, query,redirect}) {
const blogListRes = await $axios.$get(config.api.get.Blog.myList, {
params: {
page: 1,
......@@ -146,6 +146,9 @@ export default {
});
const blogClassRes = await $axios.$get(config.api.get.BlogCategory.list);
let classList = [];
if(blogListRes.code!==0){
redirect('/login');
}
blogClassRes.data.forEach(item => {
classList.push({
tag: item.category,
......
......@@ -164,7 +164,7 @@ import SelectCard from "../../../components/pc/select/selectCard";
import config from '../../../action/config';
export default {
async asyncData({$axios, query}) {
async asyncData({$axios, query,redirect}) {
const projectListRes = await $axios.$get(config.api.get.Project.myList, {
params: {
page: 1,
......@@ -173,6 +173,9 @@ export default {
});
const projectCategory = await $axios.$get(config.api.get.ProjectCategory.list);
let classList=[];
if(projectListRes.code!==0){
redirect('/login');
}
projectCategory.data.forEach(item=>{
classList.push({
tag:item.category,
......
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