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 @@
+
+
+
+
+ 〈
+
+
+
+
+
+
+
+
+
+
+ {{ currentSwiper + 1 }}/{{ product.images.length }}
+
+
+
+
+
+ 🏆
+ 实时热销榜第{{ product.rank }}名
+
+
+ 今日已有{{ product.todaySale }}人下单
+
+
+
+
+
+
+
+ 券后¥
+ {{ product.price.split('.')[0] }}
+ .{{ product.price.split('.')[1] || '00' }}
+ ¥{{ product.oldPrice }}
+
+ 已售 {{ product.totalSale }} 件
+
+
+
+ {{ product.platform }}
+ {{ product.title }}
+
+
+
+ {{ product.timeTag }}
+ {{ product.couponVal }}元
+
+
+
+
+
+
+
+
+ {{ product.couponVal }}
+ 元优惠券
+
+ 使用期限: {{ product.couponTime }}
+
+
+ 立即领券
+
+
+
+
+
+
+
+
+
+
+ 宝贝描述 {{ product.scores.desc }} ↑
+ 卖家服务 {{ product.scores.service }} ↑
+ 物流服务 {{ product.scores.post }} ↑
+
+
+
+
+
+ 商品详情
+
+
+
+
+
+
+
+
+
+
+
+ 🏠
+ 首页
+
+
+ 📤
+ 分享
+
+
+
+ 复制口令购买
+ 领券购买
+
+
+
+
+
+
+
+
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,