UNPKG

@aiot-toolkit/velasim

Version:

vela for sim

607 lines (566 loc) 18.2 kB
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/scheduled_box/scheduled/scheduled.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/scheduled_box/scheduled/scheduled.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.file")); var _system3 = _interopRequireDefault($app_require$("@app-module/system.interconnect")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _default = { protected: { appointmentCourseFilePath: "internal://app/appointCourse.txt", instance: {}, routerUrl: "", userId: 0, courseList: [], judge: "loading", isSendMessageToApp: false }, goBack(SwipeEvent) { if (SwipeEvent.direction == "right") { _system.default.replace({ uri: "pages/home" }); } }, clickCourseItem(parentIndex, childIndex) { let courseItemData = this.courseList[parentIndex].resource[childIndex]; this.writeFile(courseItemData); let params = { classTime: courseItemData.class_time, startDate: courseItemData.start_time, courseId: courseItemData.id.toString(), burying: courseItemData.burning.toString(), courseName: courseItemData.name, actionLength: courseItemData.action.length.toString(), userId: this.userId }; _system.default.push({ uri: "pages/scheduled_box/verification", params: params }); }, writeFile(data) { _system2.default.writeText({ uri: this.appointmentCourseFilePath, text: JSON.stringify(data), success: function () {}, fail: function (data, code) {} }); }, sendMessage() { let that = this; if (that.isSendMessageToApp != true) { that.isSendMessageToApp = true; var data = { type: 1, data: [] }; that.instance.send({ data: { data: JSON.stringify(data) }, success: () => {}, fail: data => {} }); } }, receiveMessageWithApp() { let that = this; that.instance.onmessage = data => { var courseData = JSON.parse(data.data); if (courseData.status == 0) { that.gotoPageWithUri("pages/login_tip"); } else { that.userId = courseData.id; that.judge = courseData.data.length == 0 ? "no" : "yes"; courseData.data.forEach((item, index) => { item["height"] = item.resource.length * (120 + 10) + 80; item["parentIndex"] = index; item.resource.forEach((childItem, childIndex) => { childItem["childIndex"] = childIndex; childItem["parentIndex"] = index; }); }); that.courseList = courseData.data; } }; }, gotoPageWithUri(uri) { _system.default.replace({ uri: uri, params: { routerUrl: "pages/scheduled_box/scheduled" } }); }, onInit() { this.instance = _system3.default.instance(); var conn_status = this.instance.getApkStatus(); if (conn_status == "CONNECTED") { this.sendMessage(); this.receiveMessageWithApp(); } else { this.gotoPageWithUri("pages/not_conn"); } }, onDestroy() { this.instance = null; } }; 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/scheduled_box/scheduled/scheduled.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/scheduled_box/scheduled/scheduled.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, "employContent" ] ], { "width": "464px", "height": "464px", "flexDirection": "column", "justifyContent": "center", "alignItems": "center" } ], [ [ [ 0, "listUl" ] ], { "width": "464px", "height": "464px", "paddingTop": "10px" } ], [ [ [ 0, "content" ] ], { "width": "386px", "height": "400px", "flexDirection": "column", "justifyContent": "center", "alignItems": "center" } ], [ [ [ 0, "item" ] ], { "width": "464px", "height": "400px", "flexDirection": "column", "justifyContent": "center", "alignItems": "center" } ], [ [ [ 0, "itemEmploy" ] ], { "width": "464px", "height": "120px" } ], [ [ [ 0, "titBox" ] ], { "width": "386px", "height": "82px", "flexDirection": "row", "alignItems": "center", "justifyContent": "center" } ], [ [ [ 0, "dateTimeTxt" ] ], { "color": "#C0191F" } ], [ [ [ 0, "listLi" ] ], { "width": "366px", "height": "120px", "borderRadius": "12px", "backgroundColor": "#282828", "marginBottom": "10px", "flexDirection": "column", "justifyContent": "center", "paddingLeft": "20px" } ], [ [ [ 0, "courseTime" ] ], { "fontSize": "34px", "color": "#AAAAAA" } ], [ [ [ 0, "courseNameBox" ] ], { "width": "326px", "height": "44px", "backgroundColor": "rgba(0,0,0,0)" } ], [ [ [ 0, "courseName" ] ], { "width": "326px", "height": "44px", "textOverflow": "ellipsis", "fontSize": "34px" } ], [ [ [ 0, "employIcon" ] ], { "width": "61px", "height": "74px", "marginBottom": "33px" } ], [ [ [ 0, "employTxt" ] ], { "fontSize": "34px", "height": "44px" } ] ] /***/ }), /***/ "./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/scheduled_box/scheduled/scheduled.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/scheduled_box/scheduled/scheduled.hml?uxType=page& ***! \************************************************************************************************************************************************************************************************************************************/ /***/ ((module) => { module.exports = function (vm) { const _vm_ = vm || this return aiot.__ce__("div", { "classList": [ "container" ] }, [ aiot.__ci__({ shown: function () {return _vm_.judge=='yes'} }, function () { return aiot.__ce__("list", { "classList": [ "listUl" ], "events": { "swipe": function (evt) {_vm_.goBack(evt)} } }, [ aiot.__cf__({ exp: function () {return _vm_.courseList} }, function ($idx, $item) { return aiot.__ce__("list-item", { "classList": [ "item" ], "style": { "height": function () {return $item.height} } }, [ aiot.__ce__("div", { "classList": [ "content" ], "style": { "height": function () {return $item.height} } }, [ aiot.__ce__("div", { "classList": [ "titBox" ] }, [ aiot.__ce__("text", { "classList": [ "dateTimeTxt" ], "value": function () {return $item.class_date} }) ]), aiot.__cf__({ exp: function () {return $item.resource} }, function ($idx, $item) { return aiot.__ce__("div", { "classList": [ "listLi" ], "events": { "click": function (evt) { return _vm_.clickCourseItem($item.parentIndex,$item.childIndex,evt)} } }, [ aiot.__ce__("div", { "classList": [ "courseNameBox" ] }, [ aiot.__ce__("text", { "classList": [ "courseName" ], "value": function () {return $item.name} }) ]), aiot.__ce__("text", { "classList": [ "courseTime" ], "value": function () {return $item.class_time} }) ])}) ]) ])}), aiot.__ce__("list-item", { "classList": [ "itemEmploy" ] }) ])}), aiot.__ci__({ shown: function () {return _vm_.judge=='no'} }, function () { return aiot.__ce__("div", { "classList": [ "employContent" ], "events": { "swipe": function (evt) {_vm_.goBack(evt)} } }, [ aiot.__ce__("image", { "src": "/common/images/no_course.png", "classList": [ "employIcon" ] }), aiot.__ce__("text", { "classList": [ "employTxt" ], "value": "暂无课程" }) ])}), aiot.__ci__({ shown: function () {return _vm_.judge=='loading'} }, function () { return aiot.__ce__("div", { "classList": [ "employContent" ], "events": { "swipe": function (evt) {_vm_.goBack(evt)} } }, [ aiot.__ce__("text", { "classList": [ "employTxt" ], "value": "读取课程中..." }) ])}) ]) } /***/ }), /***/ "./src/pages/scheduled_box/scheduled/scheduled.hml?uxType=page": /*!*********************************************************************!*\ !*** ./src/pages/scheduled_box/scheduled/scheduled.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!./scheduled.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/scheduled_box/scheduled/scheduled.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!./scheduled.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/scheduled_box/scheduled/scheduled.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!./scheduled.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/scheduled_box/scheduled/scheduled.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/scheduled_box/scheduled/scheduled.hml?uxType=page"); /******/ /******/ })() ; }; return createPageHandler(); };