Skip to content

Commit f297921

Browse files
committed
feature(uniapp商品): 商品修改
1 parent d8d784a commit f297921

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/views/mall/product/spu/save.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,23 @@ export default {
471471
this.baseForm.showStock=data.showStock;
472472
this.baseForm.brandId=data.brandId;
473473
this.ratesForm.spec=data.specType;
474+
if(this.ratesForm.spec == 2){
475+
data.productPropertyViews.forEach(p=>{
476+
let obj = {};
477+
obj.specId = p.propertyId;
478+
obj.specName = p.name;
479+
obj.specValue = p.propertyValues;
480+
this.dynamicSpec.push(obj);
481+
})
482+
data.skus.forEach(s=>{
483+
s.spec = [];
484+
s.properties.forEach(sp=>{
485+
let spec = data.productPropertyViews.find(o=>o.propertyId == sp.propertyId).propertyValues.find(v=>v.id == sp.valueId).name;
486+
s.spec.push(spec)
487+
})
488+
})
489+
}
490+
console.log(data.skus);
474491
this.ratesForm.rates=data.skus
475492
})
476493
}

0 commit comments

Comments
 (0)