This commit is contained in:
pplokijuhyg 2019-12-03 16:05:02 +08:00
parent be71aae0c7
commit 47c6581bf3
7 changed files with 53 additions and 14 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -149,6 +149,7 @@ sup {
img {
border-style: none;
}
/* Forms

View File

@ -46,14 +46,21 @@
<van-popup v-model="show" position="bottom" :style="{ height: '100%' }" class="linshi">
<div class="top">
<p class="tiao">{{plist.length}}条评论</p>
<p class="qie">
<img class="qiehuan" src="./assets/qiehuan.png" alt srcset /> 切换为时间排序
<p class="qie" @click="shot = shot == 0 ? 1 : 0">
<img class="qiehuan" src="./assets/qiehuan.png" alt srcset /> 切换为{{shot == 0 ? '时间' : "默认"}}排序
</p>
<img class="quit" src="./assets/quit.png" alt @click="show = !show" />
</div>
<div class="bodys">
<comment v-for="(item,index) in plist" :key="index"></comment>
<comment
v-for="(item,index) in plist"
:key="index"
:img="'http://lawpro.earnest.pro/' + item.avatar"
:name="item.nickname"
:text="item.text"
></comment>
</div>
<div class="msg" v-show="msgs">{{msg}}</div>
<div class="reply">
<img @click="biaoqing = !biaoqing" src="./assets/baoqing.png" alt srcset />
<textarea placeholder="写下你的评论..." v-model="content"></textarea>
@ -84,7 +91,10 @@ export default {
list: {},
huida: [],
plist: [],
pid: 0
pid: 0,
msg: "发布成功",
msgs: false,
shot:0
};
},
components: {
@ -113,8 +123,13 @@ export default {
.then(res => {
if (res.data.code == 200) {
this.pinglu(this.pid);
this.content = "";
this.msgs = true
setTimeout(()=>{
this.msgs = false
},2000)
}else{
this.$router.push("/login")
}
});
}
@ -125,20 +140,27 @@ export default {
},
pinglu(id) {
this.pid = id;
this.show = true;
this.axios
.post("http://lawpro.earnest.pro/api/login_main/CommentList", {
token: localStorage.getItem("token"),
type: 2,
type_id: id
type: 3,
type_id: id,
order:this.shot
})
.then(res => {
window.console.log(res);
this.plist = res.data.data.data;
// this.list = res.data.data;
this.show = true;
});
}
},
watch:{
shot(){
this.pinglu(this.pid)
}
},
mounted() {
this.axios
.post("http://lawpro.earnest.pro/api/login_main/mainDetails", {
@ -154,7 +176,7 @@ export default {
.post("http://lawpro.earnest.pro/api/login_main/answerList", {
token: localStorage.getItem("token"),
page: 1,
article_id: 17
article_id: this.$route.query.id
})
.then(res => {
window.console.log(res);
@ -169,6 +191,20 @@ export default {
.box {
.linshi {
z-index: 999999 !important;
.msg {
position: absolute;
padding: 10px;
max-width: 60%;
max-height: 70px;
border-radius: 5px;
background: #666;
box-sizing: border-box;
top:50%;
left: 50%;
transform: translate(-50%, -50%);
color: #fff;
}
.top {
background-color: #fff;
position: absolute;

View File

@ -13,7 +13,7 @@
</div>
<div>
<img src="../assets/pl.png" alt srcset />
{{num}}评论
{{num}}回答
</div>
<div v-show="false" class="more" @click="show = !show">
<div></div>

View File

@ -120,10 +120,10 @@
position: relative;
// overflow: hidden;
> img {
/deep/ img {
width: 690px;
height: 374px;
background-color: #000;
// background-color: #000;
display: block;
margin-top: 39px;
margin-bottom: 32px;

View File

@ -34,6 +34,8 @@
color: #000;
margin-top: 29px;
word-break: break-word;
}
.zan{
font-size: 28px;

View File

@ -143,7 +143,7 @@ export default {
});
break;
case 2:
localStorage.setItem("toekn","")
localStorage.setItem('toekn',"")
this.$router.push({
path: '/login'
});