Commit 55ab3b0d authored by xishifeng's avatar xishifeng

商学院评论

parent e67e8c6a
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
li>div>div:nth-of-type(1)>img{ li>div>div:nth-of-type(1)>img{
width: .75rem; width: .75rem;
height: .75rem; height: .75rem;
border-radius: .375rem;
} }
li>div>div:nth-of-type(2){} li>div>div:nth-of-type(2){}
li>div>div:nth-of-type(2)>p:nth-of-type(1){ li>div>div:nth-of-type(2)>p:nth-of-type(1){
......
...@@ -23,13 +23,15 @@ ...@@ -23,13 +23,15 @@
<div class="comment-area-seat"></div> <div class="comment-area-seat"></div>
<div class="txt-comment-area" v-show="isCommentingFlag"> <div class="txt-comment-area" v-show="isCommentingFlag">
<div> <div class="mask-comment-area" @click="isCommentingFlag = false"></div>
<div class="real-comment-area">
<div class="flex-center"> <div class="flex-center">
<textarea v-model="commentContent"></textarea> <textarea v-model="commentContent"></textarea>
</div> </div>
<div class="oh"> <div class="oh">
<a class="fl flex-center" href="javascript:;" @click="isCommentingFlag = false">取消</a> <a class="fl flex-center" href="javascript:;" @click="isCommentingFlag = false">取消</a>
<a class="fr flex-center" href="javascript:;" @click="commentSend">发送</a> <a class="fr flex-center" href="javascript:;" @click="commentSend" v-show="!isSending">发送</a>
<a class="fr flex-center" href="javascript:;" v-show="isSending">发送ing</a>
</div> </div>
</div> </div>
</div> </div>
...@@ -76,8 +78,9 @@ ...@@ -76,8 +78,9 @@
articleTime: '', articleTime: '',
articleContent: '', articleContent: '',
commentIcon, commentIcon,
isCommentingFlag: false, isCommentingFlag: false,//是否正在写评论
commentContent: '', commentContent: '',//评论的内容
isSending: false,//是否正在提交评论
isStop: false, isStop: false,
isLoading: false, isLoading: false,
noDataFlag: false, noDataFlag: false,
...@@ -96,6 +99,14 @@ ...@@ -96,6 +99,14 @@
endAction() { endAction() {
_this.isLoading = false; _this.isLoading = false;
} }
},{
'urlStr': '/broker/commentNews',
startAction() {
_this.isSending = true;
},
endAction() {
_this.isSending = false;
}
}); });
_this.axios({ _this.axios({
...@@ -131,7 +142,28 @@ ...@@ -131,7 +142,28 @@
if(_len<100 || _len>500){ if(_len<100 || _len>500){
layer.tipsX('评论字数需在100~500之间,当前字数为'+_len); layer.tipsX('评论字数需在100~500之间,当前字数为'+_len);
}else{ }else{
_this.axios({
method: 'POST',
url: '/broker/commentNews',
responseType: 'json',
data: {
'content': _this.commentContent,
'news_id': _this.articleId,
'AuthToken': _this.token
}
})
.then(function(response) {
if(response.data.code == 200) {
_this.resetCommentList();
_this.getCommentList();
_this.isCommentingFlag = false; _this.isCommentingFlag = false;
} else {
layer.tipsX(response.data.msg);
}
})
.catch(function(error) {
layer.tipsX(error);
});
} }
}, },
getCommentList() { getCommentList() {
...@@ -167,6 +199,13 @@ ...@@ -167,6 +199,13 @@
.catch(function(error) { .catch(function(error) {
layer.tipsX(error); layer.tipsX(error);
}); });
},
resetCommentList() {
//重置评论列表的内容
let _this = this;
_this.commentDataList = [];
_this.page = 1;
_this.noDataFlag = false;
} }
}, },
computed: { computed: {
...@@ -235,7 +274,11 @@ ...@@ -235,7 +274,11 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.txt-comment-area>div{ .mask-comment-area{
width: 100%;
height: 100%;
}
.real-comment-area{
position: fixed; position: fixed;
left: 0; left: 0;
bottom: 0; bottom: 0;
...@@ -243,20 +286,20 @@ ...@@ -243,20 +286,20 @@
height: 2.6rem; height: 2.6rem;
background-color: #f4f4f4; background-color: #f4f4f4;
} }
.txt-comment-area>div>div:nth-of-type(1){ .real-comment-area>div:nth-of-type(1){
height: 1.8rem; height: 1.8rem;
} }
.txt-comment-area>div>div:nth-of-type(1)>textarea{ .real-comment-area>div:nth-of-type(1)>textarea{
width: 6.86rem; width: 6.86rem;
height: 1.4rem; height: 1.4rem;
border: #1px solid #e0e0e0; border: #1px solid #e0e0e0;
border-radius: .1rem; border-radius: .1rem;
background-color: white; background-color: white;
} }
.txt-comment-area>div>div:nth-of-type(2){ .real-comment-area>div:nth-of-type(2){
padding: 0 .3rem; padding: 0 .3rem;
} }
.txt-comment-area>div>div:nth-of-type(2)>a{ .real-comment-area>div:nth-of-type(2)>a{
box-sizing: border-box; box-sizing: border-box;
width: 1.2rem; width: 1.2rem;
height: .6rem; height: .6rem;
...@@ -265,8 +308,12 @@ ...@@ -265,8 +308,12 @@
color: #999; color: #999;
border: 1px solid #e0e0e0; border: 1px solid #e0e0e0;
} }
.txt-comment-area>div>div:nth-of-type(2)>a:nth-of-type(2){ .real-comment-area>div:nth-of-type(2)>a:nth-of-type(2){
background-color: #FA903F; background-color: #FA903F;
color: white; color: white;
} }
.real-comment-area>div:nth-of-type(2)>a:nth-of-type(3){
background-color: #999;
color: white;
}
</style> </style>
\ No newline at end of file
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