优化前段没有报错问题

This commit is contained in:
java110 2020-06-01 08:47:06 +08:00
parent 3dc219ed63
commit 582d7ba2ec
2 changed files with 31 additions and 19 deletions

View File

@ -66,6 +66,12 @@
vc.http.apiPost('storeAttr.updateStoreAttr',
JSON.stringify(vc.component.editStoreAttr),
function (json, res) {
if (res.status == 200) {
$('#editStoreAttrModel').modal('hide');
vc.emit('storeInfoManage', 'getStoreInfo', {});
return;
}
vc.toast(json);
}, function (bodyText, res) {
if (res.status == 200) {
$('#editStoreAttrModel').modal('hide');

View File

@ -2,13 +2,13 @@
vc.extends({
data: {
editStoreInfo: {
storeId:'',
name:'',
address:'',
tel:'',
nearByLandmarks:'',
mapX:'',
mapY:'',
storeId: '',
name: '',
address: '',
tel: '',
nearByLandmarks: '',
mapX: '',
mapY: '',
}
},
_initMethod: function () {
@ -24,7 +24,7 @@
},
methods: {
refreshEditStoreInfo(_storeInfo){
refreshEditStoreInfo(_storeInfo) {
_storeInfo = _storeInfo._storeInfo;
vc.component.editStoreInfo.storeId = _storeInfo.storeId;
vc.component.editStoreInfo.name = _storeInfo.name;
@ -34,15 +34,15 @@
vc.component.editStoreInfo.mapX = _storeInfo.mapX;
vc.component.editStoreInfo.mapY = _storeInfo.mapY;
},
clearEditStoreInfo(){
vc.component.editStoreInfo= {
storeId:'',
name:'',
address:'',
tel:'',
nearByLandmarks:'',
mapX:'',
mapY:'',
clearEditStoreInfo() {
vc.component.editStoreInfo = {
storeId: '',
name: '',
address: '',
tel: '',
nearByLandmarks: '',
mapX: '',
mapY: '',
}
},
editStoreValidate: function () {
@ -96,10 +96,10 @@
param: "200",
errInfo: "附件地标位置最多200位"
}
]
]
});
},
submitEditStoreInfo:function () {
submitEditStoreInfo: function () {
if (!vc.component.editStoreValidate()) {
vc.toast(vc.validate.errInfo);
return;
@ -107,6 +107,12 @@
vc.http.apiPost('update.store.info',
JSON.stringify(vc.component.editStoreInfo),
function (json, res) {
if (res.status == 200) {
$('#editStoreModel').modal('hide');
vc.emit('storeInfoManage', 'getStoreInfo', {});
return;
}
vc.toast(json);
}, function (bodyText, res) {
if (res.status == 200) {
$('#editStoreModel').modal('hide');