Commit ddeb5c76 authored by mengwenhao's avatar mengwenhao

fix:商品-代码冲突合并完成

parent 7ceafe93
......@@ -144,7 +144,7 @@
<section class="width50p">
<h4 style="margin-bottom:20px">商品介绍图</h4>
<el-upload
:data="{ type:1 }"
:data="{ type: 1 }"
:disabled="$route.params.operation !== 'EDIT'"
:action="uploadUrl"
auto-upload
......@@ -627,7 +627,7 @@ import {
checkGoodsName,
getShopsList,
postAddShop,
editGoods
// editGoods
} from "@/service/Goods/goods";
import { GOODS_URI } from "../../../../server/config.js";
......@@ -827,8 +827,8 @@ export default {
goods_info.introduce_pic_url_list,
this.introducePicUrlList
);
this.detailUploadList = goods_info.desc_pic_url.split(",");
this.introduceUploadList = goods_info.introduce_pic_url.split(",");
this.detailUploadList = this.formatUploadPictureList(goods_info.desc_pic_url);
this.introduceUploadList = this.formatUploadPictureList(goods_info.introduce_pic_url);
} catch (error) {
console.error(error);
}
......@@ -843,6 +843,15 @@ export default {
});
},
// 初始化上传照片列表
formatUploadPictureList (fileStr) {
if (!fileStr) {
return [];
} else {
return fileStr.split(",");
}
},
// 上传图片的公共方法
uploadPicture (response, storageList) {
const responseURL = response.result.image_id;
......@@ -1122,7 +1131,7 @@ export default {
// 禁用时间
disableExpirDate (time) {
const timeMs = time.getTime();
if (timeMs > (Date.now() - 86400000)) {
if (timeMs > Date.now() - 86400000) {
return false;
} else {
return true;
......@@ -1267,12 +1276,12 @@ export default {
console.log(query);
const res = await editGoods(query);
if (res.code !== 0) {
return this.$message.error(res.reason);
}
this.$message.success("商品编辑成功!");
this.$router.replace({ name: "GoodsList" });
// const res = await editGoods(query);
// if (res.code !== 0) {
// return this.$message.error(res.reason);
// }
// this.$message.success("商品编辑成功!");
// this.$router.replace({ name: "GoodsList" });
}
}
};
......
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