Commit 0c9faa3d by 朱建香

1025

parent b4129f27
......@@ -21,12 +21,14 @@
"devDependencies": {
"babel-core": "6.24.1",
"babel-loader": "6.4.1",
"babel-preset-es2015": "6.24.1",
"babel-plugin-transform-async-to-generator": "6.24.1",
"babel-plugin-transform-object-assign": "6.22.0",
"babel-plugin-transform-runtime": "6.23.0",
"babel-preset-es2015": "6.24.1",
"crypto-js": "^3.1.9-1",
"css-loader": "0.28.0",
"es6-promise": "4.1.0",
"md5": "^2.2.1",
"style-loader": "0.16.1",
"vue-loader": "11.3.4",
"vue-template-compiler": "2.2.6",
......
......@@ -212,5 +212,4 @@ iot.navigator.aback =function(){
iot.navigator.getCurrentWebView = function (){
return plus.webview.currentWebview();
}
export {iot, uPublic, uComponents}
\ No newline at end of file
......@@ -206,37 +206,8 @@ function connectButtonTap(self){
}
let productId = config.mode.substr(config.mode_type.length, 6);
if(response.data == "joined success"){
//云端绑定
// unBind(self, deviceId, productId);
bind(self, deviceId, productId);
// iot.business.device.bind({
// data: {
// product_id: productId,
// device_id: deviceId,
//// mac: parameters.mac,
// nickname: ''
// },
// success: (response) => {
// console.log(response);
// let data = response.data;
// if(data.success){
// uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('addDevice.scanCodeAdd'));
// self.setStatus(1);
// }
// },
// error: (error) => {
// console.log(error);
// uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('addDevice.bindFailure'));
// self.setStatus(2);
// },
// complete: () => {}
// });
// //停止查找设备
iot.business.sds.stopFindDevices({
success: (response) => {},
error: (error) => {}
});
unbind(self, deviceId, productId);
// bind(self, deviceId, productId);
}else if(response.data == "fail"){
//连接失败
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('addDevice.bindFailure'));
......@@ -256,6 +227,8 @@ function connectButtonTap(self){
}
}
//tap loading button
function commLoadingButtonTap(self) {
if(self.getStatus() == 1){
......@@ -271,24 +244,51 @@ function commLoadingButtonTap(self) {
}
}
//function unBind(self, deviceId, productId){
// iot.business.device.unbind({
// data: {
// device_id: deviceId
// },
// success: (response) => {
// console.log(response);
// bind(self, deviceId, productId);
// },
// error: (error) => {
// console.log(error);
// },
// complete: () => {}
// });
//}
function unbind(self, deviceId, productId){
iot.business.api.sendCustom('lock/getLockInfo',{
data: {
device_id: self.deviceId
},
success: (response) => {
console.log(response);
let data = uPublic.checkResponseData(response.data);
if(data){
if(data.lock_id){
iot.business.api.sendCustom('lock/unbind',{
data: {
device_sn: self.getDoorlock().device_id,
device_id: self.getDoorlock().id
},
success: (response) => {
console.log(response);
bind(self, deviceId, productId);
},
error: (error) => {
console.log(error);
},
complete: () => {
}
});
}else{
bind(self, deviceId, productId);
}
}else{
bind(self, deviceId, productId);
}
},
error: (error) => {
console.log(error);
},
complete: () => {
}
});
}
function bind(self, deviceId, productId){
iot.business.device.bind({
iot.business.api.sendCustom('lock/bind',{
data: {
product_id: productId,
device_id: deviceId,
......
......@@ -434,7 +434,7 @@ function setDevceInfo(self, data) {
self.setBatteryPercent(data.BatteryPercentage.value);
self.setBatteryState(config.powerIcon[Math.round(data.BatteryPercentage.value/20)]);
if(data.action.value == 'notify'){
if(data.notify_type.value == 4){
if(data.notify_type.value == 104){
//门铃响了
self.setDoorbellRingingFlag(true);
self.setTextDoorbellRingingFlag(true);
......
......@@ -7,12 +7,14 @@
* 远程开门页面
*/
import CryptoJS from "crypto-js";
import {iot, uPublic, uComponents} from '../../public/public.js';
import crypto from '../../public/crypto.js';
iot.ready(init);
function init() {
//通用 input、按钮、dialog、loading组件
uPublic.componentsInit(['u-text','u-button','u-commstatus-loading','u-dialog','u-loading']);
uPublic.componentsInit(['u-text','u-button','u-comm-loading','u-dialog','u-loading']);
const app = new Vue({
data:{
textPassword: null,
......@@ -26,6 +28,25 @@ function init() {
},
mounted(){
resolve(this);
let a = {"mac":"B0F89310DDF2","productId":"10002","productSecret":"WABK8XXEEKKLL5MM"};
// let message = JSON.stringify(a);
// let key = CryptoJS.enc.Utf8.parse('9y5Yj3h8f3790cs6');
// let iv = CryptoJS.enc.Utf8.parse('e36de93cf0e08873');
// let b = CryptoJS.AES.encrypt(message, key, { iv: iv},{ mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.nopadding });
// console.log(b.toString());
// let c = new crypto('B0:F8:93:10:D5:09');
// c.enkey();
// let code = c.encode(a);
// console.log(code);
// let msg = c.decode(code);
// console.log(msg);
let keyIv = crypto.enkey('B0:F8:93:10:D5:09'.replace(/:/g,''));
console.log(keyIv);
let code = crypto.encode(a, keyIv);
console.log(code);
let msg = crypto.decode(code, keyIv);
console.log(msg);
},
methods:{
getTextPassword(){
......
......@@ -42,6 +42,7 @@ function init() {
console.log("returnPage");
getDoorlockInfo(self);
});
},
methods:{
getStateShowFlag(){
......@@ -171,68 +172,22 @@ function unbindDoorlockButtonTap(self){
uComponents.openConfirm(self, Vue.t('doorlockUser.unbindDialogTip'),
{text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.unbind'), callback: function () {
// uComponents.showLoading(self);
// //云端解绑
// iot.business.device.unbind({
// data: {
// device_id: self.getDoorlock().id
// },
// success: (response) => {
// console.log(response);
// iot.business.sds.unbindDevice({
// data: {
// uuid: self.extras.uuid
// },
// success: (response) => {
// console.log(response);
// if(self.extras == 'SA'){
// unbind(self);
// }
//
//
// },
// error: (error) => {
// console.log(error);
// }
// });
iot.business.device.unbind({
uComponents.showLoading(self);
iot.business.sds.unbindDevice({
data: {
sds: true,
uuid: self.extras.uuid,
device_id: self.getDoorlock().id
uuid: self.extras.uuid
},
success: (response) => {
console.log(response);
if(self.extras.role){
unbindUser(self);
}else{
self.setStateShowFlag(true);
self.setShowMsg(Vue.t('doorlockUser.unbindSuccess'));
self.setUnbindSucceess(true);
}
unbind(self);
},
error: (error) => {
console.log(error);
self.setStateShowFlag(false);
self.setShowMsg(Vue.t('doorlockUser.unbindFailue'));
self.setUnbindSucceess(false);
console.log(error)
},
complete: () => {
uComponents.hideLoading(self);
}
});
// },
// error: (error) => {
// console.log(error);
// self.setStateShowFlag(true);
// self.setShowMsg(Vue.t('doorlockUser.unbindFailue'));
// self.setUnbindSucceess(false);
// },
// complete: () => {
// uComponents.hideLoading(self);
// }
// });
}}
);
}
......@@ -249,9 +204,10 @@ function unbindStateDialogTap(self){
}
function unbind(self){
iot.business.device.unbind({
iot.business.api.sendCustom('lock/unbind',{
data: {
device_id: self.getDoorlock().device_id
device_sn: self.getDoorlock().device_id,
device_id: self.getDoorlock().id
},
success: (response) => {
console.log(response);
......
......@@ -285,7 +285,17 @@ function setUserInfo(self, data){
//tap <
function backTap(){
let opener = plus.webview.currentWebview().opener();
console.log(opener);
if(opener.id == 'addUser'){
opener.close();
iot.navigator.fire(plus.webview.getWebviewById('doorlockUsers'),'returnPage',{});
iot.navigator.back();
}else{
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log('returnPage');
iot.navigator.back();
}
}
//修改用户名称
......@@ -324,9 +334,9 @@ function unbindButtonTap(self){
self.setStateShowFlag(true);
iot.business.api.sendCustom('lock/unbindUser',{
data: {
rel_id: self.extras.id,
device_id: self.extras.lockId,
user_id: self.getInfo().user_id
user_id: self.getInfo().user_id,
device_sn: self.getInfo().device_id,
device_id: self.extras.lockId
},
success: (response) => {
console.log(response);
......@@ -362,7 +372,7 @@ function bindUnlockInfoTap(self){
id: self.extras.id,
deviceId: self.getInfo().device_id,
lockId: self.extras.lockId,
role: self.getInfo().role
role: self.extras.role
}
});
}
......@@ -408,6 +418,7 @@ function deleteUser(self){
data: {
rel_id: self.extras.id,
user_id: self.getInfo().user_id,
device_sn: self.getInfo().device_id,
device_id: self.extras.lockId
},
success: (response) => {
......
......@@ -88,8 +88,8 @@ function init() {
onTapUserList(index){
onTapUserList(this, index);
},
onTapButton(buttonIndex){
tapButton(buttonIndex);
onTapButton(index){
tapButton(this, index);
},
changeUserList(list){
changeUserList(this, list);
......@@ -223,8 +223,15 @@ function tapLoad(){
}
//点击按钮
function tapButton(buttonIndex){
console.log(buttonIndex);
function tapButton(self, index){
console.log(index);
//tap 删除该用户
uComponents.openConfirm(self, Vue.t('doorlockUser.deleteUserDialogTip'),
{text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.delete'), callback: function () {
deleteUser(self, index);
}}
);
}
// 修改userList列表
......@@ -236,3 +243,38 @@ function changeUserList(self, list) {
self.loadFlag = false;
});
}
//删除用户
function deleteUser(self, index){
uComponents.showLoading(self);
iot.business.api.sendCustom('lock/delLockUser',{
data: {
rel_id: self.getUserListData()[index].id,
user_id: self.getUserListData()[index].user_id,
device_sn: self.getUserListData()[index].device_id,
device_id: self.extras.lockId
},
success: (response) => {
console.log(response);
if(response.data.success){
uComponents.openAlert(self, Vue.t('doorlockUser.deleteSuccess'), {
text: Vue.t('btn.confirm'), callback: function () {
self.setUserList([]);
getUserList(self);
}
});
}
},
error: (err) => {
console.log(err);
uComponents.openAlert(self, Vue.t('doorlockUser.deleteFailure'), {
text: Vue.t('btn.confirm'), callback: function () {
}
});
},
complete: () => {
uComponents.hideLoading(self);
}
});
}
\ No newline at end of file
......@@ -75,6 +75,8 @@ function initComponentsConfig() {
//tap <
function backTap(){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log('returnPage');
iot.navigator.back();
}
......
webpackJsonp([26],{
/***/ 155:
/***/ 166:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_index.js
......@@ -86,13 +86,13 @@ function wifiAddTap() {
/***/ }),
/***/ 255:
/***/ 293:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(155);
module.exports = __webpack_require__(166);
/***/ })
},[255]);
},[293]);
//# sourceMappingURL=index.js.map
\ No newline at end of file
webpackJsonp([25],{
/***/ 156:
/***/ 167:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_scanCodeAdd.js
......@@ -143,13 +143,13 @@ function deviceBind(self, lockId, relId) {
/***/ }),
/***/ 256:
/***/ 294:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(156);
module.exports = __webpack_require__(167);
/***/ })
},[256]);
},[294]);
//# sourceMappingURL=scanCodeAdd.js.map
\ No newline at end of file
webpackJsonp([24],{
/***/ 157:
/***/ 168:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _config = __webpack_require__(122);
var _config = __webpack_require__(124);
var _config2 = _interopRequireDefault(_config);
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
......@@ -222,36 +222,8 @@ function connectButtonTap(self) {
}
var productId = _config2.default.mode.substr(_config2.default.mode_type.length, 6);
if (response.data == "joined success") {
//云端绑定
// unBind(self, deviceId, productId);
bind(self, deviceId, productId);
// iot.business.device.bind({
// data: {
// product_id: productId,
// device_id: deviceId,
//// mac: parameters.mac,
// nickname: ''
// },
// success: (response) => {
// console.log(response);
// let data = response.data;
// if(data.success){
// uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('addDevice.scanCodeAdd'));
// self.setStatus(1);
// }
// },
// error: (error) => {
// console.log(error);
// uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('addDevice.bindFailure'));
// self.setStatus(2);
// },
// complete: () => {}
// });
// //停止查找设备
_public.iot.business.sds.stopFindDevices({
success: function success(response) {},
error: function error(_error3) {}
});
unbind(self, deviceId, productId);
// bind(self, deviceId, productId);
} else if (response.data == "fail") {
//连接失败
_public.uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('addDevice.bindFailure'));
......@@ -260,12 +232,12 @@ function connectButtonTap(self) {
//停止查找设备
_public.iot.business.sds.stopFindDevices({
success: function success(response) {},
error: function error(_error4) {}
error: function error(_error3) {}
});
}
},
error: function error(_error5) {
console.log(_error5);
error: function error(_error4) {
console.log(_error4);
}
});
}
......@@ -286,24 +258,46 @@ function commLoadingButtonTap(self) {
}
}
//function unBind(self, deviceId, productId){
// iot.business.device.unbind({
// data: {
// device_id: deviceId
// },
// success: (response) => {
// console.log(response);
// bind(self, deviceId, productId);
// },
// error: (error) => {
// console.log(error);
// },
// complete: () => {}
// });
//}
function unbind(self, deviceId, productId) {
_public.iot.business.api.sendCustom('lock/getLockInfo', {
data: {
device_id: self.deviceId
},
success: function success(response) {
console.log(response);
var data = _public.uPublic.checkResponseData(response.data);
if (data) {
if (data.lock_id) {
_public.iot.business.api.sendCustom('lock/unbind', {
data: {
device_sn: self.getDoorlock().device_id,
device_id: self.getDoorlock().id
},
success: function success(response) {
console.log(response);
bind(self, deviceId, productId);
},
error: function error(_error5) {
console.log(_error5);
},
complete: function complete() {}
});
} else {
bind(self, deviceId, productId);
}
} else {
bind(self, deviceId, productId);
}
},
error: function error(_error6) {
console.log(_error6);
},
complete: function complete() {}
});
}
function bind(self, deviceId, productId) {
_public.iot.business.device.bind({
_public.iot.business.api.sendCustom('lock/bind', {
data: {
product_id: productId,
device_id: deviceId,
......@@ -318,8 +312,8 @@ function bind(self, deviceId, productId) {
self.setStatus(1);
}
},
error: function error(_error6) {
console.log(_error6);
error: function error(_error7) {
console.log(_error7);
_public.uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('addDevice.bindFailure'));
self.setStatus(2);
},
......@@ -330,13 +324,13 @@ function bind(self, deviceId, productId) {
/***/ }),
/***/ 257:
/***/ 295:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(157);
module.exports = __webpack_require__(168);
/***/ })
},[257]);
},[295]);
//# sourceMappingURL=wifiAdd.js.map
\ No newline at end of file
webpackJsonp([23],{
/***/ 158:
/***/ 169:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_wifiAddHelp.js
......@@ -91,13 +91,13 @@ function wifiAddButtonTap() {
/***/ }),
/***/ 258:
/***/ 296:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(158);
module.exports = __webpack_require__(169);
/***/ })
},[258]);
},[296]);
//# sourceMappingURL=wifiAddHelp.js.map
\ No newline at end of file
webpackJsonp([7],{
webpackJsonp([8],{
/***/ 159:
/***/ 170:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _vueRouter = __webpack_require__(252);
var _vueRouter = __webpack_require__(290);
var _vueRouter2 = _interopRequireDefault(_vueRouter);
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
var _r_bindUserHelp = __webpack_require__(228);
var _r_bindUserHelp = __webpack_require__(266);
var _r_bindUserHelp2 = _interopRequireDefault(_r_bindUserHelp);
var _r_bindUser = __webpack_require__(227);
var _r_bindUser = __webpack_require__(265);
var _r_bindUser2 = _interopRequireDefault(_r_bindUser);
var _r_userList = __webpack_require__(229);
var _r_userList = __webpack_require__(267);
var _r_userList2 = _interopRequireDefault(_r_userList);
......@@ -60,7 +60,7 @@ function init() {
/***/ }),
/***/ 197:
/***/ 234:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -70,7 +70,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
//通用 input、按钮、dialog、loading组件
_public.uPublic.componentsInit(['u-text', 'u-button', 'u-dialog', 'u-loading']); //
......@@ -255,7 +255,7 @@ function bindButtonTap(self) {
/***/ }),
/***/ 198:
/***/ 235:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -265,7 +265,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
//通用 按钮、dialog、loading组件
_public.uPublic.componentsInit(['u-button', 'u-dialog', 'u-loading']); //
......@@ -374,7 +374,7 @@ function boundUserTap(self) {
/***/ }),
/***/ 199:
/***/ 236:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -384,7 +384,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
//通用 侧滑列表、dialog、loading组件
_public.uPublic.componentsInit(['u-swipe-list', 'u-dialog', 'u-loading']); //
......@@ -497,14 +497,14 @@ function userListButtonTap(self, value, buttonValue) {
/***/ }),
/***/ 227:
/***/ 265:
/***/ (function(module, exports, __webpack_require__) {
var Component = __webpack_require__(3)(
var Component = __webpack_require__(4)(
/* script */
__webpack_require__(197),
__webpack_require__(234),
/* template */
__webpack_require__(249),
__webpack_require__(287),
/* scopeId */
null,
/* cssModules */
......@@ -532,14 +532,14 @@ module.exports = Component.exports
/***/ }),
/***/ 228:
/***/ 266:
/***/ (function(module, exports, __webpack_require__) {
var Component = __webpack_require__(3)(
var Component = __webpack_require__(4)(
/* script */
__webpack_require__(198),
__webpack_require__(235),
/* template */
__webpack_require__(247),
__webpack_require__(285),
/* scopeId */
null,
/* cssModules */
......@@ -567,14 +567,14 @@ module.exports = Component.exports
/***/ }),
/***/ 229:
/***/ 267:
/***/ (function(module, exports, __webpack_require__) {
var Component = __webpack_require__(3)(
var Component = __webpack_require__(4)(
/* script */
__webpack_require__(199),
__webpack_require__(236),
/* template */
__webpack_require__(232),
__webpack_require__(270),
/* scopeId */
null,
/* cssModules */
......@@ -602,7 +602,7 @@ module.exports = Component.exports
/***/ }),
/***/ 232:
/***/ 270:
/***/ (function(module, exports, __webpack_require__) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
......@@ -648,7 +648,7 @@ if (false) {
/***/ }),
/***/ 247:
/***/ 285:
/***/ (function(module, exports, __webpack_require__) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
......@@ -704,7 +704,7 @@ if (false) {
/***/ }),
/***/ 249:
/***/ 287:
/***/ (function(module, exports, __webpack_require__) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
......@@ -805,7 +805,7 @@ if (false) {
/***/ }),
/***/ 252:
/***/ 290:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -2870,17 +2870,17 @@ if (inBrowser && window.Vue) {
}
module.exports = VueRouter;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(132)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(138)))
/***/ }),
/***/ 259:
/***/ 297:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(159);
module.exports = __webpack_require__(170);
/***/ })
},[259]);
},[297]);
//# sourceMappingURL=index.js.map
\ No newline at end of file
......@@ -32,11 +32,11 @@
</div>
<u-button :init-param="componentsConfig.confirmButton.initParam" v-on:u-button-tap="onConfirmButtonTap"></u-button>
</div>
<u-commstatus-loading ref="ucommstatusloading" :text="textLoading" :status="status"
<u-comm-loading ref="ucommstatusloading" :text="textLoading" :status="status"
:init-param="componentsConfig.ucommstatusloading.initParam" v-on:u-commstatus-loading-tap="onCommstatusLoadingButtonTap()">
<p class="loader"></p>
<p class="icon"></p>
</u-commstatus-loading>
</u-comm-loading>
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
</div>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
webpackJsonp([21],{
webpackJsonp([22],{
/***/ 165:
/***/ 176:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_editName.js
......@@ -148,13 +148,13 @@ function saveTap(self) {
/***/ }),
/***/ 265:
/***/ 303:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(165);
module.exports = __webpack_require__(176);
/***/ })
},[265]);
},[303]);
//# sourceMappingURL=editName.js.map
\ No newline at end of file
webpackJsonp([9],{
webpackJsonp([10],{
/***/ 166:
/***/ 177:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _config = __webpack_require__(122);
var _config = __webpack_require__(124);
var _config2 = _interopRequireDefault(_config);
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
var _components = __webpack_require__(202);
var _components = __webpack_require__(239);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
......@@ -186,68 +186,20 @@ function editNameTap(self) {
//tap 解绑门锁
function unbindDoorlockButtonTap(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() {
// uComponents.showLoading(self);
// //云端解绑
// iot.business.device.unbind({
// data: {
// device_id: self.getDoorlock().id
// },
// success: (response) => {
// console.log(response);
// iot.business.sds.unbindDevice({
// data: {
// uuid: self.extras.uuid
// },
// success: (response) => {
// console.log(response);
// if(self.extras == 'SA'){
// unbind(self);
// }
//
//
// },
// error: (error) => {
// console.log(error);
// }
// });
_public.iot.business.device.unbind({
_public.uComponents.showLoading(self);
_public.iot.business.sds.unbindDevice({
data: {
sds: true,
uuid: self.extras.uuid,
device_id: self.getDoorlock().id
uuid: self.extras.uuid
},
success: function success(response) {
console.log(response);
if (self.extras.role) {
unbindUser(self);
} else {
self.setStateShowFlag(true);
self.setShowMsg(Vue.t('doorlockUser.unbindSuccess'));
self.setUnbindSucceess(true);
}
unbind(self);
},
error: function error(_error2) {
console.log(_error2);
self.setStateShowFlag(false);
self.setShowMsg(Vue.t('doorlockUser.unbindFailue'));
self.setUnbindSucceess(false);
},
complete: function complete() {
_public.uComponents.hideLoading(self);
}
complete: function complete() {}
});
// },
// error: (error) => {
// console.log(error);
// self.setStateShowFlag(true);
// self.setShowMsg(Vue.t('doorlockUser.unbindFailue'));
// self.setUnbindSucceess(false);
// },
// complete: () => {
// uComponents.hideLoading(self);
// }
// });
} });
}
......@@ -263,9 +215,10 @@ function unbindStateDialogTap(self) {
}
function unbind(self) {
_public.iot.business.device.unbind({
_public.iot.business.api.sendCustom('lock/unbind', {
data: {
device_id: self.getDoorlock().device_id
device_sn: self.getDoorlock().device_id,
device_id: self.getDoorlock().id
},
success: function success(response) {
console.log(response);
......@@ -312,7 +265,7 @@ function unbindUser(self) {
/***/ }),
/***/ 202:
/***/ 239:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -335,13 +288,13 @@ exports.projectMethods = projectMethods;
/***/ }),
/***/ 266:
/***/ 304:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(166);
module.exports = __webpack_require__(177);
/***/ })
},[266]);
},[304]);
//# sourceMappingURL=index.js.map
\ No newline at end of file
webpackJsonp([20],{
webpackJsonp([21],{
/***/ 169:
/***/ 180:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_addUser.js
......@@ -154,13 +154,13 @@ function confirmButtonTap(self) {
/***/ }),
/***/ 269:
/***/ 307:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(169);
module.exports = __webpack_require__(180);
/***/ })
},[269]);
},[307]);
//# sourceMappingURL=addUser.js.map
\ No newline at end of file
webpackJsonp([8],{
webpackJsonp([9],{
/***/ 170:
/***/ 181:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue, Promise) {
var _regenerator = __webpack_require__(204);
var _regenerator = __webpack_require__(242);
var _regenerator2 = _interopRequireDefault(_regenerator);
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
......@@ -354,7 +354,17 @@ function setUserInfo(self, data) {
//tap <
function backTap() {
var opener = plus.webview.currentWebview().opener();
console.log(opener);
if (opener.id == 'addUser') {
opener.close();
_public.iot.navigator.fire(plus.webview.getWebviewById('doorlockUsers'), 'returnPage', {});
_public.iot.navigator.back();
} else {
_public.iot.navigator.fire(plus.webview.currentWebview().opener(), 'returnPage', {});
console.log('returnPage');
_public.iot.navigator.back();
}
}
//修改用户名称
......@@ -391,9 +401,9 @@ function unbindButtonTap(self) {
self.setStateShowFlag(true);
_public.iot.business.api.sendCustom('lock/unbindUser', {
data: {
rel_id: self.extras.id,
device_id: self.extras.lockId,
user_id: self.getInfo().user_id
user_id: self.getInfo().user_id,
device_sn: self.getInfo().device_id,
device_id: self.extras.lockId
},
success: function success(response) {
console.log(response);
......@@ -428,7 +438,7 @@ function bindUnlockInfoTap(self) {
id: self.extras.id,
deviceId: self.getInfo().device_id,
lockId: self.extras.lockId,
role: self.getInfo().role
role: self.extras.role
}
});
}
......@@ -471,6 +481,7 @@ function deleteUser(self) {
data: {
rel_id: self.extras.id,
user_id: self.getInfo().user_id,
device_sn: self.getInfo().device_id,
device_id: self.extras.lockId
},
success: function success(response) {
......@@ -496,19 +507,19 @@ function deleteUser(self) {
}
});
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)["default"], __webpack_require__(131)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)["default"], __webpack_require__(137)))
/***/ }),
/***/ 204:
/***/ 242:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(206);
module.exports = __webpack_require__(244);
/***/ }),
/***/ 206:
/***/ 244:
/***/ (function(module, exports, __webpack_require__) {
// This method of obtaining a reference to the global object needs to be
......@@ -526,7 +537,7 @@ var oldRuntime = hadRuntime && g.regeneratorRuntime;
// Force reevalutation of runtime.js.
g.regeneratorRuntime = undefined;
module.exports = __webpack_require__(207);
module.exports = __webpack_require__(245);
if (hadRuntime) {
// Restore the original runtime.
......@@ -543,7 +554,7 @@ if (hadRuntime) {
/***/ }),
/***/ 207:
/***/ 245:
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Promise) {/**
......@@ -1277,17 +1288,17 @@ if (hadRuntime) {
(function() { return this })() || Function("return this")()
);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(131)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(137)))
/***/ }),
/***/ 270:
/***/ 308:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(170);
module.exports = __webpack_require__(181);
/***/ })
},[270]);
},[308]);
//# sourceMappingURL=doorlockUser.js.map
\ No newline at end of file
webpackJsonp([19],{
webpackJsonp([20],{
/***/ 171:
/***/ 182:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_editName.js
......@@ -157,13 +157,13 @@ function nameChange(self, text) {
/***/ }),
/***/ 271:
/***/ 309:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(171);
module.exports = __webpack_require__(182);
/***/ })
},[271]);
},[309]);
//# sourceMappingURL=editName.js.map
\ No newline at end of file
......@@ -29,7 +29,7 @@
<ul class="user-list-scroll" v-show="userList.length">
<v-touch tag="li" class="user-list-row" v-for="(item, index) in userList" :key="index" v-on:swipeleft="onSwipeLeftRow(index)" v-on:swiperight="onSwipeRightRow" v-bind:swipe-options="{direction: 'horizontal'}">
<v-touch tag="div" class="user-list-handle"
v-bind:class="{'user-list-selected': (index == userListIndex)}"
v-bind:class="{'user-list-selected': (index == userListIndex) && !role }"
v-on:tap="onTapUserList(index)">
<img class="user-list-image" v-if="item.image && item.role == 0" v-bind:src="item.image">
<div>
......
webpackJsonp([18],{
webpackJsonp([19],{
/***/ 172:
/***/ 183:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _config = __webpack_require__(122);
var _config = __webpack_require__(124);
var _config2 = _interopRequireDefault(_config);
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
......@@ -102,8 +102,8 @@ function init() {
onTapUserList: function onTapUserList(index) {
_onTapUserList(this, index);
},
onTapButton: function onTapButton(buttonIndex) {
tapButton(buttonIndex);
onTapButton: function onTapButton(index) {
tapButton(this, index);
},
changeUserList: function changeUserList(list) {
_changeUserList(this, list);
......@@ -237,8 +237,12 @@ function tapLoad() {
}
//点击按钮
function tapButton(buttonIndex) {
console.log(buttonIndex);
function tapButton(self, index) {
console.log(index);
//tap 删除该用户
_public.uComponents.openConfirm(self, Vue.t('doorlockUser.deleteUserDialogTip'), { text: Vue.t('dialog.cancel'), callback: function callback() {} }, { text: Vue.t('dialog.delete'), callback: function callback() {
deleteUser(self, index);
} });
}
// 修改userList列表
......@@ -250,17 +254,50 @@ function _changeUserList(self, list) {
self.loadFlag = false;
});
}
//删除用户
function deleteUser(self, index) {
_public.uComponents.showLoading(self);
_public.iot.business.api.sendCustom('lock/delLockUser', {
data: {
rel_id: self.getUserListData()[index].id,
user_id: self.getUserListData()[index].user_id,
device_sn: self.getUserListData()[index].device_id,
device_id: self.extras.lockId
},
success: function success(response) {
console.log(response);
if (response.data.success) {
_public.uComponents.openAlert(self, Vue.t('doorlockUser.deleteSuccess'), {
text: Vue.t('btn.confirm'), callback: function callback() {
self.setUserList([]);
getUserList(self);
}
});
}
},
error: function error(err) {
console.log(err);
_public.uComponents.openAlert(self, Vue.t('doorlockUser.deleteFailure'), {
text: Vue.t('btn.confirm'), callback: function callback() {}
});
},
complete: function complete() {
_public.uComponents.hideLoading(self);
}
});
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)["default"]))
/***/ }),
/***/ 272:
/***/ 310:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(172);
module.exports = __webpack_require__(183);
/***/ })
},[272]);
},[310]);
//# sourceMappingURL=index.js.map
\ No newline at end of file
webpackJsonp([17],{
webpackJsonp([18],{
/***/ 174:
/***/ 185:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _config = __webpack_require__(122);
var _config = __webpack_require__(124);
var _config2 = _interopRequireDefault(_config);
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
......@@ -157,13 +157,13 @@ function getBindedLockInfo(self) {
/***/ }),
/***/ 274:
/***/ 312:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(174);
module.exports = __webpack_require__(185);
/***/ })
},[274]);
},[312]);
//# sourceMappingURL=unlockInfo.js.map
\ No newline at end of file
webpackJsonp([16],{
webpackJsonp([17],{
/***/ 175:
/***/ 186:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_forgetPassword.js
......@@ -156,13 +156,13 @@ function confirmButtonTap() {
/***/ }),
/***/ 275:
/***/ 313:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(175);
module.exports = __webpack_require__(186);
/***/ })
},[275]);
},[313]);
//# sourceMappingURL=forgetPassword.js.map
\ No newline at end of file
webpackJsonp([15],{
webpackJsonp([16],{
/***/ 176:
/***/ 187:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_index.js
......@@ -224,13 +224,13 @@ function cloudsLogin(self, id) {
/***/ }),
/***/ 276:
/***/ 314:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(176);
module.exports = __webpack_require__(187);
/***/ })
},[276]);
},[314]);
//# sourceMappingURL=index.js.map
\ No newline at end of file
webpackJsonp([14],{
webpackJsonp([15],{
/***/ 177:
/***/ 188:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_login.js
......@@ -178,13 +178,13 @@ function forgetPasswordTap() {
/***/ }),
/***/ 277:
/***/ 315:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(177);
module.exports = __webpack_require__(188);
/***/ })
},[277]);
},[315]);
//# sourceMappingURL=login.js.map
\ No newline at end of file
webpackJsonp([13],{
webpackJsonp([14],{
/***/ 178:
/***/ 189:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_register.js
......@@ -159,13 +159,13 @@ function registerButtonTap() {
/***/ }),
/***/ 278:
/***/ 316:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(178);
module.exports = __webpack_require__(189);
/***/ })
},[278]);
},[316]);
//# sourceMappingURL=register.js.map
\ No newline at end of file
webpackJsonp([12],{
webpackJsonp([13],{
/***/ 179:
/***/ 190:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_editNickname.js
......@@ -119,13 +119,13 @@ function nicknameChange(self, text) {
/***/ }),
/***/ 279:
/***/ 317:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(179);
module.exports = __webpack_require__(190);
/***/ })
},[279]);
},[317]);
//# sourceMappingURL=editNickname.js.map
\ No newline at end of file
webpackJsonp([11],{
webpackJsonp([12],{
/***/ 180:
/***/ 191:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_editPassword.js
......@@ -94,13 +94,13 @@ function backTap() {
/***/ }),
/***/ 280:
/***/ 318:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(180);
module.exports = __webpack_require__(191);
/***/ })
},[280]);
},[318]);
//# sourceMappingURL=editPassword.js.map
\ No newline at end of file
webpackJsonp([10],{
webpackJsonp([11],{
/***/ 181:
/***/ 192:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Vue) {
var _public = __webpack_require__(2);
var _public = __webpack_require__(3);
_public.iot.ready(init); /**
* v_index.js
......@@ -151,13 +151,13 @@ function logoutButtonTap(self) {
/***/ }),
/***/ 281:
/***/ 319:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(181);
module.exports = __webpack_require__(192);
/***/ })
},[281]);
},[319]);
//# sourceMappingURL=index.js.map
\ No newline at end of file
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