|
|
<template>
|
|
|
<LayoutBody>
|
|
|
<LayoutBody v-if="shopData">
|
|
|
<Form :label-width="100">
|
|
|
<Form-item label="店铺名称:">
|
|
|
<span>{{shopData.shopName}}</span>
|
...
|
...
|
@@ -13,9 +13,8 @@ |
|
|
<Form-item label="店铺LOGO:">
|
|
|
<div class="upload-item">
|
|
|
<div class="upload-item-img">
|
|
|
<drag-file-upload
|
|
|
<drag-file-upload v-if="shopData"
|
|
|
:default-file="shopData.shopLogo"
|
|
|
:id="{goodIndex:1, imageIndex: 1}"
|
|
|
@on-success="uploadImageSuccess"
|
|
|
@on-remove="uploadImageRemove">
|
|
|
</drag-file-upload>
|
...
|
...
|
@@ -48,15 +47,27 @@ |
|
|
3: '初始状态(异常情况)'
|
|
|
};
|
|
|
|
|
|
const makeSaveShop = () => {
|
|
|
return {
|
|
|
shopDomain: '',
|
|
|
shopIntro: '',
|
|
|
shopLogo: '',
|
|
|
shopName: '',
|
|
|
shopNature: '',
|
|
|
shopRelationList: '',
|
|
|
shopsId: '',
|
|
|
shopsType: ''
|
|
|
};
|
|
|
};
|
|
|
|
|
|
export default {
|
|
|
created() {
|
|
|
service.getShop().then((res) => {
|
|
|
|
|
|
this.shopData = res.data;
|
|
|
this.tableData = JSON.parse(res.data.shopRelationList);
|
|
|
|
|
|
// console.log(res);
|
|
|
console.log(res.data.shopLogo);
|
|
|
console.log('res=====');
|
|
|
console.log(res);
|
|
|
}, (error) => {
|
|
|
this.$Message.error(error.message);
|
|
|
});
|
...
|
...
|
@@ -64,7 +75,7 @@ |
|
|
data() {
|
|
|
return {
|
|
|
SHOPNATURE,
|
|
|
shopData: {},
|
|
|
shopData: null,
|
|
|
tableCols: [
|
|
|
{
|
|
|
title: '品牌',
|
...
|
...
|
@@ -82,33 +93,32 @@ |
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
updateData(c) {
|
|
|
this.content = c;
|
|
|
updateData: function(content) {
|
|
|
this.shopData.shopIntro = content;
|
|
|
},
|
|
|
|
|
|
//上传图片
|
|
|
uploadImageSuccess: function (attach, file) {
|
|
|
let colorIndex = attach.goodIndex;
|
|
|
let imageIndex = attach.imageIndex;
|
|
|
uploadImageSuccess: function(attach, file) {
|
|
|
|
|
|
this.product.goods[colorIndex].goodsImage[imageIndex].imageUrl = file.url;
|
|
|
this.shopData.shopLogo = file.url;
|
|
|
},
|
|
|
uploadImageRemove: function (attach) {
|
|
|
let colorIndex = attach.goodIndex;
|
|
|
let imageIndex = attach.imageIndex;
|
|
|
|
|
|
this.product.goods[colorIndex].goodsImage[imageIndex].imageUrl = '';
|
|
|
uploadImageRemove: function() {
|
|
|
this.shopData.shopLogo = '';
|
|
|
},
|
|
|
|
|
|
//提交
|
|
|
beforeSubmit: function () {
|
|
|
beforeSubmit: function() {
|
|
|
let newShop = makeSaveShop();
|
|
|
|
|
|
// newShop.expectSaleTimeStr = this.product.expectSaleTimeStr;
|
|
|
//
|
|
|
// newShop.sellerGoodsInfoStr = JSON.stringify(this.handleColor());
|
|
|
newShop.shopDomain = this.shopData.shopDomain;
|
|
|
newShop.shopLogo = this.shopData.shopLogo;
|
|
|
newShop.shopName = this.shopData.shopName;
|
|
|
newShop.shopNature = this.shopData.shopNature;
|
|
|
newShop.shopRelationList = this.shopData.shopRelationList;
|
|
|
newShop.shopsId = this.shopData.shopsId;
|
|
|
newShop.shopsType = this.shopData.shopsType;
|
|
|
|
|
|
return newShop;
|
|
|
},
|
|
|
submit: function () {
|
|
|
submit: function() {
|
|
|
let newShop = this.beforeSubmit();
|
|
|
|
|
|
this.$Loading.start();
|
...
|
...
|
@@ -121,17 +131,14 @@ |
|
|
desc: '该店铺保存成功!'
|
|
|
});
|
|
|
|
|
|
this.$router.push({name: 'shop'});
|
|
|
} else {
|
|
|
this.$Notice.error({
|
|
|
title: '保存错误',
|
|
|
desc: result.message
|
|
|
});
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
}
|
|
|
};
|
|
|
</script>
|
...
|
...
|
|