This commit is contained in:
pplokijuhyg 2019-11-28 14:26:56 +08:00
parent 643e692bdc
commit b62c9a1eaa
3 changed files with 75 additions and 14 deletions

View File

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

View File

@ -2,9 +2,18 @@
<div class="box">
<heads></heads>
<div class="list">
<list></list>
<list></list>
<list></list>
<list
v-for="(item,index) in 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>
</template>
@ -22,19 +31,70 @@
</style>
<script>
import list from "./components/IndexList";
import heads from "./components/indexhead"
import heads from "./components/indexhead";
export default {
name: "index",
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: {
list,
heads
},
mounted(){
this.axios.get("")
mounted() {
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>

0
vue.config.js Normal file
View File