From 77e1611c3de4847e7531fc983afdd280a25dd7ff Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Wed, 15 Jan 2025 22:59:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/product/productItem.vue | 69 +++++++++++++++++++++++++++--- manifest.json | 5 +-- pages/index/category.vue | 6 ++- pages_order/product/productDetail.vue | 80 ++++++++++++++++++++++++++++++++++- 4 files changed, 148 insertions(+), 12 deletions(-) diff --git a/components/product/productItem.vue b/components/product/productItem.vue index 5af2c62..adf0aee 100644 --- a/components/product/productItem.vue +++ b/components/product/productItem.vue @@ -15,9 +15,8 @@ - + {{ getPriceByRole(item) }} /元每件 @@ -29,6 +28,59 @@ + --> + + + + ¥{{ item.price }} + /元每件 + + + ¥{{ item.oldPrice }} + /元 + + + + + + + + ¥{{ item.goldPrice }} + /元每件 + + + + + + + + + ¥{{ item.silverPrice }} + /元每件 + + + + + + + + + + ¥{{ item.diamondPrice }} + /元每件 + + + + + @@ -67,7 +119,6 @@ }, data() { return { - } }, methods: { @@ -127,7 +178,9 @@ width: calc(100% - 180rpx); box-sizing: border-box; overflow: hidden; - + display: flex; + flex-direction: column; + gap: 10rpx; // 商品标题 .title { font-size: 28rpx; @@ -143,7 +196,7 @@ align-items: center; color: #f40; font-size: 26rpx; - + align-items: flex-end; .money { font-size: 30rpx; @@ -163,6 +216,11 @@ } } } + .oldPrice{ + color: #999; + font-size: 18rpx; + text-decoration: line-through; + } // 销量 .sales-volume { @@ -192,6 +250,7 @@ display: inline-block; padding: 10rpx 20rpx; border-radius: 10rpx; + width: fit-content; } } } diff --git a/manifest.json b/manifest.json index 4c34af0..86c6e68 100644 --- a/manifest.json +++ b/manifest.json @@ -58,14 +58,11 @@ }, "usingComponents" : true, "permission" : { - "scope.userLocation" : { - "desc" : "你的位置信息将用于小程序位置接口的效果展示" - }, "scope.userFuzzyLocation" : { "desc" : "你的位置信息将用于小程序位置接口的效果展示" } }, - "requiredPrivateInfos" : [ "chooseLocation", "getLocation" ] + "requiredPrivateInfos" : [ "chooseLocation" ] }, "mp-alipay" : { "usingComponents" : true diff --git a/pages/index/category.vue b/pages/index/category.vue index 8e4d56e..272cb07 100644 --- a/pages/index/category.vue +++ b/pages/index/category.vue @@ -15,9 +15,11 @@ - + keyName="title" + @change="change"> {{ productDetail.title }} + + + + ¥{{ productDetail.price }} + /元每件 + + + ¥{{ productDetail.oldPrice }} + /元 + + + + + + ¥{{ productDetail.goldPrice }} + /元每件 + + + + + + + + + ¥{{ productDetail.silverPrice }} + /元每件 + + + + + + + + + + ¥{{ productDetail.diamondPrice }} + /元每件 + + + + + + @@ -125,7 +169,9 @@ .info { padding: 20rpx; background-color: #fff; - + display: flex; + flex-direction: column; + gap: 14rpx; .title { font-size: 36rpx; font-weight: 900; @@ -161,6 +207,38 @@ text-align: right; } } + + // 价格 + .price { + display: flex; + align-items: center; + color: #f40; + font-size: 30rpx; + align-items: flex-end; + .money { + font-size: 30rpx; + + .unit { + font-size: 24rpx; + } + } + + .price-imgs { + display: flex; + flex-wrap: wrap; + + .price-img { + width: 80rpx; + height: 30rpx; + margin-left: 10rpx; + } + } + } + .oldPrice{ + color: #999; + font-size: 24rpx; + text-decoration: line-through; + } // 商品详情 .item-line {