UNPKG

@aiot-toolkit/velasim

Version:

vela for sim

664 lines (622 loc) 17.8 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/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/art1/art1.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/art1/art1.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: { info: [], list: [], img: 0, ticai: '', city: '' }, detail(id) { _system.default.push({ uri: "pages/art_detail", params: { id: id } }); }, ewm() { _system.default.replace({ uri: "pages/ewm" }); }, setting() { _system.default.replace({ uri: "pages/setting" }); }, onswipe(event) { if (event.direction == 'right') { _system.default.replace({ uri: "pages/setting" }); } else if (event.direction == 'left') { _system.default.back(); } }, moshi() { var that = this; _system3.default.get({ key: "mode", success: function (data) { console.log("call storage.get success: " + data); that.img = data; }, fail: function (data, code) { console.log("call storage.get fail, code: " + code + ", data: " + data); } }); }, ticaiRs() { var that = this; _system3.default.get({ key: "ticai", success: function (data) { console.log("ticai: " + data); that.ticai = data; }, fail: function (data, code) { console.log("ticai, code: " + code + ", data: " + data); } }); }, cityRs() { var that = this; _system3.default.get({ key: "city", success: function (data) { console.log("city: " + data); that.city = data; }, fail: function (data, code) { console.log("city, code: " + code + ", data: " + data); } }); }, requestRs() { var that = this; _system2.default.fetch({ url: 'http://leanapp.xichuangzhu.com/huawei-watch/get-random-poem?city=' + that.city + '&kind=' + that.ticai, success: function (response) { that.info = response.data.data; console.log('111111'); console.log(that.info); _system3.default.set({ key: "rishang", value: response.data.data, success: function () { console.log("call storage.set success."); }, fail: function (data, code) { console.log("call storage.set fail, code: " + code + ", data: " + data); } }); }, fail: function () { console.info("fetch fail"); } }); }, onShow() { this.moshi(); this.ticaiRs(); this.cityRs(); this.requestRs(); } }; 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/art1/art1.css?uxType=page": /*!*********************************************************************************************************************************!*\ !*** ./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/style-loader.js?index=0&type=style!./src/pages/art1/art1.css?uxType=page ***! \*********************************************************************************************************************************/ /***/ ((module) => { module.exports = [ [ [ [ 0, "container" ] ], { "width": "466px", "height": "466px", "alignItems": "center", "justifyContent": "center" } ], [ [ [ 0, "swiper-box" ] ], { "width": "466px", "height": "466px" } ], [ [ [ 0, "swiper-item" ] ], { "width": "466px", "height": "466px", "justifyContent": "center", "alignItems": "center", "flexDirection": "column" } ], [ [ [ 0, "swiper-info" ] ], { "width": "466px", "height": "466px", "justifyContent": "center", "alignItems": "center", "flexDirection": "column" } ], [ [ [ 0, "info" ] ], { "width": "360px", "height": "230px", "backgroundColor": "#ffffff", "borderRadius": "20px", "paddingTop": "30px", "paddingRight": "30px", "paddingBottom": "10px", "paddingLeft": "30px", "flexWrap": "wrap", "flexDirection": "column" } ], [ [ [ 0, "info1" ] ], { "width": "360px", "height": "230px", "backgroundColor": "#393939", "borderRadius": "20px", "paddingTop": "30px", "paddingRight": "30px", "paddingBottom": "10px", "paddingLeft": "30px", "flexWrap": "wrap", "flexDirection": "column" } ], [ [ [ 0, "text1" ] ], { "width": "300px", "height": "90px", "textOverflow": "ellipsis", "color": "#000000", "fontSize": "30px", "textAlign": "left" } ], [ [ [ 0, "text11" ] ], { "width": "300px", "height": "90px", "textOverflow": "ellipsis", "color": "#ffffff", "fontSize": "30px", "textAlign": "left" } ], [ [ [ 0, "author" ] ], { "width": "300px", "height": "100px", "backgroundColor": "#ffffff", "alignItems": "center" } ], [ [ [ 0, "author1" ] ], { "width": "300px", "height": "100px", "backgroundColor": "#393939", "alignItems": "center" } ], [ [ [ 0, "text2" ] ], { "width": "250px", "color": "#000000", "fontSize": "30px", "textAlign": "left", "marginLeft": "10px" } ], [ [ [ 0, "text21" ] ], { "width": "250px", "color": "#ffffff", "fontSize": "30px", "textAlign": "left", "marginLeft": "10px" } ], [ [ [ 0, "logo" ] ], { "width": "40px", "height": "40px" } ], [ [ [ 0, "logo1" ] ], { "width": "40px", "height": "40px", "marginTop": "0px", "marginRight": "10px", "marginBottom": "0px", "marginLeft": "30px" } ], [ [ [ 0, "heart" ] ], { "width": "50px", "height": "50px" } ], [ [ [ 0, "imgbox" ] ], { "width": "360px", "height": "50px", "justifyContent": "center", "alignItems": "center" } ], [ [ [ 0, "imgbox1" ] ], { "width": "360px", "height": "50px", "justifyContent": "center", "alignItems": "center", "marginTop": "0px", "marginRight": "0px", "marginBottom": "10px", "marginLeft": "0px" } ] ] /***/ }), /***/ "./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/art1/art1.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/art1/art1.hml?uxType=page& ***! \************************************************************************************************************************************************************************************************************/ /***/ ((module) => { module.exports = function (vm) { const _vm_ = vm || this return aiot.__ce__("div", { "classList": [ "container" ], "events": { "swipe": function (evt) {_vm_.onswipe(evt)} } }, [ aiot.__ci__({ shown: function () {return _vm_.img==0} }, function () { return aiot.__ce__("swiper", { "vertical": "true", "indicator": "false", "classList": [ "swiper-info" ] }, [ aiot.__cf__({ exp: function () {return _vm_.info} }, function ($idx, $item) { return aiot.__ce__("div", { "classList": [ "swiper-item" ] }, [ aiot.__ce__("div", { "classList": [ "info" ], "events": { "click": function (evt) { return _vm_.detail($item.id,evt)} } }, [ aiot.__ce__("text", { "classList": [ "text1" ], "value": function () {return $item.quote} }), aiot.__ce__("div", { "classList": [ "author" ] }, [ aiot.__ce__("image", { "src": "/common/logo_round.png", "classList": [ "logo" ] }), aiot.__ce__("text", { "classList": [ "text2" ], "value": function () {return '' + ($item.dynasty) + '.' + ($item.authorName)} }) ]) ]), aiot.__ce__("div", { "classList": [ "imgbox" ] }, [ aiot.__ce__("image", { "src": "/common/setting.png", "classList": [ "logo1" ], "events": { "click": function (evt) {_vm_.setting(evt)} } }) ]) ])}) ])}), aiot.__ci__({ shown: function () {return _vm_.img==1} }, function () { return aiot.__ce__("swiper", { "vertical": "true", "indicator": "false", "classList": [ "swiper-info" ] }, [ aiot.__cf__({ exp: function () {return _vm_.info} }, function ($idx, $item) { return aiot.__ce__("div", { "classList": [ "swiper-item" ] }, [ aiot.__ce__("div", { "classList": [ "info1" ], "events": { "click": function (evt) { return _vm_.detail($item.id,evt)} } }, [ aiot.__ce__("text", { "classList": [ "text11" ], "value": function () {return $item.quote} }), aiot.__ce__("div", { "classList": [ "author1" ] }, [ aiot.__ce__("image", { "src": "/common/logo_round.png", "classList": [ "logo" ] }), aiot.__ce__("text", { "classList": [ "text21" ], "value": function () {return '' + ($item.dynasty) + '.' + ($item.authorName)} }) ]) ]), aiot.__ce__("div", { "classList": [ "imgbox" ] }, [ aiot.__ce__("image", { "src": "/common/setting.png", "classList": [ "logo1" ], "events": { "click": function (evt) {_vm_.setting(evt)} } }) ]) ])}) ])}) ]) } /***/ }), /***/ "./src/pages/art1/art1.hml?uxType=page": /*!*********************************************!*\ !*** ./src/pages/art1/art1.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!./art1.css?uxType=page */ "./node_modules/@aiot-toolkit/dsl-xvm/lib/loaders/style-loader.js?index=0&type=style!./src/pages/art1/art1.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!./art1.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/art1/art1.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!./art1.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/art1/art1.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/art1/art1.hml?uxType=page"); /******/ /******/ })() ; }; return createPageHandler(); };