From 716ef3657a75ea81a0f74aaad1153d24447963d1 Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Wed, 5 Mar 2025 13:27:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=AC=E5=91=8A=E6=8B=A6?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=88=B0=E6=9C=AC=E5=9C=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 2 +- pages/index/index.vue | 36 +++++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 576f2b0..a814c8a 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -2,7 +2,7 @@ "version" : "1.0", "configurations" : [ { - "playground" : "custom", + "playground" : "standard", "type" : "uni-app:app-android" }, { diff --git a/pages/index/index.vue b/pages/index/index.vue index e6a841d..4aad84f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -67,7 +67,7 @@ - + @@ -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