diff --git a/buyer/src/components/goodsDetail/ShowGoods.vue b/buyer/src/components/goodsDetail/ShowGoods.vue index 3c28e4d3..176cca5e 100644 --- a/buyer/src/components/goodsDetail/ShowGoods.vue +++ b/buyer/src/components/goodsDetail/ShowGoods.vue @@ -84,14 +84,14 @@ -
+

{{ sku.name }}

-
-
+

{{ item.value }}

@@ -170,14 +170,14 @@ export default { Promotion }, methods: { - select (index, id, valueId) { // 选择规格 - this.$set(this.currentSelceted, index, valueId); + select (index, value) { // 选择规格 + this.$set(this.currentSelceted, index, value); let selectedSkuId = this.goodsSpecList.find((i) => { let matched = true; let specValues = i.specValues.filter((j) => j.specName !== 'images'); for (let n = 0; n < specValues.length; n++) { - if (specValues[n].specValueId !== this.currentSelceted[n]) { + if (specValues[n].specValue !== this.currentSelceted[n]) { matched = false; return; } @@ -267,15 +267,13 @@ export default { }, formatSku (list) { // 格式化数据 - + console.log(list); let arr = [{}]; list.forEach((item, index) => { item.specValues.forEach((spec, specIndex) => { - let id = spec.specNameId; let name = spec.specName; let values = { - id: spec.specValueId, value: spec.specValue, quantity: item.quantity }; @@ -287,7 +285,7 @@ export default { if ( arrItem.name === name && arrItem.values && - !arrItem.values.find((i) => i.id === values.id) + !arrItem.values.find((i) => i.value === values.value) ) { arrItem.values.push(values); } @@ -297,7 +295,6 @@ export default { }); if (!keys.includes(name)) { arr.push({ - id: id, name: name, values: [values] }); @@ -307,12 +304,12 @@ export default { }); arr.shift(); this.formatList = arr; - + console.log(this.formatList); let cur = list.filter((i) => i.skuId === this.$route.query.skuId)[0]; if (cur) { cur.specValues.filter((i) => i.specName !== 'images') .forEach((value, _index) => { - this.currentSelceted[_index] = value.specValueId; + this.currentSelceted[_index] = value.specValue; }); } this.skuList = list; diff --git a/buyer/src/pages/GoodsDetail.vue b/buyer/src/pages/GoodsDetail.vue index aa5016f9..d43c350e 100644 --- a/buyer/src/pages/GoodsDetail.vue +++ b/buyer/src/pages/GoodsDetail.vue @@ -77,7 +77,6 @@ export default { name: cateName[index] }); }); - console.log(cateArr); this.categoryBar = cateArr; this.goodsMsg = res.result; // 判断是否收藏 diff --git a/manager/src/config/index.js b/manager/src/config/index.js index 8b6b162f..680fb1b1 100644 --- a/manager/src/config/index.js +++ b/manager/src/config/index.js @@ -17,14 +17,14 @@ export default { * @description api请求基础路径 */ api_dev: { - // common: "https://common-api.pickmall.cn", - // buyer: "https://buyer-api.pickmall.cn", - // seller: "https://store-api.pickmall.cn", - // manager: "https://admin-api.pickmall.cn" - common: 'http://192.168.0.109:8890', - buyer: 'http://192.168.0.109:8888', - seller: 'http://192.168.0.109:8889', - manager: 'http://192.168.0.109:8887' + common: "https://common-api.pickmall.cn", + buyer: "https://buyer-api.pickmall.cn", + seller: "https://store-api.pickmall.cn", + manager: "https://admin-api.pickmall.cn" + // common: 'http://192.168.0.109:8890', + // buyer: 'http://192.168.0.109:8888', + // seller: 'http://192.168.0.109:8889', + // manager: 'http://192.168.0.109:8887' }, api_prod: { common: "https://common-api.pickmall.cn",