| | |
| | | <van-uploader :after-read="(file) => afterread(file, index)" multiple> |
| | | <img src="images/pic.png" class="pic" /> |
| | | </van-uploader> |
| | | <img src="images/anonymous.png" class="anonymous" @click="SubmitComment(1,item)" /> |
| | | <div class="notanonymous" v-show="isshownotnm" @click="SubmitComment(2,item)"> |
| | | <img src="images/anonymous.png" class="anonymous" @click="SubmitComment(1,item,index)" /> |
| | | <div class="notanonymous" v-show="isshownotnm" @click="SubmitComment(2,item,index)"> |
| | | <img src="images/notanonymous.png" /> |
| | | </div> |
| | | </div> |
| | |
| | | return { |
| | | isshownotnm: true, |
| | | messageData: [], |
| | | pageswitch: { current: 1, size: 10, descs: "update_time" } |
| | | pageswitch: { current: 1, size: 5, descs: "update_time" }, |
| | | scrollBottom: "", |
| | | lastscrollBottom: "" |
| | | }; |
| | | }, |
| | | |
| | |
| | | mounted() {}, |
| | | methods: { |
| | | getScroll(event) { |
| | | let scrollBottom = |
| | | this.scrollBottom = |
| | | event.target.scrollHeight - |
| | | event.target.scrollTop - |
| | | event.target.clientHeight; |
| | | if (scrollBottom < 200) { |
| | | this.pageswitch.size += 10; |
| | | this.current.current += 1; |
| | | this.getmessagelist(this.pageswitch); |
| | | if (this.scrollBottom < 200) { |
| | | if (this.lastscrollBottom > this.scrollBottom) { |
| | | this.pageswitch.current += 1; |
| | | this.getmessagelist(); |
| | | } |
| | | } |
| | | this.lastscrollBottom = this.scrollBottom; |
| | | }, |
| | | // 获取数据 |
| | | getmessagelist() { |
| | | leaveWordslist(this.pageswitch).then(res => { |
| | | const mergedArray = this.messageData.concat(res.data.data.records); |
| | | this.messageData = mergedArray; |
| | | this.messageData.forEach((item, indexto) => { |
| | | res.data.data.records.forEach((item, indexto) => { |
| | | if (item.imageUrls != "") { |
| | | item.imageUrls = item.imageUrls.split(","); |
| | | } |
| | |
| | | }); |
| | | } |
| | | }); |
| | | const mergedArray = this.messageData.concat(res.data.data.records); |
| | | this.messageData = mergedArray; |
| | | let kehuarray = []; |
| | | if (localStorage.getItem("tokensave") == "111") { |
| | | this.messageData.forEach((item, indexto) => { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | handScroll(event) { |
| | | console.log(event); |
| | | }, |
| | | // 提交评论:1匿名提交,2不匿名提交 |
| | | SubmitComment(key, item) { |
| | | SubmitComment(key, item, index) { |
| | | if (item.inputValue == undefined && item.imageDatatoup == undefined) { |
| | | this.$toast.fail("请输入留言内容"); |
| | | } else { |
| | |
| | | toData.userDept = localStorage.getItem("dept_name"); |
| | | toData.userPost = localStorage.getItem("post_name"); |
| | | } |
| | | leaveWords(toData).then(res => { |
| | | if (res.data.code == 200) { |
| | | this.$toast.success("评论成功"); |
| | | this.getmessagelist(); |
| | | } |
| | | }); |
| | | item.children.push(toData); |
| | | console.log(this.messageData); |
| | | // leaveWords(toData).then(res => { |
| | | // if (res.data.code == 200) { |
| | | // this.$toast.success("评论成功"); |
| | | // this.getmessagelist(); |
| | | // } |
| | | // }); |
| | | } |
| | | }, |
| | | // 删除图片 |
| | |
| | | |
| | | <style scoped lang="scss"> |
| | | .boxliuyan { |
| | | height: 100%; |
| | | height: 100vh; |
| | | overflow: auto; |
| | | .Stay { |
| | | width: 100%; |