Commit 2341938a authored by xinzhedeai's avatar xinzhedeai

通告列表展示、详情展示

parent 94a1b086
......@@ -21,7 +21,7 @@
</head>
<body>
<div id="app">
<div class="content" v-cloak v-html="noticeContent" style="padding:0.15rem"></div>
<div class="content" v-cloak style="font-size: 0.48rem; padding:0.15rem" v-html="noticeContent"></div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -18,7 +18,7 @@
<body>
<div id="app">
<div class="content" v-cloak>
<van-list v-model:loading="loading" :offset="10" :finished="finished" finished-text="没有更多了" @load="getList">
<van-list v-model:loading="loading" :offset="10" :finished="finished" finished-text="没有更多了" @load="getList" :immediate-check="false">
<van-cell v-for="(item, index) in list" :key="item">
<div class="list-item-wrapper" @click="detail(index)">
<p class="">
......
......@@ -11,7 +11,7 @@ window.addEventListener("load", function() {
loading: false,
finished: false,
page: 0,
size: 999,
size: 10,
total: 0
}
},
......@@ -19,40 +19,45 @@ window.addEventListener("load", function() {
this.getList()
},
methods: {
detail(index){
detail(index) {
// location.href = './notice-list-detail.html?noticeId='+this.list[index].noticeId
gemhoUtil.navigatePage('./notice-list-detail.html?noticeId='+this.list[index].noticeId)
gemhoUtil.navigatePage('./notice-list-detail.html?noticeId=' + this.list[index]
.noticeId)
},
getList(){
if(this.loading){
return
}
this.loading = true
http2.post({
serviceId: API_KEY_MAP["notice-list"]['id'],
interfacePublicKey: API_KEY_MAP["notice-list"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["notice-list"]["privateKey"],
reqParams: {
page: this.page++,// 每次请求增加下一页
size: this.size,
// sort: 'createTime,desc',
}
}, (res) => {
if(res){
console.log('接口回调数据', JSON.parse(res))
var result = JSON.parse(res)
this.loading = false; // 加载状态结束
this.list.push(...result.content);
this.total = result.totalElements
if(this.page*this.size >= this.total){
this.finished = true; // 下滑不在刷新数据
getList() {
// if(this.loading){
// return
// }
// this.loading = true
setTimeout(() => {
http2.post({
serviceId: API_KEY_MAP["notice-list"]['id'],
interfacePublicKey: API_KEY_MAP["notice-list"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["notice-list"]["privateKey"],
reqParams: {
page: this.page++, // 每次请求增加下一页
size: this.size,
// sort: 'noticeId,desc',
}
}
this.loading = false
})
}, (res) => {
if (res) {
console.log('接口回调数据', JSON.parse(res))
var result = JSON.parse(res)
this.loading = false; // 加载状态结束
this.list.push(...result.content);
this.total = result.totalElements
if (this.page * this.size >= this.total) {
this.finished = true; // 下滑不在刷新数据
}
}
this.loading = false
})
}, 0)
}
},
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment