Commit c1a1afd5 by 朱建香

1109

parent 141b86ab
...@@ -152,11 +152,30 @@ function connectButtonTap(self){ ...@@ -152,11 +152,30 @@ function connectButtonTap(self){
success: (response) => { success: (response) => {
console.log("findWifi"); console.log("findWifi");
console.log(response); console.log(response);
console.log(JSON.stringify(response));
if(window.iotDebug){
iotDebug.push('end: findWifi'+JSON.stringify(response));
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
if(response.data == 'onProvisioning'){ if(response.data == 'onProvisioning'){
//wifi链接中 //wifi链接中
if(window.iotDebug){
iotDebug.push('end: 开始配网');
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
uComponents.showCommLoading(self); uComponents.showCommLoading(self);
uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.wifiBinding')); uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.wifiBinding'));
}else if(response.data == 'provisioned success'){ }else if(response.data == 'provisioned success'){
if(window.iotDebug){
iotDebug.push('end: 配网成功');
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
//wifi连接成功,停止连接wifi //wifi连接成功,停止连接wifi
uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.wifiBindSuccess')); uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.wifiBindSuccess'));
// iot.business.sds.stopFindWifi({ // iot.business.sds.stopFindWifi({
...@@ -167,21 +186,51 @@ function connectButtonTap(self){ ...@@ -167,21 +186,51 @@ function connectButtonTap(self){
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
if(window.iotDebug){
iotDebug.push('end: findWifiError'+JSON.stringify(error));
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
} }
}); });
let deviceId = null; let deviceId = null;
iot.business.sds.findDevices({ iot.business.sds.findDevices({
success: (response) => { success: (response) => {
console.log(response); console.log(response);
if(window.iotDebug){
iotDebug.push('end: findDevices'+JSON.stringify(response));
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
let productId = iot.navigator.getExtras().model; let productId = iot.navigator.getExtras().model;
if(response.data == "onJoining"){ if(response.data == "onJoining"){
if(window.iotDebug){
iotDebug.push('end: 激活中');
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.deviceActivating')); uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.deviceActivating'));
}else if(response.data == "joined success"){ }else if(response.data == "joined success"){
if(window.iotDebug){
iotDebug.push('end: 激活成功');
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
let deviceId = response.info.sn; let deviceId = response.info.sn;
unbind(self, deviceId, productId); unbind(self, deviceId, productId);
// bind(self, deviceId, productId); // bind(self, deviceId, productId);
}else if(response.data == "fail"){ }else if(response.data == "fail"){
//连接失败 //连接失败
if(window.iotDebug){
iotDebug.push('end: 激活失败');
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.deviceActivateFailure')); uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.deviceActivateFailure'));
self.setStatus(2); self.setStatus(2);
uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice')); uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));
...@@ -194,6 +243,12 @@ function connectButtonTap(self){ ...@@ -194,6 +243,12 @@ function connectButtonTap(self){
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
if(window.iotDebug){
iotDebug.push('end: findDevicesError'+JSON.stringify(response));
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
} }
}); });
} }
......
...@@ -781,7 +781,7 @@ function securityAlarmTap(self){ ...@@ -781,7 +781,7 @@ function securityAlarmTap(self){
//tap 门锁用户 //tap 门锁用户
function doorlockUserTap(self){ function doorlockUserTap(self){
if(self.getValueDoorlockUser() == 1){ // if(self.getValueDoorlockUser() == 1){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../doorlockUsers/index.html', url: '../doorlockUsers/index.html',
id: 'doorlockUsers', id: 'doorlockUsers',
...@@ -792,7 +792,7 @@ function doorlockUserTap(self){ ...@@ -792,7 +792,7 @@ function doorlockUserTap(self){
role: self.getRole() role: self.getRole()
} }
}); });
} // }
} }
//tap 远程开门 //tap 远程开门
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
display: none; display: none;
} }
</style> </style>
<script type="text/javascript" src="./start.js"></script>
<script type="text/javascript" src="../../lib/js/p.js"></script> <script type="text/javascript" src="../../lib/js/p.js"></script>
<script type="text/javascript" src="../../lib/js/UIOT.js"></script> <script type="text/javascript" src="../../lib/js/UIOT.js"></script>
</head> </head>
......
...@@ -24706,18 +24706,18 @@ function securityAlarmTap(self) { ...@@ -24706,18 +24706,18 @@ function securityAlarmTap(self) {
//tap 门锁用户 //tap 门锁用户
function doorlockUserTap(self) { function doorlockUserTap(self) {
if (self.getValueDoorlockUser() == 1) { // if(self.getValueDoorlockUser() == 1){
_public.iot.navigator.openWindow({ _public.iot.navigator.openWindow({
url: '../doorlockUsers/index.html', url: '../doorlockUsers/index.html',
id: 'doorlockUsers', id: 'doorlockUsers',
extras: { extras: {
deviceId: self.deviceId, deviceId: self.deviceId,
uuid: self.getUuid(), uuid: self.getUuid(),
lockId: self.getLockId(), lockId: self.getLockId(),
role: self.getRole() role: self.getRole()
} }
}); });
} // }
} }
//tap 远程开门 //tap 远程开门
......
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