Commit cc12a54b authored by v-yuchenglong's avatar v-yuchenglong

update:商品图片编辑保存修改

parent 171cc6b0
...@@ -406,11 +406,18 @@ export default { ...@@ -406,11 +406,18 @@ export default {
} }
}, },
getUrlParms(path, name) {
var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");
if (reg.test(path)) return unescape(RegExp.$2.replace(/\+/g, " "));
return "";
},
// 编辑商品详情 // 编辑商品详情
async editGoodsMet(goodsSkuID) { async editGoodsMet(goodsSkuID) {
let pic = this.picUrlList[0].url;
const res = await editGoods({ const res = await editGoods({
goods_name: this.commodityForm.goods_name, goods_name: this.commodityForm.goods_name,
desc_pic_url: this.picUploadList.join(","), desc_pic_url:this.getUrlParms(pic,"url"),
desc: "", desc: "",
inventory_add: this.commodityForm.inventory_total, inventory_add: this.commodityForm.inventory_total,
original_price: this.commodityForm.original_price, original_price: this.commodityForm.original_price,
...@@ -439,12 +446,6 @@ export default { ...@@ -439,12 +446,6 @@ export default {
} }
} }
// for (var j in this.comLibTableData) {
// if (this.comLibTableData[j].goods_sku_id == goodsSkuID) {
// this.comTableData.push(this.comLibTableData[j]);
// }
// }
this.addCommodityPopup = false; this.addCommodityPopup = false;
} else { } else {
ElMessage.error(res.reason); ElMessage.error(res.reason);
......
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