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 { img {
border-style: none; border-style: none;
} }
/* Forms /* Forms

View File

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

View File

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

View File

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

View File

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

View File

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