Commit 029a3a72 by lixiaomin

修改商品规格

parent f3f13a7a
...@@ -170,7 +170,7 @@ export default { ...@@ -170,7 +170,7 @@ export default {
//这个判断是先用一份数据 //这个判断是先用一份数据
// if(this.steps.length==0){ // if(this.steps.length==0){
await this.getStepListByMidAndSkuId(queryParams).then((res)=>{ await this.getStepListByMidAndSkuId(queryParams).then((res)=>{
console.log("res",res); console.log("getStepListByMidAndSkuId res",res);
let step_opts = []; let step_opts = [];
for(let obj in res.data){ for(let obj in res.data){
//console.log(obj,spec_model.step_list[obj]); //console.log(obj,spec_model.step_list[obj]);
...@@ -192,6 +192,7 @@ export default { ...@@ -192,6 +192,7 @@ export default {
step_opts.push(step_obj); step_opts.push(step_obj);
} }
console.log("step_opts",step_opts); console.log("step_opts",step_opts);
//注意这里会覆盖上一个机器的步骤
this.steps = step_opts; this.steps = step_opts;
}); });
...@@ -287,6 +288,9 @@ export default { ...@@ -287,6 +288,9 @@ export default {
//返回的数据是商品的所有sku的配置,需要循环对应后,把数据初始化; //返回的数据是商品的所有sku的配置,需要循环对应后,把数据初始化;
for(let i=0;i<pres.data.length;i++){ for(let i=0;i<pres.data.length;i++){
let item = pres.data[i]; let item = pres.data[i];
if(item.sku_id != this.psku.sku_id){
continue;
}
let tb_data = this.findSkuById(item.sku_id,item.model_id); let tb_data = this.findSkuById(item.sku_id,item.model_id);
console.log("initStepData tb_data",tb_data); console.log("initStepData tb_data",tb_data);
let step_data = item.data; let step_data = item.data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment