|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
<template> |
|
|
|
|
<goods-sku-popup :modelValue="modelValue" @input="onChangeValue" border-radius="20" :localdata="goodsInfo" :mode="skuMode" :maskCloseAble="true" |
|
|
|
|
<goods-sku-popup :modelValue="modelValue" @input="onChangeValue" border-radius="20" :localdata="goodsInfo" :mode="skuMode" :maskCloseAble="true" |
|
|
|
|
:priceColor="appTheme.mainBg" :buyNowBackgroundColor="appTheme.mainBg" :addCartColor="appTheme.viceText" |
|
|
|
|
:addCartBackgroundColor="appTheme.viceBg" |
|
|
|
|
:activedStyle="{ color: appTheme.mainBg, borderColor: appTheme.mainBg, backgroundColor: activedBtnBackgroundColor }" |
|
|
|
@ -49,9 +49,8 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
const app = this |
|
|
|
|
const { goods } = app |
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
const app = this |
|
|
|
|
const { goods } = app |
|
|
|
|
app.goodsInfo = { |
|
|
|
|
_id: goods.goods_id, |
|
|
|
|
name: goods.goods_name, |
|
|
|
@ -59,9 +58,9 @@ |
|
|
|
|
sku_list: app.getSkuList(), |
|
|
|
|
spec_list: app.getSpecList() |
|
|
|
|
} |
|
|
|
|
console.log(111,app.goodsInfo) |
|
|
|
|
app.maxBuyNum = app.getMaxBuyNum() |
|
|
|
|
},500) |
|
|
|
|
console.log(111,app.goods) |
|
|
|
|
console.log(111222,goods) |
|
|
|
|
app.maxBuyNum = app.getMaxBuyNum() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
methods: { |
|
|
|
@ -97,13 +96,17 @@ |
|
|
|
|
// 获取sku记录的规格值列表 |
|
|
|
|
getSkuNameArr(specValueIds) { |
|
|
|
|
const app = this |
|
|
|
|
const defaultData = ['默认'] |
|
|
|
|
const defaultData = ['默认'] |
|
|
|
|
const { goods: { specList } } = app |
|
|
|
|
const skuNameArr = [] |
|
|
|
|
if (specValueIds) { |
|
|
|
|
specValueIds.forEach((valueId, groupIndex) => { |
|
|
|
|
const specValueName = app.getSpecValueName(valueId, groupIndex) |
|
|
|
|
skuNameArr.push(specValueName) |
|
|
|
|
}) |
|
|
|
|
if (specValueIds) { |
|
|
|
|
if(specList && specList.length > 0){ |
|
|
|
|
specValueIds.forEach((valueId, groupIndex) => { |
|
|
|
|
const specValueName = app.getSpecValueName(valueId, groupIndex) |
|
|
|
|
skuNameArr.push(specValueName) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return skuNameArr.length ? skuNameArr : defaultData |
|
|
|
|
}, |
|
|
|
|