Commit 941ff1b1 by 朱建香

1214

1.登陆获取cid
2.登陆判断sds是否初始化成功
3.iot.navigator.fire方法更改
parent 93551a29
......@@ -330,7 +330,8 @@
"oldPasswordInputTipAgain": "请再次输入旧密码"
},
"request":{
"error": "请求发送失败"
"error": "请求发送失败",
"initError": "初始化失败,请关闭APP重试"
},
"deviceList":{
"model": "型号:",
......
......@@ -117,17 +117,7 @@ iot.navigator.getAllWebviw = function () {
}
iot.navigator.fire = function (webview, eventType, data) {
if (webview) {
if (typeof data === 'undefined') {
data = '';
} else if (typeof data === 'boolean' || typeof data === 'number') {
webview.evalJS("typeof mui!=='undefined'&&mui.receive('" + eventType + "'," + data + ")");
return;
} else if (typeof data === 'object' && Object.keys(data).length == 0) {
data = JSON.stringify(data || {}).replace(/\'/g, "\\u0027").replace(/\\/g, "\\u005c");
}
webview.evalJS('iot.navigator.receive("' + eventType + '","' + data + '")');
}
mui.fire(webview, eventType, data);
};
window.iot = iot;
......
......@@ -143,6 +143,7 @@ function deviceBind(self, lockId, relId){
let data = response.data;
if(data.success){
uComponents.openAlert(self, Vue.t('addDevice.bindSuccess'), {
iot.navigator.fire(plus.webview.getWebviewById('device'),'returnPage',{});
text: Vue.t('dialog.confirm'), callback: function () {
iot.navigator.openWindow({
url: '../device/index.html',
......
......@@ -26,6 +26,7 @@ function init() {
},
mounted(){
resolve(this);
},
methods:{
getTextWiFiName(){
......@@ -285,6 +286,8 @@ function commLoadingButtonTap(self) {
if(self.getStatus() == 1){
//绑定成功
uComponents.hideCommLoading(self);
iot.navigator.fire(plus.webview.getWebviewById('device'),'returnPage',{});
iot.navigator.openWindow({
url: '../device/index.html',
id: 'device'
......
......@@ -1287,7 +1287,7 @@ function confirmButtonTap(self){
});
}
console.log('aaaa');
setTimeout(function (){
let time = setTimeout(function (){
console.log(self.getStatus());
if(self.getStatus() == 0){
console.log("timeout");
......@@ -1295,6 +1295,7 @@ function confirmButtonTap(self){
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('remoteOpendoor.openDoorFailure'));
uComponents.changeCommButtonText(self, Vue.t('remoteOpendoor.remoteOpendoorAgain'));
self.setStatus(2);
window.clearTimeout(time);
}
},config.remote_opendoor_timeout);
}
......
......@@ -311,6 +311,7 @@ function unbindDoorlockButtonTap(self){
//tap 隐藏提示框
function unbindStateDialogTap(self){
self.setStateShowFlag(false);
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
if(self.getUnbindSucceess){
iot.navigator.openWindow({
url: '../device/index.html',
......
......@@ -104,6 +104,11 @@ function loginButtonTap(self){
// alert(error);
// console.log(err);
// })
iot.business.sds.checkSDSInit({
data: {},
success: (response) => {
//初始化成功
console.log(response);
iot.business.sds.login({
data: {
userinfo: {}
......@@ -137,6 +142,26 @@ function loginButtonTap(self){
uComponents.hideLoading(self);
}
});
},
error: (error) => {
//初始化失败,重新初始化
console.log(error);
if(window.iotDebug){
iotDebug.push('end: 初始化失败'+JSON.stringify(error));
}
if (window.iotDebug) {
iotDebug.upload(iot,'初始化失败');
}
uPublic.openRequestErrorAlert(self, Vue.t('request.initError'));
uComponents.openAlert(self, Vue.t('request.initError'), {
text: Vue.t('dialog.confirm'), callback: function () {
iot.navigator.closeAll();
}
});
},
complete: () => {}
});
}
function cloudsLogin(self, id){
......
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