From fd3d93b8a110880928431fe75ba3dcba5b0e7f12 Mon Sep 17 00:00:00 2001 From: hflllll Date: Mon, 15 Sep 2025 15:42:19 +0800 Subject: [PATCH] =?UTF-8?q?'=E4=BF=AEBUG'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/home.vue | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/pages/index/home.vue b/pages/index/home.vue index 9bd6b45..7d72119 100644 --- a/pages/index/home.vue +++ b/pages/index/home.vue @@ -174,18 +174,7 @@ export default { // 轮播图数据 bannerList: [ - { - image: '/static/首页背景图.png', - title: '轮播图1' - }, - { - image: '/static/默认图片.png', - title: '轮播图2' - }, - { - image: '/static/logo.png', - title: '轮播图3' - } + ], // 今日更新数据 @@ -322,14 +311,25 @@ export default { uni.navigateTo({ url: '/subPages/home/directory' }) - } + }, + async getBanner() { + const bannerRes = await this.$api.home.getBanner() + if (bannerRes.code === 200){ + this.bannerList = bannerRes.result.map(item => ({ + image: item.img, + title: item.title + })) + } + }, + }, + + async onShow() { + await this.getBanner() } }