修改公告拦保存到本地

This commit is contained in:
duan 2025-03-05 13:27:30 +08:00
parent e8944b3ad1
commit 716ef3657a
2 changed files with 28 additions and 10 deletions

View File

@ -2,7 +2,7 @@
"version" : "1.0",
"configurations" : [
{
"playground" : "custom",
"playground" : "standard",
"type" : "uni-app:app-android"
},
{

View File

@ -67,7 +67,7 @@
<!-- #endif -->
<!-- 公告弹窗 -->
<up-modal :show="datas.stopShows" :showConfirmButton="true" title="公告" @confirm="confirmEvent ">
<up-modal :show="datas.stopShows&&datas.isExamine" :showConfirmButton="true" title="公告" @confirm="confirmEvent ">
<view class="color-red u-text-left">
<view style="text-align: justify;font-size: 18px;color: #666;"
v-html="datas.noticeList[datas.cloneNum].title"></view>
@ -169,11 +169,36 @@
++datas.page
getrecomVideo()
})
//
async function getMsg() {
let res = await messageselectMessage()
let arr = []
let ids = uni.getStorageSync('ids')
res.list.forEach(ele => {
if (ids.length) {
if (ids.indexOf(ele.id) == -1) {
arr.push(ele)
}
} else {
uni.setStorageSync('ids', [res.list[0].id]);
arr.push(ele)
}
})
datas.noticeList = arr
if (arr.length) {
if (ids.length) {
uni.setStorageSync('ids', [...uni.getStorageSync('ids'), datas.noticeList[datas.cloneNum].id]);
}
datas.stopShows = true
}
}
function confirmEvent() {
datas.stopShows = false
if (datas.cloneNum < datas.noticeList.length - 1) {
++datas.cloneNum
uni.setStorageSync('ids', [...uni.getStorageSync('ids'), datas.noticeList[datas.cloneNum].id]);
datas.stopShows = true
}
}
@ -304,14 +329,7 @@
});
}
//
async function getMsg() {
let res = await messageselectMessage()
datas.noticeList = res.list
if (res.list.length) {
datas.stopShows = true
}
}
//
async function getrecomVideo(sort, active = 1) {
datas.active = active