Commit ddeb5c76 authored by mengwenhao's avatar mengwenhao

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

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