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);
......
......@@ -73,7 +73,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 69);
/******/ return __webpack_require__(__webpack_require__.s = 73);
/******/ })
/************************************************************************/
/******/ ([
......@@ -216,7 +216,7 @@ function flush() {
function attemptVertx() {
try {
var r = require;
var vertx = __webpack_require__(5);
var vertx = __webpack_require__(7);
vertxNext = vertx.runOnLoop || vertx.runOnContext;
return useVertxTimer();
} catch (e) {
......@@ -1239,37 +1239,10 @@ return Promise;
})));
//# sourceMappingURL=es6-promise.map
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3), __webpack_require__(0), __webpack_require__(1)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(0), __webpack_require__(2)))
/***/ }),
/* 1 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -1283,7 +1256,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var CheckParams = __webpack_require__(7);
var CheckParams = __webpack_require__(5);
var Ready = function (_CheckParams) {
_inherits(Ready, _CheckParams);
......@@ -1319,7 +1292,74 @@ var Ready = function (_CheckParams) {
module.exports = Ready;
/***/ }),
/* 2 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Plugin = function () {
function Plugin() {
_classCallCheck(this, Plugin);
this.readyFn = [];
}
_createClass(Plugin, [{
key: "needReady",
value: function needReady() {
return null;
}
}, {
key: "ready",
value: function ready(fn) {
this.readyFn.push(fn);
}
}, {
key: "getReadyFn",
value: function getReadyFn() {
return this.readyFn;
}
}]);
return Plugin;
}();
module.exports = Plugin;
/***/ }),
/* 4 */
/***/ (function(module, exports) {
// shim for using process in browser
......@@ -1509,94 +1549,7 @@ process.umask = function() { return 0; };
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Plugin = function () {
function Plugin() {
_classCallCheck(this, Plugin);
this.readyFn = [];
}
_createClass(Plugin, [{
key: "needReady",
value: function needReady() {
return null;
}
}, {
key: "ready",
value: function ready(fn) {
this.readyFn.push(fn);
}
}, {
key: "getReadyFn",
value: function getReadyFn() {
return this.readyFn;
}
}]);
return Plugin;
}();
module.exports = Plugin;
/***/ }),
/* 5 */
/***/ (function(module, exports) {
/* (ignored) */
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var EventEmitter = __webpack_require__(13).EventEmitter;
var BaseEvent = function (_EventEmitter) {
_inherits(BaseEvent, _EventEmitter);
function BaseEvent() {
_classCallCheck(this, BaseEvent);
return _possibleConstructorReturn(this, (BaseEvent.__proto__ || Object.getPrototypeOf(BaseEvent)).apply(this, arguments));
}
_createClass(BaseEvent, [{
key: 'getEventName',
value: function getEventName() {
return this.constructor.name.toUpperCase();
}
}, {
key: 'onEvent',
value: function onEvent() {}
}]);
return BaseEvent;
}(EventEmitter);
module.exports = BaseEvent;
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -1644,7 +1597,7 @@ CheckParams.checkKeyExists = function (map) {
module.exports = CheckParams;
/***/ }),
/* 8 */
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -1654,8 +1607,8 @@ var _createClass = function () { function defineProperties(target, props) { for
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var PromiseSequence = __webpack_require__(17);
var CheckParams = __webpack_require__(7);
var PromiseSequence = __webpack_require__(13);
var CheckParams = __webpack_require__(5);
/**
* @class
......@@ -1806,169 +1759,48 @@ var Utils = function () {
module.exports = Utils;
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
/* 7 */
/***/ (function(module, exports) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Promise) {
/* (ignored) */
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
/**
* Created by Ugen on 16/12/12.
var __WEBPACK_AMD_DEFINE_RESULT__;/*
* JavaScript MD5
* https://github.com/blueimp/JavaScript-MD5
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*
* Based on
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
__webpack_require__(14);
var IOTEvents = __webpack_require__(12);
var NetWork = function NetWork() {
_classCallCheck(this, NetWork);
};
/* global define */
/**
* url 请求url
* params:
*
*/
;(function ($) {
'use strict'
NetWork.send = function (url, params) {
var opts = {
method: 'POST'
};
if (params.data) {
opts.body = params.data;
}
if (params.type) {
opts.method = params.type;
}
if (params.headers) {
opts.headers = params.headers;
if (opts.headers.Accept == 'application/json') {
opts.body = JSON.stringify(opts.body);
}
}
if (params.timeout) {
opts.timeout = params.timeout;
}
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).beforeSend();
var fetchPromise = _uFetch(url, opts).then(function (res) {
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).complete();
if (params.dataType == 'text') return res.text();
return res.json();
}).catch(function (err) {
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).complete();
throw err;
});
if (params.success) {
fetchPromise.then(function (res) {
params.success(res);
if (params.complete) params.complete();
}).catch(function (err) {
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).complete();
if (params.error) params.error(err);
if (params.complete) params.complete();
});
} else {
return fetchPromise;
}
};
//超时
var _uFetch = function _uFetch(url, params) {
var abort_fn = null;
var abortPromise = new Promise(function (resolve, reject) {
abort_fn = function abort_fn() {
reject({ code: 'timeout' });
};
});
var fetchPromise = new Promise(function (resolve, reject) {
fetch(url, params).then(checkStatus).then(function (res) {
resolve(res);
}).catch(function (err) {
reject(err);
});
});
var abortable_promise = Promise.race([fetchPromise, abortPromise]);
setTimeout(function () {
abort_fn();
}, (params.timeout || 30) * 1000);
return abortable_promise;
};
//检查请求返回的状态
var checkStatus = function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response;
} else {
var error = new Error(response.statusText);
error.response = response;
throw error;
}
};
module.exports = NetWork;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = {
logConfig: {
type: ['uploadOperationLog', 'uploadSystemLog', 'uploadDebugLog']
},
keys: {
"uToken": "utoken",
"USER_INFO": "userinfo",
"signPerfix": "ugen_iot",
"groupCache": "IOT_GROUP_CACHE"
},
thirdParty: {
appId: 'wxcc1ee78ae256be1f'
}
};
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_RESULT__;/*
* JavaScript MD5
* https://github.com/blueimp/JavaScript-MD5
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*
* Based on
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
/* global define */
;(function ($) {
'use strict'
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safeAdd (x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF)
var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
return (msw << 16) | (lsw & 0xFFFF)
}
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safeAdd (x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF)
var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
return (msw << 16) | (lsw & 0xFFFF)
}
/*
* Bitwise rotate a 32-bit number to the left.
......@@ -2221,7 +2053,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/*
/***/ }),
/* 12 */
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -2231,127 +2063,458 @@ var _createClass = function () { function defineProperties(target, props) { for
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var BaseEvent = __webpack_require__(6);
var EventNetWork = __webpack_require__(16);
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
var EventManager = function () {
function EventManager() {
_classCallCheck(this, EventManager);
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
this.type = {};
this.events = {};
var EventEmitter = __webpack_require__(15).EventEmitter;
var BaseEvent = function (_EventEmitter) {
_inherits(BaseEvent, _EventEmitter);
function BaseEvent() {
_classCallCheck(this, BaseEvent);
return _possibleConstructorReturn(this, (BaseEvent.__proto__ || Object.getPrototypeOf(BaseEvent)).apply(this, arguments));
}
_createClass(EventManager, [{
key: 'on',
value: function on(event, fn) {
if (event in this.type) {
this.events[event].onEvent(fn);
}
}
}, {
key: 'getSendMsgObj',
value: function getSendMsgObj(event) {
if (event in this.type) {
return this.events[event];
}
return null;
_createClass(BaseEvent, [{
key: 'getEventName',
value: function getEventName() {
return this.constructor.name.toUpperCase();
}
}, {
key: 'loadEvent',
value: function loadEvent(eventObj) {
if (eventObj instanceof BaseEvent) {
var eventName = eventObj.getEventName();
this.type[eventName] = eventName;
this.events[eventName] = eventObj;
} else {
throw Error(eventObj.constructor.name + ' is not extend Class BaseEvent');
}
}
key: 'onEvent',
value: function onEvent() {}
}]);
return EventManager;
}();
var event = new EventManager();
event.loadEvent(EventNetWork);
return BaseEvent;
}(EventEmitter);
module.exports = event;
module.exports = BaseEvent;
/***/ }),
/* 13 */
/***/ (function(module, exports) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
function EventEmitter() {
this._events = this._events || {};
this._maxListeners = this._maxListeners || undefined;
}
module.exports = EventEmitter;
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;
"use strict";
/* WEBPACK VAR INJECTION */(function(Promise) {
EventEmitter.prototype._events = undefined;
EventEmitter.prototype._maxListeners = undefined;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
EventEmitter.defaultMaxListeners = 10;
/**
* Created by Ugen on 16/12/12.
*/
__webpack_require__(16);
var IOTEvents = __webpack_require__(14);
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function(n) {
if (!isNumber(n) || n < 0 || isNaN(n))
throw TypeError('n must be a positive number');
this._maxListeners = n;
return this;
var NetWork = function NetWork() {
_classCallCheck(this, NetWork);
};
EventEmitter.prototype.emit = function(type) {
var er, handler, len, args, i, listeners;
/**
* url 请求url
* params:
*
*/
if (!this._events)
this._events = {};
// If there is no 'error' event listener then throw.
if (type === 'error') {
if (!this._events.error ||
(isObject(this._events.error) && !this._events.error.length)) {
er = arguments[1];
if (er instanceof Error) {
throw er; // Unhandled 'error' event
} else {
// At least give some kind of context to the user
var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
err.context = er;
throw err;
}
NetWork.send = function (url, params) {
var opts = {
method: 'POST'
};
if (params.data) {
opts.body = params.data;
}
}
handler = this._events[type];
if (params.type) {
opts.method = params.type;
}
if (params.headers) {
opts.headers = params.headers;
if (opts.headers.Accept == 'application/json') {
opts.body = JSON.stringify(opts.body);
}
}
if (params.timeout) {
opts.timeout = params.timeout;
}
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).beforeSend();
var fetchPromise = _uFetch(url, opts).then(function (res) {
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).complete();
if (params.dataType == 'text') return res.text();
return res.json();
}).catch(function (err) {
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).complete();
throw err;
});
if (params.success) {
fetchPromise.then(function (res) {
params.success(res);
if (params.complete) params.complete();
}).catch(function (err) {
IOTEvents.getSendMsgObj(IOTEvents.type.NETWORK).complete();
if (params.error) params.error(err);
if (params.complete) params.complete();
});
} else {
return fetchPromise;
}
};
//超时
var _uFetch = function _uFetch(url, params) {
var abort_fn = null;
var abortPromise = new Promise(function (resolve, reject) {
abort_fn = function abort_fn() {
reject({ code: 'timeout' });
};
});
var fetchPromise = new Promise(function (resolve, reject) {
fetch(url, params).then(checkStatus).then(function (res) {
resolve(res);
}).catch(function (err) {
reject(err);
});
});
var abortable_promise = Promise.race([fetchPromise, abortPromise]);
setTimeout(function () {
abort_fn();
}, (params.timeout || 30) * 1000);
return abortable_promise;
};
//检查请求返回的状态
var checkStatus = function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response;
} else {
var error = new Error(response.statusText);
error.response = response;
throw error;
}
};
module.exports = NetWork;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = {
logConfig: {
type: ['uploadOperationLog', 'uploadSystemLog', 'uploadDebugLog']
},
keys: {
"uToken": "utoken",
"USER_INFO": "userinfo",
"signPerfix": "ugen_iot",
"groupCache": "IOT_GROUP_CACHE"
},
thirdParty: {
appId: 'wxcc1ee78ae256be1f'
}
};
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Ready = __webpack_require__(1);
var Plugin = __webpack_require__(3);
var md5 = __webpack_require__(8);
var IOTBase = function () {
function IOTBase() {
_classCallCheck(this, IOTBase);
this.readyFn = [];
this.readyList = [];
this.pluginList = [];
this.timeout = setTimeout(function () {
//window.location.reload();
}, 4000);
}
_createClass(IOTBase, [{
key: 'loadReady',
value: function loadReady(items) {
// console.log('loadReady 2', items);
if (items instanceof Array) {
for (var i in items) {
this.doLoad(items[i]);
}
} else {
this.doLoad(items);
}
}
}, {
key: 'loadPlugin',
value: function loadPlugin(plugin) {
// console.log('loadPlugin 1', plugin);
if (plugin instanceof Plugin) {
this.pluginList.push(plugin);
// console.log('loadPlugin 1', plugin.needReady());
this.loadReady(plugin.needReady());
} else if (plugin instanceof Ready) {
this.loadReady(plugin);
} else {
console.error(plugin.constructor.name + ' is not extend Class Plugin');
}
}
}, {
key: 'doLoad',
value: function doLoad(obj) {
var _this = this;
// console.log('doLoad 3', obj);
if (obj instanceof Ready) {
var key = obj.register(md5(Date.now() + Math.random()).slice(-8));
// console.log('doLoad 3', key);
var map = {
key: key,
isReady: false
};
this.readyList.push(map);
window.addEventListener(key, function () {
var readyObj = obj.onReady();
// console.log('doLoad 3', readyObj);
if (readyObj != null) {
obj.obj = readyObj;
// console.log('doLoad 3', obj.obj);
}
_this.updateAndCheck(key);
}, false);
} else {
console.error(obj.constructor.name + ' is not extend Class Ready');
}
}
}, {
key: 'updateAndCheck',
value: function updateAndCheck(key) {
var isReady = true;
for (var i in this.readyList) {
var item = this.readyList[i];
if (item.key == key) {
item.isReady = true;
}
isReady = isReady && item.isReady;
}
if (isReady) {
clearTimeout(this.timeout);
for (var _i in this.pluginList) {
this.addReadyArray(this.pluginList[_i].getReadyFn());
}
for (var _i2 = 0; _i2 < this.readyFn.length; _i2++) {
this.readyFn[_i2]();
}
}
}
}, {
key: 'ready',
value: function ready(fn) {
this.readyFn.push(fn);
}
}, {
key: 'addReadyArray',
value: function addReadyArray(list) {
this.readyFn = this.readyFn.concat(list);
}
}]);
return IOTBase;
}();
module.exports = IOTBase;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Promise) {
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var PromiseSequence = function () {
function PromiseSequence() {
_classCallCheck(this, PromiseSequence);
}
_createClass(PromiseSequence, null, [{
key: "sequence",
value: function sequence() {
var p = Promise.resolve();
for (var _len = arguments.length, list = Array(_len), _key = 0; _key < _len; _key++) {
list[_key] = arguments[_key];
}
for (var i in list[0]) {
p = PromiseSequence._do(p, list[0][i]);
}
return p;
}
}, {
key: "_do",
value: function _do(p, fn) {
return p.then(fn).catch(function (err) {
throw err;
});
}
}]);
return PromiseSequence;
}();
module.exports = PromiseSequence;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var BaseEvent = __webpack_require__(9);
var EventNetWork = __webpack_require__(17);
var EventManager = function () {
function EventManager() {
_classCallCheck(this, EventManager);
this.type = {};
this.events = {};
}
_createClass(EventManager, [{
key: 'on',
value: function on(event, fn) {
if (event in this.type) {
this.events[event].onEvent(fn);
}
}
}, {
key: 'getSendMsgObj',
value: function getSendMsgObj(event) {
if (event in this.type) {
return this.events[event];
}
return null;
}
}, {
key: 'loadEvent',
value: function loadEvent(eventObj) {
if (eventObj instanceof BaseEvent) {
var eventName = eventObj.getEventName();
this.type[eventName] = eventName;
this.events[eventName] = eventObj;
} else {
throw Error(eventObj.constructor.name + ' is not extend Class BaseEvent');
}
}
}]);
return EventManager;
}();
var event = new EventManager();
event.loadEvent(EventNetWork);
module.exports = event;
/***/ }),
/* 15 */
/***/ (function(module, exports) {
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
function EventEmitter() {
this._events = this._events || {};
this._maxListeners = this._maxListeners || undefined;
}
module.exports = EventEmitter;
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;
EventEmitter.prototype._events = undefined;
EventEmitter.prototype._maxListeners = undefined;
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
EventEmitter.defaultMaxListeners = 10;
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function(n) {
if (!isNumber(n) || n < 0 || isNaN(n))
throw TypeError('n must be a positive number');
this._maxListeners = n;
return this;
};
EventEmitter.prototype.emit = function(type) {
var er, handler, len, args, i, listeners;
if (!this._events)
this._events = {};
// If there is no 'error' event listener then throw.
if (type === 'error') {
if (!this._events.error ||
(isObject(this._events.error) && !this._events.error.length)) {
er = arguments[1];
if (er instanceof Error) {
throw er; // Unhandled 'error' event
} else {
// At least give some kind of context to the user
var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
err.context = er;
throw err;
}
}
}
handler = this._events[type];
if (isUndefined(handler))
return false;
......@@ -2587,7 +2750,7 @@ function isUndefined(arg) {
/***/ }),
/* 14 */
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(Promise) {(function(self) {
......@@ -3006,175 +3169,56 @@ function isUndefined(arg) {
self.Headers = Headers
self.Request = Request
self.Response = Response
self.fetch = function(input, init) {
return new Promise(function(resolve, reject) {
var request = new Request(input, init)
var xhr = new XMLHttpRequest()
xhr.onload = function() {
var options = {
status: xhr.status,
statusText: xhr.statusText,
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
}
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
var body = 'response' in xhr ? xhr.response : xhr.responseText
resolve(new Response(body, options))
}
xhr.onerror = function() {
reject(new TypeError('Network request failed'))
}
xhr.ontimeout = function() {
reject(new TypeError('Network request failed'))
}
xhr.open(request.method, request.url, true)
if (request.credentials === 'include') {
xhr.withCredentials = true
}
if ('responseType' in xhr && support.blob) {
xhr.responseType = 'blob'
}
request.headers.forEach(function(value, name) {
xhr.setRequestHeader(name, value)
})
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
})
}
self.fetch.polyfill = true
})(typeof self !== 'undefined' ? self : this);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Ready = __webpack_require__(2);
var Plugin = __webpack_require__(4);
var md5 = __webpack_require__(11);
var IOTBase = function () {
function IOTBase() {
_classCallCheck(this, IOTBase);
this.readyFn = [];
this.readyList = [];
this.pluginList = [];
this.timeout = setTimeout(function () {
//window.location.reload();
}, 4000);
}
_createClass(IOTBase, [{
key: 'loadReady',
value: function loadReady(items) {
// console.log('loadReady 2', items);
if (items instanceof Array) {
for (var i in items) {
this.doLoad(items[i]);
}
} else {
this.doLoad(items);
}
}
}, {
key: 'loadPlugin',
value: function loadPlugin(plugin) {
// console.log('loadPlugin 1', plugin);
if (plugin instanceof Plugin) {
this.pluginList.push(plugin);
// console.log('loadPlugin 1', plugin.needReady());
this.loadReady(plugin.needReady());
} else if (plugin instanceof Ready) {
this.loadReady(plugin);
} else {
console.error(plugin.constructor.name + ' is not extend Class Plugin');
}
}
}, {
key: 'doLoad',
value: function doLoad(obj) {
var _this = this;
// console.log(obj);
// console.log('doLoad 3', obj);
if (obj instanceof Ready) {
var key = obj.register(md5(Date.now() + Math.random()).slice(-8));
// console.log('doLoad 3', key);
var map = {
key: key,
isReady: false
};
this.readyList.push(map);
window.addEventListener(key, function () {
var readyObj = obj.onReady();
// console.log('doLoad 3', readyObj);
if (readyObj != null) {
obj.obj = readyObj;
// console.log('doLoad 3', obj.obj);
}
_this.updateAndCheck(key);
}, false);
} else {
console.error(obj.constructor.name + ' is not extend Class Ready');
}
}
}, {
key: 'updateAndCheck',
value: function updateAndCheck(key) {
var isReady = true;
for (var i in this.readyList) {
var item = this.readyList[i];
if (item.key == key) {
item.isReady = true;
}
isReady = isReady && item.isReady;
}
if (isReady) {
clearTimeout(this.timeout);
for (var _i in this.pluginList) {
this.addReadyArray(this.pluginList[_i].getReadyFn());
}
for (var _i2 = 0; _i2 < this.readyFn.length; _i2++) {
this.readyFn[_i2]();
}
}
}
}, {
key: 'ready',
value: function ready(fn) {
this.readyFn.push(fn);
}
}, {
key: 'addReadyArray',
value: function addReadyArray(list) {
this.readyFn = this.readyFn.concat(list);
self.Response = Response
self.fetch = function(input, init) {
return new Promise(function(resolve, reject) {
var request = new Request(input, init)
var xhr = new XMLHttpRequest()
xhr.onload = function() {
var options = {
status: xhr.status,
statusText: xhr.statusText,
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
}
}]);
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
var body = 'response' in xhr ? xhr.response : xhr.responseText
resolve(new Response(body, options))
}
return IOTBase;
}();
xhr.onerror = function() {
reject(new TypeError('Network request failed'))
}
module.exports = IOTBase;
xhr.ontimeout = function() {
reject(new TypeError('Network request failed'))
}
xhr.open(request.method, request.url, true)
if (request.credentials === 'include') {
xhr.withCredentials = true
}
if ('responseType' in xhr && support.blob) {
xhr.responseType = 'blob'
}
request.headers.forEach(function(value, name) {
xhr.setRequestHeader(name, value)
})
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
})
}
self.fetch.polyfill = true
})(typeof self !== 'undefined' ? self : this);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 16 */
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -3188,7 +3232,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var BaseEvent = __webpack_require__(6);
var BaseEvent = __webpack_require__(9);
var NetWork = function (_BaseEvent) {
_inherits(NetWork, _BaseEvent);
......@@ -3227,59 +3271,251 @@ var NetWork = function (_BaseEvent) {
module.exports = new NetWork();
/***/ }),
/* 17 */
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(44);
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(Promise) {
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var PromiseSequence = function () {
function PromiseSequence() {
_classCallCheck(this, PromiseSequence);
}
/**
* Log.js
* Version: 0.1
* User: shz
* Date: 2017-07-21
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* Log
*/
var config = __webpack_require__(11);
var NetWork = __webpack_require__(10);
_createClass(PromiseSequence, null, [{
key: "sequence",
value: function sequence() {
var p = Promise.resolve();
// const Utils = require('../../utils/Utils');
for (var _len = arguments.length, list = Array(_len), _key = 0; _key < _len; _key++) {
list[_key] = arguments[_key];
}
var Log = function () {
function Log(params) {
_classCallCheck(this, Log);
for (var i in list[0]) {
p = PromiseSequence._do(p, list[0][i]);
}
return p;
}
}, {
key: "_do",
value: function _do(p, fn) {
return p.then(fn).catch(function (err) {
throw err;
});
}
}]);
var log = params.plugin.log;
this.checkKeyExists(params, 'appId');
this.checkKeyExists(log, 'url');
this.appId = params.appId;
this.baseUrl = log.url;
}
_createClass(Log, [{
key: 'upload',
value: function upload(params) {
var data = params.data;
data.cloud_app_id = this.appId;
// 系统log 调试log 运行环境信息 日志上报类型(1:Android 2:iOS 3:Javascript)
if (data.environment && data.code_type) {
this.checkKeyExists(params.data, 'log_type', 'code_type', 'environment', 'title', 'log_data');
params.interface = config.logConfig.type[data.log_type];
// 业务log 自定义动作
} else if (data.action) {
this.checkKeyExists(params.data, 'log_type', 'action', 'log_data');
params.interface = config.logConfig.type[0];
}
console.log(params);
this.send(params);
}
}, {
key: 'send',
value: function send(opts) {
var params = {};
var headers = {
'Accept': 'application/json',
'Content-Type': 'application/json; charset=UTF-8'
};
params.headers = headers;
params.success = function (ret) {
if (ret.code && ret.code != 0) {
opts.error(ret);
} else {
opts.success(ret);
}
};
params.interface = opts.interface;
params.data = opts.data;
params.timeout = opts.timeout;
params.error = opts.error;
params.complete = opts.complete;
NetWork.send(this.baseUrl + '/' + params.interface, params);
}
}, {
key: 'checkKeyExists',
value: function checkKeyExists(map) {
for (var _len = arguments.length, keys = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
keys[_key - 1] = arguments[_key];
}
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var key = _step.value;
if (!(key in map)) {
throw new Error(key + ' is undefined');
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
}
}]);
return Log;
}();
module.exports = Log;
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* index.js
* Version: 0.1
* User: shz
* Date: 2017-11-15
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* index
*/
var Ready = __webpack_require__(1);
var PermissionBridge = function (_Ready) {
_inherits(PermissionBridge, _Ready);
function PermissionBridge() {
_classCallCheck(this, PermissionBridge);
var _this = _possibleConstructorReturn(this, (PermissionBridge.__proto__ || Object.getPrototypeOf(PermissionBridge)).call(this));
document.addEventListener("plusready", function () {
_this.onPlusready();
_this.dispatch();
}, false);
return _this;
}
_createClass(PermissionBridge, [{
key: 'onPlusready',
value: function onPlusready() {
var _PERMISSIONCODE = 'UgenPermission',
B = window.plus.bridge,
callbackID = void 0;
var UgenPermission = {
//开始扫描ble设备
checkPermission: function checkPermission(permission, successCallback, errorCallback) {
// alert('api js function scan init');
var success = typeof successCallback !== 'function' ? null : function (args) {
successCallback(args);
},
fail = typeof errorCallback !== 'function' ? null : function (code) {
errorCallback(code);
};
callbackID = B.callbackId(success, fail);
return B.exec(_PERMISSIONCODE, "checkPermission", [callbackID, permission]);
}
};
this.UgenPermission = UgenPermission;
}
}, {
key: 'onReady',
value: function onReady() {
return this.UgenPermission;
}
}]);
return PermissionBridge;
}(Ready);
module.exports = PermissionBridge;
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Plugin = __webpack_require__(3);
var Permission = __webpack_require__(22);
var Utils = __webpack_require__(6);
var Main = function (_Plugin) {
_inherits(Main, _Plugin);
function Main() {
_classCallCheck(this, Main);
return PromiseSequence;
}();
var _this = _possibleConstructorReturn(this, (Main.__proto__ || Object.getPrototypeOf(Main)).call(this));
module.exports = PromiseSequence;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
_this.permission = new Permission();
return _this;
}
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
_createClass(Main, [{
key: 'needReady',
value: function needReady() {
if (Utils.getBrowserInfo().mobile != null) {
return [this.permission.bridge];
} else {
return [];
}
}
}]);
module.exports = __webpack_require__(40);
return Main;
}(Plugin);
module.exports = Main;
/***/ }),
/* 19 */
/* 22 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -3290,112 +3526,62 @@ var _createClass = function () { function defineProperties(target, props) { for
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/**
* Log.js
* method.js
* Version: 0.1
* User: shz
* Date: 2017-07-21
* Date: 2017-09-14
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* Log
* permission 调用bridge方法
*/
var config = __webpack_require__(10);
var NetWork = __webpack_require__(9);
var Bridge = __webpack_require__(20);
var READ_FILE = "READ_EXTERNAL_STORAGE";
var SMS = "SEND_SMS";
var SENSORS = "SENSORS";
var PHONE = "PHONE";
var CALENDAR = "READ_CALENDAR";
var CONTACTS = "READ_CONTACTS";
var CAMERA = "CAMERA";
var LOCATION = "ACCESS_FINE_LOCATION";
// const Utils = require('../../utils/Utils');
/**
* @class
* Permission
*/
var Log = function () {
function Log(params) {
_classCallCheck(this, Log);
var PermissionMethod = function () {
function PermissionMethod() {
_classCallCheck(this, PermissionMethod);
var log = params.plugin.log;
this.checkKeyExists(params, 'appId');
this.checkKeyExists(log, 'url');
this.appId = params.appId;
this.baseUrl = log.url;
this.map = [];
this.bridge = new Bridge();
}
_createClass(Log, [{
key: 'upload',
value: function upload(params) {
var data = params.data;
data.cloud_app_id = this.appId;
// 系统log 调试log 运行环境信息 日志上报类型(1:Android 2:iOS 3:Javascript)
if (data.environment && data.code_type) {
this.checkKeyExists(params.data, 'log_type', 'code_type', 'environment', 'title', 'log_data');
params.interface = config.logConfig.type[data.log_type];
// 业务log 自定义动作
} else if (data.action) {
this.checkKeyExists(params.data, 'log_type', 'action', 'log_data');
params.interface = config.logConfig.type[0];
}
console.log(params);
this.send(params);
}
}, {
key: 'send',
value: function send(opts) {
var params = {};
var headers = {
'Accept': 'application/json',
'Content-Type': 'application/json; charset=UTF-8'
};
params.headers = headers;
params.success = function (ret) {
if (ret.code && ret.code != 0) {
opts.error(ret);
} else {
opts.success(ret);
}
};
params.interface = opts.interface;
params.data = opts.data;
params.timeout = opts.timeout;
params.error = opts.error;
params.complete = opts.complete;
NetWork.send(this.baseUrl + '/' + params.interface, params);
}
}, {
key: 'checkKeyExists',
value: function checkKeyExists(map) {
for (var _len = arguments.length, keys = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
keys[_key - 1] = arguments[_key];
}
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
/**
* 申请Android权限
* @param permission 由需要申请的权限组成的数组
* @param success
* @param error
*/
try {
for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var key = _step.value;
if (!(key in map)) {
throw new Error(key + ' is undefined');
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
_createClass(PermissionMethod, [{
key: "checkPermission",
value: function checkPermission(permission, success, error) {
this.bridge.obj.checkPermission(permission, function (ret) {
success(ret);
}, function (err) {
error(err);
});
}
}]);
return Log;
return PermissionMethod;
}();
module.exports = Log;
module.exports = PermissionMethod;
/***/ }),
/* 20 */
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -3409,9 +3595,9 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Plugin = __webpack_require__(4);
var Ready = __webpack_require__(2);
var Utils = __webpack_require__(8);
var Plugin = __webpack_require__(3);
var Ready = __webpack_require__(1);
var Utils = __webpack_require__(6);
var Main = function (_Plugin) {
_inherits(Main, _Plugin);
......@@ -3530,21 +3716,21 @@ var I18NInit = function (_Ready) {
module.exports = Main;
/***/ }),
/* 21 */
/* 24 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
if (!__webpack_require__(46)()) {
Object.defineProperty(__webpack_require__(27), 'Symbol',
{ value: __webpack_require__(48), configurable: true, enumerable: false,
if (!__webpack_require__(50)()) {
Object.defineProperty(__webpack_require__(31), 'Symbol',
{ value: __webpack_require__(52), configurable: true, enumerable: false,
writable: true });
}
/***/ }),
/* 22 */
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -3560,7 +3746,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var WebSqlTool = __webpack_require__(52);
/*let websql;
try {
const WebSqlTool = require('./webSqlTool');
websql = new WebSqlTool('UIOT', '1.0', 'ugen', 1024 * 1024 * 5);
} catch (error) {
const LocalStorageTool = require('./localStorageTool');
websql = new LocalStorageTool();
}*/
var WebSqlTool = __webpack_require__(56);
var websql = new WebSqlTool('UIOT', '1.0', 'ugen', 1024 * 1024 * 5);
var PublicStore = function () {
......@@ -3820,7 +4015,7 @@ module.exports = PublicStore;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 23 */
/* 26 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -3830,7 +4025,7 @@ var _createClass = function () { function defineProperties(target, props) { for
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var qs = __webpack_require__(44);
var qs = __webpack_require__(48);
var Base = function () {
function Base() {
......@@ -3862,6 +4057,21 @@ var Base = function () {
value: function back() {
window.history.back();
}
}, {
key: "closeOthers",
value: function closeOthers() {
console.log('iot.navigator.closeOthers');
}
}, {
key: "backToHomePage",
value: function backToHomePage() {
console.log('iot.navigator.backToHomePage');
}
}, {
key: "fire",
value: function fire() {
console.log('iot.navigator.fire');
}
}]);
return Base;
......@@ -3870,7 +4080,7 @@ var Base = function () {
module.exports = Base;
/***/ }),
/* 24 */
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -3882,11 +4092,12 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
__webpack_require__(21);
var IOTMain = __webpack_require__(50);
var Business = __webpack_require__(61);
var vueI18N = __webpack_require__(20);
var Navigator = __webpack_require__(56);
__webpack_require__(24);
var IOTMain = __webpack_require__(54);
var Business = __webpack_require__(65);
var Permission = __webpack_require__(21);
var vueI18N = __webpack_require__(23);
var Navigator = __webpack_require__(60);
var IOT = function (_IOTMain) {
_inherits(IOT, _IOTMain);
......@@ -3900,6 +4111,10 @@ var IOT = function (_IOTMain) {
_this.loadPlugin(businessPlugin);
_this.business = businessPlugin.business;
var permissionPlugin = new Permission();
_this.loadPlugin(permissionPlugin);
_this.permission = permissionPlugin.permission;
var i18n = new vueI18N(params.lang || ["zh"], params.vue, params.i18n);
_this.loadPlugin(i18n);
......@@ -3914,9 +4129,10 @@ var IOT = function (_IOTMain) {
module.exports = IOT;
/***/ }),
/* 25 */,
/* 26 */,
/* 27 */
/* 28 */,
/* 29 */,
/* 30 */,
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -3926,19 +4142,19 @@ module.exports = new Function("return this")();
/***/ }),
/* 28 */
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(29)()
module.exports = __webpack_require__(33)()
? Object.assign
: __webpack_require__(30);
: __webpack_require__(34);
/***/ }),
/* 29 */
/* 33 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -3954,14 +4170,14 @@ module.exports = function () {
/***/ }),
/* 30 */
/* 34 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var keys = __webpack_require__(32)
, value = __webpack_require__(36)
var keys = __webpack_require__(36)
, value = __webpack_require__(40)
, max = Math.max;
......@@ -3983,7 +4199,7 @@ module.exports = function (dest, src/*, …srcn*/) {
/***/ }),
/* 31 */
/* 35 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -3995,19 +4211,19 @@ module.exports = function (obj) { return typeof obj === 'function'; };
/***/ }),
/* 32 */
/* 36 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(33)()
module.exports = __webpack_require__(37)()
? Object.keys
: __webpack_require__(34);
: __webpack_require__(38);
/***/ }),
/* 33 */
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -4022,7 +4238,7 @@ module.exports = function () {
/***/ }),
/* 34 */
/* 38 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -4036,7 +4252,7 @@ module.exports = function (object) {
/***/ }),
/* 35 */
/* 39 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -4060,7 +4276,7 @@ module.exports = function (options/*, …options*/) {
/***/ }),
/* 36 */
/* 40 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -4073,19 +4289,19 @@ module.exports = function (value) {
/***/ }),
/* 37 */
/* 41 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
module.exports = __webpack_require__(38)()
module.exports = __webpack_require__(42)()
? String.prototype.contains
: __webpack_require__(39);
: __webpack_require__(43);
/***/ }),
/* 38 */
/* 42 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -4100,7 +4316,7 @@ module.exports = function () {
/***/ }),
/* 39 */
/* 43 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -4114,7 +4330,7 @@ module.exports = function (searchString/*, position*/) {
/***/ }),
/* 40 */
/* 44 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {// This method of obtaining a reference to the global object needs to be
......@@ -4135,7 +4351,7 @@ var oldRuntime = hadRuntime && g.regeneratorRuntime;
// Force reevalutation of runtime.js.
g.regeneratorRuntime = undefined;
module.exports = __webpack_require__(41);
module.exports = __webpack_require__(45);
if (hadRuntime) {
// Restore the original runtime.
......@@ -4149,10 +4365,10 @@ if (hadRuntime) {
}
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))
/***/ }),
/* 41 */
/* 45 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, Promise) {/**
......@@ -4892,10 +5108,10 @@ if (hadRuntime) {
typeof self === "object" ? self : this
);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(0)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(0)))
/***/ }),
/* 42 */
/* 46 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -4986,7 +5202,7 @@ var isArray = Array.isArray || function (xs) {
/***/ }),
/* 43 */
/* 47 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -5078,27 +5294,27 @@ var objectKeys = Object.keys || function (obj) {
/***/ }),
/* 44 */
/* 48 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.decode = exports.parse = __webpack_require__(42);
exports.encode = exports.stringify = __webpack_require__(43);
exports.decode = exports.parse = __webpack_require__(46);
exports.encode = exports.stringify = __webpack_require__(47);
/***/ }),
/* 45 */
/* 49 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var assign = __webpack_require__(28)
, normalizeOpts = __webpack_require__(35)
, isCallable = __webpack_require__(31)
, contains = __webpack_require__(37)
var assign = __webpack_require__(32)
, normalizeOpts = __webpack_require__(39)
, isCallable = __webpack_require__(35)
, contains = __webpack_require__(41)
, d;
......@@ -5159,7 +5375,7 @@ d.gs = function (dscr, get, set/*, options*/) {
/***/ }),
/* 46 */
/* 50 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -5183,7 +5399,7 @@ module.exports = function () {
/***/ }),
/* 47 */
/* 51 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -5199,7 +5415,7 @@ module.exports = function (x) {
/***/ }),
/* 48 */
/* 52 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -5207,8 +5423,8 @@ module.exports = function (x) {
var d = __webpack_require__(45)
, validateSymbol = __webpack_require__(49)
var d = __webpack_require__(49)
, validateSymbol = __webpack_require__(53)
, create = Object.create, defineProperties = Object.defineProperties
, defineProperty = Object.defineProperty, objPrototype = Object.prototype
......@@ -5324,13 +5540,13 @@ defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive,
/***/ }),
/* 49 */
/* 53 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var isSymbol = __webpack_require__(47);
var isSymbol = __webpack_require__(51);
module.exports = function (value) {
if (!isSymbol(value)) throw new TypeError(value + " is not a symbol");
......@@ -5339,7 +5555,7 @@ module.exports = function (value) {
/***/ }),
/* 50 */
/* 54 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -5367,15 +5583,15 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* IOTSuper
*/
__webpack_require__(21);
var error = __webpack_require__(51);
var IOTBase = __webpack_require__(15);
var IOTEvents = __webpack_require__(12);
__webpack_require__(24);
var error = __webpack_require__(55);
var IOTBase = __webpack_require__(12);
var IOTEvents = __webpack_require__(14);
var Log = __webpack_require__(19);
var network = __webpack_require__(9);
var PublicStore = __webpack_require__(22);
var Utils = __webpack_require__(8);
var config = __webpack_require__(10);
var network = __webpack_require__(10);
var PublicStore = __webpack_require__(25);
var Utils = __webpack_require__(6);
var config = __webpack_require__(11);
var keys = config.keys;
var IOTMain = function (_IOTBase) {
......@@ -5496,7 +5712,7 @@ var IOTMain = function (_IOTBase) {
module.exports = IOTMain;
/***/ }),
/* 51 */
/* 55 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -5510,7 +5726,7 @@ module.exports = IOTMain;
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* Error
*/
var Utils = __webpack_require__(8);
var Utils = __webpack_require__(6);
var LOG_URL = 'https://admin.iot.u-gen.net/admin/api/debug/uploadDebugLog';
window.onerror = function (message, source, lineNo, columnNo, error) {
console.log('window on error');
......@@ -5540,7 +5756,7 @@ window.onerror = function (message, source, lineNo, columnNo, error) {
};
/***/ }),
/* 52 */
/* 56 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -5626,10 +5842,10 @@ module.exports = WebSqlTool;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
/***/ }),
/* 53 */,
/* 54 */,
/* 55 */,
/* 56 */
/* 57 */,
/* 58 */,
/* 59 */,
/* 60 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -5637,9 +5853,9 @@ module.exports = WebSqlTool;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Utils = __webpack_require__(8);
var Web = __webpack_require__(58);
var App = __webpack_require__(57);
var Utils = __webpack_require__(6);
var Web = __webpack_require__(62);
var App = __webpack_require__(61);
var Loader = function Loader(type) {
_classCallCheck(this, Loader);
......@@ -5666,7 +5882,7 @@ Loader.type = {
module.exports = Loader;
/***/ }),
/* 57 */
/* 61 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -5682,7 +5898,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Base = __webpack_require__(23);
var Base = __webpack_require__(26);
var App = function (_Base) {
_inherits(App, _Base);
......@@ -5822,7 +6038,7 @@ var App = function (_Base) {
module.exports = App;
/***/ }),
/* 58 */
/* 62 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -5834,7 +6050,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Base = __webpack_require__(23);
var Base = __webpack_require__(26);
var Web = function (_Base) {
_inherits(Web, _Base);
......@@ -5851,7 +6067,7 @@ var Web = function (_Base) {
module.exports = Web;
/***/ }),
/* 59 */
/* 63 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -6025,7 +6241,7 @@ var Device = function () {
module.exports = Device;
/***/ }),
/* 60 */
/* 64 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -6043,7 +6259,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* SDSPlugin
*/
var Bridge = __webpack_require__(64);
var Bridge = __webpack_require__(68);
var SDS = function () {
function SDS() {
......@@ -6410,12 +6626,24 @@ var SDS = function () {
});
}
}, {
key: 'unbindByManager',
value: function unbindByManager(params) {
var _this25 = this;
this.checkKeyExists(params.data, 'uuid', 'destAuid');
this.bridge.obj.unbindByManager(params.data.uuid, params.data.destAuid, function (ret) {
_this25.handleSuccess(params, ret);
}, function (err) {
params.error(err);
});
}
}, {
key: 'getSSId',
value: function getSSId(params) {
var _this25 = this;
var _this26 = this;
this.bridge.obj.getSSId(function (ret) {
_this25.handleSuccess(params, ret);
_this26.handleSuccess(params, ret);
}, function (err) {
params.error(err);
});
......@@ -6423,10 +6651,10 @@ var SDS = function () {
}, {
key: 'findDevices',
value: function findDevices(params) {
var _this26 = this;
var _this27 = this;
this.bridge.obj.findDevices(function (ret) {
_this26.handleSuccess(params, ret);
_this27.handleSuccess(params, ret);
}, function (err) {
params.error(err);
});
......@@ -6434,10 +6662,10 @@ var SDS = function () {
}, {
key: 'stopFindDevices',
value: function stopFindDevices(params) {
var _this27 = this;
var _this28 = this;
this.bridge.obj.stopFindDevices(function (ret) {
_this27.handleSuccess(params, ret);
_this28.handleSuccess(params, ret);
}, function (err) {
params.error(err);
});
......@@ -6445,11 +6673,11 @@ var SDS = function () {
}, {
key: 'findWifi',
value: function findWifi(params) {
var _this28 = this;
var _this29 = this;
this.checkKeyExists(params.data, 'model', 'ssid', 'wifiPwd', 'timeout');
this.bridge.obj.startFindWIFI(params.data.model, params.data.ssid, params.data.wifiPwd, params.data.timeout, function (ret) {
_this28.handleSuccess(params, ret);
_this29.handleSuccess(params, ret);
}, function (err) {
params.error(err);
});
......@@ -6457,10 +6685,10 @@ var SDS = function () {
}, {
key: 'stopFindWifi',
value: function stopFindWifi(params) {
var _this29 = this;
var _this30 = this;
this.bridge.obj.stopFindWIFI(function (ret) {
_this29.handleSuccess(params, ret);
_this30.handleSuccess(params, ret);
}, function (err) {
params.error(err);
});
......@@ -6473,7 +6701,7 @@ var SDS = function () {
module.exports = SDS;
/***/ }),
/* 61 */
/* 65 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -6487,11 +6715,11 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Plugin = __webpack_require__(4);
var Bridge = __webpack_require__(67);
var SDS = __webpack_require__(60);
var User = __webpack_require__(63);
var Device = __webpack_require__(62);
var Plugin = __webpack_require__(3);
var Bridge = __webpack_require__(71);
var SDS = __webpack_require__(64);
var User = __webpack_require__(67);
var Device = __webpack_require__(66);
var SDSBusiness = function (_Plugin) {
_inherits(SDSBusiness, _Plugin);
......@@ -6522,7 +6750,7 @@ var SDSBusiness = function (_Plugin) {
module.exports = SDSBusiness;
/***/ }),
/* 62 */
/* 66 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -6546,7 +6774,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* SDSUser
*/
var Device = __webpack_require__(59);
var Device = __webpack_require__(63);
var SDSDevice = function (_Device) {
_inherits(SDSDevice, _Device);
......@@ -6589,7 +6817,6 @@ var SDSDevice = function (_Device) {
}, {
key: 'setNickname',
value: function setNickname(params) {
console.log('setNickname', params.data);
var sds = params.data.sds === true;
if (sds) {
this.business.sds.updateDeviceInfo({
......@@ -6655,6 +6882,27 @@ var SDSDevice = function (_Device) {
});
}*/
}, {
key: 'removeUser',
value: function removeUser(params) {
var _this3 = this;
var sds = params.data.sds === true;
if (sds) {
this.business.sds.unbindByManager({
data: {
uuid: params.data.uuid,
destAuid: params.data.destAuid
},
success: function success() {
_get(SDSDevice.prototype.__proto__ || Object.getPrototypeOf(SDSDevice.prototype), 'removeUser', _this3).call(_this3, params);
},
error: params.error
});
} else {
_get(SDSDevice.prototype.__proto__ || Object.getPrototypeOf(SDSDevice.prototype), 'removeUser', this).call(this, params);
}
}
}]);
return SDSDevice;
......@@ -6663,7 +6911,7 @@ var SDSDevice = function (_Device) {
module.exports = SDSDevice;
/***/ }),
/* 63 */
/* 67 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -6687,7 +6935,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* SDSUser
*/
var User = __webpack_require__(65);
var User = __webpack_require__(69);
var SDSUser = function (_User) {
_inherits(SDSUser, _User);
......@@ -6768,7 +7016,7 @@ var SDSUser = function (_User) {
module.exports = SDSUser;
/***/ }),
/* 64 */
/* 68 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -6782,7 +7030,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Ready = __webpack_require__(2);
var Ready = __webpack_require__(1);
var SDSBridge = function (_Ready) {
_inherits(SDSBridge, _Ready);
......@@ -7101,6 +7349,16 @@ var SDSBridge = function (_Ready) {
callbackID = B.callbackId(success, fail);
return B.exec(_SDSCODE, "wifiDeviceConfig", [callbackID]);
},
unbindByManager: function unbindByManager(uuid, destAuid, successCallback, errorCallback) {
var success = typeof successCallback !== 'function' ? null : function (args) {
successCallback(args);
},
fail = typeof errorCallback !== 'function' ? null : function (code) {
errorCallback(code);
};
callbackID = B.callbackId(success, fail);
return B.exec(_SDSCODE, "unbindByManager", [callbackID, uuid, destAuid]);
},
/******************** 设备自定义配网API ******************************/
//获取ssid
getSSId: function getSSId(successCallback, errorCallback) {
......@@ -7173,7 +7431,7 @@ var SDSBridge = function (_Ready) {
module.exports = SDSBridge;
/***/ }),
/* 65 */
/* 69 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -7189,7 +7447,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var config = __webpack_require__(10);
var config = __webpack_require__(11);
var keys = config.keys;
var User = function () {
......@@ -7520,7 +7778,7 @@ var User = function () {
module.exports = User;
/***/ }),
/* 66 */
/* 70 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -7532,10 +7790,10 @@ var _createClass = function () { function defineProperties(target, props) { for
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var md5 = __webpack_require__(11);
var config = __webpack_require__(10);
var md5 = __webpack_require__(8);
var config = __webpack_require__(11);
var keys = config.keys;
var NetWork = __webpack_require__(9);
var NetWork = __webpack_require__(10);
var CloudAPI = function () {
function CloudAPI(params) {
......@@ -8020,14 +8278,26 @@ var CloudAPI = function () {
}
params.headers = headers;
params.data = opts.data;
if (window.iotDebug) {
iotDebug.push('start: ' + url);
}
params.success = function (ret) {
if (ret.code && ret.code != 0) {
opts.error(ret);
} else {
if (window.iotDebug) {
iotDebug.push('end: ' + url);
}
opts.success(ret);
}
};
params.error = opts.error;
params.error = function (err) {
if (window.iotDebug) {
iotDebug.push('end: ' + url);
}
opts.error(err);
};
// params.error = opts.error;
params.complete = opts.complete;
params.timeout = opts.timeout;
var time = Date.now();
......@@ -8051,7 +8321,7 @@ var CloudAPI = function () {
module.exports = CloudAPI;
/***/ }),
/* 67 */
/* 71 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
......@@ -8065,10 +8335,10 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Ready = __webpack_require__(2);
var CloudAPI = __webpack_require__(66);
var PublicStore = __webpack_require__(22);
var config = __webpack_require__(10);
var Ready = __webpack_require__(1);
var CloudAPI = __webpack_require__(70);
var PublicStore = __webpack_require__(25);
var config = __webpack_require__(11);
var keys = config.keys;
var BusinessReady = function (_Ready) {
......@@ -8126,11 +8396,11 @@ var BusinessReady = function (_Ready) {
module.exports = BusinessReady;
/***/ }),
/* 68 */,
/* 69 */
/* 72 */,
/* 73 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(24);
module.exports = __webpack_require__(27);
/***/ })
......
......@@ -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