Commit 21da8e70 by 朱建香

1120

parent 49697cd8
......@@ -345,12 +345,14 @@ function unbindButtonTap(self){
uComponents.openConfirm(self, Vue.t('doorlockUser.unbindDialogTip'),
{text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.unbind'), callback: function () {
self.setStateShowFlag(true);
// iot.business.sds.unbindDevice({
alert(self.extras.account);
// iot.business.sds.unbindByManager({
// data: {
// uuid: self.extras.uuid
// uuid: self.extras.uuid,
// destAuid: self.extras.account
// },
// success: (response) => {
//// alert(JSON.stringify(response));
iot.business.api.sendCustom('lock/unbindUser',{
data: {
user_id: self.getInfo().user_id,
......@@ -359,6 +361,7 @@ function unbindButtonTap(self){
},
success: (response) => {
console.log(response);
// alert(JSON.stringify(response));
self.setStateShowFlag(true);
getUserInfo(self);
},
......@@ -382,16 +385,19 @@ function unbindButtonTap(self){
// },
// error: (error) => {
// console.log(error);
// // if(window.iotDebug){
// // iotDebug.push('end: sds解绑设备失败'+JSON.stringify(error));
// // }
// // if (window.iotDebug) {
// // iotDebug.upload(iot,'sds解绑设备失败');
// // }
// alert(error);
//// if(window.iotDebug){
//// iotDebug.push('end: sds解绑普通用户失败'+JSON.stringify(error));
//// }
//// if (window.iotDebug) {
//// iotDebug.upload(iot,'sds解绑普通用户失败');
//// }
// uPublic.openRequestErrorAlert(self);
// self.setImageSrc('../../resources/image/green_unbindFail_icon.png');
// self.setTextBindTip(Vue.t('doorlockUser.unbindFailue'));
// self.setStateShowFlag(true);
// },
// complete: () => {
// uComponents.hideLoading(self);
// }
// });
}}
......
......@@ -246,6 +246,7 @@ function onTapUserList(self, listIndex) {
extras: {
id: self.getUserListData()[listIndex].id,
uuid: self.extras.uuid,
account: self.getUserListData()[listIndex].account,
lockId: self.extras.lockId,
role: self.extras.role
}
......
......@@ -20,6 +20,13 @@ function init() {
clientId: null
},
mounted(){
if (plus.os.name == 'Android') {
iot.permission.checkPermission(['READ_EXTERNAL_STORAGE', 'CAMERA','ACCESS_FINE_LOCATION'], function (res) {
console.log('success', res);
}, function (err) {
console.log('error', err);
});
}
var clientInfo = plus.push.getClientInfo();
this.setClientId(clientInfo.clientid);
loginButtonTap(this);
......
......@@ -1193,12 +1193,14 @@ function bindTap(self) {
//tap 解绑
function unbindButtonTap(self) {
_public.uComponents.openConfirm(self, Vue.t('doorlockUser.unbindDialogTip'), { text: Vue.t('dialog.cancel'), callback: function callback() {} }, { text: Vue.t('dialog.unbind'), callback: function callback() {
self.setStateShowFlag(true);
// iot.business.sds.unbindDevice({
alert(self.extras.account);
// iot.business.sds.unbindByManager({
// data: {
// uuid: self.extras.uuid
// uuid: self.extras.uuid,
// destAuid: self.extras.account
// },
// success: (response) => {
//// alert(JSON.stringify(response));
_public.iot.business.api.sendCustom('lock/unbindUser', {
data: {
user_id: self.getInfo().user_id,
......@@ -1207,6 +1209,7 @@ function unbindButtonTap(self) {
},
success: function success(response) {
console.log(response);
// alert(JSON.stringify(response));
self.setStateShowFlag(true);
getUserInfo(self);
},
......@@ -1230,16 +1233,19 @@ function unbindButtonTap(self) {
// },
// error: (error) => {
// console.log(error);
// // if(window.iotDebug){
// // iotDebug.push('end: sds解绑设备失败'+JSON.stringify(error));
// // }
// // if (window.iotDebug) {
// // iotDebug.upload(iot,'sds解绑设备失败');
// // }
// alert(error);
//// if(window.iotDebug){
//// iotDebug.push('end: sds解绑普通用户失败'+JSON.stringify(error));
//// }
//// if (window.iotDebug) {
//// iotDebug.upload(iot,'sds解绑普通用户失败');
//// }
// uPublic.openRequestErrorAlert(self);
// self.setImageSrc('../../resources/image/green_unbindFail_icon.png');
// self.setTextBindTip(Vue.t('doorlockUser.unbindFailue'));
// self.setStateShowFlag(true);
// },
// complete: () => {
// uComponents.hideLoading(self);
// }
// });
} });
......
......@@ -1069,6 +1069,7 @@ function _onTapUserList(self, listIndex) {
extras: {
id: self.getUserListData()[listIndex].id,
uuid: self.extras.uuid,
account: self.getUserListData()[listIndex].account,
lockId: self.extras.lockId,
role: self.extras.role
}
......
......@@ -27,6 +27,13 @@ function init() {
clientId: null
},
mounted: function mounted() {
if (plus.os.name == 'Android') {
_public.iot.permission.checkPermission(['READ_EXTERNAL_STORAGE', 'CAMERA', 'ACCESS_FINE_LOCATION'], function (res) {
console.log('success', res);
}, function (err) {
console.log('error', err);
});
}
var clientInfo = plus.push.getClientInfo();
this.setClientId(clientInfo.clientid);
loginButtonTap(this);
......
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