Commit 21da8e70 by 朱建香

1120

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