From 8eb2c136b975f2484a6e8b5a20ce7195ad8f2852 Mon Sep 17 00:00:00 2001 From: sdaduanbilei Date: Mon, 1 Dec 2025 17:32:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE=E6=89=80=E5=B1=9E=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/garden/index.wxml | 2 +- pages/index/index.js | 17 +++++++++++++++++ pages/index/index.wxml | 16 ++++++++-------- project.private.config.json | 14 +------------- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/pages/garden/index.wxml b/pages/garden/index.wxml index 6f79173..ec9abcf 100644 --- a/pages/garden/index.wxml +++ b/pages/garden/index.wxml @@ -37,7 +37,7 @@ - {{item.plant.name}} + {{item.name}} 立即完成 已完成 跳过 diff --git a/pages/index/index.js b/pages/index/index.js index 43bae7a..47af646 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -16,6 +16,7 @@ Page({ rightList: [], leftHeight: 0, rightHeight: 0, + hotList:[] }, /** @@ -48,6 +49,10 @@ Page({ if (res.data === null) { return } + if (res.data.list.length === 0) { + this.fetchHotList() + return + } this.setData({leftList:[],rightList:[]}) const tmps = res.data.list.map(e => { e.pic = e.imgList[0].url @@ -64,6 +69,18 @@ Page({ }) }, + fetchHotList(){ + api('/library/list','POST',{isHot:0,current:0,pageSize:6},'json').then(res => { + if (res.code === 200){ + const data = res.data.list.map(e => { + e.pic = e.imgList[0].url + return e + }) + this.setData({hotList:data}) + } + }) + }, + addItems(newItems) { let h1 = 0; let h2 = 0; diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 35a202d..7ea2a45 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -64,14 +64,14 @@ - + 今日需养护 - - + + 今日无需养护 @@ -97,14 +97,14 @@ 您还可以从以下热门植物中,免费领取 - - + + - 绿萝 - 超好养 + {{item.name}} + {{item.genus}} - 日照充足、超级好养 + {{item.lifeCycle}} {{item.lightIntensity}} diff --git a/project.private.config.json b/project.private.config.json index 5e67f92..0c9a4af 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -20,17 +20,5 @@ "bigPackageSizeSupport": false }, "libVersion": "3.10.1", - "condition": { - "miniprogram": { - "list": [ - { - "name": "pages/community/add", - "pathName": "pages/community/add", - "query": "", - "scene": null, - "launchMode": "default" - } - ] - } - } + "condition": {} } \ No newline at end of file