Commit 1b5e4c39 by 高浩杰

博客问答标签必选取消 修改推荐标签样式

parent ebb9a65c
...@@ -219,6 +219,7 @@ export default { ...@@ -219,6 +219,7 @@ export default {
this.list.push({ this.list.push({
tagId: item.tagId, tagId: item.tagId,
tag: item.tagName, tag: item.tagName,
referenceCount: item.referenceCount,
tagType: item.tagType tagType: item.tagType
}) })
}) })
......
<template> <template>
<div class="tag-box"> <div class="tag-box">
<p v-if="!isHot" @click="handleClick">{{item.tag}}</p> <p v-if="!isHot" @click="handleClick">{{item.tag}}</p>
<div v-if="isHot" @click="handleClick" :style="{backgroundColor: bgColor}">{{item.tag}}</div> <div v-if="isHot" @click="handleClick">{{item.tag}}{{item.referenceCount}}</div>
</div> </div>
</template> </template>
...@@ -21,17 +21,6 @@ export default { ...@@ -21,17 +21,6 @@ export default {
console.log(this.item); console.log(this.item);
this.$emit('select', this.item.tag, this.item.tagId); this.$emit('select', this.item.tag, this.item.tagId);
} }
},
created() {
if (this.isHot) {
if (this.index % 2 === 0) {
this.bgColor = '#38d3e9'
} else if (this.index % 3 === 0) {
this.bgColor = '#FF7474'
} else {
this.bgColor = '#75D098'
}
}
} }
} }
</script> </script>
...@@ -41,12 +30,12 @@ export default { ...@@ -41,12 +30,12 @@ export default {
display: inline-block; display: inline-block;
> div { > div {
display: inline-block; display: inline-block;
margin: 5*$length 7*$length; margin: 2*$length 5*$length 8*$length 8*$length;
padding: 5*$length 7*$length; padding: 2*$length 9*$length;
@extend %cursorPointer; @extend %cursorPointer;
@include border-radius(4*$length); @include border-radius(2*$length);
background-color: orange; background-color: #F4F8FA;
@include fontStyle(14, 20, 500, #fff, center); @include fontStyle(12, 22, 500, #999, center);
} }
> p { > p {
width: 275*$length; width: 275*$length;
......
...@@ -187,9 +187,9 @@ ...@@ -187,9 +187,9 @@
//参数判断 //参数判断
dataPostQuestion(){ dataPostQuestion(){
console.log(this.tagList); // console.log(this.tagList);
console.log(Array.from(this.tagList)); // console.log(Array.from(this.tagList));
console.log(this.questionTitle.slice(this.questionTitle.length-1,this.questionTitle.length)); // console.log(this.questionTitle.slice(this.questionTitle.length-1,this.questionTitle.length));
if(this.questionTitle==='' if(this.questionTitle===''
){ ){
this.$refs.questionTitle.focus(); this.$refs.questionTitle.focus();
...@@ -207,16 +207,16 @@ ...@@ -207,16 +207,16 @@
}); });
return false; return false;
} }
if(Array.from(this.tagList).length===0){ // if(Array.from(this.tagList).length===0){
//this.$refs.tagIds.focus(); // //this.$refs.tagIds.focus();
this.$refs.tagIds.handleShow(); // this.$refs.tagIds.handleShow();
this.$refs.tagIds.$refs.tag.focus(); // this.$refs.tagIds.$refs.tag.focus();
this.$message({ // this.$message({
message: "请添加或创建您的问题标签", // message: "请添加或创建您的问题标签",
type: 'warning' // type: 'warning'
}); // });
return false; // return false;
} // }
if(this.blogClass===''){ if(this.blogClass===''){
this.$refs.blogClass.handleShow(); this.$refs.blogClass.handleShow();
this.$refs.blogClass.$refs.select.focus(); this.$refs.blogClass.$refs.select.focus();
......
...@@ -336,19 +336,19 @@ export default { ...@@ -336,19 +336,19 @@ export default {
}); });
return false; return false;
} }
if (Array.from(this.tagList).length === 0) { // if (Array.from(this.tagList).length === 0) {
this.$refs.tagIds.handleShow(); // this.$refs.tagIds.handleShow();
this.$refs.tagIds.$refs.tag.focus(); // this.$refs.tagIds.$refs.tag.focus();
this.$message({ // this.$message({
message: "请添加或创建您的博客标签", // message: "请添加或创建您的博客标签",
type: 'warning' // type: 'warning'
}); // });
return false; // return false;
} // }
if (this.originLink !== '') { if (this.originLink !== '') {
let reg = /^(?=^.{3,255}$)((http|https|ftp)?:\/\/)?(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/)?(?:\/(.+)\/?$)?(\/\w+\.\w+)*([\?&]\w+=\w*|[\u4e00-\u9fa5]+)*$/; let reg = /^(?=^.{3,255}$)((http|https|ftp)?:\/\/)?(www\.)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:\d+)*(\/)?(?:\/(.+)\/?$)?(\/\w+\.\w+)*([\?&]\w+=\w*|[\u4e00-\u9fa5]+)*$/;
if (this.originLink === "无" || reg.test(this.originLink)) { if (this.originLink === "无" || reg.test(this.originLink)) {
this.dataPostSaveUserInfo(); this.dataPostBlog();
return false; return false;
} else if (!reg.test(this.originLink)) { } else if (!reg.test(this.originLink)) {
this.$refs.originLink.focus(); this.$refs.originLink.focus();
...@@ -360,11 +360,11 @@ export default { ...@@ -360,11 +360,11 @@ export default {
} }
} else { } else {
this.originLink = '无'; this.originLink = '无';
this.dataPostSaveUserInfo() this.dataPostBlog()
} }
}, },
dataPostSaveUserInfo() { dataPostBlog() {
if (this.$route.query.id) { if (this.$route.query.id) {
this.$axios.$put(config.api.put.Blog.revise + this.$route.query.id, { this.$axios.$put(config.api.put.Blog.revise + this.$route.query.id, {
allowComment: this.allowComment,//评论权限 allowComment: this.allowComment,//评论权限
......
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