From 690c2d1833240d5ffb2c759375a38f1c03c3b1b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Mon, 28 Jul 2025 17:38:48 +0800 Subject: [PATCH] =?UTF-8?q?feat=20:=20=E5=95=86=E5=9F=8E=E9=A1=B5=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=BD=93=E6=97=A5=E8=BE=BE=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/homeServer/serverInfo/index.vue | 2 +- packages/shop/index/index.css | 41 ++++++++++++++++---- packages/shop/index/index.vue | 49 +++++++++++++++++++----- packages/shop/shopCar/index.vue | 4 +- 4 files changed, 76 insertions(+), 20 deletions(-) diff --git a/packages/homeServer/serverInfo/index.vue b/packages/homeServer/serverInfo/index.vue index 05bf3a4b..2b572e68 100644 --- a/packages/homeServer/serverInfo/index.vue +++ b/packages/homeServer/serverInfo/index.vue @@ -179,7 +179,7 @@ export default { NavgateTo("../vendor/index"); }, selectMaster() { - NavgateTo("../chooseMaster/index"); + NavgateTo("../searchInfo/index"); }, lookImage(item, index) { // 提取所有图片URL diff --git a/packages/shop/index/index.css b/packages/shop/index/index.css index 6ef2055d..b32b66ae 100644 --- a/packages/shop/index/index.css +++ b/packages/shop/index/index.css @@ -158,6 +158,7 @@ page { overflow: hidden; position: relative; overflow-y: auto; + margin-bottom: 150rpx; } .CateInfo_tit { @@ -197,7 +198,28 @@ page { height: 140rpx; border-radius: 20rpx 20rpx 20rpx 20rpx; overflow: hidden; - margin-right: 3rpx; + margin-right: 15rpx; + position: relative; +} + +.tag { + background-color: #ff7d00; + color: white; + font-size: 22rpx; + padding: 5rpx 10rpx; + border-radius: 20rpx 0 20rpx 20rpx; +} + +.tag-img { + position: absolute; + top: 0; + left: 0; + z-index: 1; +} + +.tag-text { + display: inline-block; + vertical-align: middle; margin-right: 20rpx; } @@ -485,8 +507,12 @@ page { .GGItem_Image { width: 120rpx; height: 100rpx; - border-radius: 20rpx 20rpx 20rpx 20rpx; - margin-right: 20rpx; + margin: 0 20rpx 20rpx 0; + position: relative; +} + +.GGItem_Image image{ + border-radius: 20rpx; } .GGItem_Con_Tit { @@ -528,16 +554,16 @@ page { left: 0; right: 0; top: 0; - bottom: 0; + bottom: 0; } -.shadowBox1{ +.shadowBox1 { height: 250rpx; width: 100%; background-color: #fff; } -.shop_car{ +.shop_car { width: 140rpx; height: 140rpx; position: fixed; @@ -545,7 +571,8 @@ page { bottom: 180rpx; z-index: 10; } -.shop_car image{ + +.shop_car image { width: 100%; height: 100%; } diff --git a/packages/shop/index/index.vue b/packages/shop/index/index.vue index f221e85f..13987287 100644 --- a/packages/shop/index/index.vue +++ b/packages/shop/index/index.vue @@ -139,7 +139,7 @@
-
+
{{ item.tag_name }}
@@ -150,6 +150,14 @@ >
+ 当日达
+ 当日达 {{ items.commodity_name }}
-
+
{{ items.commodity_intro }}
- {{ items.commodity_goods_info_list[0].sales_price }} + {{ getPriceRange(items.commodity_goods_info_list) }}
+ 当日达
-
{{ ite.goods_name }}
+
+ 当日达 + {{ ite.goods_name }} +
{{ ite.sales_price }} @@ -376,6 +395,8 @@ export default { carNum: "", goodsDetail: [], + + showTag: false, //当日达标签 }; }, methods: { @@ -459,7 +480,6 @@ export default { }); }); this.tagList = res.commodity_list; - console.log("🚀 ~ getGoodsList ~ this.tagList:", this.tagList) }); }, @@ -467,7 +487,9 @@ export default { request(apiArr.getCar, "POST").then((res) => { console.log(res); this.carNum = res.total; - this.goodsDetail = res.commodity_cart_list; + // 合并当日达和普通商品数据 + this.goodsDetail = [].concat(res.same_day_cart_list, res.normal_cart_list) + .flatMap(supplier => supplier.commodity_cart_and_goods_model); }); }, @@ -504,6 +526,13 @@ export default { }); }); }, + getPriceRange(goodsList) { + if (!goodsList || goodsList.length === 0) return '¥0'; + const prices = goodsList.map(item => Number(item.sales_price)); + const minPrice = Math.min(...prices); + const maxPrice = Math.max(...prices); + return minPrice === maxPrice ? `¥${minPrice}` : `¥${minPrice} ~ ¥${maxPrice}`; + }, }, onLoad(options) { const meun = menuButtonInfo(); diff --git a/packages/shop/shopCar/index.vue b/packages/shop/shopCar/index.vue index 8cb896bc..af349ad9 100644 --- a/packages/shop/shopCar/index.vue +++ b/packages/shop/shopCar/index.vue @@ -29,11 +29,11 @@