Commit 2341938a authored by xinzhedeai's avatar xinzhedeai

通告列表展示、详情展示

parent 94a1b086
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</head> </head>
<body> <body>
<div id="app"> <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> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<body> <body>
<div id="app"> <div id="app">
<div class="content" v-cloak> <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"> <van-cell v-for="(item, index) in list" :key="item">
<div class="list-item-wrapper" @click="detail(index)"> <div class="list-item-wrapper" @click="detail(index)">
<p class=""> <p class="">
......
...@@ -11,7 +11,7 @@ window.addEventListener("load", function() { ...@@ -11,7 +11,7 @@ window.addEventListener("load", function() {
loading: false, loading: false,
finished: false, finished: false,
page: 0, page: 0,
size: 999, size: 10,
total: 0 total: 0
} }
}, },
...@@ -19,40 +19,45 @@ window.addEventListener("load", function() { ...@@ -19,40 +19,45 @@ window.addEventListener("load", function() {
this.getList() this.getList()
}, },
methods: { methods: {
detail(index){ detail(index) {
// location.href = './notice-list-detail.html?noticeId='+this.list[index].noticeId // 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(){ getList() {
if(this.loading){ // if(this.loading){
return // return
} // }
this.loading = true // this.loading = true
http2.post({ setTimeout(() => {
serviceId: API_KEY_MAP["notice-list"]['id'],
interfacePublicKey: API_KEY_MAP["notice-list"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["notice-list"]["privateKey"], http2.post({
reqParams: { serviceId: API_KEY_MAP["notice-list"]['id'],
page: this.page++,// 每次请求增加下一页 interfacePublicKey: API_KEY_MAP["notice-list"]["publicKey"],
size: this.size, interfacePrivateKey: API_KEY_MAP["notice-list"]["privateKey"],
// sort: 'createTime,desc', reqParams: {
} page: this.page++, // 每次请求增加下一页
}, (res) => { size: this.size,
// sort: 'noticeId,desc',
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; // 下滑不在刷新数据
} }
} }, (res) => {
this.loading = false
}) 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