This commit is contained in:
pplokijuhyg 2019-12-01 15:52:42 +08:00
parent 71fb824b9c
commit 58eb28c680
4 changed files with 190 additions and 167 deletions

View File

@ -14,7 +14,6 @@
:text="item.articlecontent" :text="item.articlecontent"
:comment="item.comment" :comment="item.comment"
:num="item.islike" :num="item.islike"
></follow> ></follow>
</div> </div>
@ -54,7 +53,6 @@
</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"></comment>
</div> </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 />
@ -100,26 +98,33 @@ export default {
}, },
methods: { methods: {
pfb() { pfb() {
window.console.log(this.content) if (localStorage.getItem("token") == "") {
this.axios.post("http://lawpro.earnest.pro/api/login_main/appendComment",{ this.$router.push("/login");
} else {
window.console.log(this.content);
if (this.content != "") {
this.axios
.post("http://lawpro.earnest.pro/api/login_main/appendComment", {
text: this.content, text: this.content,
token:localStorage.getItem('token'), token: localStorage.getItem("token"),
type_id: this.pid, type_id: this.pid,
type: 3 type: 3
}).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 = "";
}
});
}
} }
})
}, },
handleEmotion(i) { handleEmotion(i) {
this.content += i; this.content += i;
}, },
pinglu(id) { pinglu(id) {
this.pid= id this.pid = id;
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"),
@ -127,10 +132,10 @@ this.pinglu(this.pid);
type_id: id type_id: id
}) })
.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 this.show = true;
}); });
} }
}, },
@ -320,5 +325,4 @@ this.pinglu(this.pid);
} }
} }
} }
</style> </style>

View File

@ -196,7 +196,9 @@ export default {
} }
}, },
mounted(){ mounted(){
if(localStorage.getItem('token') == ""){
this.$router.push("/login")
}
this.axios.post('http://lawpro.earnest.pro/api/login_main/getUserDetails',{ this.axios.post('http://lawpro.earnest.pro/api/login_main/getUserDetails',{
token:localStorage.getItem("token") token:localStorage.getItem("token")
}).then((res)=>{ }).then((res)=>{

View File

@ -57,7 +57,7 @@
.logo { .logo {
width: 115px; width: 115px;
height: 37px; height: 37px;
background-color: #000; // background-color: #000;
display: block; display: block;
margin-left: 30px; margin-left: 30px;
} }

View File

@ -12,7 +12,7 @@
<div class="tel yzm"> <div class="tel yzm">
<input type="text" class="shuru tel1" placeholder="输入6位验证码" v-model="yzm" /> <input type="text" class="shuru tel1" placeholder="输入6位验证码" v-model="yzm" />
<button class="getyzm" @click="yz">发送验证码</button> <button class="getyzm" @click="yz">{{yzs}}</button>
</div> </div>
<div class="ale"> <div class="ale">
<p class="alert">未注册手机验证后自动登录</p> <p class="alert">未注册手机验证后自动登录</p>
@ -69,7 +69,9 @@ export default {
yzm: "", yzm: "",
yztoken: "", yztoken: "",
Verification: "", Verification: "",
ifsign: false ifsign: false,
yzs: "获取验证码",
miao: 60
}; };
}, },
methods: { methods: {
@ -86,7 +88,22 @@ export default {
}, },
yz() { yz() {
let yz = ""; let yz = "";
if (this.tel != "") { if (this.tel != "") {
if (this.yzs != "获取验证码") {
return;
} else {
let t = this;
let a = setInterval(() => {
t.yzs = t.miao + "秒";
t.miao = t.miao - 1;
if (t.miao < 0) {
t.miao = 5;
t.yzs = "获取验证码";
clearInterval(a);
}
}, 1000);
}
window.console.log("aaaa"); window.console.log("aaaa");
var t = this; var t = this;
this.axios this.axios