Commit f9cc342d by 朱建香

1117

parent 33797562
...@@ -292,8 +292,8 @@ ...@@ -292,8 +292,8 @@
"cancelAssociatedFailue": "取消关联失败", "cancelAssociatedFailue": "取消关联失败",
"setHijackSuccess": "设为劫持指纹成功", "setHijackSuccess": "设为劫持指纹成功",
"setHijackFailue": "设为劫持指纹失败", "setHijackFailue": "设为劫持指纹失败",
"cancelHijackSuccess": "设为劫持指纹成功", "cancelHijackSuccess": "取消劫持指纹成功",
"cancelHijackFailue": "设为劫持指纹失败" "cancelHijackFailue": "取消劫持指纹失败"
}, },
"addUnlockInfo":{ "addUnlockInfo":{
"opendoorMode": "选择要关联的开锁方式", "opendoorMode": "选择要关联的开锁方式",
......
...@@ -314,42 +314,51 @@ function recordSelectChange(self, value) { ...@@ -314,42 +314,51 @@ function recordSelectChange(self, value) {
//tap 添加 //tap 添加
function addButtonTap(self){ function addButtonTap(self){
if(self.getOpenId()){
uComponents.showLoading(self); uComponents.showLoading(self);
iot.business.api.sendCustom('lock/bindOpenLog',{ iot.business.api.sendCustom('lock/bindOpenLog',{
data: { data: {
device_id: self.extras.deviceId, device_id: self.extras.deviceId,
mode: self.getMode(), mode: self.getMode(),
openId: self.getOpenId(), openId: self.getOpenId(),
rel_id: self.extras.id rel_id: self.extras.id
}, },
success: (response) => { success: (response) => {
console.log(response); console.log(response);
if(response.data.success){ if(response.data.success){
uComponents.openAlert(self, Vue.t('addUnlockInfo.addInfoSuccess'), { uComponents.openAlert(self, Vue.t('addUnlockInfo.addInfoSuccess'), {
text: Vue.t('dialog.confirm'), callback: function () {
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{ });
iot.navigator.back();
}
});
}else{}
},
error: (error) => {
console.log(error);
// if(window.iotDebug){
// iotDebug.push('end: 绑定开门方式失败'+JSON.stringify(error));
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'绑定开门方式失败');
// }
uComponents.openAlert(vmObj, Vue.t('addUnlockInfo.addInfoFailue'), {
text: Vue.t('dialog.confirm'), callback: function () { text: Vue.t('dialog.confirm'), callback: function () {
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{ });
iot.navigator.back();
} }
}); });
}else{} },
}, complete: () => {
error: (error) => { uComponents.hideLoading(self);
console.log(error); }
// if(window.iotDebug){ });
// iotDebug.push('end: 绑定开门方式失败'+JSON.stringify(error)); setTimeout(function(){
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'绑定开门方式失败');
// }
uComponents.openAlert(vmObj, Vue.t('addUnlockInfo.addInfoFailue'), { uComponents.openAlert(vmObj, Vue.t('addUnlockInfo.addInfoFailue'), {
text: Vue.t('dialog.confirm'), callback: function () { text: Vue.t('dialog.confirm'), callback: function () {
} }
}); });
}, uComponents.hideLoading(self);
complete: () => { },config.wifi_add_timeout);
uComponents.hideLoading(self); }
}
});
} }
function selectOpenDoorModeTap(self, index){ function selectOpenDoorModeTap(self, index){
......
...@@ -360,6 +360,7 @@ function unbindButtonTap(self){ ...@@ -360,6 +360,7 @@ function unbindButtonTap(self){
success: (response) => { success: (response) => {
console.log(response); console.log(response);
self.setStateShowFlag(true); self.setStateShowFlag(true);
getUserInfo(self);
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
......
...@@ -17106,41 +17106,49 @@ function recordSelectChange(self, value) { ...@@ -17106,41 +17106,49 @@ function recordSelectChange(self, value) {
//tap 添加 //tap 添加
function addButtonTap(self) { function addButtonTap(self) {
_public.uComponents.showLoading(self); if (self.getOpenId()) {
_public.iot.business.api.sendCustom('lock/bindOpenLog', { _public.uComponents.showLoading(self);
data: { _public.iot.business.api.sendCustom('lock/bindOpenLog', {
device_id: self.extras.deviceId, data: {
mode: self.getMode(), device_id: self.extras.deviceId,
openId: self.getOpenId(), mode: self.getMode(),
rel_id: self.extras.id openId: self.getOpenId(),
}, rel_id: self.extras.id
success: function success(response) { },
console.log(response); success: function success(response) {
if (response.data.success) { console.log(response);
_public.uComponents.openAlert(self, Vue.t('addUnlockInfo.addInfoSuccess'), { if (response.data.success) {
text: Vue.t('dialog.confirm'), callback: function callback() { _public.uComponents.openAlert(self, Vue.t('addUnlockInfo.addInfoSuccess'), {
_public.iot.navigator.fire(plus.webview.currentWebview().opener(), 'returnPage', {}); text: Vue.t('dialog.confirm'), callback: function callback() {
_public.iot.navigator.back(); _public.iot.navigator.fire(plus.webview.currentWebview().opener(), 'returnPage', {});
} _public.iot.navigator.back();
}
});
} else {}
},
error: function error(_error) {
console.log(_error);
// if(window.iotDebug){
// iotDebug.push('end: 绑定开门方式失败'+JSON.stringify(error));
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'绑定开门方式失败');
// }
_public.uComponents.openAlert(vmObj, Vue.t('addUnlockInfo.addInfoFailue'), {
text: Vue.t('dialog.confirm'), callback: function callback() {}
}); });
} else {} },
}, complete: function complete() {
error: function error(_error) { _public.uComponents.hideLoading(self);
console.log(_error); }
// if(window.iotDebug){ });
// iotDebug.push('end: 绑定开门方式失败'+JSON.stringify(error)); setTimeout(function () {
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'绑定开门方式失败');
// }
_public.uComponents.openAlert(vmObj, Vue.t('addUnlockInfo.addInfoFailue'), { _public.uComponents.openAlert(vmObj, Vue.t('addUnlockInfo.addInfoFailue'), {
text: Vue.t('dialog.confirm'), callback: function callback() {} text: Vue.t('dialog.confirm'), callback: function callback() {}
}); });
},
complete: function complete() {
_public.uComponents.hideLoading(self); _public.uComponents.hideLoading(self);
} }, _config2.default.wifi_add_timeout);
}); }
} }
function selectOpenDoorModeTap(self, index) { function selectOpenDoorModeTap(self, index) {
......
...@@ -1208,6 +1208,7 @@ function unbindButtonTap(self) { ...@@ -1208,6 +1208,7 @@ function unbindButtonTap(self) {
success: function success(response) { success: function success(response) {
console.log(response); console.log(response);
self.setStateShowFlag(true); self.setStateShowFlag(true);
getUserInfo(self);
}, },
error: function error(_error2) { error: function error(_error2) {
console.log(_error2); console.log(_error2);
......
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