Commit 94f6b325 by wjd

Merge branch 'jianxiang' into 'debug'

Jianxiang

See merge request iot-project-js/doorlock!34
parents 3d363a7c ef8c3132
...@@ -134,6 +134,7 @@ function resolve(self){ ...@@ -134,6 +134,7 @@ function resolve(self){
function passwordChange(self,text){ function passwordChange(self,text){
self.setTextPassword(text); self.setTextPassword(text);
console.log('passwordChange: ' + self.getTextPassword()); console.log('passwordChange: ' + self.getTextPassword());
self.setTextErrorTip('');
} }
//重新mui.back //重新mui.back
...@@ -153,7 +154,7 @@ function connectButtonTap(self){ ...@@ -153,7 +154,7 @@ function connectButtonTap(self){
self.setTextErrorTip(Vue.t('wifiAdd.unbindWifiTip')); self.setTextErrorTip(Vue.t('wifiAdd.unbindWifiTip'));
}else if(self.getTextPassword() == null || self.getTextPassword().trim() == ''){ }else if(self.getTextPassword() == null || self.getTextPassword().trim() == ''){
self.setTextErrorTip(Vue.t('wifiAdd.passwordInputTip')); self.setTextErrorTip(Vue.t('wifiAdd.passwordInputTip'));
}else{ }else if(self.getTextErrorTip() == ''){
self.countDownText = config.add_wifi_timeout; self.countDownText = config.add_wifi_timeout;
window.clearInterval(self.timeout); window.clearInterval(self.timeout);
self.timeout = setInterval(() => { self.timeout = setInterval(() => {
...@@ -218,17 +219,7 @@ function connectButtonTap(self){ ...@@ -218,17 +219,7 @@ function connectButtonTap(self){
iotDebug.upload(iot,'配网成功'); iotDebug.upload(iot,'配网成功');
} }
//wifi连接成功,停止连接wifi //wifi连接成功,停止连接wifi
uComponents.showProcess(self, 0, Vue.t('wifiAdd.wifiBindSuccess'), [{ uComponents.showProcess(self, 0, Vue.t('wifiAdd.wifiBindSuccess'));
"class": 'custom-process-button custom-process-cancelButton', 'text': Vue.t('btn.cancel'), 'callback': () => {
uComponents.hideProcess(self);
window.clearInterval(self.timeout);
//停止配网
iot.business.sds.stopFindDevices({
success: (response) => {},
error: (error) => {}
});
}
}]);
} }
}, },
error: (error) => { error: (error) => {
...@@ -259,17 +250,7 @@ function connectButtonTap(self){ ...@@ -259,17 +250,7 @@ function connectButtonTap(self){
if (window.iotDebug) { if (window.iotDebug) {
iotDebug.upload(iot,'激活中'); iotDebug.upload(iot,'激活中');
} }
uComponents.showProcess(self, 0, Vue.t('wifiAdd.deviceActivating'), [{ uComponents.showProcess(self, 0, Vue.t('wifiAdd.deviceActivating'));
"class": 'custom-process-button custom-process-cancelButton', 'text': Vue.t('btn.cancel'), 'callback': () => {
uComponents.hideProcess(self);
window.clearInterval(self.timeout);
//停止配网
iot.business.sds.stopFindDevices({
success: (response) => {},
error: (error) => {}
});
}
}]);
}else if(response.data == "joined success"){ }else if(response.data == "joined success"){
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('end: 激活成功'+JSON.stringify(response)); iotDebug.push('end: 激活成功'+JSON.stringify(response));
......
...@@ -1235,7 +1235,9 @@ function confirmButtonTap(self){ ...@@ -1235,7 +1235,9 @@ function confirmButtonTap(self){
if(self.boolPasswordMinlength){ if(self.boolPasswordMinlength){
if(self.getTextPassword() == null || self.getTextPassword().trim() == ''){ if(self.getTextPassword() == null || self.getTextPassword().trim() == ''){
self.setTextErrorTip(Vue.t('remoteOpendoor.error.noPasswordTip')); self.setTextErrorTip(Vue.t('remoteOpendoor.error.noPasswordTip'));
}else{ }else if(uPublic.checkString(self.getTextPassword())){
self.setTextErrorTip(Vue.t('remoteOpendoor.textlengthTip'));
}else if(self.textErrorTip == ''){
uComponents.showCommLoading(self); uComponents.showCommLoading(self);
setRemoteOpenDoorLoading(self, 0, Vue.t('remoteOpendoor.loading')); setRemoteOpenDoorLoading(self, 0, Vue.t('remoteOpendoor.loading'));
let keyIv = crypto.enkey(self.mac.replace(/:/g,'')); let keyIv = crypto.enkey(self.mac.replace(/:/g,''));
...@@ -1281,11 +1283,12 @@ function confirmButtonTap(self){ ...@@ -1281,11 +1283,12 @@ function confirmButtonTap(self){
} }
},config.remote_opendoor_timeout); },config.remote_opendoor_timeout);
}else{ }else{
uComponents.openAlert(self, Vue.t('remoteOpendoor.textlengthTip'), { self.setTextErrorTip(Vue.t('remoteOpendoor.textlengthTip'));
text: Vue.t('dialog.confirm'), callback: function () { // uComponents.openAlert(self, Vue.t('remoteOpendoor.textlengthTip'), {
// text: Vue.t('dialog.confirm'), callback: function () {
} //
}); // }
// });
} }
}else{ }else{
uComponents.openAlert(self, Vue.t('remoteOpendoor.offlineTip'), { uComponents.openAlert(self, Vue.t('remoteOpendoor.offlineTip'), {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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