Commit d8d8d909 by 朱建香

1012

parent a6ab7446
...@@ -158,7 +158,7 @@ function connectButtonTap(self){ ...@@ -158,7 +158,7 @@ function connectButtonTap(self){
}else{ }else{
iot.business.sds.findWifi({ iot.business.sds.findWifi({
data: { data: {
model: 'THM_LIVING_ELECTRICALBLANKET_TH_1507', model: 'UGEN_LIVING_ELECTRICALBLANKET_THM_BL',
ssid: self.getTextWiFiName(), ssid: self.getTextWiFiName(),
wifiPwd: self.getTextPassword(), wifiPwd: self.getTextPassword(),
timeout: 20000 timeout: 20000
......
...@@ -63,19 +63,19 @@ function backTap(){ ...@@ -63,19 +63,19 @@ function backTap(){
//tap 开始配置Wi-Fi //tap 开始配置Wi-Fi
function wifiAddButtonTap(){ function wifiAddButtonTap(){
// iot.navigator.openWindow({ iot.navigator.openWindow({
// url: './wifiAdd.html', url: './wifiAdd.html',
// id: 'wifiAdd' id: 'wifiAdd'
// }); });
console.log("in"); console.log("in");
iot.business.sds.wifiDeviceConfig({ // iot.business.sds.wifiDeviceConfig({
success: function (response) { // success: function (response) {
console.log('wifiDeviceConfig success'); // console.log('wifiDeviceConfig success');
console.log(response); // console.log(response);
}, // },
error: function (error) { // error: function (error) {
console.log('wifiDeviceConfig error'); // console.log('wifiDeviceConfig error');
console.log(error); // console.log(error);
} // }
}); // });
} }
\ No newline at end of file
...@@ -460,6 +460,7 @@ function doorlockManageTap(self){ ...@@ -460,6 +460,7 @@ function doorlockManageTap(self){
url: '../doorlockManage/', url: '../doorlockManage/',
id: 'doorlockManage', id: 'doorlockManage',
extras: { extras: {
deviceId: self.deviceId,
uuid: self.getUuid() uuid: self.getUuid()
} }
}); });
...@@ -481,7 +482,7 @@ function opendoorRecordTap(self){ ...@@ -481,7 +482,7 @@ function opendoorRecordTap(self){
//tap 安全报警 //tap 安全报警
function securityAlarmTap(self){ function securityAlarmTap(self){
if(self.getValueSecurityAlarm == 1){ if(self.getValueSecurityAlarm() == 1){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: './alarmInfo.html', url: './alarmInfo.html',
id: 'alarmInfo', id: 'alarmInfo',
...@@ -504,7 +505,7 @@ function doorlockUserTap(){ ...@@ -504,7 +505,7 @@ function doorlockUserTap(){
//tap 远程开门 //tap 远程开门
function remoteOpendoorTap(self){ function remoteOpendoorTap(self){
if(self.getValueRemoteOpendoor == 1){ if(self.getValueRemoteOpendoor() == 1){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: './remoteOpendoor.html', url: './remoteOpendoor.html',
id: 'remoteOpendoor', id: 'remoteOpendoor',
...@@ -517,7 +518,7 @@ function remoteOpendoorTap(self){ ...@@ -517,7 +518,7 @@ function remoteOpendoorTap(self){
//tap 劫持报警 //tap 劫持报警
function hijackAlarmTap(self){ function hijackAlarmTap(self){
if(self.setValueHijackAlarm == 1){ if(self.setValueHijackAlarm() == 1){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: './hijackRecord.html', url: './hijackRecord.html',
id: 'hijackRecord', id: 'hijackRecord',
......
...@@ -118,13 +118,14 @@ function initComponentsConfig() { ...@@ -118,13 +118,14 @@ function initComponentsConfig() {
function getDoorlockInfo(self){ function getDoorlockInfo(self){
uComponents.showLoading(self); uComponents.showLoading(self);
iot.business.device.getList({ iot.business.api.send('device/getList',{
data: { data: {
sds: false, sds: false,
device_id: self.extras.deviceId,
product_id: 2, product_id: 2,
parent_id: 0, parent_id: 0,
start_id: 0, start_id: 0,
number: 1 number: 10
}, },
success: (response) => { success: (response) => {
console.log(response); console.log(response);
...@@ -143,7 +144,7 @@ function getDoorlockInfo(self){ ...@@ -143,7 +144,7 @@ function getDoorlockInfo(self){
complete: () => { complete: () => {
uComponents.hideLoading(self); uComponents.hideLoading(self);
} }
}); },true);
} }
//tap < //tap <
...@@ -157,7 +158,7 @@ function editNameTap(self){ ...@@ -157,7 +158,7 @@ function editNameTap(self){
url: './editName.html', url: './editName.html',
id: 'editName', id: 'editName',
extras: { extras: {
deviceId: self.getDoorlock().device_id, deviceId: self.getDoorlock().id,
nickname: self.getTextNickname() nickname: self.getTextNickname()
} }
}); });
...@@ -165,55 +166,61 @@ function editNameTap(self){ ...@@ -165,55 +166,61 @@ function editNameTap(self){
//tap 解绑门锁 //tap 解绑门锁
function unbindDoorlockButtonTap(self){ function unbindDoorlockButtonTap(self){
uComponents.openConfirm(self, Vue.t('doorlockUser.unbindDialogTip'), uComponents.openConfirm(self, Vue.t('doorlockUser.unbindDialogTip'),
{text: Vue.t('dialog.cancel'), callback: function () {}}, {text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.unbind'), callback: function () { {text: Vue.t('dialog.unbind'), callback: function () {
uComponents.showLoading(self); // uComponents.showLoading(self);
iot.business.device.unbind({ // //云端解绑
data: { // iot.business.device.unbind({
sds: true, // data: {
uuid: self.extras.uuid // device_id: self.getDoorlock().id
}, // },
success: (response) => { // success: (response) => {
console.log(response); // console.log(response);
//云端解绑
iot.business.device.unbind({ iot.business.device.unbind({
data: { data: {
device_id: self.getDoorlock().device_id sds: true,
}, uuid: self.extras.uuid,
device_id: self.getDoorlock().id
},
success: (response) => { success: (response) => {
console.log(response); console.log(response);
self.setStateShowFlag(true); self.setStateShowFlag(true);
self.setShowMsg(Vue.t('doorlockUser.unbindSuccess')); self.setShowMsg(Vue.t('doorlockUser.unbindSuccess'));
self.setUnbindSucceess(true); self.setUnbindSucceess(true);
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
self.setStateShowFlag(true); self.setStateShowFlag(false);
self.setShowMsg(Vue.t('doorlockUser.unbindFailue')); self.setShowMsg(Vue.t('doorlockUser.unbindFailue'));
self.setUnbindSucceess(false); self.setUnbindSucceess(false);
}, },
complete: () => { complete: () => {
uComponents.hideLoading(self); uComponents.hideLoading(self);
} }
}); });
}, // },
error: (error) => { // error: (error) => {
console.log(error); // console.log(error);
self.setStateShowFlag(true); // self.setStateShowFlag(true);
self.setShowMsg(Vue.t('doorlockUser.unbindFailue')); // self.setShowMsg(Vue.t('doorlockUser.unbindFailue'));
self.setUnbindSucceess(false); // self.setUnbindSucceess(false);
}, // },
complete: () => { // complete: () => {
uComponents.hideLoading(self); // uComponents.hideLoading(self);
} // }
}); // });
}} }}
); );
} }
//tap 隐藏提示框 //tap 隐藏提示框
function unbindStateDialogTap(self){ function unbindStateDialogTap(self){
self.setStateShowFlag(false); self.setStateShowFlag(false);
if(self.getUnbindSucceess){
iot.navigator.openWindow({
url: '../device/',
id: 'device'
});
}
} }
...@@ -74,6 +74,7 @@ function loginButtonTap(self){ ...@@ -74,6 +74,7 @@ function loginButtonTap(self){
console.log(response); console.log(response);
let data = uPublic.checkResponseData(response.data); let data = uPublic.checkResponseData(response.data);
if(data){ if(data){
console.log("云端登陆");
cloudsLogin(self, data.UserID); cloudsLogin(self, data.UserID);
// iot.navigator.openWindow({ // iot.navigator.openWindow({
// url: '../device/', // url: '../device/',
......
...@@ -118,6 +118,11 @@ function logoutButtonTap(self){ ...@@ -118,6 +118,11 @@ function logoutButtonTap(self){
sds: true sds: true
}, },
success: (response) => { success: (response) => {
iot.business.websql.delMaps(['utoken', 'userinfo'], (response) => {
console.log(response);
}, (error) => {
console.log(error);
});
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../login/', url: '../login/',
id: 'login' id: 'login'
......
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