Commit 596841d2 by yanju

Merge branch 'xue' into 'master'

8.1and8.6

See merge request pigbigbig/beyond-clouds-front!28
parents 7fd80508 6f550f6e
......@@ -5,7 +5,12 @@
title="已发布的博客"
width="302px"
height="400px"
></card-container>
>
<div class="blog-release_List" v-for="val in blogList" :key="val.blogId" :info="val">
<div style="width: 60%"><p @click="toDetail">{{val.blogTitle}}</p></div>
<p @click="toDetail" style="color: #999999">{{val.category}}</p>
</div>
</card-container>
<card-container
title="博客草稿箱"
width="302px"
......@@ -28,24 +33,28 @@
<div class="header-content">
<div class="select__wrap">
<span>*</span>
<select-card
selectType="2"
:class-list="classList"
@handleClass="handleBlogClass"
placeholder="请选择文章分类"></select-card>
<<<<<<< HEAD
<select-card selectType="2" :class-list="classList" @handleClass="handleBlogClass" placeholder="请选择文章分类" ></select-card>
=======
<select-card selectType="2" :class-list="classList" placeholder="请选择文章分类" ></select-card>
>>>>>>> caa436abf80933566b76b72acbaa8d43b70d78fc
</div>
<input type="text" placeholder="原文链接" style="width: 461px;" >
<input type="text" placeholder="原文链接" style="width: 461px;" v-model="originLink" >
</div>
<div class="header-content">
<span>*</span>
<input type="text" placeholder="请用一句话介绍该文章">
<input type="text" placeholder="请用一句话介绍该文章" v-model="blogAbstract">
</div>
</div>
<div class="blog-release__content">
<span>*</span>
<div class="editor-container">
<mavon-editor
v-model="value"
<<<<<<< HEAD
v-model="content"
=======
v-model="blogContent"
>>>>>>> caa436abf80933566b76b72acbaa8d43b70d78fc
:toolbars="markdownOption"
class="editor"
placeholder="问题详情...."
......@@ -63,43 +72,39 @@
<span>*</span>
<select-card selectType="1" @handleTag="handleTagList"></select-card>
</div>
<select-card
selectType="2"
:class-list="classList"
@handleClass="handleQuestionClass"
placeholder="请选择问题分类"></select-card>
<select-card selectType="2" :class-list="classList" @handleClass="handleQuestionClass" placeholder="请选择问题分类"></select-card>
</div>
<div class="choose-container">
<div class="input-box__wrap">
<span>*</span>
<div class="input-box">
<input type="radio" id="公开" value="公开" v-model="way" name="way">
<input type="radio" id="公开" value="1" v-model="way" name="way">
<label for="公开">公开</label>
</div>
<div class="input-box">
<input type="radio" id="私密" value="私密" v-model="way" name="way">
<input type="radio" id="私密" value="0" v-model="way" name="way">
<label for="私密">私密</label>
</div>
</div>
<div class="input-box__wrap">
<span>*</span>
<div class="input-box">
<input type="radio" id="开启评论" value="开启评论" v-model="comment" name="comment">
<input type="radio" id="开启评论" value="true" v-model="allowComment" name="comment">
<label for="开启评论">开启评论</label>
</div>
<div class="input-box">
<input type="radio" id="禁止评论" value="禁止评论" v-model="comment" name="comment">
<input type="radio" id="禁止评论" value="false" v-model="allowComment" name="comment">
<label for="禁止评论">禁止评论</label>
</div>
</div>
<div class="input-box__wrap">
<span>*</span>
<div class="input-box">
<input type="radio" id="可以转载" value="可以转载" v-model="reprint" name="reprint">
<input type="radio" id="可以转载" value="true" v-model="allowForward" name="reprint">
<label for="可以转载">可以转载</label>
</div>
<div class="input-box">
<input type="radio" id="禁止转载" value="禁止转载" v-model="reprint" name="reprint">
<input type="radio" id="禁止转载" value="false" v-model="allowForward" name="reprint">
<label for="禁止转载">禁止转载</label>
</div>
</div>
......@@ -107,13 +112,17 @@
<div class="blog-release__footer">
<p class="footer__left">上传封面
<img :src="imgSrc" alt="">
<input type="file" @change="e=>changeToUploadCover(e)" placeholder="上传项目封面图">
<input type="file" @change="e=>changeToUploadCover(e)" placeholder="上传项目封面图" >
</p>
<div class="footer__right">
<p>已自动存为草稿</p>
<button class="preview" @click="readScreen">预览</button>
<button class="submit" v-on:click="postblog">提交</button>
<button class="submit" v-on:click="postBlog">提交</button>
<<<<<<< HEAD
</div>
=======
</div>
>>>>>>> caa436abf80933566b76b72acbaa8d43b70d78fc
</div>
</div>
</card-container>
......@@ -122,10 +131,106 @@
</template>
<script>
<<<<<<< HEAD
import CardContainer from "../../../components/pc/cardContainer";
import SelectCard from "../../../components/pc/select/selectCard";
import config from "../../../action/config";
export default {
async asyncData ({ $axios }) {
const blogList = await $axios.$get(config.api.get.Blog.myList,{
params:{
page:1,
size:8,
}
});
return {blogList:blogList.data.dataList}
=======
import CardContainer from "../../../components/pc/cardContainer";
import SelectCard from "../../../components/pc/select/selectCard";
import config from "../../../action/config";
export default {
async asyncData ({ $axios }) {
const blogList = await $axios.$get(config.api.get.Blog.myList,{
params:{
page:1,
size:8,
}
});
return {blogList:blogList.data.dataList}
},
components: {SelectCard, CardContainer},
data() {
return {
markdownOption: {
bold: true, // 粗体
italic: true, // 斜体
header: true, // 标题
underline: true, // 下划线
strikethrough: true, // 中划线
mark: true, // 标记
superscript: true, // 上角标
subscript: true, // 下角标
quote: true, // 引用
ol: true, // 有序列表
ul: true, // 无序列表
link: true, // 链接
imagelink: true, // 图片链接
code: true, // code
table: true, // 表格
fullscreen: true, // 全屏编辑
readmodel: true, // 沉浸式阅读
htmlcode: true, // 展示html源码
help: false, // 帮助
undo: true, // 上一步
redo: true, // 下一步
trash: true, // 清空
save: true, // 保存(触发events中的save事件)
navigation: true, // 导航目录
alignleft: true, // 左对齐
subfield: true, // 单双栏模式
preview: true // 预览
},
zIndex: 100, // 控制全屏时
value: '',
way: '',
comment: '',
reprint: '',
imgSrc: '',
lastSaveTime: new Date(),
classList: [ 'web', 'java', 'javascript']
}
},
methods: {
toDetail(){
this.$router.push('/detail')
},
postBlog(){
this.$axios.$post(config.api.post.Blog.release,{
allowComment: this.allowComment,//评论权限
allowForward: this.allowForward,//转载权限
blogAbstract: this.blogAbstract,
blogContent: this.blogContent,
blogTitle: this.blogTitle,
categoryId: 1,//文章类型
content: "string",
cover: "string",//封面图
originLink: this.originLink,
tagIds: [
"Java"//标签
],
topicIds: [
"Java"//话题
],
viewPrivileges: this.way //1公开,0私有
}).then((response)=>{
//处理response
console.log(response)
})
>>>>>>> caa436abf80933566b76b72acbaa8d43b70d78fc
},
components: {SelectCard, CardContainer},
data() {
return {
......@@ -172,10 +277,20 @@ export default {
}
},
methods: {
toDetail(){
this.$router.push('/detail')
},
// 获得下拉框得内容
handleBlogClass(value) {
this.blogClass = value;
console.log(value);
if(value=="web"){
this.blogClass=1
}else if(value=="java"){
this.blogClass=2
}else if(value=="javascript"){
this.blogClass=3
}
console.log(this.blogClass);
},
handleQuestionClass(value) {
this.class = value;
......@@ -185,25 +300,25 @@ export default {
handleTagList(tagList) {
console.log(tagList);
},
postblog(){
this.handleTag();
postBlog(){
//this.handleTag();
this.$axios.$post(config.api.post.Blog.release,{
allowComment: true,
allowForward: true,
blogAbstract: "是你啊点",
blogContent: "无",
allowComment: this.allowComment,//评论权限
allowForward: this.allowForward,//转载权限
blogAbstract: this.blogAbstract,
content: this.content,
blogTitle: this.blogTitle,
categoryId: 1,
content: "string",
cover: "string",
originLink: "string",
categoryId: this.blogClass,//文章类型
cover: "string",//封面图
originLink: this.originLink,
tagIds: [
"Java"
"Java"//标签id
],
topicIds: [
"Java"
"Java"//话题id
],
viewPrivileges: 1
viewPrivileges: this.way //1公开,0私有
}).then((response)=>{
//处理response
console.log(response)
......@@ -251,7 +366,7 @@ export default {
this.zIndex = 8000
}
}
}
}
</script>
<style lang="scss" scoped>
......@@ -261,6 +376,29 @@ export default {
@extend %flex-row-spb;
align-items: start;
.blog-release-container__l {
.blog-release_List{
<<<<<<< HEAD
width: 266*$length;
=======
>>>>>>> caa436abf80933566b76b72acbaa8d43b70d78fc
@extend %flex-row-spb;
margin-top: 5px;
padding-left: 18*$length;
padding-right: 18*$length;
font-size: 13*$length;
p{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
<<<<<<< HEAD
:hover{
color: #00AAE6;
}
=======
>>>>>>> caa436abf80933566b76b72acbaa8d43b70d78fc
}
}
.blog-release-container__r {
.blog-release {
......@@ -438,3 +576,4 @@ export default {
}
}
</style>
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