From eb7103fe4f2f05864e8cfc4fedf98fe98ee55ab1 Mon Sep 17 00:00:00 2001 From: "1173117610@qq.com" Date: Sat, 9 May 2026 17:37:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 12 +- pages/detail/detail.vue | 620 ++++++++++++++++++++++++++++++++++++++++ pages/index/index.vue | 15 +- 3 files changed, 641 insertions(+), 6 deletions(-) create mode 100644 pages/detail/detail.vue diff --git a/pages.json b/pages.json index 869105d..78589ad 100644 --- a/pages.json +++ b/pages.json @@ -1,9 +1,15 @@ { - "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + "pages": [ { "path": "pages/index/index", "style": { - "navigationBarTitleText": "uni-app" + "navigationBarTitleText": "首页" + } + }, + { + "path": "pages/detail/detail", + "style": { + "navigationStyle": "custom" } } ], @@ -14,4 +20,4 @@ "backgroundColor": "#F8F8F8" }, "uniIdRouter": {} -} +} \ No newline at end of file diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue new file mode 100644 index 0000000..043934b --- /dev/null +++ b/pages/detail/detail.vue @@ -0,0 +1,620 @@ + + + + + diff --git a/pages/index/index.vue b/pages/index/index.vue index 0468271..5986820 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -108,7 +108,7 @@ - + @@ -174,7 +174,7 @@ - + 🎂 @@ -217,7 +217,7 @@ - + 🎂 @@ -346,6 +346,12 @@ } }); }, + goToDetail(id) { + console.log('正在跳转到详情页,商品ID:', id); + uni.navigateTo({ + url: `/pages/detail/detail?id=${id}` + }); + }, getBottomBar() { uni.request({ url: 'https://api.cmspro.haodanku.com/bottomBar/lists?cid=qOstW90', @@ -390,6 +396,7 @@ } return { + id: item.id, image: item.itempic, title: item.itemshorttitle, finalPrice: item.itemendprice, @@ -412,6 +419,7 @@ if (res.data && res.data.code === 200) { const formatData = (list) => { return list.map(item => ({ + id: item.id, img: item.itempic, title: item.itemshorttitle, label1: item.label && item.label[0] ? item.label[0] : '', @@ -443,6 +451,7 @@ desc: shop.title || '官方直降 爆款秒杀', tags: shop.label ? shop.label.slice(0, 2) : ['抢限量大额券', '霸榜天猫3大榜单'], items: (shop.items || []).slice(0, 3).map(goods => ({ + id: goods.id, img: goods.itempic, title: goods.itemshorttitle, sold: goods.itemsale >= 10000 ? (goods.itemsale / 10000).toFixed(1) + '万' : goods.itemsale,