Commit e80cc168 by yanju

Merge branch 'xue' into 'master'

项目问答已发布列表

See merge request pigbigbig/beyond-clouds-front!66
parents a073d636 87b638e7
......@@ -5,7 +5,14 @@
title="以发布的问题"
width="302px"
height="270px"
></card-container>
>
<div class="answer-release_List" v-for="val in questionList" :key="val.questionId" :info="val">
<div class="answer-box" @click="toDetail(val.questionId)">
<p>{{val.questionTitle}}</p>
<p style="color: #999">{{val.category}}</p>
</div>
</div>
</card-container>
<card-container
title="问题草稿箱"
width="302px"
......@@ -66,6 +73,12 @@
import config from "../../../action/config";
export default {
async asyncData({$axios, query}) {
const questionListRes = await $axios.$get(config.api.get.Question.myCreated, {
params: {
page: 1,
size: 12,
}
});
const questionClass = await $axios.$get(config.api.get.QuestionCategory.list);
let classList = [];
questionClass.data.forEach(item => {
......@@ -74,16 +87,21 @@
tagId: item.categoryId
})
});
console.log(classList)
//console.log(classList);
if (query.hasOwnProperty('id')) {
const response = await $axios.$get(config.api.get.Question.detail + query.id);
console.log(response);
return {
questionList: questionListRes.data.dataList,
response:response,
classList
}
}else{ return {classList}}
}else{
return {classList,
questionList: questionListRes.data.dataList,}
}
},
mounted(){
......@@ -153,6 +171,9 @@
}
},
methods: {
toDetail(path) {
this.$router.push(`/answer/detail/${path}`);
},
handleClass(value) {
this.blogClass = value.tagId;
},
......@@ -340,6 +361,25 @@
align-items: start;
.answer-release-container__l {
.answer-release_List {
width: 266*$length;
padding: 0 18*$length;
.answer-box {
margin: 15*$length 0;
@extend %cursorPointer;
@include fontStyle(13,17,500,#333,left);
@extend %flex-row-spb;
@extend %cursorPointer;
.answer-box__title {
width: 60%;
@extend %nowrap;
}
&:hover {
color: #00AAE6;
}
}
}
}
.answer-release-container__r {
......
......@@ -5,7 +5,14 @@
title="已发布项目"
width="302px"
height="400px"
></card-container>
>
<div class="project-release_List" v-for="val in projectList" :key="val.projectId" :info="val">
<div class="project-box" @click="toDetail(val.projectId)">
<p>{{val.projectName}}</p>
<p style="color: #999">{{val.category}}</p>
</div>
</div>
</card-container>
<card-container
title="项目草稿箱"
width="302px"
......@@ -157,6 +164,12 @@ import config from '../../../action/config';
export default {
async asyncData({$axios, query}) {
const projectListRes = await $axios.$get(config.api.get.Project.myList, {
params: {
page: 1,
size: 12,
}
});
const projectCategory = await $axios.$get(config.api.get.ProjectCategory.list);
let classList=[];
projectCategory.data.forEach(item=>{
......@@ -170,11 +183,15 @@ export default {
const response = await $axios.$get(config.api.get.Project.detail + query.id);
console.log(response);
return {
projectList: projectListRes.data.dataList,
response:response,
classList
}
}else{
return {classList}
return {
classList,
projectList: projectListRes.data.dataList,
}
}
},
mounted() {
......@@ -250,6 +267,9 @@ export default {
}
},
methods: {
toDetail(path) {
this.$router.push(`/project/detail/${path}`);
},
imgAdd(pos, file) {
// filename: 写在md中的文件名, File: File Object
// 第一步.将图片上传到服务器.
......@@ -481,6 +501,26 @@ export default {
align-items: start;
.project-release-container__l {
.project-release_List {
width: 266*$length;
padding: 0 18*$length;
.project-box {
margin: 15*$length 0;
@extend %cursorPointer;
@include fontStyle(13,17,500,#333,left);
@extend %flex-row-spb;
@extend %cursorPointer;
.project-box__title {
width: 60%;
@extend %nowrap;
}
&:hover {
color: #00AAE6;
}
}
}
}
.project-release-container__r {
......
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