@zeppos/zeus-cli 1.1.9 → 1.2.0
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 +2 -0
- package/modules/bridge.js +7 -8
- package/modules/build.js +21 -2
- package/modules/create.js +89 -38
- package/package.json +2 -2
- package/private-modules/zeppos-app-utils/dist/config/device.js +114 -14
- package/private-modules/zeppos-app-utils/dist/modules/build.js +30 -11
- package/private-modules/zeppos-app-utils/dist/modules/config.js +0 -1
- package/private-modules/zeppos-app-utils/dist/modules/create/index.js +74 -36
- package/private-modules/zeppos-app-utils/dist/modules/create/local-app.js +4 -4
- package/private-modules/zeppos-app-utils/dist/modules/login.js +1 -5
- package/private-modules/zeppos-app-utils/dist/modules/status.js +0 -1
- package/private-modules/zeppos-app-utils/dist/public/template/{_package.json → v1/_package.json} +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/app-side/i18n/en-US.po +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/app-side/index.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/app.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/app.json +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/assets/default/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/page/i18n/en-US.po +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/page/index.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/setting/i18n/en-US.po +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/setting/index.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{empty → v1/empty}/watchface/index.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/app-side/index.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/app.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/app.json +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/assets/gtr3/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/assets/gtr3/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/assets/gtr3-pro/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/assets/gtr3-pro/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/assets/gts3/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/assets/gts3/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gtr3/home/index.page.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gtr3/home/index.page.json +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gtr3/home/index.style.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gtr3-pro/home/index.page.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gtr3-pro/home/index.page.json +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gtr3-pro/home/index.style.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gts3/home/index.page.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gts3/home/index.page.json +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/gts3/home/index.style.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/page/i18n/en-US.po +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/setting/i18n/en-US.po +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/setting/index.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{hello-world → v1/hello-world}/utils/index.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{jsconfig.json → v1/jsconfig.json} +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/app.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/app.json +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bg/bg.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/0.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/1.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/2.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/3.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/4.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/5.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/6.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/7.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/8.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/9.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/bigNum/sp.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/btn/back.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/btn/lv.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/btn/red.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/bg.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/bottom.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/center.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/h.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/left.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/m.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/right.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/point/s.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/preview.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/second/second.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/0.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/1.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/2.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/3.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/4.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/5.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/6.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/7.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/8.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/9.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/d.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/smallNum/n.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/1.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/2.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/3.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/4.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/5.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/6.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_ch/7.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/1.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/2.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/3.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/4.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/5.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/6.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/assets/gtr-3-pro/images/week_en/7.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/shared/buffer.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/shared/device-polyfill.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/shared/global.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/shared/js-module.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/shared/logger.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/shared/setTimeout.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/watchface/gtr-3-pro/index.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/{timer → v1/timer}/watchface/round/index.js +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/_package.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/app.js +28 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/app.json +56 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/consume.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/beer.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/cake.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/chocolate.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/coffee.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/cookies.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/ham.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/hamburger.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/ice cream.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/pizza.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/food/sausage.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/multiply.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/selected.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/assets/gts/unselected.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/gts/food-list.js +113 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/gts/index.js +126 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/i18n/en-US.po +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/page/i18n/zh-CN.po +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/constants.js +54 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/storage.js +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/styles-gts-3.js +141 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/calories/utils/styles.js +142 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app-side/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app-side/index.js +13 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app.js +10 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/app.json +60 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/assets/default/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/page/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/page/index.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/setting/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/setting/index.js +7 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/watchface/index.js +13 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app-side/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app-side/index.js +57 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app.js +23 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/app.json +65 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/assets/common/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/pages/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/pages/index.js +55 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/data.js +67 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/defer.js +35 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/device-polyfill.js +6 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/es6-promise.js +1149 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/event.js +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/message-side.js +1145 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/shared/message.js +1151 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/utils/config/constants.js +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/utils/config/device.js +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/app-side/index.js +11 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/app.js +10 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/app.json +101 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gtr/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gtr/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gts/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/assets/gts/image/logo.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gtr/home/index.page.js +20 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gtr/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gtr/home/index.style.js +18 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gts/home/index.page.js +21 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gts/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/gts/home/index.style.js +17 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/page/i18n/en-US.po +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/setting/i18n/en-US.po +2 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/setting/index.js +5 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/hello-world/utils/index.js +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/jsconfig.json +14 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/.prettierrc.js +6 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/app-side/index.js +48 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/app.js +25 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/app.json +75 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/assets/gts/icon.png +0 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/home/index.page.js +155 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/home/index.page.json +1 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/home/index.style.js +93 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/page/i18n/en-US.po +8 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/setting/i18n/en-US.po +5 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/setting/index.js +145 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/data.js +67 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/defer.js +35 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/device-polyfill.js +6 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/es6-promise.js +1149 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/event.js +42 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/message-side.js +1145 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/shared/message.js +1151 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/utils/constants.js +3 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/utils/fs.js +38 -0
- package/private-modules/zeppos-app-utils/dist/public/template/v2/todo-list/utils/index.js +38 -0
- package/private-modules/zeppos-app-utils/dist/tools/index.js +0 -2
- package/private-modules/zeppos-app-utils/package.json +2 -2
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"configVersion": "v2",
|
|
3
|
+
"app": {
|
|
4
|
+
"appId": 20000,
|
|
5
|
+
"appName": "Empty",
|
|
6
|
+
"appType": "app",
|
|
7
|
+
"version": {
|
|
8
|
+
"code": 1,
|
|
9
|
+
"name": "1.0.0"
|
|
10
|
+
},
|
|
11
|
+
"icon": "icon.png",
|
|
12
|
+
"vender": "zepp",
|
|
13
|
+
"description": "empty application"
|
|
14
|
+
},
|
|
15
|
+
"permissions": [
|
|
16
|
+
"data:os.device.info",
|
|
17
|
+
"device:os.local_storage",
|
|
18
|
+
"data:user.hd.calorie"
|
|
19
|
+
],
|
|
20
|
+
"runtime": {
|
|
21
|
+
"apiVersion": {
|
|
22
|
+
"compatible": "2.0.0",
|
|
23
|
+
"target": "2.0.0",
|
|
24
|
+
"minVersion": "2.0.0"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"targets": {
|
|
28
|
+
"default": {
|
|
29
|
+
"module": {
|
|
30
|
+
"page": {
|
|
31
|
+
"pages": [
|
|
32
|
+
"page/index"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"app-side": {
|
|
36
|
+
"path": "app-side/index"
|
|
37
|
+
},
|
|
38
|
+
"setting": {
|
|
39
|
+
"path": "setting/index"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"platforms": [{
|
|
43
|
+
"name": "gtr3-pro",
|
|
44
|
+
"deviceSource": 229
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "gtr3-pro-w",
|
|
48
|
+
"deviceSource": 230
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"designWidth": 480
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"i18n": {
|
|
55
|
+
"en-US": {
|
|
56
|
+
"appName": "Empty"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"defaultLanguage": "en-US"
|
|
60
|
+
}
|
package/private-modules/zeppos-app-utils/dist/public/template/v2/empty/assets/default/icon.png
ADDED
|
Binary file
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { MessageBuilder } from '../shared/message-side'
|
|
2
|
+
|
|
3
|
+
const messageBuilder = new MessageBuilder()
|
|
4
|
+
|
|
5
|
+
// Simulating an asynchronous network request using Promise
|
|
6
|
+
const mockAPI = async () => {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
setTimeout(() => {
|
|
9
|
+
resolve({
|
|
10
|
+
body: {
|
|
11
|
+
data: {
|
|
12
|
+
text: 'HELLO ZEPPOS'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
}, 1000)
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const fetchData = async (ctx) => {
|
|
21
|
+
try {
|
|
22
|
+
// Requesting network data using the fetch API
|
|
23
|
+
// The sample program is for simulation only and does not request real network data, so it is commented here
|
|
24
|
+
// const { body: { data = {} } = {} } = await fetch('https://xxx.com/api/xxx')
|
|
25
|
+
|
|
26
|
+
// A network request is simulated here
|
|
27
|
+
const { body: { data = {} } = {} } = await mockAPI()
|
|
28
|
+
|
|
29
|
+
ctx.response({
|
|
30
|
+
data: { result: data },
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
} catch (error) {
|
|
34
|
+
ctx.response({
|
|
35
|
+
data: { result: 'ERROR' },
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
AppSideService({
|
|
41
|
+
onInit() {
|
|
42
|
+
messageBuilder.listen(() => {})
|
|
43
|
+
|
|
44
|
+
messageBuilder.on('request', (ctx) => {
|
|
45
|
+
const jsonRpc = messageBuilder.buf2Json(ctx.request.payload)
|
|
46
|
+
if (jsonRpc.method === 'GET_DATA') {
|
|
47
|
+
return fetchData(ctx)
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
onRun() {
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
onDestroy() {
|
|
56
|
+
}
|
|
57
|
+
})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import './shared/device-polyfill'
|
|
2
|
+
import { MessageBuilder } from './shared/message'
|
|
3
|
+
import { getPackageInfo } from '@zos/app'
|
|
4
|
+
import * as ble from '@zos/ble'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
App({
|
|
8
|
+
globalData: {
|
|
9
|
+
messageBuilder: null,
|
|
10
|
+
},
|
|
11
|
+
onCreate(options) {
|
|
12
|
+
console.log('app on create invoke')
|
|
13
|
+
const { appId } = getPackageInfo()
|
|
14
|
+
const messageBuilder = new MessageBuilder({ appId, appDevicePort: 20, appSidePort: 0, ble })
|
|
15
|
+
this.globalData.messageBuilder = messageBuilder
|
|
16
|
+
messageBuilder.connect()
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
onDestroy(options) {
|
|
20
|
+
console.log('app on destroy invoke')
|
|
21
|
+
this.globalData.messageBuilder && this.globalData.messageBuilder.disConnect()
|
|
22
|
+
}
|
|
23
|
+
})
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"configVersion": "v2",
|
|
3
|
+
"app": {
|
|
4
|
+
"appId": 20001,
|
|
5
|
+
"appName": "Fetch API",
|
|
6
|
+
"appType": "app",
|
|
7
|
+
"version": {
|
|
8
|
+
"code": 1,
|
|
9
|
+
"name": "1.0.1"
|
|
10
|
+
},
|
|
11
|
+
"icon": "icon.png",
|
|
12
|
+
"vender": "zepp",
|
|
13
|
+
"description": "A sample application to demonstrate the fetch API"
|
|
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.0"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"targets": {
|
|
27
|
+
"common": {
|
|
28
|
+
"module": {
|
|
29
|
+
"page": {
|
|
30
|
+
"pages": [
|
|
31
|
+
"pages/index"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"app-side": {
|
|
35
|
+
"path": "app-side/index"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"platforms": [
|
|
39
|
+
{
|
|
40
|
+
"name": "gtr4",
|
|
41
|
+
"deviceSource": 7930112
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "gtr4-w",
|
|
45
|
+
"deviceSource": 7930113
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "gts4",
|
|
49
|
+
"deviceSource": 7995648
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "gts4-w",
|
|
53
|
+
"deviceSource": 7995649
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"designWidth": 480
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"i18n": {
|
|
60
|
+
"en-US": {
|
|
61
|
+
"appName": "Fetch API"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"defaultLanguage": "en-US"
|
|
65
|
+
}
|
package/private-modules/zeppos-app-utils/dist/public/template/v2/fetch-api/assets/common/icon.png
ADDED
|
Binary file
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as hmUI from '@zos/ui'
|
|
2
|
+
import { log as Logger, px } from '@zos/utils'
|
|
3
|
+
import {
|
|
4
|
+
DEFAULT_COLOR,
|
|
5
|
+
DEFAULT_COLOR_TRANSPARENT,
|
|
6
|
+
} from "../utils/config/constants"
|
|
7
|
+
import { DEVICE_WIDTH } from "../utils/config/device"
|
|
8
|
+
|
|
9
|
+
const logger = Logger.getLogger("fetch_api")
|
|
10
|
+
const { messageBuilder } = getApp()._options.globalData
|
|
11
|
+
|
|
12
|
+
Page({
|
|
13
|
+
state: {},
|
|
14
|
+
build() {
|
|
15
|
+
hmUI.createWidget(hmUI.widget.BUTTON, {
|
|
16
|
+
x: (DEVICE_WIDTH - px(400)) / 2,
|
|
17
|
+
y: px(260),
|
|
18
|
+
w: px(400),
|
|
19
|
+
h: px(100),
|
|
20
|
+
text_size: px(36),
|
|
21
|
+
radius: px(12),
|
|
22
|
+
normal_color: DEFAULT_COLOR,
|
|
23
|
+
press_color: DEFAULT_COLOR_TRANSPARENT,
|
|
24
|
+
text: "Fetch Data",
|
|
25
|
+
click_func: (button_widget) => {
|
|
26
|
+
logger.log("click button")
|
|
27
|
+
this.fetchData()
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
},
|
|
31
|
+
fetchData() {
|
|
32
|
+
messageBuilder.request({
|
|
33
|
+
method: "GET_DATA",
|
|
34
|
+
})
|
|
35
|
+
.then(data => {
|
|
36
|
+
logger.log('receive data')
|
|
37
|
+
const { result = {} } = data
|
|
38
|
+
const { text } = result
|
|
39
|
+
|
|
40
|
+
hmUI.createWidget(hmUI.widget.TEXT, {
|
|
41
|
+
x: px(96),
|
|
42
|
+
y: px(100),
|
|
43
|
+
w: px(288),
|
|
44
|
+
h: px(46),
|
|
45
|
+
color: 0xffffff,
|
|
46
|
+
text_size: px(36),
|
|
47
|
+
align_h: hmUI.align.CENTER_H,
|
|
48
|
+
align_v: hmUI.align.CENTER_V,
|
|
49
|
+
text_style: hmUI.text_style.NONE,
|
|
50
|
+
text
|
|
51
|
+
})
|
|
52
|
+
}).catch(res => {
|
|
53
|
+
})
|
|
54
|
+
},
|
|
55
|
+
})
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export function json2buf(json) {
|
|
2
|
+
return str2buf(json2str(json))
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function json2bin(json) {
|
|
6
|
+
return str2bin(json2str(json))
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function len(binOrBuf) {
|
|
10
|
+
return binOrBuf.byteLength
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function buf2json(buf) {
|
|
14
|
+
return str2json(buf2str(buf))
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function str2json(str) {
|
|
18
|
+
return JSON.parse(str)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function json2str(json) {
|
|
22
|
+
return JSON.stringify(json)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function str2buf(str) {
|
|
26
|
+
return Buffer.from(str, 'utf-8')
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function buf2str(buf) {
|
|
30
|
+
return buf.toString('utf-8')
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function bin2buf(bin) {
|
|
34
|
+
return Buffer.from(bin)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function buf2bin(buf) {
|
|
38
|
+
return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function buf2hex(buf) {
|
|
42
|
+
return buf.toString('hex')
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function bin2hex(bin) {
|
|
46
|
+
return buf2hex(bin2buf(bin))
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function bin2json(bin) {
|
|
50
|
+
return buf2json(bin2buf(bin))
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function bin2str(bin) {
|
|
54
|
+
return buf2str(bin2buf(bin))
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function str2bin(str) {
|
|
58
|
+
return buf2bin(str2buf(str))
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function allocOfBin(size = 0) {
|
|
62
|
+
return Buffer.alloc(size).buffer
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function allocOfBuf(size = 0) {
|
|
66
|
+
return Buffer.alloc(size)
|
|
67
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export function Deferred() {
|
|
2
|
+
const defer = {}
|
|
3
|
+
|
|
4
|
+
defer.promise = new Promise(function (resolve, reject) {
|
|
5
|
+
defer.resolve = resolve
|
|
6
|
+
defer.reject = reject
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
return defer
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function delay(ms) {
|
|
13
|
+
const defer = Deferred()
|
|
14
|
+
|
|
15
|
+
setTimeout(defer.resolve, ms)
|
|
16
|
+
|
|
17
|
+
return defer.promise
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function timeout(ms, cb) {
|
|
21
|
+
const defer = Deferred()
|
|
22
|
+
ms = ms || 1000
|
|
23
|
+
|
|
24
|
+
const wait = setTimeout(() => {
|
|
25
|
+
clearTimeout(wait)
|
|
26
|
+
|
|
27
|
+
if (cb) {
|
|
28
|
+
cb && cb(defer.resolve, defer.reject)
|
|
29
|
+
} else {
|
|
30
|
+
defer.reject('Timed out in ' + ms + 'ms.')
|
|
31
|
+
}
|
|
32
|
+
}, ms)
|
|
33
|
+
|
|
34
|
+
return defer.promise
|
|
35
|
+
}
|