From e97dbe1c909b61fa910fe39040ec0b9c0ff9433e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com> Date: Fri, 27 May 2022 10:28:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=BB=B7=E6=A0=BC=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/goodsDetail/ShowGoods.vue | 185 +++++++++++------- buyer/src/pages/GoodsDetail.vue | 74 ++++--- 2 files changed, 164 insertions(+), 95 deletions(-) diff --git a/buyer/src/components/goodsDetail/ShowGoods.vue b/buyer/src/components/goodsDetail/ShowGoods.vue index 006492f6..0a85cb34 100644 --- a/buyer/src/components/goodsDetail/ShowGoods.vue +++ b/buyer/src/components/goodsDetail/ShowGoods.vue @@ -7,8 +7,18 @@
-
实物商品
-
虚拟商品
+
+ 实物商品 +
+
+ 虚拟商品 +
{{ - isCollected ? "已收藏" : "收藏" - }}{{ isCollected ? "已收藏" : "收藏" }}
@@ -46,9 +57,11 @@
- -
+

秒  杀 价

-

- 价     格 - {{ skuDetail.price | unitPrice("¥") }} -

+ +
+ 价     格 + {{ + skuDetail.price | unitPrice("¥") + }} +
+ +
+
+
+ 价     格 +
+
{{ + skuDetail.price | unitPrice("¥") + }}
+
{{ + skuDetail.price | unitPrice("¥") + }}
+
+
+
起 批 量
+
20-39
+
40-90
+
+
@@ -82,7 +119,9 @@ >满{{ item.consumeThreshold }}减{{ item.price }} 满{{ item.consumeThreshold }}打{{ item.couponDiscount }}折满{{ item.consumeThreshold }}打{{ + item.couponDiscount + }}折

@@ -90,7 +129,9 @@

- 促     销 + 促     销 满减 满{{ promotionMap["FULL_DISCOUNT"].fullMoney }}元,立享{{ promotionMap["FULL_DISCOUNT"].fullRate }}折

累计评价

- {{ skuDetail.commentNum || 0 }} 条 + {{ skuDetail.commentNum || 0 }} 条

-
+

{{ sku.name }}

-
+
@@ -158,7 +213,9 @@

重量

@@ -224,13 +281,25 @@ export default { default: null, }, }, + watch: { + detail: { + handler(val) { + this.skuDetail = val.data; + this.swiperGoodsImg(); + }, + deep: true, + immediate: true, + }, + }, data() { return { count: 1, // 商品数量 imgIndex: 0, // 展示图片下标 currentSelceted: [], // 当前商品sku imgList: [{ url: "" }], // 商品图片列表 - skuDetail: this.detail.data, // sku详情 + skuDetail: { + specList: [], + }, // sku详情 goodsSpecList: this.detail.specs, // 商品spec promotionMap: { // 活动状态 @@ -262,9 +331,9 @@ export default { return i; } }); - this.$router.push({ - path: "/goodsDetail", - query: { skuId: selectedSkuId.skuId, goodsId: this.skuDetail.goodsId }, + this.$emit("handleClickSku", { + skuId: selectedSkuId.skuId, + goodsId: this.skuDetail.goodsId, }); }, @@ -307,7 +376,10 @@ export default { .then((res) => { this.loading1 = false; if (res.success) { - this.$router.push({ path: "/pay", query: { way: params.cartType } }); + this.$router.push({ + path: "/pay", + query: { way: params.cartType }, + }); } else { this.$Message.warning(res.message); } @@ -405,6 +477,13 @@ export default { } } }, + swiperGoodsImg() { + this.skuDetail.specList.forEach((e) => { + if (e.specName === "images") { + this.imgList = e.specImage; + } + }); + }, }, mounted() { // 用户登录才会判断是否收藏 @@ -415,11 +494,7 @@ export default { } }); } - this.detail.data.specList.forEach((e) => { - if (e.specName === "images") { - this.imgList = e.specImage; - } - }); + this.formatSku(this.goodsSpecList); this.promotion(); document.title = this.skuDetail.goodsName; @@ -433,57 +508,25 @@ export default { width: 175px; margin-left: 30px; } +.flex{ + display: flex; +} .inventory { padding-left: 4px; } -.global_color { - text-align: center; -} - -.see-Img { - width: 100%; - height: 175px; -} - -.see-Item { - > p { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } -} - -.Report { - color: $theme_color !important; -} .wrapper { @include white_background_color(); } -.item-sale-flex { - width: 29%; - padding: 0 3%; + +.item-num{ + text-align:center; + width: 100px; } -.item-sale { - margin: 10px 0; - > h3 { - width: 13%; - text-align: center; - font-size: 20px; - line-height: 60px; - box-sizing: border-box; - border-right: 1px solid $border_color; - } - height: 60px; - justify-content: center; - align-items: center; - display: flex; - width: 1200px; - margin: 0 auto; - margin-bottom: 10px; - border: 1px solid $border_color; - background: #f7f7f7; +.item-price-num{ + font-size: 16px; + color: #666; } .item-detail-show { diff --git a/buyer/src/pages/GoodsDetail.vue b/buyer/src/pages/GoodsDetail.vue index 0772fed7..80b44155 100644 --- a/buyer/src/pages/GoodsDetail.vue +++ b/buyer/src/pages/GoodsDetail.vue @@ -1,5 +1,5 @@