Merge branch 'master' into xuebaoxin

This commit is contained in:
pplokijuhyg 2019-12-03 16:06:41 +08:00
commit 82cdd08ef3
2 changed files with 138 additions and 6 deletions

View File

@ -8,6 +8,8 @@
<div class="all1" v-for="(i,j) in list" :key="j" @click="todetail(i.id,i.type)">
<indexfindall :title="i.title" :num="i.comment" :right="i.avatar" :content="i.text"></indexfindall>
</div>
<div style="width:100%;height:0.5rem;text-align:center;line-height:0.3rem">{{text}}</div>
<!-- <div class="all1">
<indexfindall title="学法律后,对你最大的影响或改变是什么?" num="1532" :right="pics"></indexfindall>
</div> -->
@ -16,6 +18,8 @@
<div class="user1" v-for="(i,j) in list2" :key="j">
<indedfinduser :answer="i.answer" :article="i.article" :attention="i.attention" :username="i.nickname" :pic="i.avatar"></indedfinduser>
</div>
<div style="width:100%;height:0.5rem;text-align:center;line-height:0.3rem">{{text}}</div>
<!-- <div class="user1">
<indedfinduser></indedfinduser>
</div>
@ -31,6 +35,8 @@
<!-- klmklvnklnkvl -->
<indedfinduser :username="i.topic_name" :pic="i.img" :desc="i.text" :ifnum="false"></indedfinduser>
</div>
<div style="width:100%;height:0.5rem;text-align:center;line-height:0.3rem">{{text}}</div>
<!-- <div class="user1">
<indedfinduser></indedfinduser>
</div> -->
@ -58,12 +64,29 @@ mounted(){
// http://lawpro.earnest.pro/uploads/20191121/145e1911017ac255f25d6eb760d0bb4c.jpg
var t=this;
t.axios.post("http://lawpro.earnest.pro/api/login_main/indexsearch", {where:t.$route.query.word,type:0}).then((res)=>{
window.console.log(res)
// window.console.log(res)
for(let i in res.data.data){
res.data.data[i].avatar= res.data.data[i].avatar.substr(1)
res.data.data[i].avatar= "http://lawpro.earnest.pro/"+res.data.data[i].avatar
}
t.list=res.data.data
// t.list=res.data.data
if (res.data.code == 200) {
t.list = res.data.data;
window.$(window).scroll(() => {
var windowH = window.$(window).height(); //
var documentH = window.$(document).height(); //
var scrollH = window.$(window).scrollTop(); //
// scrollH = $(document).scrollTop();
if (windowH + scrollH >= documentH) {
// do something
// alert(2);
window.console.log(1);
t.getlist();
}
});
} else {
t.text = "暂无数据";
}
})
t.axios.post("http://lawpro.earnest.pro/api/login_main/indexsearch", {where:t.$route.query.word,type:5}).then((res)=>{
@ -72,7 +95,24 @@ mounted(){
res.data.data[i].avatar= res.data.data[i].avatar.substr(1)
res.data.data[i].avatar= "http://lawpro.earnest.pro/"+res.data.data[i].avatar
}
t.list2=res.data.data
if (res.data.code == 200) {
t.list2 = res.data.data;
window.$(window).scroll(() => {
var windowH = window.$(window).height(); //
var documentH = window.$(document).height(); //
var scrollH = window.$(window).scrollTop(); //
// scrollH = $(document).scrollTop();
if (windowH + scrollH >= documentH) {
// do something
// alert(2);
window.console.log(1);
t.getlist();
}
});
} else {
t.text = "暂无数据";
}
// t.list2=res.data.data
})
t.axios.post("http://lawpro.earnest.pro/api/login_main/indexsearch", {where:t.$route.query.word,type:2}).then((res)=>{
@ -81,15 +121,104 @@ mounted(){
res.data.data[i].img= res.data.data[i].img.substr(1)
res.data.data[i].img= "http://lawpro.earnest.pro/"+res.data.data[i].img
}
t.list3=res.data.data
// t.list3=res.data.data
if (res.data.code == 200) {
t.list3 = res.data.data;
window.$(window).scroll(() => {
var windowH = window.$(window).height(); //
var documentH = window.$(document).height(); //
var scrollH = window.$(window).scrollTop(); //
// scrollH = $(document).scrollTop();
if (windowH + scrollH >= documentH) {
// do something
// alert(2);
window.console.log(1);
t.getlist();
}
});
} else {
t.text = "暂无数据";
}
})
},
watch:{
no(){
this.page = 0
this.dynamiclist = []
this.lock = false;
this.getlist()
}
},
beforeRouteLeave(a,b,c){
window.$(window).scroll(() => {
});
c()
},
methods:{
getlist() {
if (this.lock) {
return "lock";
}
this.lock = true;
var t = this;
t.page += 1;
t.axios.post("http://lawpro.earnest.pro/api/login_main/indexsearch", {where:t.$route.query.word,type:0,page: t.page}).then((res)=>{
window.console.log(res)
for(let i in res.data.data){
if (res.data.code == 200) {
t.list = t.list.concat(res.data.data);
t.lock = false;
} else {
t.text = "暂无更多";
}
res.data.data[i].avatar= res.data.data[i].avatar.substr(1)
res.data.data[i].avatar= "http://lawpro.earnest.pro/"+res.data.data[i].avatar
}
t.list=res.data.data
})
t.axios.post("http://lawpro.earnest.pro/api/login_main/indexsearch", {where:t.$route.query.word,type:5,page: t.page}).then((res)=>{
window.console.log(res)
if (res.data.code == 200) {
t.list = t.list.concat(res.data.data);
t.lock = false;
} else {
t.text = "暂无更多";
}
for(let i in res.data.data){
res.data.data[i].avatar= res.data.data[i].avatar.substr(1)
res.data.data[i].avatar= "http://lawpro.earnest.pro/"+res.data.data[i].avatar
}
t.list2=res.data.data
})
t.axios.post("http://lawpro.earnest.pro/api/login_main/indexsearch", {where:t.$route.query.word,type:2,page: t.page}).then((res)=>{
window.console.log(res)
for(let i in res.data.data){
if (res.data.code == 200) {
t.list = t.list.concat(res.data.data);
t.lock = false;
} else {
t.text = "暂无更多";
}
res.data.data[i].img= res.data.data[i].img.substr(1)
res.data.data[i].img= "http://lawpro.earnest.pro/"+res.data.data[i].img
}
t.list3=res.data.data
})
},
getno(e){
window.console.log(e)
this.no=e
// this.page = 0
// this.dynamiclist = []
// this.lock = false;
// this.getlist()
},
todetail(e, type) {
window.console.log(e);
@ -141,7 +270,10 @@ data(){
list:[],
list1:[],
list2:[],
list3:[]
list3:[],
page:0,
lock:false,
text: "加载中"
}
}
}

View File

@ -114,7 +114,7 @@ export default {
isshow() {
// this.show = !this.show;
this.$router.push({
path: `/index`
path: `/`
});
},
shuru(){