Commit 9fdcc826 by 张立顺

fix bug修复

1 parent c8f1df5c
......@@ -758,47 +758,50 @@ export default {
// goodsSpecificationNameList 商品
res = res.data
console.log(res, 'res')
goodType = res.goodsSpecificationNameList.map((item, index) => {
item.name = item.specificationName
item.propertyList = item.goodsSpecificationValueList.map((el, elIndex) => {
el.name = el.specificationValue
// el.id = el.specificationValue
el.id = index.toString() + elIndex.toString()
return el
if (res.specificationType == 2) {
console.log(res, 'res')
goodType = res.goodsSpecificationNameList.map((item, index) => {
item.name = item.specificationName
item.propertyList = item.goodsSpecificationValueList.map((el, elIndex) => {
el.name = el.specificationValue
// el.id = el.specificationValue
el.id = index.toString() + elIndex.toString()
return el
})
return item
})
return item
})
console.log(goodType, 'goodType')
orgdata.skus = res.upgradeGoodsSpecificationValueDTOS.map((item, index) => {
item.skuId = ''
item.skusTypes = item.specificationValues.map((el, elIndex) => {
let skuItem = goodType[elIndex].propertyList.find((skuItem, skuItemIndex) => {
console.log(skuItem.name == el, skuItem.name, el)
// 取第一个默认选中
if (skuItem.name == el && index == res.upgradeGoodsSpecificationValueDTOS.length - 1) {
goodType[elIndex].propertyList[skuItemIndex].selected = true
console.log(goodType, 'goodType')
console.log(goodType, 'goodType')
orgdata.skus = res.upgradeGoodsSpecificationValueDTOS.map((item, index) => {
item.skuId = ''
item.skusTypes = item.specificationValues.map((el, elIndex) => {
let skuItem = goodType[elIndex].propertyList.find((skuItem, skuItemIndex) => {
console.log(skuItem.name == el, skuItem.name, el)
// 取第一个默认选中
if (skuItem.name == el && index == res.upgradeGoodsSpecificationValueDTOS.length - 1) {
goodType[elIndex].propertyList[skuItemIndex].selected = true
console.log(goodType, 'goodType')
}
return skuItem.name == el
})
let obj = {
propertyId: skuItem.id,
propertyName: el
}
return skuItem.name == el
item.skuId += skuItem.id
return obj
})
let obj = {
propertyId: skuItem.id,
propertyName: el
}
item.skuId += skuItem.id
return obj
})
return item
})
console.log(goodType, 'goodType')
console.log(orgdata, 'orgdata')
// return
// 初始化
this.init()
// 获取所有的规格
this.getShopGoodsType()
this.initGoodType()
return item
})
console.log(goodType, 'goodType')
console.log(orgdata, 'orgdata')
// return
// 初始化
this.init()
// 获取所有的规格
this.getShopGoodsType()
this.initGoodType()
}
this.goodsInfo = res
this.tableInfo = res?.upgradeGoodsList?.merchantGoodsInfoList
......@@ -867,6 +870,7 @@ export default {
// 判断是否有值
params.upgradeGoodsId &&
this.$apis.purchaseShopping.shoppingCarAdd(params).then(res => {
console.log(res, 'res')
this.$message.success('加入购物车成功')
this.$EventBus.$emit('updateCarShopping')
this.dialogShow = false
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!