Merge branch 'zhengjie' of pplokijuhyg/falvpingtai into master

This commit is contained in:
asd 2019-12-04 16:30:25 +08:00
commit 530a83e8cb

View File

@ -16,7 +16,13 @@
</div> </div>
<div class="user" v-if="no==2"> <div class="user" v-if="no==2">
<div class="user1" v-for="(i,j) in list" :key="j"> <div class="user1" v-for="(i,j) in list" :key="j">
<indedfinduser :answer="i.answer" :article="i.article" :attention="i.attention" :username="i.topic_name" :pic="'http://lawpro.earnest.pro/'+i.img"></indedfinduser> <indedfinduser
:answer="i.answer"
:article="i.article"
:attention="i.attention"
:username="i.topic_name"
:pic="'http://lawpro.earnest.pro/'+i.img"
></indedfinduser>
</div> </div>
<div style="width:100%;height:0.5rem;text-align:center;line-height:0.3rem">{{text}}</div> <div style="width:100%;height:0.5rem;text-align:center;line-height:0.3rem">{{text}}</div>
@ -34,7 +40,12 @@
<div class="user1" v-for="(i,j) in list" :key="j"> <div class="user1" v-for="(i,j) in list" :key="j">
<!-- klmklvnklnkvl --> <!-- klmklvnklnkvl -->
<!-- <indedfinduser :username="i.topic_name" :pic="'http://lawpro.earnest.pro/'+i.img" :desc="i.text" :ifnum="false" v-if="i.img"></indedfinduser> --> <!-- <indedfinduser :username="i.topic_name" :pic="'http://lawpro.earnest.pro/'+i.img" :desc="i.text" :ifnum="false" v-if="i.img"></indedfinduser> -->
<indedfinduser :username="i.nickname" :pic="'http://lawpro.earnest.pro/'+i.avatar" :desc="i.text" :ifnum="false"></indedfinduser> <indedfinduser
:username="i.nickname"
:pic="'http://lawpro.earnest.pro/'+i.avatar"
:desc="i.text"
:ifnum="false"
></indedfinduser>
</div> </div>
<div style="width:100%;height:0.5rem;text-align:center;line-height:0.3rem">{{text}}</div> <div style="width:100%;height:0.5rem;text-align:center;line-height:0.3rem">{{text}}</div>
@ -49,11 +60,11 @@
</template> </template>
<script> <script>
import indexfindhead from "./components/indexfindhead" import indexfindhead from "./components/indexfindhead";
import indexfindtab from "./components/indexfindtab" import indexfindtab from "./components/indexfindtab";
import indexfindall from "./components/indexfindall" import indexfindall from "./components/indexfindall";
import pics from "./assets/ad.png" import pics from "./assets/ad.png";
import indedfinduser from "./components/indexfinduser" import indedfinduser from "./components/indexfinduser";
export default { export default {
components: { components: {
indexfindhead, indexfindhead,
@ -62,17 +73,80 @@ components:{
indedfinduser indedfinduser
}, },
mounted() { mounted() {
// http://lawpro.earnest.pro/uploads/20191121/145e1911017ac255f25d6eb760d0bb4c.jpg this.getlist1()
var t=this; },
t.axios.post("http://lawpro.earnest.pro/api/login_main/indexsearch", {where:t.$route.query.word,type:this.no}).then((res)=>{ watch: {
// window.console.log(res) no() {
for(let i in res.data.data){ this.page = 0;
res.data.data[i].avatar= res.data.data[i].avatar.substr(1) this.dynamiclist = [];
res.data.data[i].avatar= "http://lawpro.earnest.pro/"+res.data.data[i].avatar this.list = [];
this.lock = false;
// this.getlist1();
this.text="加载中"
} }
// t.list=res.data.data },
beforeRouteLeave(a, b, c) {
window.$(window).scroll(() => {});
c();
},
methods: {
getlist1(){
let t=this;
t.list=[]
t.axios
.post("http://lawpro.earnest.pro/api/login_main/indexsearch", {
where: t.$route.query.word,
type: t.no,
}).then((res)=>{
if(res.data.data){
t.list=res.data.data
window.console.log(t.list.length,"hfihaifohog")
if(t.list.length<5){
t.text="暂无数据"
}
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{
window.console.log("errir")
t.text="暂无数据"
}
})
},
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: t.no,
page: t.page
})
.then(res => {
window.console.log(res);
if (res.data.code == 200) { if (res.data.code == 200) {
t.list = res.data.data; if(res.data.data){
t.list = t.list.concat(res.data.data);
}
t.lock = false;
window.$(window).scroll(() => { window.$(window).scroll(() => {
var windowH = window.$(window).height(); // var windowH = window.$(window).height(); //
var documentH = window.$(document).height(); // var documentH = window.$(document).height(); //
@ -85,143 +159,19 @@ mounted(){
t.getlist(); 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)=>{
// 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
// }
// 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)=>{
// window.console.log(res)
// for(let i in res.data.data){
// 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
// 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:t.no,page: t.page}).then((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
// }
if (res.data.code == 200) {
t.list = t.list.concat(res.data.data);
t.lock = false;
} else { } else {
t.text = "暂无更多"; t.text = "暂无更多";
} }
// t.list=res.data.data // 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) { getno(e) {
window.console.log(e) window.console.log(e);
this.no=e this.no = e;
this.list=[] this.list = [];
// this.page = 0 this.getlist1()
// this.dynamiclist = [] window.console.log(this.list.length,"list")
// this.lock = false;
// this.getlist()
}, },
todetail(e, type) { todetail(e, type) {
window.console.log(e); window.console.log(e);
@ -275,7 +225,6 @@ methods:{
// t.list=res.data.data // t.list=res.data.data
// }) // })
// t.axios.post("http://lawpro.earnest.pro/api/login_main/indexsearch", {where:e,type:2}).then((res)=>{ // t.axios.post("http://lawpro.earnest.pro/api/login_main/indexsearch", {where:e,type:2}).then((res)=>{
// window.console.log(res) // window.console.log(res)
// for(let i in res.data.data){ // for(let i in res.data.data){
@ -305,14 +254,14 @@ data(){
page: 0, page: 0,
lock: false, lock: false,
text: "加载中" text: "加载中"
};
} }
} };
}
</script> </script>
<style lang="scss"> <style lang="scss">
body { body {
background-color: #F6F6F6 background-color: #f6f6f6;
} }
.tab { .tab {
margin-top: 89px; margin-top: 89px;