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,27 +19,31 @@ window.addEventListener("load", function() { ...@@ -19,27 +19,31 @@ 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
setTimeout(() => {
http2.post({ http2.post({
serviceId: API_KEY_MAP["notice-list"]['id'], serviceId: API_KEY_MAP["notice-list"]['id'],
interfacePublicKey: API_KEY_MAP["notice-list"]["publicKey"], interfacePublicKey: API_KEY_MAP["notice-list"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["notice-list"]["privateKey"], interfacePrivateKey: API_KEY_MAP["notice-list"]["privateKey"],
reqParams: { reqParams: {
page: this.page++,// 每次请求增加下一页 page: this.page++, // 每次请求增加下一页
size: this.size, size: this.size,
// sort: 'createTime,desc', // sort: 'noticeId,desc',
} }
}, (res) => { }, (res) => {
if(res){ if (res) {
console.log('接口回调数据', JSON.parse(res)) console.log('接口回调数据', JSON.parse(res))
var result = JSON.parse(res) var result = JSON.parse(res)
...@@ -47,12 +51,13 @@ window.addEventListener("load", function() { ...@@ -47,12 +51,13 @@ window.addEventListener("load", function() {
this.list.push(...result.content); this.list.push(...result.content);
this.total = result.totalElements this.total = result.totalElements
if(this.page*this.size >= this.total){ if (this.page * this.size >= this.total) {
this.finished = true; // 下滑不在刷新数据 this.finished = true; // 下滑不在刷新数据
} }
} }
this.loading = false 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