Commit 525053aa by 朱建香

首页登录优化

parent a00ec4d1
...@@ -85,22 +85,6 @@ function initComponentsConfig() { ...@@ -85,22 +85,6 @@ function initComponentsConfig() {
} }
} }
//function resolve(self){
// if (plus.os.name == 'Android') {
// iot.permission.checkPermission(['READ_EXTERNAL_STORAGE'], function (res) {
// console.log('success', res);
// loginButtonTap(self);
// }, function (err) {
// console.log('error', err);
// //已禁用,跳到系统设置页面
// iot.native.toAppSetting();
// });
// }else{
// loginButtonTap(self);
// }
//}
//sds登陆 //sds登陆
function loginButtonTap(self){ function loginButtonTap(self){
if (plus.os.name == 'Android') { if (plus.os.name == 'Android') {
...@@ -109,18 +93,6 @@ function loginButtonTap(self){ ...@@ -109,18 +93,6 @@ function loginButtonTap(self){
openSdsLogin(self); openSdsLogin(self);
}, function (err) { }, function (err) {
console.log('error', err); console.log('error', err);
//已禁用,跳到系统设置页面
// plus.nativeUI.confirm('需要文件读取权限', (e)=>{
// if(e.index == 1){
// //确认
// iot.native.toAppSetting();
// }else if(e.index == 1){
// //取消
// uComponents.hideloading(self);
// }
// },{ "title":"权限请求",
// "buttons":["取消","确定"],
// "verticalAlign":"center"});
}); });
}else{ }else{
openSdsLogin(self); openSdsLogin(self);
...@@ -163,14 +135,11 @@ function openSdsLogin(self){ ...@@ -163,14 +135,11 @@ function openSdsLogin(self){
} }
uComponents.hideLoading(self); uComponents.hideLoading(self);
}, },
complete: () => { complete: () => {}
// uComponents.hideLoading(self);
}
}); });
}, },
error: (error) => { error: (error) => {
//初始化失败,重新初始化 //初始化失败,重新初始化
console.log('eroor');
console.log(error); console.log(error);
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('end: 初始化失败'+JSON.stringify(error)); iotDebug.push('end: 初始化失败'+JSON.stringify(error));
...@@ -185,7 +154,10 @@ function openSdsLogin(self){ ...@@ -185,7 +154,10 @@ function openSdsLogin(self){
} }
}); });
}, },
complete: () => {} complete: () => {
console.log("complete");
uComponents.hideLoading(self);
}
}); });
} }
...@@ -224,11 +196,13 @@ function cloudsLogin(self, id){ ...@@ -224,11 +196,13 @@ function cloudsLogin(self, id){
console.log(response); console.log(response);
}, },
error: (error) => { error: (error) => {
uComponents.hideLoading(self);
console.log(error); console.log(error);
uPublic.openRequestErrorAlert(self); uPublic.openRequestErrorAlert(self);
uComponents.hideLoading(self);
}, },
complete: () => {} complete: () => {
// uComponents.hideLoading(self);
}
}); });
} }
iot.navigator.openWindow({ iot.navigator.openWindow({
......
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