...
|
...
|
@@ -144,7 +144,9 @@ export default { |
|
|
|
|
|
this.productService.getProduct(this.$route.params.id).then((result) => {
|
|
|
if (result.code === 200) {
|
|
|
this.product = result.data;
|
|
|
// 这里的处理单选的问题,双向绑定的问题
|
|
|
Object.assign(this.product, result.data);
|
|
|
|
|
|
_.update(this.product, 'goodsSeason', (s) => `${s}`);
|
|
|
if (!_.has(this.product, 'materialList')) {
|
|
|
this.product.materialList = [];
|
...
|
...
|
@@ -161,12 +163,17 @@ export default { |
|
|
if (!_.has(this.product, 'ageLevel')) {
|
|
|
this.product.ageLevel = '';
|
|
|
}
|
|
|
} else {
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
}).then(() => {
|
|
|
return this.getAllAttr(this.product.smallSortId, this.product.maxSortId);
|
|
|
}).then(() => {
|
|
|
this.init();
|
|
|
this.showLoading = false;
|
|
|
}).catch(() => {
|
|
|
this.$Message.error('商品出错');
|
|
|
this.showLoading = false;
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
...
|
...
|
@@ -351,7 +358,10 @@ export default { |
|
|
let goodsList = this.product.sellerGoodList;
|
|
|
|
|
|
this.product.goods = _.range(goodsList.length || 0).map((i) => {
|
|
|
return this.productCreateService.handleGoodsImage(this.product.sellerGoodsImagesList[i] || {});
|
|
|
return this.productCreateService.handleGoodsImage(
|
|
|
goodsList[i],
|
|
|
this.product.sellerGoodsImagesList[i] || {}
|
|
|
);
|
|
|
});
|
|
|
},
|
|
|
handleItem(goods, goodsImage) {
|
...
|
...
|
|