修改公告拦保存到本地
This commit is contained in:
parent
e8944b3ad1
commit
716ef3657a
|
|
@ -2,7 +2,7 @@
|
|||
"version" : "1.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"playground" : "custom",
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue