@zeppos/zeus-cli 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/main.js +1 -1
- package/modules/bridge.js +1 -1
- package/modules/build.js +152 -32
- package/modules/create.js +7 -6
- package/modules/help.js +1 -1
- package/modules/run.js +14 -12
- package/package.json +2 -2
- package/private-modules/zeppos-app-utils/dist/api/index.js +1 -1
- package/private-modules/zeppos-app-utils/dist/config/device-server.js +113 -0
- package/private-modules/zeppos-app-utils/dist/config/device.js +403 -152
- package/private-modules/zeppos-app-utils/dist/modules/build.js +101 -29
- package/private-modules/zeppos-app-utils/dist/modules/config.js +1 -1
- package/private-modules/zeppos-app-utils/dist/modules/create/index.js +13 -11
- package/private-modules/zeppos-app-utils/dist/modules/create/local-app.js +10 -10
- package/private-modules/zeppos-app-utils/dist/modules/create/yeoman-app.js +1 -1
- package/private-modules/zeppos-app-utils/dist/modules/login.js +1 -1
- package/private-modules/zeppos-app-utils/dist/modules/status.js +1 -1
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/_package.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app-side/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app-side/index.js +13 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app.js +10 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/app.json +59 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/assets/default/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/page/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/page/index.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/setting/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/setting/index.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/empty/watchface/index.js +13 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/app-side/index.js +11 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/app.js +10 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/app.json +66 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3-pro/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gtr3-pro/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gts3/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/assets/gts3/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3/home/index.page.js +18 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3/home/index.style.js +15 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3-pro/home/index.page.js +18 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3-pro/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gtr3-pro/home/index.style.js +15 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gts3/home/index.page.js +19 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gts3/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/gts3/home/index.style.js +15 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/page/i18n/en-US.po +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/setting/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/setting/index.js +5 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/hello-world/utils/index.js +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/jsconfig.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/app.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/app.json +51 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bg/bg.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/0.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/1.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/2.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/3.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/4.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/5.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/6.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/7.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/8.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/9.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/bigNum/sp.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/btn/back.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/btn/lv.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/btn/red.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/bg.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/bottom.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/center.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/h.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/left.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/m.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/right.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/point/s.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/preview.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/second/second.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/0.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/1.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/2.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/3.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/4.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/5.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/6.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/7.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/8.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/9.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/d.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/smallNum/n.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/1.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/2.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/3.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/4.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/5.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/6.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_ch/7.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/1.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/2.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/3.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/4.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/5.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/6.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/assets/gtr-3-pro/images/week_en/7.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/buffer.js +11 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/device-polyfill.js +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/global.js +17 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/js-module.js +27 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/logger.js +21 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/shared/setTimeout.js +59 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/watchface/gtr-3-pro/index.js +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v1/timer/watchface/round/index.js +438 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/_package.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/app.js +28 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/app.json +51 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/consume.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/beer.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/cake.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/chocolate.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/coffee.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/cookies.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/ham.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/hamburger.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/ice cream.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/pizza.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/food/sausage.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/multiply.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/selected.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/assets/gt.s/unselected.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/gt/food-list.js +113 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/gt/index.js +126 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/i18n/en-US.po +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/page/i18n/zh-CN.po +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/constants.js +54 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/storage.js +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/styles-gts-3.js +141 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/calories/utils/styles.js +142 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app-side/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app-side/index.js +13 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app.js +10 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/app.json +59 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/assets/default/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/page/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/page/index.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/setting/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/setting/index.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/empty/watchface/index.js +13 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app-side/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app-side/index.js +72 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app.js +23 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/app.json +55 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/assets/common.r/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/assets/common.s/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/page/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/page/index.js +55 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/data.js +67 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/defer.js +35 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/device-polyfill.js +6 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/es6-promise.js +1149 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/event.js +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/message-side.js +1145 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/shared/message.js +1151 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/utils/config/constants.js +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/fetch-api/utils/config/device.js +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/app-side/index.js +11 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/app.js +10 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/app.json +66 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.r/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.r/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.s/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/assets/gt.s/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.js +17 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.r.layout.js +28 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.page.s.layout.js +28 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/gt/home/index.style.js +18 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/page/i18n/en-US.po +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/setting/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/setting/index.js +5 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/hello-world/utils/index.js +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/jsconfig.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/.prettierrc.js +6 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app-side/index.js +48 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app.js +25 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app.json +70 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/assets/gt.s/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/home/index.page.js +155 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/home/index.style.js +93 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/page/i18n/en-US.po +9 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/setting/i18n/en-US.po +5 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/setting/index.js +145 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/data.js +67 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/defer.js +35 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/device-polyfill.js +6 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/es6-promise.js +1149 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/event.js +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/message-side.js +1145 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/shared/message.js +1151 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/utils/constants.js +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/utils/fs.js +38 -0
- package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/utils/index.js +38 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/page/index.js +2 -2
- package/private-modules/zeppos-app-utils/dist/tools/index.js +1 -1
- package/private-modules/zeppos-app-utils/dist/tools/tools.js +14 -0
- package/private-modules/zeppos-app-utils/package.json +1 -1
- package/utils/pre-check.js +11 -22
- package/utils/tools.js +14 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"configVersion": "v3",
|
|
3
|
+
"app": {
|
|
4
|
+
"appId": 20001,
|
|
5
|
+
"appName": "Hello World",
|
|
6
|
+
"appType": "app",
|
|
7
|
+
"version": {
|
|
8
|
+
"code": 1,
|
|
9
|
+
"name": "1.0.1"
|
|
10
|
+
},
|
|
11
|
+
"icon": "icon.png",
|
|
12
|
+
"vender": "zepp",
|
|
13
|
+
"description": "hello world app"
|
|
14
|
+
},
|
|
15
|
+
"permissions": [
|
|
16
|
+
"data:os.device.info",
|
|
17
|
+
"device:os.local_storage"
|
|
18
|
+
],
|
|
19
|
+
"runtime": {
|
|
20
|
+
"apiVersion": {
|
|
21
|
+
"compatible": "2.0.0",
|
|
22
|
+
"target": "2.0.0",
|
|
23
|
+
"minVersion": "2.0"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"debug": false,
|
|
27
|
+
"targets": {
|
|
28
|
+
"gt": {
|
|
29
|
+
"module": {
|
|
30
|
+
"page": {
|
|
31
|
+
"pages": [
|
|
32
|
+
"page/gt/home/index.page"
|
|
33
|
+
],
|
|
34
|
+
"window": {
|
|
35
|
+
"navigationBarBackgroundColor": "#ffffff",
|
|
36
|
+
"navigationBarTextStyle": "black",
|
|
37
|
+
"navigationBarTitleText": "Hello World",
|
|
38
|
+
"backgroundColor": "#eeeeee",
|
|
39
|
+
"backgroundTextStyle": "light"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"app-side": {
|
|
43
|
+
"path": "app-side/index"
|
|
44
|
+
},
|
|
45
|
+
"setting": {
|
|
46
|
+
"path": "setting/index"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"platforms": [
|
|
50
|
+
{
|
|
51
|
+
"st": "r"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"st": "s"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"designWidth": 480
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"i18n": {
|
|
61
|
+
"en-US": {
|
|
62
|
+
"appName": "Hello World"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"defaultLanguage": "en-US"
|
|
66
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { log as Logger } from '@zos/utils'
|
|
2
|
+
import { layout } from 'zosLoader:./[name].[pf].layout.js'
|
|
3
|
+
|
|
4
|
+
const logger = Logger.getLogger('helloworld')
|
|
5
|
+
Page({
|
|
6
|
+
build() {
|
|
7
|
+
logger.debug('page build invoked')
|
|
8
|
+
layout.render(this)
|
|
9
|
+
},
|
|
10
|
+
onInit() {
|
|
11
|
+
logger.debug('page onInit invoked')
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
onDestroy() {
|
|
15
|
+
logger.debug('page onDestroy invoked')
|
|
16
|
+
},
|
|
17
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as hmUI from '@zos/ui'
|
|
2
|
+
import { getText } from '@zos/i18n'
|
|
3
|
+
import { getDeviceInfo } from '@zos/device'
|
|
4
|
+
import { px } from '@zos/utils'
|
|
5
|
+
|
|
6
|
+
export const { width: DEVICE_WIDTH, height: DEVICE_HEIGHT } = getDeviceInfo()
|
|
7
|
+
|
|
8
|
+
export const layout = {
|
|
9
|
+
refs: {},
|
|
10
|
+
render(vm) {
|
|
11
|
+
this.state = vm.state
|
|
12
|
+
this.build()
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
build() {
|
|
16
|
+
hmUI.createWidget(hmUI.widget.TEXT, {
|
|
17
|
+
text: getText('appName'),
|
|
18
|
+
x: px(42),
|
|
19
|
+
y: px(200),
|
|
20
|
+
w: DEVICE_WIDTH - px(42) * 2,
|
|
21
|
+
h: px(100),
|
|
22
|
+
color: 0xffffff,
|
|
23
|
+
text_size: px(36),
|
|
24
|
+
align_h: hmUI.align.CENTER_H,
|
|
25
|
+
text_style: hmUI.text_style.WRAP,
|
|
26
|
+
})
|
|
27
|
+
},
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as hmUI from '@zos/ui'
|
|
2
|
+
import { getText } from '@zos/i18n'
|
|
3
|
+
import { getDeviceInfo } from '@zos/device'
|
|
4
|
+
import { px } from '@zos/utils'
|
|
5
|
+
|
|
6
|
+
export const { width: DEVICE_WIDTH, height: DEVICE_HEIGHT } = getDeviceInfo()
|
|
7
|
+
|
|
8
|
+
export const layout = {
|
|
9
|
+
refs: {},
|
|
10
|
+
render(vm) {
|
|
11
|
+
this.state = vm.state
|
|
12
|
+
this.build()
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
build() {
|
|
16
|
+
hmUI.createWidget(hmUI.widget.TEXT, {
|
|
17
|
+
text: getText('appName'),
|
|
18
|
+
x: px(42),
|
|
19
|
+
y: px(200),
|
|
20
|
+
w: DEVICE_WIDTH - px(42 * 2),
|
|
21
|
+
h: px(100),
|
|
22
|
+
color: 0xffffff,
|
|
23
|
+
text_size: px(36),
|
|
24
|
+
align_h: hmUI.align.CENTER_H,
|
|
25
|
+
text_style: hmUI.text_style.WRAP,
|
|
26
|
+
})
|
|
27
|
+
},
|
|
28
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as hmUI from '@zos/ui'
|
|
2
|
+
import { getText } from '@zos/i18n'
|
|
3
|
+
import { getDeviceInfo } from '@zos/device'
|
|
4
|
+
import { px } from '@zos/utils'
|
|
5
|
+
|
|
6
|
+
export const { width: DEVICE_WIDTH, height: DEVICE_HEIGHT } = getDeviceInfo()
|
|
7
|
+
|
|
8
|
+
export const TEXT_STYLE = {
|
|
9
|
+
text: getText('appName'),
|
|
10
|
+
x: px(42),
|
|
11
|
+
y: px(200),
|
|
12
|
+
w: DEVICE_WIDTH - px(42) * 2,
|
|
13
|
+
h: px(100),
|
|
14
|
+
color: 0xffffff,
|
|
15
|
+
text_size: px(36),
|
|
16
|
+
align_h: hmUI.align.CENTER_H,
|
|
17
|
+
text_style: hmUI.text_style.WRAP,
|
|
18
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { MessageBuilder } from '../shared/message-side'
|
|
2
|
+
import { DEFAULT_TODO_LIST } from './../utils/constants'
|
|
3
|
+
const messageBuilder = new MessageBuilder()
|
|
4
|
+
|
|
5
|
+
function getTodoList() {
|
|
6
|
+
return settings.settingsStorage.getItem('todoList')
|
|
7
|
+
? JSON.parse(settings.settingsStorage.getItem('todoList'))
|
|
8
|
+
: [...DEFAULT_TODO_LIST]
|
|
9
|
+
}
|
|
10
|
+
AppSideService({
|
|
11
|
+
onInit() {
|
|
12
|
+
messageBuilder.listen(() => {})
|
|
13
|
+
settings.settingsStorage.addListener(
|
|
14
|
+
'change',
|
|
15
|
+
({ key, newValue, oldValue }) => {
|
|
16
|
+
messageBuilder.call(getTodoList())
|
|
17
|
+
},
|
|
18
|
+
)
|
|
19
|
+
messageBuilder.on('request', (ctx) => {
|
|
20
|
+
const payload = messageBuilder.buf2Json(ctx.request.payload)
|
|
21
|
+
if (payload.method === 'GET_TODO_LIST') {
|
|
22
|
+
ctx.response({
|
|
23
|
+
data: { result: getTodoList() },
|
|
24
|
+
})
|
|
25
|
+
} else if (payload.method === 'ADD') {
|
|
26
|
+
// 这里补充一个
|
|
27
|
+
const todoList = getTodoList()
|
|
28
|
+
const newTodoList = [...todoList, String(Math.floor(Math.random()*100))]
|
|
29
|
+
settings.settingsStorage.setItem('todoList', JSON.stringify(newTodoList))
|
|
30
|
+
|
|
31
|
+
ctx.response({
|
|
32
|
+
data: { result: newTodoList },
|
|
33
|
+
})
|
|
34
|
+
} else if (payload.method === 'DELETE') {
|
|
35
|
+
const { params: { index } = {} } = payload
|
|
36
|
+
const todoList = getTodoList()
|
|
37
|
+
const newTodoList = todoList.filter((_, i) => i !== index)
|
|
38
|
+
settings.settingsStorage.setItem('todoList', JSON.stringify(newTodoList))
|
|
39
|
+
|
|
40
|
+
ctx.response({
|
|
41
|
+
data: { result: newTodoList },
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
},
|
|
46
|
+
onRun() {},
|
|
47
|
+
onDestroy() {},
|
|
48
|
+
})
|
package/private-modules/zeppos-app-utils/dist/public/template/config-version-v3/v2/todo-list/app.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import './shared/device-polyfill'
|
|
2
|
+
import { MessageBuilder } from './shared/message'
|
|
3
|
+
import { getPackageInfo } from '@zos/app'
|
|
4
|
+
import { log as Logger } from '@zos/utils'
|
|
5
|
+
import * as ble from '@zos/ble'
|
|
6
|
+
|
|
7
|
+
const logger = Logger.getLogger('todo-list-app')
|
|
8
|
+
|
|
9
|
+
App({
|
|
10
|
+
globalData: {
|
|
11
|
+
messageBuilder: null,
|
|
12
|
+
},
|
|
13
|
+
onCreate() {
|
|
14
|
+
logger.log('app onCreate invoked')
|
|
15
|
+
const { appId } = getPackageInfo()
|
|
16
|
+
const messageBuilder = new MessageBuilder({ appId, appDevicePort: 20, appSidePort: 0, ble })
|
|
17
|
+
this.globalData.messageBuilder = messageBuilder
|
|
18
|
+
messageBuilder.connect()
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
onDestroy() {
|
|
22
|
+
logger.log('app onDestroy invoked')
|
|
23
|
+
this.globalData.messageBuilder && this.globalData.messageBuilder.disConnect()
|
|
24
|
+
},
|
|
25
|
+
})
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"configVersion": "v3",
|
|
3
|
+
"app": {
|
|
4
|
+
"appType": "app",
|
|
5
|
+
"version": {
|
|
6
|
+
"code": 1,
|
|
7
|
+
"name": "1.0.0"
|
|
8
|
+
},
|
|
9
|
+
"appId": 20001,
|
|
10
|
+
"appName": "Todo List",
|
|
11
|
+
"icon": "icon.png",
|
|
12
|
+
"vender": "zepp",
|
|
13
|
+
"description": "todo list application"
|
|
14
|
+
},
|
|
15
|
+
"runtime": {
|
|
16
|
+
"apiVersion": {
|
|
17
|
+
"compatible": "2.0.0",
|
|
18
|
+
"target": "2.0.0",
|
|
19
|
+
"minVersion": "2.0"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"targets": {
|
|
23
|
+
"gt": {
|
|
24
|
+
"module": {
|
|
25
|
+
"page": {
|
|
26
|
+
"pages": ["page/home/index.page"],
|
|
27
|
+
"window": {
|
|
28
|
+
"navigationBarBackgroundColor": "#ffffff",
|
|
29
|
+
"navigationBarTextStyle": "black",
|
|
30
|
+
"navigationBarTitleText": "",
|
|
31
|
+
"backgroundColor": "#eeeeee",
|
|
32
|
+
"backgroundTextStyle": "light"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"app-widget": {
|
|
36
|
+
"widgets": []
|
|
37
|
+
},
|
|
38
|
+
"watchface": {
|
|
39
|
+
"path": ""
|
|
40
|
+
},
|
|
41
|
+
"watch-widget": {
|
|
42
|
+
"widgets": []
|
|
43
|
+
},
|
|
44
|
+
"app-side": {
|
|
45
|
+
"path": "app-side/index"
|
|
46
|
+
},
|
|
47
|
+
"setting": {
|
|
48
|
+
"path": "setting/index"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"designWidth": 390,
|
|
52
|
+
"platforms": [
|
|
53
|
+
{
|
|
54
|
+
"st": "s"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"permissions": [
|
|
60
|
+
"data:os.device.info",
|
|
61
|
+
"device:os.local_storage"
|
|
62
|
+
],
|
|
63
|
+
"i18n": {
|
|
64
|
+
"en-US": {
|
|
65
|
+
"name": "Todo List"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"defaultLanguage": "en-US",
|
|
69
|
+
"debug": false
|
|
70
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import * as hmUI from '@zos/ui'
|
|
2
|
+
import { getDeviceInfo, SCREEN_SHAPE_SQUARE } from '@zos/device'
|
|
3
|
+
import { log as Logger } from '@zos/utils'
|
|
4
|
+
|
|
5
|
+
import { TITLE_TEXT_STYLE, TIPS_TEXT_STYLE, SCROLL_LIST, ADD_BUTTON } from './index.style'
|
|
6
|
+
import { readFileSync, writeFileSync } from './../../utils/fs'
|
|
7
|
+
import { getScrollListDataConfig } from './../../utils/index'
|
|
8
|
+
|
|
9
|
+
const logger = Logger.getLogger('todo-list-page')
|
|
10
|
+
const { messageBuilder } = getApp()._options.globalData
|
|
11
|
+
|
|
12
|
+
Page({
|
|
13
|
+
state: {
|
|
14
|
+
scrollList: null,
|
|
15
|
+
tipText: null,
|
|
16
|
+
refreshText: null,
|
|
17
|
+
addButton: null,
|
|
18
|
+
dataList: readFileSync()
|
|
19
|
+
},
|
|
20
|
+
onInit() {
|
|
21
|
+
logger.debug('page onInit invoked')
|
|
22
|
+
this.onMessage()
|
|
23
|
+
this.getTodoList()
|
|
24
|
+
},
|
|
25
|
+
build() {
|
|
26
|
+
logger.debug('page build invoked')
|
|
27
|
+
|
|
28
|
+
if (getDeviceInfo().screenShape !== SCREEN_SHAPE_SQUARE) {
|
|
29
|
+
this.state.title = hmUI.createWidget(hmUI.widget.TEXT, {
|
|
30
|
+
...TITLE_TEXT_STYLE
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
this.state.addButton = hmUI.createWidget(hmUI.widget.BUTTON, {
|
|
35
|
+
...ADD_BUTTON,
|
|
36
|
+
click_func: () => {
|
|
37
|
+
this.addRandomTodoItem()
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
this.createAndUpdateList()
|
|
42
|
+
},
|
|
43
|
+
onDestroy() {
|
|
44
|
+
logger.debug('page onDestroy invoked')
|
|
45
|
+
writeFileSync(this.state.dataList, false)
|
|
46
|
+
},
|
|
47
|
+
onMessage() {
|
|
48
|
+
messageBuilder.on('call', ({ payload: buf }) => {
|
|
49
|
+
const data = messageBuilder.buf2Json(buf)
|
|
50
|
+
const dataList = data.map((i) => ({ name: i }))
|
|
51
|
+
logger.log('call dataList', dataList)
|
|
52
|
+
this.refreshAndUpdate(dataList)
|
|
53
|
+
})
|
|
54
|
+
},
|
|
55
|
+
getTodoList() {
|
|
56
|
+
messageBuilder
|
|
57
|
+
.request({
|
|
58
|
+
method: 'GET_TODO_LIST'
|
|
59
|
+
})
|
|
60
|
+
.then(({ result }) => {
|
|
61
|
+
this.state.dataList = result.map((d) => ({ name: d }))
|
|
62
|
+
logger.log('GET_TODO_LIST dataList', this.state.dataList)
|
|
63
|
+
this.createAndUpdateList()
|
|
64
|
+
})
|
|
65
|
+
.catch((res) => {})
|
|
66
|
+
},
|
|
67
|
+
addRandomTodoItem() {
|
|
68
|
+
messageBuilder
|
|
69
|
+
.request({
|
|
70
|
+
method: 'ADD'
|
|
71
|
+
})
|
|
72
|
+
.then(({ result }) => {
|
|
73
|
+
this.state.dataList = result.map((d) => ({ name: d }))
|
|
74
|
+
this.createAndUpdateList()
|
|
75
|
+
})
|
|
76
|
+
.catch((res) => {})
|
|
77
|
+
},
|
|
78
|
+
deleteTodoItem(index) {
|
|
79
|
+
messageBuilder
|
|
80
|
+
.request({
|
|
81
|
+
method: 'DELETE',
|
|
82
|
+
params: { index }
|
|
83
|
+
})
|
|
84
|
+
.then(({ result }) => {
|
|
85
|
+
const dataList = result.map((d) => ({ name: d }))
|
|
86
|
+
|
|
87
|
+
this.refreshAndUpdate(dataList)
|
|
88
|
+
})
|
|
89
|
+
.catch((res) => {})
|
|
90
|
+
},
|
|
91
|
+
changeUI(showEmpty) {
|
|
92
|
+
const { dataList } = this.state
|
|
93
|
+
|
|
94
|
+
if (showEmpty) {
|
|
95
|
+
if (dataList.length === 0) {
|
|
96
|
+
!this.state.tipText &&
|
|
97
|
+
(this.state.tipText = hmUI.createWidget(hmUI.widget.TEXT, {
|
|
98
|
+
...TIPS_TEXT_STYLE
|
|
99
|
+
}))
|
|
100
|
+
}
|
|
101
|
+
const isTip = dataList.length === 0
|
|
102
|
+
|
|
103
|
+
this.state.refreshText && this.state.refreshText.setProperty(hmUI.prop.VISIBLE, false)
|
|
104
|
+
this.state.tipText && this.state.tipText.setProperty(hmUI.prop.VISIBLE, isTip)
|
|
105
|
+
this.state.scrollList && this.state.scrollList.setProperty(hmUI.prop.VISIBLE, !isTip)
|
|
106
|
+
} else {
|
|
107
|
+
// 占位刷新
|
|
108
|
+
!this.state.refreshText &&
|
|
109
|
+
(this.state.refreshText = hmUI.createWidget(hmUI.widget.TEXT, {
|
|
110
|
+
...TIPS_TEXT_STYLE,
|
|
111
|
+
text: ' '
|
|
112
|
+
}))
|
|
113
|
+
|
|
114
|
+
this.state.tipText && this.state.tipText.setProperty(hmUI.prop.VISIBLE, false)
|
|
115
|
+
this.state.refreshText.setProperty(hmUI.prop.VISIBLE, true)
|
|
116
|
+
this.state.scrollList && this.state.scrollList.setProperty(hmUI.prop.VISIBLE, false)
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
createAndUpdateList(showEmpty = true) {
|
|
120
|
+
const _scrollListItemClick = (list, index) => {
|
|
121
|
+
this.deleteTodoItem(index)
|
|
122
|
+
}
|
|
123
|
+
const { scrollList, dataList } = this.state
|
|
124
|
+
this.changeUI(showEmpty)
|
|
125
|
+
const dataTypeConfig = getScrollListDataConfig(dataList.length === 0 ? -1 : 0, dataList.length)
|
|
126
|
+
if (scrollList) {
|
|
127
|
+
scrollList.setProperty(hmUI.prop.UPDATE_DATA, {
|
|
128
|
+
data_array: dataList,
|
|
129
|
+
data_count: dataList.length,
|
|
130
|
+
data_type_config: [{ start: 0, end: dataList.length, type_id: 2 }],
|
|
131
|
+
data_type_config_count: dataTypeConfig.length,
|
|
132
|
+
on_page: 1
|
|
133
|
+
})
|
|
134
|
+
} else {
|
|
135
|
+
this.state.scrollList = hmUI.createWidget(hmUI.widget.SCROLL_LIST, {
|
|
136
|
+
...(SCROLL_LIST || {}),
|
|
137
|
+
data_array: dataList,
|
|
138
|
+
data_count: dataList.length,
|
|
139
|
+
data_type_config: dataTypeConfig,
|
|
140
|
+
data_type_config_count: dataTypeConfig.length,
|
|
141
|
+
on_page: 1,
|
|
142
|
+
item_click_func: _scrollListItemClick
|
|
143
|
+
})
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
refreshAndUpdate(dataList = []) {
|
|
147
|
+
this.state.dataList = []
|
|
148
|
+
this.createAndUpdateList(false)
|
|
149
|
+
|
|
150
|
+
setTimeout(() => {
|
|
151
|
+
this.state.dataList = dataList
|
|
152
|
+
this.createAndUpdateList()
|
|
153
|
+
}, 20)
|
|
154
|
+
}
|
|
155
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as hmUI from '@zos/ui'
|
|
2
|
+
import { getText } from '@zos/i18n'
|
|
3
|
+
import { getDeviceInfo } from '@zos/device'
|
|
4
|
+
import { px } from '@zos/utils'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export const { width: DEVICE_WIDTH, height: DEVICE_HEIGHT } = getDeviceInfo()
|
|
8
|
+
|
|
9
|
+
export const TITLE_TEXT_STYLE = {
|
|
10
|
+
text: getText('todoList'),
|
|
11
|
+
x: px(42),
|
|
12
|
+
y: px(65),
|
|
13
|
+
w: DEVICE_WIDTH - px(42 * 2),
|
|
14
|
+
h: px(50),
|
|
15
|
+
color: 0xffffff,
|
|
16
|
+
text_size: 36,
|
|
17
|
+
align_h: hmUI.align.CENTER_H,
|
|
18
|
+
text_style: hmUI.text_style.WRAP,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const ADD_BUTTON = {
|
|
22
|
+
text: getText('add'),
|
|
23
|
+
x: px(30),
|
|
24
|
+
y: px(65),
|
|
25
|
+
w: px(120),
|
|
26
|
+
h: px(50),
|
|
27
|
+
normal_color: 0xfc6950,
|
|
28
|
+
press_color: 0xfeb4a8,
|
|
29
|
+
radius: px(12)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const TIPS_TEXT_STYLE = {
|
|
33
|
+
text: getText('noData'),
|
|
34
|
+
x: px(15),
|
|
35
|
+
y: px(120),
|
|
36
|
+
w: DEVICE_WIDTH - px(15 * 2),
|
|
37
|
+
h: DEVICE_HEIGHT - px(120),
|
|
38
|
+
color: 0xffffff,
|
|
39
|
+
text_size: 32,
|
|
40
|
+
align_h: hmUI.align.CENTER_H,
|
|
41
|
+
align_v: hmUI.align.CENTER_V,
|
|
42
|
+
text_style: hmUI.text_style.WRAP,
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const SCROLL_LIST = {
|
|
46
|
+
item_height: px(80),
|
|
47
|
+
item_space: px(6),
|
|
48
|
+
item_config: [
|
|
49
|
+
{
|
|
50
|
+
type_id: 1,
|
|
51
|
+
item_bg_color: 0x333333,
|
|
52
|
+
item_bg_radius: px(10),
|
|
53
|
+
text_view: [
|
|
54
|
+
{
|
|
55
|
+
x: px(80),
|
|
56
|
+
y: px(0),
|
|
57
|
+
w: px(360),
|
|
58
|
+
h: px(80),
|
|
59
|
+
key: 'name',
|
|
60
|
+
color: 0xffff00,
|
|
61
|
+
text_size: px(36),
|
|
62
|
+
align_h: hmUI.align.LEFT,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
text_view_count: 1,
|
|
66
|
+
item_height: px(80),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type_id: 2,
|
|
70
|
+
item_bg_color: 0x333333,
|
|
71
|
+
item_bg_radius: px(10),
|
|
72
|
+
text_view: [
|
|
73
|
+
{
|
|
74
|
+
x: px(80),
|
|
75
|
+
y: px(0),
|
|
76
|
+
w: px(360),
|
|
77
|
+
h: px(80),
|
|
78
|
+
key: 'name',
|
|
79
|
+
color: 0xff0000,
|
|
80
|
+
text_size: px(36),
|
|
81
|
+
align_h: hmUI.align.LEFT,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
text_view_count: 1,
|
|
85
|
+
item_height: px(80),
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
item_config_count: 2,
|
|
89
|
+
x: px(30),
|
|
90
|
+
y: px(120),
|
|
91
|
+
h: DEVICE_HEIGHT - px(180),
|
|
92
|
+
w: DEVICE_WIDTH - px(30) * 2,
|
|
93
|
+
}
|