提交 d82f7498 authored 作者: huaxinzhu's avatar huaxinzhu

云仓入驻,上传图片,接口修改

上级 c3eae2ff
...@@ -63,11 +63,20 @@ export function addShopInf(data) { ...@@ -63,11 +63,20 @@ export function addShopInf(data) {
// 上传图片 // 上传图片
export function upLoadImg (data) { export function upLoadImg (data) {
return request({ return request({
url: '/system/goods/uploadImg', url: '/system/goodsNew/uploadImage',
method: 'post', method: 'post',
data: data data: data
}); });
} }
// old
// export function upLoadImg (data) {
// return request({
// url: '/system/goods/uploadImg',
// method: 'post',
// data: data
// });
// }
// 获取商品类目 // 获取商品类目
export function getGoodsType(query) { export function getGoodsType(query) {
return request({ return request({
......
...@@ -338,11 +338,11 @@ ...@@ -338,11 +338,11 @@
this.getBase64(param.file).then((res) => { this.getBase64(param.file).then((res) => {
let result = res.split(","); let result = res.split(",");
this.Base64img = result[1]; this.Base64img = result[1];
let data = {"image": this.Base64img}; let data = {"img_data": this.Base64img};
upLoadImg(data).then((res) => { upLoadImg(data).then((res) => {
if (res && res.data.code == 1) { if (res && res.code === 1) {
this.brandImgFileList.push({'url': res.data.data.imageUrl}); this.brandImgFileList.push({'url': res.data.image_url});
this.$message('上传成功'); this.$message({type:'success',message:'上传成功'});
this.$refs.brandForm.clearValidate('brand_logo'); this.$refs.brandForm.clearValidate('brand_logo');
//this.$refs.logoImg.clearValidate(); //this.$refs.logoImg.clearValidate();
} }
...@@ -354,11 +354,11 @@ ...@@ -354,11 +354,11 @@
this.getBase64(param.file).then((res) => { this.getBase64(param.file).then((res) => {
let result = res.split(","); let result = res.split(",");
this.Base64img = result[1]; this.Base64img = result[1];
let data = {"image":this.Base64img}; let data = {"img_data":this.Base64img};
upLoadImg(data).then((res) => { upLoadImg(data).then((res) => {
if(res && res.data.code == 1){ if(res && res.code === 1){
this.shopImgFileList.push({'url':res.data.data.imageUrl}); this.shopImgFileList.push({'url':res.data.image_url});
this.$message('上传成功'); this.$message({type:'success',message:'上传成功'});
this.$refs.brandForm.clearValidate('brand_business_auth'); this.$refs.brandForm.clearValidate('brand_business_auth');
} }
}); });
...@@ -369,11 +369,11 @@ ...@@ -369,11 +369,11 @@
this.getBase64(param.file).then((res) => { this.getBase64(param.file).then((res) => {
let result = res.split(","); let result = res.split(",");
this.Base64img = result[1]; this.Base64img = result[1];
let data = {"image":this.Base64img}; let data = {"img_data":this.Base64img};
upLoadImg(data).then((res) => { upLoadImg(data).then((res) => {
if(res && res.data.code == 1){ if(res && res.code === 1){
this.factoryImgFileList.push({'url':res.data.data.imageUrl}); this.factoryImgFileList.push({'url':res.data.image_url});
this.$message('上传成功'); this.$message({type:'success',message:'上传成功'});
} }
}); });
}); });
...@@ -486,7 +486,7 @@ ...@@ -486,7 +486,7 @@
// 初始化 // 初始化
//this.resetForm(); //this.resetForm();
getBrandsInf().then(res => { getBrandsInf().then(res => {
console.log("获取品牌:",res.data); //console.log("获取品牌:",res.data);
if(res.code === 1 && res.data) { if(res.code === 1 && res.data) {
this.brandForm = res.data[0]; this.brandForm = res.data[0];
// 商标logo图片处理 // 商标logo图片处理
...@@ -625,7 +625,7 @@ ...@@ -625,7 +625,7 @@
if(this.brandForm.id === 0) { if(this.brandForm.id === 0) {
addBrandForm.brands = toArrBrandForm; addBrandForm.brands = toArrBrandForm;
addBrands(addBrandForm).then(res => { addBrands(addBrandForm).then(res => {
console.log("新增返回信息",res); //console.log("新增返回信息",res);
this.$router.push("/fillShopInf"); this.$router.push("/fillShopInf");
}); });
}else { }else {
......
...@@ -322,10 +322,11 @@ ...@@ -322,10 +322,11 @@
this.getBase64(param.file).then((res) => { this.getBase64(param.file).then((res) => {
let result = res.split(","); let result = res.split(",");
this.Base64img = result[1]; this.Base64img = result[1];
let data = {"image":this.Base64img}; let data = {"img_data":this.Base64img};
upLoadImg(data).then((res) => { upLoadImg(data).then((res) => {
if(res && res.data.code == 1){ //console.log('上传图片新接口返回:', res);
this.licenseImgFileList.push({'url':res.data.data.imageUrl}); if(res && res.code === 1){
this.licenseImgFileList.push({'url':res.data.image_url});
this.$message({type: 'success',message:'上传成功'}); this.$message({type: 'success',message:'上传成功'});
this.$refs.mainForm.clearValidate('license'); this.$refs.mainForm.clearValidate('license');
} }
...@@ -348,11 +349,11 @@ ...@@ -348,11 +349,11 @@
this.getBase64(param.file).then((res) => { this.getBase64(param.file).then((res) => {
let result = res.split(","); let result = res.split(",");
this.Base64img = result[1]; this.Base64img = result[1];
let data = {"image":this.Base64img}; let data = {"img_data":this.Base64img};
upLoadImg(data).then((res) => { upLoadImg(data).then((res) => {
if(res && res.data.code == 1){ if(res && res.code === 1){
this.idcardImgFileList.push({'url':res.data.data.imageUrl}); this.idcardImgFileList.push({'url':res.data.image_url});
this.$message('上传成功'); this.$message({type:'success',message:'上传成功'});
this.$refs.mainForm.clearValidate('idcard_front'); this.$refs.mainForm.clearValidate('idcard_front');
} }
}); });
...@@ -372,7 +373,7 @@ ...@@ -372,7 +373,7 @@
// 获取主体信息接口 // 获取主体信息接口
getMain() { getMain() {
getMainInf().then(res => { getMainInf().then(res => {
console.log("获取主体数据:",res); //console.log("获取主体数据:",res);
if(res.code === 1) { if(res.code === 1) {
this.resetForm('mainForm'); this.resetForm('mainForm');
this.mainForm = res.data; this.mainForm = res.data;
...@@ -488,7 +489,7 @@ ...@@ -488,7 +489,7 @@
// 处理营业执照 // 处理营业执照
if(this.licenseImgFileList.length > 0) { if(this.licenseImgFileList.length > 0) {
console.log(445,this.licenseImgFileList) //console.log(445,this.licenseImgFileList)
for(let i = 0; i < this.licenseImgFileList.length; i++) { for(let i = 0; i < this.licenseImgFileList.length; i++) {
if(i === 0) { if(i === 0) {
this.mainForm.license = this.licenseImgFileList[i].url; this.mainForm.license = this.licenseImgFileList[i].url;
......
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
this.storeForm = res.data; this.storeForm = res.data;
this.storeForm.scope = scopeList; this.storeForm.scope = scopeList;
} }
console.log("处理后的格式:",this.storeForm.scope); //console.log("处理后的格式:",this.storeForm.scope);
// 店铺logo回显处理 // 店铺logo回显处理
let logoList = {}; let logoList = {};
let logoArr = []; let logoArr = [];
...@@ -314,9 +314,9 @@ ...@@ -314,9 +314,9 @@
this.Base64img = result[1]; this.Base64img = result[1];
let data = {"image":this.Base64img}; let data = {"image":this.Base64img};
upLoadImg(data).then((res) => { upLoadImg(data).then((res) => {
if(res && res.data.code == 1){ if(res && res.code === 1){
this.logoImgFileList.push({'url':res.data.data.imageUrl}); this.logoImgFileList.push({'url':res.data.image_url});
this.$message('上传成功'); this.$message({type:'success',message:'上传成功'});
this.$refs.storeForm.clearValidate('shop_logo'); this.$refs.storeForm.clearValidate('shop_logo');
} }
}); });
...@@ -330,9 +330,9 @@ ...@@ -330,9 +330,9 @@
this.Base64img = result[1]; this.Base64img = result[1];
let data = {"image":this.Base64img}; let data = {"image":this.Base64img};
upLoadImg(data).then((res) => { upLoadImg(data).then((res) => {
if(res && res.data.code == 1){ if(res && res.code === 1){
this.businessImgFileList.push({'url':res.data.data.imageUrl}); this.businessImgFileList.push({'url':res.data.image_url});
this.$message('上传成功'); this.$message({type:'success',message:'上传成功'});
this.$refs.storeForm.clearValidate('business_auth'); this.$refs.storeForm.clearValidate('business_auth');
} }
}); });
...@@ -388,7 +388,7 @@ ...@@ -388,7 +388,7 @@
scoprStr += this.storeForm.scope[i] + ','; scoprStr += this.storeForm.scope[i] + ',';
} }
this.storeForm.scope = scoprStr.substring(0,scoprStr.length - 1); this.storeForm.scope = scoprStr.substring(0,scoprStr.length - 1);
console.log("提交前的scope",this.storeForm.scope); //console.log("提交前的scope",this.storeForm.scope);
// shop_logo图片地址字段 // shop_logo图片地址字段
if(this.logoImgFileList.length > 0) { if(this.logoImgFileList.length > 0) {
...@@ -412,7 +412,7 @@ ...@@ -412,7 +412,7 @@
} }
} }
console.log("新增/修改的店铺信息:",this.storeForm); //console.log("新增/修改的店铺信息:",this.storeForm);
//formName //formName
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if(valid) { if(valid) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论