@aiot-toolkit/velasim
Version:
vela for sim
385 lines (337 loc) • 13.9 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/zdying/work/aidong_watch/vela-source&cacheDirectory&plugins[]=/home/zdying/work/aidong_watch/vela-source/node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/babel-plugin-jsx.js&comments=false&configFile=/home/zdying/work/aidong_watch/vela-source/node_modules/@aiot-toolkit/packager/babel.config.js!./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/access-loader.js!./src/pages/index/index.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/zdying/work/aidong_watch/vela-source&cacheDirectory&plugins[]=/home/zdying/work/aidong_watch/vela-source/node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/babel-plugin-jsx.js&comments=false&configFile=/home/zdying/work/aidong_watch/vela-source/node_modules/@aiot-toolkit/packager/babel.config.js!./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/access-loader.js!./src/pages/index/index.js?uxType=page ***!
\************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
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.app"));
var _system2 = _interopRequireDefault($app_require$("@app-module/system.router"));
var _storageData = _interopRequireDefault(__webpack_require__(/*! ../../common/js/storageData.js */ "./src/common/js/storageData.js"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = {
protected: {},
gotoUseStepPage() {
setTimeout(() => {
_system2.default.replace({
uri: "pages/use_steps"
});
}, 1500);
},
onInit() {
let that = this;
var info = _system.default.getInfo();
_storageData.default.getVersionName(res => {
if (info.versionName == res) {
setTimeout(() => {
_system2.default.push({
uri: "pages/home"
});
}, 1500);
} else {
that.gotoUseStepPage();
}
}, err => {
_storageData.default.setVersionName(info.versionName);
that.gotoUseStepPage();
});
}
};
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!./node_modules/sass-loader/dist/cjs.js!./src/pages/index/index.scss?uxType=page":
/*!***************************************************************************************************************************************************************************!*\
!*** ./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/style-loader.js?index=0&type=style!./node_modules/sass-loader/dist/cjs.js!./src/pages/index/index.scss?uxType=page ***!
\***************************************************************************************************************************************************************************/
/***/ ((module) => {
module.exports = [
[
[
[
0,
"publicContainer"
]
],
{
"width": "464px",
"height": "464px",
"flexDirection": "column",
"alignItems": "center",
"backgroundColor": "#000000"
}
],
[
[
[
0,
"container"
]
],
{
"width": "464px",
"height": "464px",
"flexDirection": "column",
"alignItems": "center",
"backgroundColor": "#000000",
"justifyContent": "center"
}
],
[
[
[
2,
"text"
]
],
{
"fontSize": "34px",
"color": "#FFFFFF"
}
],
[
[
[
0,
"logo"
]
],
{
"width": "201px",
"height": "150px",
"marginTop": "119px",
"marginBottom": "88px"
}
],
[
[
[
0,
"companyName"
]
],
{
"width": "80px",
"height": "44px"
}
],
[
[
[
0,
"companyNameTxt"
]
],
{
"color": "#FFFFFF",
"textAlign": "center",
"fontSize": "34px",
"height": "44px"
}
],
[
[
[
0,
"receiveMessage"
]
],
{
"fontSize": "34px",
"marginTop": "10px",
"width": "464px",
"textAlign": "center"
}
],
[
[
[
0,
"trainBtn"
]
],
{
"width": "260px",
"height": "86px",
"fontSize": "34px",
"backgroundColor": "#C0191F"
}
]
]
/***/ }),
/***/ "./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/index/index.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/index/index.hml?uxType=page& ***!
\**************************************************************************************************************************************************************************************************************/
/***/ ((module) => {
module.exports = function (vm) {
const _vm_ = vm || this
return aiot.__ce__("div", {
"classList": [
"container"
]
}, [
aiot.__ce__("image", {
"src": "/common/images/logo.png",
"classList": [
"logo"
],
"events": {
"click": function (evt) {_vm_.gotoUseStepPage(evt)}
}
}),
aiot.__ce__("div", {
"classList": [
"companyName"
]
}, [
aiot.__ce__("text", {
"classList": [
"companyNameTxt"
],
"value": "爱动"
})
])
])
}
/***/ }),
/***/ "./src/pages/index/index.hml?uxType=page":
/*!***********************************************!*\
!*** ./src/pages/index/index.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!sass-loader!./index.scss?uxType=page */ "./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/style-loader.js?index=0&type=style!./node_modules/sass-loader/dist/cjs.js!./src/pages/index/index.scss?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/zdying/work/aidong_watch/vela-source&cacheDirectory&plugins[]=/home/zdying/work/aidong_watch/vela-source/node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/babel-plugin-jsx.js&comments=false&configFile=/home/zdying/work/aidong_watch/vela-source/node_modules/@aiot-toolkit/packager/babel.config.js!../../../node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/access-loader.js!./index.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/zdying/work/aidong_watch/vela-source&cacheDirectory&plugins[]=/home/zdying/work/aidong_watch/vela-source/node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/babel-plugin-jsx.js&comments=false&configFile=/home/zdying/work/aidong_watch/vela-source/node_modules/@aiot-toolkit/packager/babel.config.js!./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/access-loader.js!./src/pages/index/index.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!./index.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/index/index.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;
/***/ }),
/***/ "./src/common/js/storageData.js":
/*!**************************************!*\
!*** ./src/common/js/storageData.js ***!
\**************************************/
/***/ ((module) => {
"use strict";
var _system = _interopRequireDefault($app_require$("@app-module/system.storage"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
//命名存储app版本的变量
const versionName = "versionName";
/**
* 存储app版本号
* @params {versionName}存储版本号的storage_key
*/
function setVersionName(value) {
setStorageKey(versionName, value);
}
/**
* 通过storage_key把存储版本号获取
* @params {versionName}
* @params {successCallback} 获取成功的回调
* @params {errCallback} 获取失败的回调
*/
function getVersionName(successCallback, errCallback) {
getStorageWithKey(versionName, successCallback, errCallback);
}
/**
* 把存储封装成函数
*/
function setStorageKey(key, value) {
_system.default.set({
key: key,
value: value,
success: function () {
console.log("call storage.set success.");
},
fail: function (data, code) {
console.log("call storage.set fail, code: " + code + ", data: " + data);
}
});
}
/**
* 把获取存储封装成函数
* 通过Promise把加过返回
*/
function getStorageWithKey(key, successCallback, errCallback) {
_system.default.get({
key: key,
success: function (data) {
successCallback(data);
},
fail: function (data, code) {
errCallback(data);
}
});
}
module.exports = {
setVersionName: setVersionName,
getVersionName: getVersionName
};
/***/ })
/******/ });
/************************************************************************/
/******/ // 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/index/index.hml?uxType=page");
/******/
/******/ })()
;
};
return createPageHandler();
};