|
|
|
@ -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 }" |
|
|
|
@ -50,8 +50,7 @@ |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
const app = this |
|
|
|
|
const { goods } = app |
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
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) |
|
|
|
|
console.log(111,app.goods) |
|
|
|
|
console.log(111222,goods) |
|
|
|
|
app.maxBuyNum = app.getMaxBuyNum() |
|
|
|
|
},500) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
methods: { |
|
|
|
@ -98,12 +97,16 @@ |
|
|
|
|
getSkuNameArr(specValueIds) { |
|
|
|
|
const app = this |
|
|
|
|
const defaultData = ['默认'] |
|
|
|
|
const { goods: { specList } } = app |
|
|
|
|
const skuNameArr = [] |
|
|
|
|
if (specValueIds) { |
|
|
|
|
specValueIds.forEach((valueId, groupIndex) => { |
|
|
|
|
const specValueName = app.getSpecValueName(valueId, groupIndex) |
|
|
|
|
skuNameArr.push(specValueName) |
|
|
|
|
}) |
|
|
|
|
if(specList && specList.length > 0){ |
|
|
|
|
specValueIds.forEach((valueId, groupIndex) => { |
|
|
|
|
const specValueName = app.getSpecValueName(valueId, groupIndex) |
|
|
|
|
skuNameArr.push(specValueName) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return skuNameArr.length ? skuNameArr : defaultData |
|
|
|
|
}, |
|
|
|
|