@aiot-toolkit/velasim
Version:
vela for sim
366 lines (330 loc) • 13.2 kB
JavaScript
export default function(global, globalThis, window, $app_exports$){
var createPageHandler = function() {
return /******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/script-loader.js!./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/module-loader.js!./node_modules/babel-loader/lib/index.js?cwd=/home/baerg/vela/app/vela-xcz&cacheDirectory&plugins[]=/home/baerg/vela/app/vela-xcz/node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/babel-plugin-jsx.js&comments=false&configFile=/home/baerg/vela/app/vela-xcz/node_modules/@aiot-toolkit/packager/babel.config.js!./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/access-loader.js!./src/pages/ewm/ewm.js?uxType=page":
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/script-loader.js!./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/module-loader.js!./node_modules/babel-loader/lib/index.js?cwd=/home/baerg/vela/app/vela-xcz&cacheDirectory&plugins[]=/home/baerg/vela/app/vela-xcz/node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/babel-plugin-jsx.js&comments=false&configFile=/home/baerg/vela/app/vela-xcz/node_modules/@aiot-toolkit/packager/babel.config.js!./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/access-loader.js!./src/pages/ewm/ewm.js?uxType=page ***!
\*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module) => {
module.exports = function __scriptModule__ (module, exports, $app_require$){"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _system = _interopRequireDefault($app_require$("@app-module/system.router"));
var _system2 = _interopRequireDefault($app_require$("@app-module/system.fetch"));
var _system3 = _interopRequireDefault($app_require$("@app-module/system.storage"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = {
protected: {
ewm: ''
},
back() {
_system.default.replace({
uri: "pages/art1"
});
},
onInit() {
console.log('1111');
var len = len || 18;
var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
var maxPos = chars.length;
var pwd = '';
for (var i = 0; i < len; i++) {
pwd += chars.charAt(Math.floor(Math.random() * maxPos));
}
;
var obj = {
code: pwd,
action: 'signIn',
client: 'oppoWatch',
deviceId: pwd
};
var str = JSON.stringify(obj);
this.ewm = str;
console.log(this.ewm);
setInterval(function () {
_system2.default.fetch({
url: 'http://leanapp.xichuangzhu.com/huawei-watch/sign-in-by-action-code?code=' + pwd + '&action=signIn&client=oppoWatch&deviceId=' + pwd,
method: 'POST',
success: function (response) {
console.log(JSON.stringify(response));
if (response.data.status == 1) {
_system3.default.set({
key: "userId",
value: response.data.data.userId,
success: function () {},
fail: function (data, code) {}
});
_system3.default.set({
key: "sessionToken",
value: response.data.data.sessionToken,
success: function () {},
fail: function (data, code) {}
});
_system3.default.set({
key: "username",
value: response.data.data.username,
success: function () {},
fail: function (data, code) {}
});
_system3.default.set({
key: "avatar",
value: response.data.data.avatar,
success: function () {},
fail: function (data, code) {}
});
}
},
fail: function () {
console.info("fetch fail");
}
});
}, 1500);
}
};
exports.default = _default;
const moduleOwn = exports.default || module.exports;
const accessors = ['public', 'protected', 'private'];
if (moduleOwn.data && accessors.some(function (acc) {
return moduleOwn[acc];
})) {
throw new Error('页面VM对象中的属性data不可与"' + accessors.join(',') + '"同时存在,请使用private替换data名称');
} else if (!moduleOwn.data) {
moduleOwn.data = {};
moduleOwn._descriptor = {};
accessors.forEach(function (acc) {
const accType = typeof moduleOwn[acc];
if (accType === 'object') {
moduleOwn.data = Object.assign(moduleOwn.data, moduleOwn[acc]);
for (const name in moduleOwn[acc]) {
moduleOwn._descriptor[name] = {
access: acc
};
}
} else if (accType === 'function') {
console.warn('页面VM对象中的属性' + acc + '的值不能是函数,请使用对象');
}
});
}}
/***/ }),
/***/ "./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/style-loader.js?index=0&type=style!./src/pages/ewm/ewm.css?uxType=page":
/*!*******************************************************************************************************************************!*\
!*** ./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/style-loader.js?index=0&type=style!./src/pages/ewm/ewm.css?uxType=page ***!
\*******************************************************************************************************************************/
/***/ ((module) => {
module.exports = [
[
[
[
0,
"container"
]
],
{
"width": "466px",
"height": "466px",
"flexWrap": "wrap",
"flexDirection": "column",
"alignItems": "center"
}
],
[
[
[
0,
"top"
]
],
{
"width": "466px",
"height": "40px",
"marginTop": "50px",
"marginRight": "0px",
"marginBottom": "5px",
"marginLeft": "0px",
"alignItems": "center"
}
],
[
[
[
0,
"img1"
]
],
{
"width": "34px",
"height": "34px",
"marginTop": "0px",
"marginRight": "0px",
"marginBottom": "0px",
"marginLeft": "90px"
}
],
[
[
[
0,
"tit"
]
],
{
"width": "80px",
"height": "40px",
"fontSize": "30px",
"color": "#ffffff"
}
],
[
[
[
2,
"marquee"
]
],
{
"width": "466px",
"height": "40px",
"color": "#ffffff",
"fontSize": "30px",
"alignItems": "center"
}
],
[
[
[
0,
"box"
]
],
{
"width": "250px",
"height": "250px",
"marginTop": "20px",
"marginRight": "0px",
"marginBottom": "0px",
"marginLeft": "0px",
"flexWrap": "wrap",
"flexDirection": "column"
}
],
[
[
[
0,
"ewm"
]
],
{
"width": "250px",
"height": "250px"
}
]
]
/***/ }),
/***/ "./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/template-loader.js!./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/fragment-loader.js?index=0&type=template!./src/pages/ewm/ewm.hml?uxType=page&":
/*!**********************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/template-loader.js!./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/fragment-loader.js?index=0&type=template!./src/pages/ewm/ewm.hml?uxType=page& ***!
\**********************************************************************************************************************************************************************************************************/
/***/ ((module) => {
module.exports = function (vm) {
const _vm_ = vm || this
return aiot.__ce__("div", {
"classList": [
"container"
]
}, [
aiot.__ce__("div", {
"classList": [
"top"
],
"events": {
"click": function (evt) {_vm_.back(evt)}
}
}, [
aiot.__ce__("image", {
"src": "/common/ic_back.png",
"classList": [
"img1"
],
"events": {
"click": function (evt) {_vm_.back(evt)}
}
}),
aiot.__ce__("text", {
"classList": [
"tit"
],
"value": "返回"
})
]),
aiot.__ce__("marquee", {
"value": "请用手机app扫码登录"
}),
aiot.__ce__("div", {
"classList": [
"box"
]
}, [
aiot.__ce__("qrcode", {
"value": function () {return _vm_.ewm},
"classList": [
"ewm"
]
})
])
])
}
/***/ }),
/***/ "./src/pages/ewm/ewm.hml?uxType=page":
/*!*******************************************!*\
!*** ./src/pages/ewm/ewm.hml?uxType=page ***!
\*******************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
var $app_style$ = __webpack_require__(/*! !../../../node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/style-loader.js?index=0&type=style!./ewm.css?uxType=page */ "./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/style-loader.js?index=0&type=style!./src/pages/ewm/ewm.css?uxType=page")
var $app_script$ = __webpack_require__(/*! !../../../node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/script-loader.js!../../../node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/module-loader.js!../../../node_modules/babel-loader/lib/index.js?cwd=/home/baerg/vela/app/vela-xcz&cacheDirectory&plugins[]=/home/baerg/vela/app/vela-xcz/node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/babel-plugin-jsx.js&comments=false&configFile=/home/baerg/vela/app/vela-xcz/node_modules/@aiot-toolkit/packager/babel.config.js!../../../node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/access-loader.js!./ewm.js?uxType=page */ "./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/script-loader.js!./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/module-loader.js!./node_modules/babel-loader/lib/index.js?cwd=/home/baerg/vela/app/vela-xcz&cacheDirectory&plugins[]=/home/baerg/vela/app/vela-xcz/node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/babel-plugin-jsx.js&comments=false&configFile=/home/baerg/vela/app/vela-xcz/node_modules/@aiot-toolkit/packager/babel.config.js!./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/access-loader.js!./src/pages/ewm/ewm.js?uxType=page")
var $app_template$ = __webpack_require__(/*! !../../../node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/template-loader.js!../../../node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/fragment-loader.js?index=0&type=template!./ewm.hml?uxType=page& */ "./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/template-loader.js!./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/fragment-loader.js?index=0&type=template!./src/pages/ewm/ewm.hml?uxType=page&")
$app_script$({}, $app_exports$, $app_require$);
$app_exports$.default.template = $app_template$;
$app_exports$.default.style = $app_style$;
module.exports = $app_exports$.default;
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __webpack_exports__ = __webpack_require__("./src/pages/ewm/ewm.hml?uxType=page");
/******/
/******/ })()
;
};
return createPageHandler();
};