File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
src/views/mall/product/spu Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -471,6 +471,23 @@ export default {
471
471
this .baseForm .showStock = data .showStock ;
472
472
this .baseForm .brandId = data .brandId ;
473
473
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 );
474
491
this .ratesForm .rates = data .skus
475
492
})
476
493
}
You can’t perform that action at this time.
0 commit comments