Merge branch 'xuebaoxin' of pplokijuhyg/falvpingtai into master

This commit is contained in:
pplokijuhyg 2019-11-28 14:27:23 +08:00
commit a9447c1661
3 changed files with 75 additions and 14 deletions

View File

@ -1,10 +1,10 @@
<template> <template>
<div class="PersonafFollow"> <div class="PersonafFollow">
<div class="center">舆论之于司法利大于弊还是弊大于利</div> <div class="center">{{title}}</div>
<div class="answer"> <div class="answer">
<div class="content"> <div class="content">
<img class="img" src alt srcset /> <img v-if="img == ''?false : true " class="img" :src="'http://lawpro.earnest.pro' + img" alt srcset />
<p>这取决于司法是否独立舆论能影响司法判决结果的只能说明司法肯定不仅仅收到舆论的影响还会收到同样的来自其他多方面的强力的影响这种情况只能说明这取决于司法是否独立舆论能影响司法判决结果的只能说明司法肯定不仅仅收到舆论的影响还会收到同样的来自其他多方面的强力的影响这种情况只能说明</p> <p>{{text}}</p>
</div> </div>
<div class="operation"> <div class="operation">
<div> <div>
@ -13,9 +13,9 @@
</div> </div>
<div> <div>
<img src="../assets/share.png" alt srcset /> <img src="../assets/share.png" alt srcset />
888评论 {{num}}评论
</div> </div>
<div class="more" @click="show = !show"> <div v-show="false" class="more" @click="show = !show">
<div></div> <div></div>
<div></div> <div></div>
<div></div> <div></div>
@ -178,6 +178,7 @@ export default {
return { return {
show:false show:false
}; };
} },
props:["title",'id','img','text','num']
}; };
</script> </script>

View File

@ -2,9 +2,18 @@
<div class="box"> <div class="box">
<heads></heads> <heads></heads>
<div class="list"> <div class="list">
<list></list> <list
<list></list> v-for="(item,index) in list"
<list></list> :key="index"
:title="item.title"
:id="item.id"
:num="item.comment"
:img="item.img"
:text="item.text"
></list>
<div style="width:100%;height:0.5rem;text-align:center;line-height:0.3rem">{{text}}</div>
<!-- <list></list>
<list></list>-->
</div> </div>
</div> </div>
</template> </template>
@ -22,19 +31,70 @@
</style> </style>
<script> <script>
import list from "./components/IndexList"; import list from "./components/IndexList";
import heads from "./components/indexhead" import heads from "./components/indexhead";
export default { export default {
name: "index", name: "index",
data() { data() {
return {}; return {
list: [],
page: 1,
lock:false,
text:"加载中"
};
},
methods: {
getlist(){
if(this.lock){
return 'lock'
}
this.lock = true
var t = this
this.page += 1;
this.axios
.post("http://lawpro.earnest.pro/api/login_main/articleList", {
page: t.page
})
.then(res => {
if (res.data.code == 200) {
t.list = t.list.concat(res.data.data);
t.lock = false
}else{
t.text = "暂无更多"
}
})
}
}, },
methods: {},
components: { components: {
list, list,
heads heads
}, },
mounted() { mounted() {
this.axios.get("") var t = this;
this.axios
.post("http://lawpro.earnest.pro/api/login_main/articleList", {
page: t.page
})
.then(res => {
window.console.log(res.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 = "暂无数据"
}
});
} }
}; };
</script> </script>

0
vue.config.js Normal file
View File