| | |
| | | <replyBox ref="commentBoxId" v-bind="$attrs"></replyBox> |
| | | <a-modal v-model="visible" :title="replyTaget" :footer="null" |
| | | :bodyStyle="{'overflow':'overlay','maxHeight': '550px','scrollbarWidth': 'none'}"> |
| | | <replyBox ref="replyBoxId" v-bind="$attrs"></replyBox> |
| | | <replyBox ref="replyBoxId" v-bind="$attrs" @sendMsg="sendMsg()"></replyBox> |
| | | </a-modal> |
| | | <div class="mySecret" v-if="commentListData.length==0"> |
| | | <div class="mySecret" style="max-height:350px ;" v-if="commentListData.length==0"> |
| | | <p>空空如也..</p> |
| | | </div> |
| | | <div v-for="temp in commentListData" class="commentList"> |
| | |
| | | } from '../../api/blogArticleComment.js' |
| | | |
| | | export default { |
| | | props: ["articleId"], |
| | | components: { |
| | | replyBox |
| | | }, |
| | | beforeMount() { |
| | | queryBlogCommentList({ |
| | | pageNo: this.page.current, |
| | | pageSize: this.page.pageSize, |
| | | articleId: this.$attrs.acticleId |
| | | }).then((res) => { |
| | | this.page.total = Number(res.data.total) |
| | | this.page.pageSize = Number(res.data.size); |
| | | this.commentListData = res.data.records; |
| | | return res |
| | | }) |
| | | }, |
| | | methods: { |
| | | onChange(current) { |
| | | this.page.current = current; |
| | | updateCommentList(articleId) { |
| | | queryBlogCommentList({ |
| | | pageNo: this.page.current, |
| | | pageSize: this.page.pageSize, |
| | | articleId: this.$attrs.articleId |
| | | articleId: articleId |
| | | }).then((res) => { |
| | | this.page.total = Number(res.data.total) |
| | | this.page.pageSize = Number(res.data.size); |
| | | this.commentListData = res.data.records; |
| | | }) |
| | | }, |
| | | sendMsg() { |
| | | this.visible = false; |
| | | this.$message.info("列表刷新中..") |
| | | setTimeout(() => { |
| | | this.updateCommentList(this.$attrs.articleId); |
| | | }, 1000); |
| | | }, |
| | | onChange(current) { |
| | | this.page.current = current; |
| | | this.updateCommentList(); |
| | | }, |
| | | loadMore(temp) { |
| | | temp.isHasNext = 0; |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | // articleId: null, |
| | | isAllowedComment: true, |
| | | page: { |
| | | size: "small", |
| | |
| | | } from '../../api/blogArticleComment.js' |
| | | |
| | | export default { |
| | | props: ["articleId"], |
| | | methods: { |
| | | getMsgInfo(param) { |
| | | this.msgInfo = param; |
| | |
| | | this.replyHolder = "@" + this.msgInfo.useName; |
| | | }, |
| | | send() { |
| | | console.log(this.msgInfo); |
| | | console.log(11); |
| | | if (this.form.nickName === "") { |
| | | this.$message.info("怎么称呼..") |
| | | return |
| | |
| | | res = false; |
| | | } |
| | | }); |
| | | var articleId=this.$attrs.acticleId; |
| | | console.log(articleId); |
| | | |
| | | var articleId=this.$attrs.articleId; |
| | | let commentType = (articleId == null || articleId == undefined) ? 1 : 2; |
| | | this.isSending = true; |
| | | |
| | |
| | | }).then((res) => { |
| | | this.isSending = false; |
| | | if (res.code == 200) { |
| | | this.$message.info("已送达,审核通过后显示..") |
| | | this.$emit("sendMsg"); |
| | | this.$message.info("信息已送达..") |
| | | } else { |
| | | this.$notification.error({ |
| | | message: '好像哪里不对劲..', |
| | |
| | | </div> |
| | | </div> |
| | | <div class="articleComment"> |
| | | <comment :acticleId="acticleId"></comment> |
| | | <comment ref="myComment" :articleId="articleId"> </comment> |
| | | </div> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | // import esPath from '../../assets/es.md' |
| | | import VueMarkdown from 'vue-markdown' |
| | | import md5 from 'js-md5'; |
| | | |
| | |
| | | data() { |
| | | return { |
| | | source: "", |
| | | acticleId: "", |
| | | articleId: "", |
| | | showMsg: false, |
| | | myLock: false, |
| | | errorMsg: '', |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.acticleId = this.$route.query.id; |
| | | this.articleId = this.$route.query.id; |
| | | }, |
| | | watch: { |
| | | '$route'(to, from) { |
| | | if ("mdDetail" === to.name) { |
| | | this.acticleId = this.$route.query.id; |
| | | this.articleId = this.$route.query.id; |
| | | } |
| | | }, |
| | | acticleId: function(newValue, oldValue) { |
| | | articleId: function(newValue, oldValue) { |
| | | if (newValue == undefined || newValue == null || newValue == "") { |
| | | this.showMsg = true; |
| | | this.errorMsg = "日志id参数缺失"; |
| | | } else { |
| | | this.queryDetail(); |
| | | this.$refs.myComment.updateCommentList(this.articleId); |
| | | } |
| | | } |
| | | |
| | |
| | | this.showMsg = true; |
| | | this.errorMsg = "加载中.."; |
| | | queryBlogArticleDetail({ |
| | | id: this.acticleId, |
| | | id: this.articleId, |
| | | authWord: this.secret == "" ? null : md5(this.secret) |
| | | }).then((res) => { |
| | | this.showMsg = true; |
| | |
| | | <div class="myFriend" style="min-height: 950px;"> |
| | | |
| | | <h1 style="text-align: center;">碎碎念</h1> |
| | | <comment></comment> |
| | | <comment ref="myComment"></comment> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | export default { |
| | | components: { |
| | | comment |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$refs.myComment.updateCommentList(null); |
| | | }, |
| | | } |
| | | </script> |
| | | |