diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/.gitignore b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..dc4e6353bf3caf74c5953d0bec81c72a3635bf33 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/.gitignore @@ -0,0 +1,9 @@ +/node_modules +/local.properties +/.idea +**/build +/.hvigor +.cxx +/.clangd +/.clang-format +/.clang-tidy \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/README.md b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/README.md new file mode 100644 index 0000000000000000000000000000000000000000..311621c95fa233841208a73ce9284ba651c7a253 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/README.md @@ -0,0 +1,25 @@ +# HealthDietAPi8——健康饮食APP + +**该项目是基于学习华为官网HealthDiet项目,使用ArkTS语言开发的、使用ArkUI开发框架改进开发的健康饮食APP项目** + +#### 项目介绍 +- 项目名称:健康饮食 +- 编程语言:ArkTS +- 功能:可以查看App中已有食物的热量,并根据自己每顿的饮食记录每天摄入的热量。APP会将此记录下来,方便查看分析饮食健康状况。健康饮食APP还提供“用餐时间”的功能,方便用户清楚的看到自己每餐所花费的时间,从而督促自己养成细嚼慢咽的好习惯。 +- 开发版本:sdk api8、ArkTS语言、DevEco Studio 3.1.0.100 HarmonyOS +- 作者:万冬阳 +- 联系邮箱:2665070510@qq.com +- 联系电话:1807406680 + +#### 项目演示效果: +##### Previewer中的演示效果 +- ![](Resource/previewer演示.gif) + +##### 华为matepad11平板真机测试的演示效果 +![](Resource/华为matepad11平板真机测试.gif) + +#### 说明 +- 该项目在不同的对手机和平板两种设备的UI做了不同的处理。如上方的gif演示图中所示,在平板中的翻页时钟的大小和手机(previewer)中的大小是不同的,平板中的翻页时钟设计的更大,以使得在平板中的观看效果更好。而且对翻页时钟启动时的图片也针对不同设备做了适配,并且加入了一些动画。 + + +- 因为本人的真机平板最高只支持Api8,因此开发时就选择了HarmonyOS Api8的版本进行开发。 diff --git "a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/Resource/previewer\346\274\224\347\244\272.gif" "b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/Resource/previewer\346\274\224\347\244\272.gif" new file mode 100644 index 0000000000000000000000000000000000000000..3ef55826c3d8e2d9550cd10c892999c6a336c1e7 Binary files /dev/null and "b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/Resource/previewer\346\274\224\347\244\272.gif" differ diff --git "a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/Resource/\345\215\216\344\270\272matepad11\345\271\263\346\235\277\347\234\237\346\234\272\346\265\213\350\257\225.gif" "b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/Resource/\345\215\216\344\270\272matepad11\345\271\263\346\235\277\347\234\237\346\234\272\346\265\213\350\257\225.gif" new file mode 100644 index 0000000000000000000000000000000000000000..5e35eaaecd47db27318d77140629e4eb2e000a75 Binary files /dev/null and "b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/Resource/\345\215\216\344\270\272matepad11\345\271\263\346\235\277\347\234\237\346\234\272\346\265\213\350\257\225.gif" differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/build-profile.json5 b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..e0a83d3028b081af139d582e07edff64b292fa9f --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/build-profile.json5 @@ -0,0 +1,41 @@ +{ + "app": { + "signingConfigs": [ + { + "name": "default", + "type": "HarmonyOS", + "material": { + "certpath": "C:\\Users\\万冬阳\\.ohos\\config\\auto_debug_HealthDietApi8_com.example.healthdietapi8_60773393.cer", + "storePassword": "0000001B9BE32857A6B0673126D8E2306550AB176AE9F4479D213C40A5A0A1EC3280CD2441973FFF48C894", + "keyAlias": "debugKey", + "keyPassword": "0000001B62022B432CE05EFBA699FAFF67BBAA048DFB21717351C7CDF2723278AB6CC281AAF9C836816261", + "profile": "C:\\Users\\万冬阳\\.ohos\\config\\auto_debug_HealthDietApi8_com.example.healthdietapi8_60773393.p7b", + "signAlg": "SHA256withECDSA", + "storeFile": "C:\\Users\\万冬阳\\.ohos\\config\\auto_debug_HealthDietApi8_com.example.healthdietapi8_60773393.p12" + } + } + ], + "compileSdkVersion": 8, + "compatibleSdkVersion": 8, + "products": [ + { + "name": "default", + "signingConfig": "default", + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/.gitignore b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5a6ba80fa3d9498a23ae8ae7d9518f8743fa8a96 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/.gitignore @@ -0,0 +1,4 @@ +/node_modules +/.preview +/build +/.cxx \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/build-profile.json5 b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..cfdc90f805d1f7ef3a6557bc101de47b91895eb7 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/build-profile.json5 @@ -0,0 +1,14 @@ +{ + "apiType": 'faMode', + "buildOption": { + }, + "targets": [ + { + "name": "default", + "runtimeOS": "HarmonyOS" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/hvigorfile.ts b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c4c187d26c30546ed81a44e1979d6ec2be6e52c2 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { legacyHapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/package-lock.json b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..15bc7145be1490029883067847743ea7134cf545 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "entry", + "version": "1.0.0", + "lockfileVersion": 1 +} diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/package.json b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c7685ac4e7c0d79df04c96744f0d8f22cb4a9025 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/package.json @@ -0,0 +1,14 @@ +{ + "license": "ISC", + "devDependencies": {}, + "name": "entry", + "ohos": { + "org": "huawei", + "directoryLevel": "module", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.0", + "dependencies": {} +} diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/config.json b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..d66b3f4447b37bb1a72d669890d9acee6f53d403 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/config.json @@ -0,0 +1,78 @@ +{ + "app": { + "bundleName": "com.example.healthdietapi8", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.healthdietapi8", + "name": ".entry", + "mainAbility": ".MainAbility", + "deviceType": [ + "phone", + "tablet" + ], + "metaData":{ + "customizeData":[ + { + "name": "hwc-theme", + "extra": "", + "value": "androidhwext:style/Theme.Emui.Light.NoTitleBar" + } + ] + }, + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "formsEnabled": false, + "name": ".MainAbility", + "srcLanguage": "ets", + "srcPath": "MainAbility", + "icon": "$media:logo", + "description": "$string:MainAbility_desc", + "label": "$string:MainAbility_label", + "type": "page", + "visible": true, + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/Logo", + "pages/Home", + "pages/FoodDetail" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/app.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 0000000000000000000000000000000000000000..38b43199a5e4b4e38c7cabf02fe51ca61dd12700 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,12 @@ +import hilog from '@ohos.hilog'; + +export default { + onCreate() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Application onCreate'); + }, + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Application onDestroy'); + }, +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/common/BreakpointSystem.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/common/BreakpointSystem.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d61364398c287a7b51293fbfa2c8ed06b16f427 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/common/BreakpointSystem.ets @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import mediaQuery from '@ohos.mediaquery' + +declare interface BreakPointTypeOption { + xs?: T + sm?: T + md?: T + lg?: T + xl?: T + xxl?: T +} + +export class BreakPointType { + options: BreakPointTypeOption + + constructor(option: BreakPointTypeOption) { + this.options = option + } + + getValue(currentBreakPoint: string) { + if (currentBreakPoint === 'xs') { + return this.options.xs + } else if (currentBreakPoint === 'sm') { + return this.options.sm + } else if (currentBreakPoint === 'md') { + return this.options.md + } else if (currentBreakPoint === 'lg') { + return this.options.lg + } else if (currentBreakPoint === 'xl') { + return this.options.xl + } else if (currentBreakPoint === 'xxl') { + return this.options.xxl + } else { + return undefined + } + } +} + +type Breakpoint = { + name: string + size: number + mediaQueryListener?: mediaQuery.MediaQueryListener +} + +export class BreakpointSystem { + private currentBreakpoint: string = 'md' + private breakpoints: Breakpoint[] = [{ name: 'xs', size: 0 }, { name: 'sm', size: 320 }, + { name: 'md', size: 520 }, { name: 'lg', size: 840 }] + + private updateCurrentBreakpoint(breakpoint: string) { + if (this.currentBreakpoint !== breakpoint) { + this.currentBreakpoint = breakpoint + AppStorage.Set('currentBreakpoint', this.currentBreakpoint) + console.log('on current breakpoint: ' + this.currentBreakpoint) + } + } + + public register() { + this.breakpoints.forEach((breakpoint: Breakpoint, index) => { + let condition + if (index === this.breakpoints.length - 1) { + condition = "(" + breakpoint.size + "vp<=width" + ")" + } else { + condition = "(" + breakpoint.size + "vp<=width<" + this.breakpoints[index + 1].size + "vp)" + } + console.log(condition) + breakpoint.mediaQueryListener = mediaQuery.matchMediaSync(condition) + breakpoint.mediaQueryListener.on('change', (mediaQueryResult) => { + if (mediaQueryResult.matches) { + this.updateCurrentBreakpoint(breakpoint.name) + } + }) + }) + } + + public unregister() { + this.breakpoints.forEach((breakpoint: Breakpoint) => { + breakpoint.mediaQueryListener.off('change') + }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/common/Constants.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/common/Constants.ets new file mode 100644 index 0000000000000000000000000000000000000000..9fc0dfbcca83fdd177063c322eb0559b5b41a15e --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/common/Constants.ets @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export let CIRCLE_RADIUS: number = 80 \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/common/images/logo.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/common/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..826c9813215ecaef36f1900b9ad37c93598181c2 Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/common/images/logo.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/entryability/EntryAbility.ts b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..a548a4a610b5dd2da5ff1fa5173e9d21ccb88d97 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/entryability/EntryAbility.ts @@ -0,0 +1,51 @@ +import hilog from '@ohos.hilog'; +import Ability from '@ohos.application.Ability' +import Window from '@ohos.window' + +export default class EntryAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + } + + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + // Main window is created, set main page for this ability + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err, data) => { + if (err.code) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.ERROR); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/mock/MockData.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/mock/MockData.ets new file mode 100644 index 0000000000000000000000000000000000000000..15fe5bc29d5a8a1f934291d67cdb1bc624feaed5 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/mock/MockData.ets @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FoodInfo, CategoryId, MealTimeId, DietRecord } from '../model/DataModels' + +export let mockFoods: Array = [ + { + id: 0, + letter: 'Tomato', + name: $r('app.string.food_name_tomato'), + image: $r('app.media.tomato'), + categoryId: CategoryId.Vegetable, + calories: 15, + protein: 0.9, + fat: 0.2, + carbohydrates: 3.3, + vitaminC: 14.0 + }, + { + id: 1, + letter: 'Walnut', + name: $r('app.string.food_name_walnut'), + image: $r('app.media.walnut'), + categoryId: CategoryId.Nut, + calories: 646, + protein: 14.9, + fat: 58.8, + carbohydrates: 19.1, + vitaminC: 1.0 + }, + { + id: 2, + letter: 'Cucumber', + name: $r('app.string.food_name_cucumber'), + image: $r('app.media.cucumber'), + categoryId: CategoryId.Vegetable, + calories: 16, + protein: 0.8, + fat: 0.2, + carbohydrates: 2.9, + vitaminC: 9.0 + }, + { + id: 3, + letter: 'Blueberry', + name: $r('app.string.food_name_blueberry'), + image: $r('app.media.blueberry'), + categoryId: CategoryId.Fruit, + calories: 57, + protein: 0.7, + fat: 0.3, + carbohydrates: 14.5, + vitaminC: 9.7 + }, + { + id: 4, + letter: 'Crab', + name: $r('app.string.food_name_crab'), + image: $r('app.media.crab'), + categoryId: CategoryId.Seafood, + calories: 97, + protein: 19, + fat: 1.5, + carbohydrates: 0, + vitaminC: 7.6 + }, + { + id: 5, + letter: 'IceCream', + name: $r('app.string.food_name_ice_cream'), + image: $r('app.media.icecream'), + categoryId: CategoryId.Dessert, + calories: 150, + protein: 3.5, + fat: 11, + carbohydrates: 24, + vitaminC: 0.6 + }, + { + id: 6, + letter: 'Onion', + name: $r('app.string.food_name_onion'), + image: $r('app.media.onion'), + categoryId: CategoryId.Vegetable, + calories: 40, + protein: 1.1, + fat: 0.2, + carbohydrates: 9, + vitaminC: 8.0 + }, + { + id: 7, + letter: 'Mushroom', + name: $r('app.string.food_name_mushroom'), + image: $r('app.media.mushroom'), + categoryId: CategoryId.Vegetable, + calories: 20, + protein: 3.1, + fat: 0.3, + carbohydrates: 3.3, + vitaminC: 206 + }, + { + id: 8, + letter: 'Kiwi', + name: $r('app.string.food_name_kiwi'), + image: $r('app.media.kiwi'), + categoryId: CategoryId.Fruit, + calories: 61, + protein: 0.8, + fat: 0.6, + carbohydrates: 14.5, + vitaminC: 62 + }, + { + id: 9, + letter: 'Pitaya', + name: $r('app.string.food_name_pitaya'), + image: $r('app.media.pitaya'), + categoryId: CategoryId.Fruit, + calories: 55, + protein: 1.1, + fat: 0.2, + carbohydrates: 13.3, + vitaminC: 3.0 + }, + { + id: 10, + letter: 'Avocado', + name: $r('app.string.food_name_avocado'), + image: $r('app.media.avocado'), + categoryId: CategoryId.Fruit, + calories: 171, + protein: 2.0, + fat: 15.3, + carbohydrates: 7.4, + vitaminC: 8.0 + }, + { + id: 11, + letter: 'Strawberry', + name: $r('app.string.food_name_strawberry'), + image: $r('app.media.strawberry'), + categoryId: CategoryId.Fruit, + calories: 32, + protein: 1.0, + fat: 0.2, + carbohydrates: 7.1, + vitaminC: 47.0 + } +] + +export let mockFoodInfo: FoodInfo = { + id: 0, + letter: 'Tomato', + name: $r('app.string.food_name_tomato'), + image: $r('app.media.tomato'), + categoryId: CategoryId.Vegetable, + calories: 15, + protein: 0.9, + fat: 0.2, + carbohydrates: 3.3, + vitaminC: 14.0 +} + +export let mockDietRecords: Array = [ + { + id: 1, + foodId: 2, + mealTime: { name: $r('app.string.meal_time_dinner'), id: MealTimeId.Dinner }, + weight: 200 + }, + { + id: 2, + foodId: 8, + mealTime: { name: $r('app.string.meal_time_dinner'), id: MealTimeId.Dinner }, + weight: 200 + }, + { + id: 3, + foodId: 6, + mealTime: { name: $r('app.string.meal_time_lunch'), id: MealTimeId.Lunch }, + weight: 200 + }, + { + id: 4, + foodId: 3, + mealTime: { name: $r('app.string.meal_time_dinner'), id: MealTimeId.Dinner }, + weight: 200 + } +] \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/model/DataModels.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/model/DataModels.ets new file mode 100644 index 0000000000000000000000000000000000000000..8675d720116c0b7905e13083b8450e1bc794efe3 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/model/DataModels.ets @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export enum CategoryId { + Fruit = 0, + Vegetable, + Nut, + Seafood, + Dessert +} + +export type Category = { + name: Resource + id: CategoryId +} + +export type FoodInfo = { + id: number + letter: string + name: string | Resource + image: Resource + categoryId: CategoryId + calories: number + protein: number + fat: number + carbohydrates: number + vitaminC: number +} + +export enum MealTimeId { + Breakfast = 0, + Lunch, + Dinner, + Supper, +} + +export class MealTime { + name: Resource + id: MealTimeId + + constructor(id: MealTimeId) { + this.id = id + switch (id) { + case MealTimeId.Breakfast: + this.name = $r('app.string.meal_time_breakfast') + break + case MealTimeId.Lunch: + this.name = $r('app.string.meal_time_lunch') + break + case MealTimeId.Dinner: + this.name = $r('app.string.meal_time_dinner') + break + case MealTimeId.Supper: + this.name = $r('app.string.meal_time_supper') + break + } + } +} + +export class DietRecord { + id: number + foodId: number + mealTime: MealTime + weight: number + + constructor(id: number, foodId: number, mealTime: MealTime, weight: number) { + this.id = id + this.foodId = foodId + this.mealTime = mealTime + this.weight = weight + } +} + +@Observed +export class OneMealStatisticsInfo { + mealTime: MealTime + mealFoods: Array = [] + totalCalories: number = 0 + totalFat: number = 0 + totalCarbohydrates: number = 0 + totalProtein: number = 0 + + constructor(mealTime: MealTime) { + this.mealTime = mealTime + } +} + +export class MealFoodInfo { + recordId: number + name: string | Resource + image: Resource + calories: number + protein: number + fat: number + carbohydrates: number + weight: number + + constructor(recordId: number, name: string | Resource, image: Resource, calories: number, protein: number, fat: number, carbohydrates: number, weight: number) { + this.recordId = recordId + this.name = name + this.image = image + this.calories = calories + this.protein = protein + this.fat = fat + this.carbohydrates = carbohydrates + this.weight = weight + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/model/DataUtil.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/model/DataUtil.ets new file mode 100644 index 0000000000000000000000000000000000000000..e12b14195c2c7b8612ae2ab689e512fe9f3e2518 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/model/DataUtil.ets @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router' +import { + FoodInfo, + Category, + CategoryId, + MealTimeId, + OneMealStatisticsInfo, + MealFoodInfo, + DietRecord +} from './DataModels' +import { mockFoods, mockFoodInfo, mockDietRecords } from '../mock/MockData' + +const DEBUG_PREVIEW = false +const MOCK_API = true + +export function getFoods(): Array { + return mockFoods +} + +export function getFoodInfo(): FoodInfo { + return DEBUG_PREVIEW ? mockFoodInfo : router.getParams()['foodId'] +} + +// make records ordered by meal time +export let initDietRecords: Array = [ + { + id: -1, + foodId: 0, + mealTime: { name: $r('app.string.meal_time_breakfast'), id: MealTimeId.Breakfast }, + weight: 0 + }, + { + id: -1, + foodId: 0, + mealTime: { name: $r('app.string.meal_time_lunch'), id: MealTimeId.Lunch }, + weight: 0 + }, + { + id: -1, + foodId: 0, + mealTime: { name: $r('app.string.meal_time_dinner'), id: MealTimeId.Dinner }, + weight: 0 + }, + { + id: -1, + foodId: 0, + mealTime: { name: $r('app.string.meal_time_supper'), id: MealTimeId.Supper }, + weight: 0 + }] + +export function getDietRecords(): Array { + return DEBUG_PREVIEW ? initDietRecords.concat(mockDietRecords) : + AppStorage.Get>('dietRecords') +} + +export function getFoodCategories(): Category[] { + return [{ id: CategoryId.Vegetable, name: $r('app.string.category_vegetable') }, + { id: CategoryId.Fruit, name: $r('app.string.category_fruit') }, + { id: CategoryId.Nut, name: $r('app.string.category_nut') }, + { id: CategoryId.Seafood, name: $r('app.string.category_seafood') }, + { id: CategoryId.Dessert, name: $r('app.string.category_dessert') }] +} + +export function getMileTimes(): string[] { + if (MOCK_API) { + return ['早餐', '午餐', '晚餐', '夜宵'] + } else { + let mealTimeResources: Resource[] = [$r("app.string.meal_time_breakfast"), $r('app.string.meal_time_lunch'), $r('app.string.meal_time_dinner'), $r('app.string.meal_time_supper'), $r('app.string.category_dessert')] + let mealTimes = [] + mealTimeResources.forEach(item => { + let mealTime = this.context.resourceManager.getStringSync(item.id) + if (mealTime !== '') { + mealTimes.push(mealTime) + } + }) + return mealTimes + } +} + +export function getSortedFoodData(): Array { + var letterReg = /^[A-Z]$/ + var list = new Array() + var foods = getFoods() + for (var i = 0;i < foods.length; i++) { + list['#'] = new Array() + // convert the first letter to uppercase + var letter = foods[i].letter.substr(0, 1).toUpperCase() + if (!letterReg.test(letter)) { + letter = '#' + } + // create group by letter + if (!(letter in list)) { + list[letter] = new Array() + } + list[letter].push(foods[i]) + } + + // sort by alphabetical order + var letterGroup = new Array() + for (var key in list) { + letterGroup.push({ + letter: key, + list: list[key] + }) + } + letterGroup.sort(function (x, y) { + return x.letter.charCodeAt(0) - y.letter.charCodeAt(0) + }) + + // put '#' to last for others + var lastArr = letterGroup[0] + letterGroup.splice(0, 1) + letterGroup.push(lastArr) + + // create result list + var resultList = [] + for (var i = 0; i < letterGroup.length; i++) { + resultList.push(letterGroup[i].letter) + resultList = resultList.concat(letterGroup[i].list) + } + return resultList +} + +export function statistics(): Array { + console.info('meal statistics') + let dietRecords = getDietRecords() + const mealMap = new Map() + dietRecords.forEach((item) => { + let oneMealStatisticsInfo: OneMealStatisticsInfo = mealMap.get(item.mealTime.id) + if (oneMealStatisticsInfo === undefined) { + oneMealStatisticsInfo = new OneMealStatisticsInfo(item.mealTime) + } + var foodInfo = getFoods().find((food) => { + return food.id === item.foodId + }) + var calories = foodInfo.calories * item.weight + var protein = foodInfo.protein * item.weight + var fat = foodInfo.fat * item.weight + var carbohydrates = foodInfo.carbohydrates * item.weight + oneMealStatisticsInfo.mealFoods.push(new MealFoodInfo(item.id, foodInfo.name, foodInfo.image, calories, protein, fat, carbohydrates, item.weight)) + oneMealStatisticsInfo.totalFat += fat + oneMealStatisticsInfo.totalCalories += calories + oneMealStatisticsInfo.totalCarbohydrates += carbohydrates + oneMealStatisticsInfo.totalProtein += protein + mealMap.set(item.mealTime.id, oneMealStatisticsInfo) + }) + + return Array.from(mealMap.values()) +} + +export function updateDietWeight(recordId: number, weight: number) { + let dietRecords = getDietRecords() + let index = dietRecords.findIndex((record) => { + return record.id === recordId + }) + dietRecords[index].weight = weight + AppStorage.SetOrCreate>('dietRecords', dietRecords) +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/FoodDetail.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/FoodDetail.ets new file mode 100644 index 0000000000000000000000000000000000000000..f818f65af1322362139089c306e1c8de5783bbb0 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/FoodDetail.ets @@ -0,0 +1,424 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import curves from '@ohos.curves' +import router from '@ohos.router' +import { CIRCLE_RADIUS } from '../common/Constants' +import { BreakPointType } from '../common/BreakpointSystem' +import { FoodInfo, CategoryId, MealTime, MealTimeId, DietRecord } from '../model/DataModels' +import { getFoodInfo, initDietRecords, getMileTimes } from '../model/DataUtil' + +@Styles function cardStyle () { + .height('100%') + .padding({ top: 20, right: 20, left: 20 }) + .backgroundColor(Color.White) + .borderRadius(12) +} + +@Component +struct CardTitle { + private title: Resource + private subtitle: Resource + + build() { + Row() { + Text(this.title) + .fontSize(26) + Blank() + Text(this.subtitle) + .fontSize(13) + .fontColor('rgba(0,0,0,0.6)') + } + .width('100%') + .height(26) + } +} + +@Component +struct PageTitle { + private foodName: Resource = $r('app.string.title_food_detail') + + build() { + Row() { + Image($r('app.media.back')) + .width(20) + .height(20) + .onClick(() => { + router.back() + }) + Text(this.foodName) + .fontSize(22) + .margin({ left: 20 }) + } + .padding(12) + .width('100%') + } +} + +@Component +struct FoodImageDisplay { + private foodInfo: FoodInfo + @State imageBgColorA: number = 0 + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'sm' + + build() { + Stack({ alignContent: Alignment.BottomStart }) { + Image(this.foodInfo.image) + .sharedTransition(this.foodInfo.letter, { + duration: 400, + curve: curves.cubicBezier(0.2, 0.2, 0.1, 1.0), + delay: 100 + }) + .backgroundColor(`rgba(255, 255, 255, ${this.imageBgColorA})`) + .objectFit(ImageFit.Contain) + Text(this.foodInfo.name) + .fontSize(26) + .fontWeight(FontWeight.Bold) + .margin({ left: 26, bottom: 18 }) + } + .height(this.currentBreakpoint == 'lg' ? 166 : 280) + } +} + +@Component +struct ContentTable { + private foodInfo: FoodInfo + + @Builder IngredientItem(title: Resource, colorValue: string, name: Resource, value: Resource) { + Row() { + Text(title) + .fontSize(18) + .fontWeight(FontWeight.Bold) + .layoutWeight(1) + .align(Alignment.Start) + Row() { + Circle({ width: 6, height: 6 }) + .margin({ right: 12 }) + .fill(colorValue) + Text(name) + .fontSize(18) + Blank() + Text(value) + .fontSize(18) + } + .width('100%') + .layoutWeight(2) + } + .margin({ bottom: 20 }) + } + + build() { + Column() { + this.IngredientItem($r('app.string.diet_record_calorie'), '#F54040', $r('app.string.diet_record_calorie'), $r('app.string.calorie_with_kcal_unit', this.foodInfo.calories.toString())) + Row().height(20) + this.IngredientItem($r('app.string.nutrition_element'), '#CCC', $r('app.string.nutrition_element'), $r('app.string.weight_with_gram_unit', this.foodInfo.protein.toString())) + this.IngredientItem(null, '#F5D640', $r('app.string.diet_record_fat'), $r('app.string.weight_with_gram_unit', this.foodInfo.fat.toString())) + this.IngredientItem(null, '#9E9EFF', $r('app.string.diet_record_carbohydrates'), $r('app.string.weight_with_gram_unit', this.foodInfo.carbohydrates.toString())) + this.IngredientItem(null, '#53F540', $r('app.string.diet_record_vitaminC'), $r('app.string.weight_with_milligram_unit', this.foodInfo.vitaminC.toString())) + } + .cardStyle() + } +} + +@Component +struct CaloriesProgress { + private foodInfo: FoodInfo + private averageCalories: number = 0 + private totalCalories: number = 0 + private highCalories: boolean = false + + aboutToAppear() { + switch (this.foodInfo.categoryId) { + case CategoryId.Vegetable: + this.averageCalories = 26 + break + case CategoryId.Fruit: + this.averageCalories = 60 + break + case CategoryId.Nut: + this.averageCalories = 606 + break + case CategoryId.Seafood: + this.averageCalories = 56 + break + case CategoryId.Dessert: + this.averageCalories = 365 + break + } + this.totalCalories = this.averageCalories * 2 + this.highCalories = this.foodInfo.calories < this.averageCalories + } + + build() { + Column() { + CardTitle({ title: $r('app.string.diet_record_calorie'), subtitle: $r('app.string.unit_weight') }) + + Row() { + Text(this.foodInfo.calories.toString()) + .fontColor(this.getCalorieColor()) + .fontSize(65) + Text($r('app.string.calorie_with_kcal_unit', '')) + .fontSize(20) + .margin({ bottom: 10 }) + } + .margin({ top: 25, bottom: 25 }) + .alignItems(VerticalAlign.Bottom) + + Text(this.highCalories ? $r('app.string.high_calorie_food') : $r('app.string.low_calorie_food')) + .fontSize(13) + .fontColor('#313131') + + Progress({ value: this.foodInfo.calories, total: this.totalCalories, style: ProgressStyle.Linear }) + .style({ strokeWidth: 24 }) + .color(this.getCalorieColor()) + .margin({ top: 18 }) + } + .cardStyle() + } + + getCalorieColor() { + return this.highCalories ? $r('app.color.high_calorie') : $r('app.color.low_calorie') + } +} + +class NutritionElement { + element: Resource + weight: number + percent: number + beginAngle: number + endAngle: number + color: string + + constructor(element: Resource, weight: number, color: string) { + this.element = element + this.weight = weight + this.color = color + } +} + +@Component +struct NutritionPieChart { + private foodInfo: FoodInfo + private nutritionElements: NutritionElement[] + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + + build() { + Column() { + CardTitle({ title: $r('app.string.nutrition_element'), subtitle: $r('app.string.unit_weight') }) + Canvas(this.context) + .height(CIRCLE_RADIUS * 2) + .aspectRatio(1) + .margin({ top: 30, bottom: 32 }) + .onReady(() => { + this.nutritionElements.forEach((item) => { + this.context.beginPath() + this.context.moveTo(CIRCLE_RADIUS, CIRCLE_RADIUS) + this.context.arc(CIRCLE_RADIUS, CIRCLE_RADIUS, CIRCLE_RADIUS, item.beginAngle, item.endAngle) + this.context.fillStyle = item.color + this.context.fill() + }) + }) + Row() { + ForEach(this.nutritionElements, (item: NutritionElement) => { + Row({ space: 4 }) { + Circle({ width: 8, height: 8 }).fill(item.color) + Text(item.element).fontSize(12) + Text($r('app.string.weight_with_gram_unit', item.weight.toString())).fontSize(12) + } + }) + } + .width('100%') + .justifyContent(FlexAlign.SpaceAround) + } + .cardStyle() + } +} + +@Component +struct NutritionPercent { + private foodInfo: FoodInfo + private nutritionElements: NutritionElement[] + + build() { + Column() { + CardTitle({ title: $r('app.string.nutrition_element'), subtitle: $r('app.string.unit_weight') }) + + Row() { + ForEach(this.nutritionElements, (item: NutritionElement) => { + Column() { + Stack({ alignContent: Alignment.Center }) { + Progress({ value: item.percent, type: ProgressType.Ring }) + .style({ strokeWidth: 10 }) + .color(item.color) + .margin(4) + Text(item.percent + '%').fontSize(17) + } + + Text(item.element) + .fontSize(13) + .margin({ top: 24 }) + Text($r('app.string.weight_with_gram_unit', item.weight.toString())) + .fontSize(13) + }.layoutWeight(1) + + }) + } + .width('100%') + .margin({ top: 50 }) + } + .cardStyle() + } +} + +@CustomDialog +struct Record { + private foodInfo: FoodInfo + private controller: CustomDialogController + private select: number = 1 + private mileTime: string[] = getMileTimes() + private foodWeight: string[] = ['25', '50', '100', '150', '200', '250', '300', '350', '400', '450', '500'] + private mealTimeId: MealTimeId = MealTimeId.Lunch + private mealWeight: number = Number(this.foodWeight[this.select]) + + build() { + Column() { + Row({ space: 6 }) { + Column() { + Text(this.foodInfo.name) + .minFontSize(18) + .maxFontSize(30) + .maxLines(1) + Text($r('app.string.calorie_with_kcal_unit', this.foodInfo.calories.toString())) + .fontSize(16) + .fontColor('rgba(0,0,0,0.4)') + .margin({ top: 2 }) + } + .layoutWeight(1) + .justifyContent(FlexAlign.Center) + + TextPicker({ range: this.mileTime, selected: this.select }) + .layoutWeight(1) + .linearGradient({ + angle: 0, + direction: GradientDirection.Top, + colors: [[0xfdfdfd, 0.0], [0xe0e0e0, 0.5], [0xfdfdfd, 1]], + }) + .onChange((value: string, index: number) => { + this.mealTimeId = index + }) + + TextPicker({ range: this.foodWeight, selected: this.select }) + .layoutWeight(1) + .linearGradient({ + angle: 0, + direction: GradientDirection.Top, + colors: [[0xfdfdfd, 0.0], [0xe0e0e0, 0.5], [0xfdfdfd, 1]], + }) + .onChange((value: string) => { + this.mealWeight = Number(value) + }) + } + .height(128) + + Button($r('app.string.button_food_detail_complete'), { type: ButtonType.Capsule, stateEffect: true }) + .height(43) + .width('100%') + .margin({ top: 33, left: 72, right: 72 }) + .backgroundColor($r('app.color.theme_color_green')) + .onClick(() => { + let dietRecordsList = AppStorage.Get>('dietRecords') + if (dietRecordsList == undefined || dietRecordsList.length === 0) { + dietRecordsList = initDietRecords + } + let dietRecordData = new DietRecord(dietRecordsList.length, this.foodInfo.id, new MealTime(this.mealTimeId), this.mealWeight) + dietRecordsList.push(dietRecordData) + AppStorage.SetOrCreate>('dietRecords', dietRecordsList) + this.controller.close() + }) + } + .cardStyle() + .height(254) + .width('90%') + } +} + +@Entry +@Component +struct FoodDetail { + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'sm' + private foodInfo: FoodInfo = getFoodInfo() + private nutritionElements: NutritionElement[] + dialogController: CustomDialogController = new CustomDialogController({ + builder: Record({ foodInfo: this.foodInfo }), + autoCancel: true, + alignment: DialogAlignment.Bottom, + offset: { dx: 0, dy: -20 }, + customStyle: true + }) + + aboutToAppear() { + let total = this.foodInfo.protein + this.foodInfo.fat + this.foodInfo.carbohydrates + this.nutritionElements = [ + new NutritionElement($r('app.string.diet_record_protein'), this.foodInfo.protein, '#ff9421'), + new NutritionElement($r('app.string.diet_record_fat'), this.foodInfo.fat, '#ffd100'), + new NutritionElement($r('app.string.diet_record_carbohydrates'), this.foodInfo.carbohydrates, '#4cd041') + ] + let lastEndAngle = -0.5 * Math.PI + this.nutritionElements.forEach((value) => { + let percent = value.weight / total + value.percent = Math.round(percent * 100) + value.beginAngle = lastEndAngle + value.endAngle = (percent * 2 * Math.PI) + lastEndAngle + lastEndAngle = value.endAngle + return value + }) + } + + build() { + Scroll() { + Column() { + PageTitle() + FoodImageDisplay({ foodInfo: this.foodInfo }) + Swiper() { + ContentTable({ foodInfo: this.foodInfo }) + CaloriesProgress({ foodInfo: this.foodInfo }) + NutritionPercent({ foodInfo: this.foodInfo, nutritionElements: this.nutritionElements }) + NutritionPieChart({ foodInfo: this.foodInfo, nutritionElements: this.nutritionElements }) + } + .indicator(new BreakPointType({ sm: true, md: false, lg: false }).getValue(this.currentBreakpoint)) + .displayCount(new BreakPointType({ sm: 1, md: 2, lg: 3 }).getValue(this.currentBreakpoint)) + .clip(new Rect().width('100%').height('100%').radiusWidth(15).radiusHeight(15)) + .itemSpace(20) + .height(330) + .indicatorStyle({ selectedColor: $r('app.color.theme_color_green') }) + .margin({ top: 10, right: 10, left: 10 }) + + Button($r('app.string.button_food_detail_record'), { type: ButtonType.Capsule, stateEffect: true }) + .height(42) + .width('80%') + .margin({ top: 32, bottom: 32 }) + .backgroundColor($r('app.color.theme_color_green')) + .onClick(() => { + this.dialogController.open() + }) + } + .alignItems(HorizontalAlign.Center) + } + .backgroundColor('#EDF2F5') + .height('100%') + .align(Alignment.Top) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/Home.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/Home.ets new file mode 100644 index 0000000000000000000000000000000000000000..7eeac6cd767a63efade1479b7b14753f79525d4b --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/Home.ets @@ -0,0 +1,497 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router' +import curves from '@ohos.curves' +import { BreakpointSystem, BreakPointType } from '../common/BreakpointSystem' +import { FoodInfo, Category } from '../model/DataModels' +import { getFoods, getFoodCategories, getSortedFoodData } from '../model/DataUtil' +import { Records } from './components/DietRecord' +import deviceInfo from '@ohos.deviceInfo'; +import { FlipPage } from './components/FlipPage' + +@Component +struct FoodListItem { + private foodItem: FoodInfo + + build() { + Navigator({ target: 'pages/FoodDetail' }) { + Row() { + Image(this.foodItem.image) + .objectFit(ImageFit.Contain) + .autoResize(false) + .height(40) + .width(40) + .backgroundColor('#FFf1f3f5') + .margin({ right: 16 }) + .borderRadius(6) + .sharedTransition(this.foodItem.letter, { + duration: 400, + curve: curves.cubicBezier(0.2, 0.2, 0.1, 1.0), + delay: 100 + }) + Text(this.foodItem.name) + .fontSize(14) + Blank() + Text($r('app.string.calorie_with_kcal_unit', this.foodItem.calories.toString())) + .fontSize(14) + } + .height(64) + .width('100%') + } + .params({ foodId: this.foodItem }) + .margin({ right: 24, left: 32 }) + } +} + +@Component +struct ListModeFoods { + private foodItems: FoodInfo[] = getSortedFoodData() + + build() { + Column() { + Text($r("app.string.title_food_list")) + .width('100%') + .height(56) + .padding({ left: 20 }) + .backgroundColor('#FF1f3f5') + .fontSize(20) + + List() { + ForEach(this.foodItems, (item) => { + ListItem() { + if (item.letter !== undefined) { + FoodListItem({ foodItem: item }) + } else { + Text(item) + .fontSize(14) + .height(48) + .margin({ left: 24 }) + .width('100%') + } + } + }) + } + .layoutWeight(1) + } + } +} + +@Component +struct FoodGridItem { + private foodItem: FoodInfo + + build() { + Column() { + Image(this.foodItem.image) + .objectFit(ImageFit.Contain) + .backgroundColor('#f1f3f5') + .height(152) + .sharedTransition(this.foodItem.letter, { + duration: 400, + curve: curves.cubicBezier(0.2, 0.2, 0.1, 1.0), + delay: 100 + }) + Row() { + Text(this.foodItem.name) + .fontSize(14) + Blank() + Text($r('app.string.calorie_with_kcal_unit', this.foodItem.calories.toString())) + .fontSize(14) + .fontColor(0x99000000) + } + .padding({ left: 12, right: 12 }) + .width('100%') + .height(32) + .backgroundColor('#E5E5E5') + } + .height(184) + .clip(new Rect({ width: '100%', height: '100%', radius: 12 })) + .onClick(() => { + router.push({ url: 'pages/FoodDetail', params: { foodId: this.foodItem } }) + }) + } +} + +@Component +struct FoodGrid { + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'md' + private foodItems: FoodInfo[] + + build() { + Grid() { + ForEach(this.foodItems, (item: FoodInfo) => { + GridItem() { + FoodGridItem({ foodItem: item }) + } + }) + } + .columnsTemplate(new BreakPointType({ + sm: '1fr 1fr', + md: '1fr 1fr 1fr', + lg: '1fr 1fr 1fr 1fr' + }).getValue(this.currentBreakpoint)) + .columnsGap(8) + .rowsGap(8) + .padding({ left: 16, right: 16 }) + } +} + +@Component +struct CategoryModeFoods { + @State currentTabIndex: number = 0 + private foodItems: FoodInfo[] = getFoods() + private foodCategories: Category[] = getFoodCategories() + + @Builder tabBarItemBuilder(value: Resource, index: number) { + Text(value) + .fontColor(this.currentTabIndex === index ? 'rgba(0,0,0,0.9)' : 'rgba(0,0,0,0.6)') + .fontSize(this.currentTabIndex === index ? 24 : 18) + .margin({ top: 2 }) + .height(56) + } + + build() { + Tabs() { + TabContent() { + FoodGrid({ foodItems: this.foodItems }) + }.tabBar(this.tabBarItemBuilder($r('app.string.category_all'), 0)) + + ForEach(this.foodCategories, (foodCategory: Category, index) => { + TabContent() { + FoodGrid({ foodItems: this.foodItems.filter(item => (item.categoryId === foodCategory.id)) }) + }.tabBar(this.tabBarItemBuilder(foodCategory.name, index + 1)) + }) + } + .animationDuration(0) + .barMode(BarMode.Scrollable) + .onChange((index) => { + this.currentTabIndex = index + }) + } +} + +@Component +struct FoodsDisplay { + @State isCategoryMode: boolean = true + + build() { + Stack({ alignContent: Alignment.TopEnd }) { + if (this.isCategoryMode) { + CategoryModeFoods() + } else { + ListModeFoods() + } + Row() { + Image($r("app.media.ic_switch")) + .height(24) + .width(24) + .margin({ left: 24, right: 24 }) + } + .height(56) + .backgroundColor(this.isCategoryMode ? Color.White : '#F1F3F5') + .onClick(() => { + this.isCategoryMode = !this.isCategoryMode + }) + } + } +} + +//窗帘组件 +@Component +struct Curtain{ + private ImgHeight: number = px2vp(2170)//图片高度 + private ImgWidth: number = px2vp(1080)//图片宽度 + @State ImgRealWidth: number = px2vp(1080) + @State opacity:number = 1 + @State flag:boolean = false + @State buttonWidth:number = 160 + @State buttonHeight:number = 60 + private buttonFontSize:number = 22 + @State buttonText:string = "开始用餐" + private curtainImgName = "foodForPhone.jpg" + private translateY = this.ImgWidth/4; + + + // 小时-旧值 + @State oldHours: string = '' + // 小时-新值 + @State newHours: string = '' + // 分钟-旧值 + @State oldMinutes: string = '' + // 分钟-新值 + @State newMinutes: string = '' + // 秒数-旧值 + @State oldSeconds: string = '' + // 秒数-新值 + @State newSeconds: string = '' + + @Builder Colon() { + Column() { + Circle().width(8).height(8).fill(Color.Black) + Circle().width(8).height(8).fill(Color.Black).margin({ top: 10 }) + }.padding(10) + } + + /** + * 初始化时间 + */ + initDate() { + let date = new Date() + // 设置小时 在previewer中时钟数会比国内慢八个小时,但是在真机中测试显示正常,与国内时间相同 + this.oldHours = this.format(date.getHours()) + // 设置分钟 + this.oldMinutes = this.format(date.getMinutes()) + // 设置秒数 + this.oldSeconds = this.format(date.getSeconds()) + // 设置新的秒数 + this.newSeconds = date.getSeconds() + 1 === 60 ? '00' : this.format(date.getSeconds() + 1) + } + + /** + * 更新时间 + */ + updateDate() { + let date = new Date() + // 当新值改变,才有动画 + if (date.getSeconds() === 59) { + this.newSeconds = '00' + this.newMinutes = date.getMinutes() + 1 === 60 ? '00' : this.format(date.getMinutes() + 1) + if (date.getMinutes() === 59) { + this.newHours = date.getHours() + 1 === 24 ? '00' : this.format(date.getHours() + 1) + } + } else { + this.newSeconds = this.format(date.getSeconds() + 1) + } + } + + /** + * 不足十位前面补零 + */ + format(param) { + let value = '' + param + if (param < 10) { + value = '0' + param + } + return value + } + + //如果是平板设备,改变图片宽高 + aboutToAppear(){ + if(deviceInfo.deviceType == "tablet"){ + this.ImgHeight = px2vp(1460) + this.ImgWidth = px2vp(2560) + this.ImgRealWidth = px2vp(2560) + this.translateY = this.ImgHeight/4; + this.curtainImgName = "foodForTablet.jpg" + } + } + build() { + Stack() { + Column() { + + Row() { + // 翻页组件-显示小时 + FlipPage({ oldValue: this.oldHours, newValue: $newHours }) + // 冒号 + this.Colon() + // 翻页组件-显示分钟 + FlipPage({ oldValue: this.oldMinutes, newValue: $newMinutes }) + // 冒号 + this.Colon() + // 翻页组件-显示秒数 + FlipPage({ oldValue: this.oldSeconds, newValue: $newSeconds}) + } + .justifyContent(FlexAlign.Center) + .opacity(1-this.opacity) + .width('100%') + .height('100%') + .onAppear(() => { + // 开启定时器 + this.initDate() + setInterval(() => { + this.updateDate() + }, 1000) + }) + + Image($rawfile(this.curtainImgName)) + .objectFit(ImageFit.Fill) + .width(this.ImgRealWidth) + .height(this.ImgHeight) + .opacity(this.opacity) + .position({ + x: 0, + y: 0 + }) + } + .position({ + x: 0, + y: 0 + }) + + Row() { + Button(this.buttonText) + .width(this.buttonWidth) + .height(this.buttonHeight) + .backgroundColor("#ff61cf3a") + .borderRadius(10) + .fontSize(this.buttonFontSize) + + .onClick(() => { + this.flag = !this.flag + animateTo({ + duration: 800, + curve: Curve.EaseIn, + delay: 100, + onFinish: () => { + if(this.flag){ + this.buttonText = "结束用餐" + }else{ + this.buttonText = "开始用餐" + } + } + }, () => { + if(deviceInfo.deviceType=="tablet"){ + if(this.flag){ + this.ImgRealWidth = px2vp(0) + this.buttonWidth = 120 + this.buttonHeight = 45 + this.opacity = 0 + }else{ + this.ImgRealWidth = px2vp(2560) + this.buttonWidth = 160 + this.buttonHeight = 60 + this.opacity = 1 + } + }else{ + if(this.flag){ + this.ImgRealWidth = px2vp(0) + this.buttonWidth = 120 + this.buttonHeight = 45 + this.opacity =0 + }else{ + this.ImgRealWidth = px2vp(1080) + this.buttonWidth = 160 + this.buttonHeight = 60 + this.opacity = 1 + } + } + }) + }) + .position({x:this.ImgWidth/2-this.buttonWidth/2 + 10,y:this.ImgHeight/2-this.buttonHeight/2+(1-this.ImgRealWidth/this.ImgWidth)*this.translateY}) + }.position({x:0,y:0}) + + }.width("100%") + .position({ + x:0, + y:0 + }) + } +} + +@Component +struct EatingTimePage { + + build() { + Stack() { +// EatingTime(); + // ImageCurtain() + Curtain() + } + } +} + +@Entry +@Component +struct Home { + @State currentTabIndex: number = 0 + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'md' + private breakpointSystem: BreakpointSystem = new BreakpointSystem() + @State scrollable:boolean = true + + @Builder bottomBarItemBuilder(name: Resource, icon: Resource, index: number) { + Flex({ + direction: new BreakPointType({ + sm: FlexDirection.Column, + md: FlexDirection.Row, + lg: FlexDirection.Column + }).getValue(this.currentBreakpoint), + justifyContent: FlexAlign.Center, + alignItems: ItemAlign.Center + }) { + Image(icon) + .height(24) + .width(24) + .fillColor(this.getTabBarColor(index)) + Text(name) + .margin(new BreakPointType({ + sm: { top: 4 }, + md: { left: 8 }, + lg: { top: 4 } + }).getValue(this.currentBreakpoint)) + .fontSize(11) + .fontColor(this.getTabBarColor(index)) + } + .width('100%') + .height('100%') + } + + aboutToAppear() { + this.breakpointSystem.register() + } + + aboutToDisappear() { + this.breakpointSystem.unregister() + } + + build() { + Tabs({ + barPosition: new BreakPointType({ + sm: BarPosition.End, + md: BarPosition.End, + lg: BarPosition.Start + }).getValue(this.currentBreakpoint) + }) { + TabContent() { + FoodsDisplay() + }.tabBar(this.bottomBarItemBuilder($r("app.string.tab_bar_home"), $r("app.media.ic_bottom_home"), 0)) + + TabContent() { + EatingTimePage() + }.tabBar(this.bottomBarItemBuilder($r("app.string.tab_bar_eatingTime"), $r("app.media.ic_public_face"), 1)) + + TabContent() { + Records() + }.tabBar(this.bottomBarItemBuilder($r("app.string.tab_bar_record"), $r("app.media.ic_bottom_record"), 2)) + } + .vertical(new BreakPointType({ sm: false, md: false, lg: true }).getValue(this.currentBreakpoint)) + .barWidth(new BreakPointType({ sm: '100%', md: '100%', lg: '56vp' }).getValue(this.currentBreakpoint)) + .barHeight(new BreakPointType({ sm: '56vp', md: '56vp', lg: '60%' }).getValue(this.currentBreakpoint)) + .animationDuration(0) + .scrollable(this.scrollable) + .onChange((index) => { + this.currentTabIndex = index + if(index == 1){ + this.scrollable = false + }else{ + this.scrollable = true + } + }) + } + + private getTabBarColor(index: number) { + return this.currentTabIndex == index ? $r('app.color.tab_bar_select_color') : $r('app.color.tab_bar_normal_color') + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/Logo.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/Logo.ets new file mode 100644 index 0000000000000000000000000000000000000000..34cbc52db9d450083dfe4a3d44efeec660f42f2d --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/Logo.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import curves from '@ohos.curves' +import router from '@ohos.router' + +@Entry +@Component +struct Logo { + @State opacityValue: number = 0 + @State scaleValue: number = 0 + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Shape() { + Image($r("app.media.HuaweiIcon")) + .scale({x:0.7,y:0.7}) + } + .height(210) + .width(210) + .opacity(this.opacityValue) + .onAppear(() => { + animateTo({ + duration: 1000, + curve: Curve.EaseIn, + delay: 100, + onFinish: () => { + setTimeout(() => { + router.replace({ url: 'pages/Home' }) + }, 1000) + } + }, () => { + this.opacityValue = 1 +// this.scaleValue = 1 + }) + }) + + Text($r("app.string.healthy_diet")) + .fontSize(26) + .fontColor(Color.White) + .margin({ top: 300 }) + + Text($r("app.string.logo_description")) + .fontSize(17) + .fontColor(Color.White) + .margin({ top: 4 }) + } + .width('100%') + .height('100%') + .linearGradient({ angle: 180, colors: [['#BDE895', 0.1], ['#95DE7F', 0.6], ['#7AB967', 1]] }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/Test.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/Test.ets new file mode 100644 index 0000000000000000000000000000000000000000..9493ce276103e20731103ef99e44b7ef9a8e32a2 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/Test.ets @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import curves from '@ohos.curves' +import router from '@ohos.router' +import deviceInfo from '@ohos.deviceInfo'; +//@Entry +@Component +struct Logo { + @State opacityValue: number = 0 + @State scaleValue: number = 0 + private rightPath: string = 'M319.5 128.1 c103.5 0 187.5 84 187.5 187.5 v15 a172.5 172.5 0 0 3 -172.5 172.5 H198 a36 36 0 0 3 -13.8 -1 207 207 0 0 0 87 -372 h48.3 z' + private rightBottomPath: string = 'M270.6 128.1 h48.6 c51.6 0 98.4 21 132.3 54.6 a411 411 0 0 3 -45.6 123 c-25.2 45.6 -56.4 84 -87.6 110.4 a206.1 206.1 0 0 0 -47.7 -288 z' + + aboutToAppear(){ + + } + + build() { + + } +} + +@Entry +@Component +struct test{ + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + private imgResource:ImageBitmap = new ImageBitmap("common/images/logo.png") + + // @State imageWidth:number = 300 + @State flag:boolean = false + private ImgHeight: number = 300//图片高度 + private ImgWidth: number = 300//图片宽度 + @State ImgRealWidth: number = 300 + + + build() { + Stack() { + Canvas(this.context){ + Button("test") + .fontSize(11) + .onClick(()=>{ + console.log("dianji") + this.flag = !this.flag + }) + } + .onReady(() => { + this.context.drawImage(this.imgResource, 0, 0, this.ImgRealWidth, 300) + }) + Button("test") + .position({x:300,y:500}) + .onClick(() => { + console.log("dianji") + this.flag = !this.flag + animateTo({ + duration: 500, + curve: Curve.Linear, + delay: 100, + onFinish() { + } + }, () => { + if (this.flag) { + this.ImgRealWidth = 100 + } else { + this.ImgRealWidth = 300 + } + }) + }) + } + +// this.context.createImageData($r("app.media.logo")) +// this.context.getImageData() + +// Image($r("app.media.logo")) +// .objectFit(ImageFit.Fill) +// .width(this.ImgRealWidth) +// .height(this.ImgHeight) +// // .direction(Direction.Rtl) +// // .borderWidth(2) +// .position({ x: 0, y: 0 }) +// .clip(new Path({ +// commands: "M0 0 L" + vp2px(this.ImgRealWidth / 10) + " 0 " + "C" + vp2px(this.ImgRealWidth / 10) + " 0 " + vp2px(this.ImgRealWidth / 10 * 2) + " " + +// vp2px((1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + vp2px(this.ImgRealWidth / 10 * 3) + " 0 " + "L" + vp2px(this.ImgRealWidth / 10 * 3) + " 0 L" + +// vp2px(this.ImgRealWidth / 10 * 4) + " 0 C" + vp2px(this.ImgRealWidth / 10 * 4) + " 0 " + vp2px(this.ImgRealWidth / 10 * 5) + " " + vp2px((1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + +// vp2px(this.ImgRealWidth / 10 * 6) + " 0 L" + vp2px(this.ImgRealWidth / 10 * 6) + " 0 L" + vp2px(this.ImgRealWidth / 10 * 7) + " 0 C" + vp2px(this.ImgRealWidth / 10 * 7) + " 0 " + +// vp2px(this.ImgRealWidth / 10 * 8) + " " + vp2px((1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + vp2px(this.ImgRealWidth / 10 * 9) + " 0 L" + vp2px(this.ImgRealWidth / 10 * 9) + " 0 L" + +// vp2px(this.ImgRealWidth) + " 0 L" + vp2px(this.ImgRealWidth) + " " + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 9) + " " + vp2px(this.ImgHeight) + " C" + +// vp2px(this.ImgRealWidth / 10 * 9) + " " + vp2px(this.ImgHeight) + " " + vp2px(this.ImgRealWidth / 10 * 8) + " " + vp2px(this.ImgHeight - (1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + +// vp2px(this.ImgRealWidth / 10 * 7) + " " + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 7) + " " + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 6) + " " + +// vp2px(this.ImgHeight) + " C" + vp2px(this.ImgRealWidth / 10 * 6) + " " + vp2px(this.ImgHeight) + " " + vp2px(this.ImgRealWidth / 10 * 5) + " " + +// vp2px(this.ImgHeight - (1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + vp2px(this.ImgRealWidth / 10 * 4) + " " + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 4) + " " + +// vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 3) + " " + vp2px(this.ImgHeight) + " C" + vp2px(this.ImgRealWidth / 10 * 3) + " " + vp2px(this.ImgHeight) + " " + +// vp2px(this.ImgRealWidth / 10 * 2) + " " + vp2px(this.ImgHeight - (1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + vp2px(this.ImgRealWidth / 10 * 1) + " " + vp2px(this.ImgHeight) + " L" + +// vp2px(this.ImgRealWidth / 10 * 1) + " " + vp2px(this.ImgHeight) + " L0" + " " + vp2px(this.ImgHeight) + " Z" +// })) +// .onClick(() => { +// this.flag = !this.flag +// animateTo({ +// duration: 500, +// curve: Curve.Linear, +// delay: 100, +// onFinish() { +// } +// }, () => { +// if (this.flag) { +// this.ImgRealWidth = 100 +// } else { +// this.ImgRealWidth = 300 +// } +// +// }) +// }) +// } + } + +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/components/CustomCounter.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/components/CustomCounter.ets new file mode 100644 index 0000000000000000000000000000000000000000..e9effcc6b2886e8c74e04c76daa687527d7705f8 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/components/CustomCounter.ets @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Preview +@Component +struct DecIcon { + private click: () => void = undefined + + build() { + Stack() { + Line() + .startPoint([0, 0]) + .endPoint([12, 0]) + .stroke(Color.White) + .strokeWidth(2) + .strokeLineCap(LineCapStyle.Round) + } + .borderRadius(10) + .backgroundColor('#35BD6A') + .width(20) + .height(20) + .opacity(0.4) + .onClick(() => { + this.click() + }) + } +} + +@Preview +@Component +struct IncIcon { + private readonly click: () => void = undefined + + build() { + Stack() { + Line() + .startPoint([0, 0]) + .endPoint([0, 12]) + .stroke(Color.White) + .strokeWidth(2) + .strokeLineCap(LineCapStyle.Round) + } + .borderRadius(10) + .backgroundColor('#35BD6A') + .width(20) + .height(20) + .onClick(() => { + this.click() + }) + } +} + +@Component +export struct CustomCounter { + @Prop value: string + private onDec: () => void = undefined + private onInc: () => void = undefined + + build() { + Row() { + DecIcon({ click: this.onDec }) + Text(this.value).margin({ left: 11, right: 11 }) + IncIcon({ click: this.onInc }) + } + } +} + +@Preview +@Entry +@Component +struct PreviewCustomCounter { + @State weight: number = 50 + + build() { + Row() { + CustomCounter({ + value: this.weight + 'g', + onDec: () => { + this.weight -= 50 + }, + onInc: () => { + this.weight += 50 + } + }) + } + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/components/DietRecord.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/components/DietRecord.ets new file mode 100644 index 0000000000000000000000000000000000000000..d224ada5ae5e93a455d05cbf7e2f2d93c3dcd526 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/components/DietRecord.ets @@ -0,0 +1,368 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { OneMealStatisticsInfo, MealFoodInfo, DietRecord } from '../../model/DataModels' +import { statistics, updateDietWeight } from '../../model/DataUtil' +import { BreakPointType } from '../../common/BreakpointSystem' +import { CustomCounter } from './CustomCounter' + +class HistogramLegend { + public color: string + public value: Resource + + constructor(color: string, value: Resource) { + this.color = color + this.value = value + } +} + +function GetColor(value: number): Resource { + if (value / 1000 > 100) { + return $r("app.color.theme_color_orange") + } else { + return $r("app.color.theme_color_green") + } +} + +@Component +struct Histogram { + @Consume("dietData") dietData: Array + @BuilderParam content: any + @BuilderParam legendComponent: any + private title: string | Resource + private legend: HistogramLegend[] + + build() { + Column() { + Text(this.title) + .textAlign(TextAlign.Start) + .fontSize(24) + .fontColor('#000000') + .fontFamily('HarmonyHeTi-Medium') + .width('100%') + .height(46) + + Stack({ alignContent: Alignment.Bottom }) { + Column() { + ForEach(new Array(6), (item) => { + Divider() + .strokeWidth(1) + .color('#D8D8D8') + }) + } + .height('100%') + .margin({ top: 20 }) + .justifyContent(FlexAlign.SpaceBetween) + + Column() { + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceEvenly, alignItems: ItemAlign.Start }) { + ForEach(this.dietData, (item: OneMealStatisticsInfo) => { + if (item.mealFoods.length > 1) { + Column() { + this.content(item) + Text(item.mealTime.name).fontSize(14) + .fontColor('#7E7E7E') + .fontFamily('HarmonyHeTi') + .margin({ top: 10 }) + } + .justifyContent(FlexAlign.End) + .height('100%') + } + }) + } + } + .height(236) + } + .height(190) + + Row() { + ForEach(this.legend, item => { + Row() { + Rect({ width: 9, height: 9, radius: 9 }).fill(item.color).margin({ right: 18 }) + this.legendComponent(item) + } + }) + } + .justifyContent(FlexAlign.SpaceEvenly) + .width('100%') + .margin({ top: 70 }) + } + .height('100%') + .padding({ left: 32, right: 32 }) + .borderRadius(12) + .backgroundColor('#FFFFFF') + } +} + +@Component +struct NutritionHistogramContent { + private legend: HistogramLegend[] = [ + new HistogramLegend('#FFD339', $r("app.string.diet_record_fat")), + new HistogramLegend('#FD9A42', $r("app.string.diet_record_protein")), + new HistogramLegend('#73CD57', $r("app.string.diet_record_carbohydrates")) + ] + + @Builder legendComponent(item: HistogramLegend) { + Text(item.value).fontSize(12).fontColor('#18181A').fontFamily('HarmonyHeTi') + } + + @Builder content(item) { + Column() { + if (item.totalFat > 0) { + Rect({ width: 14, height: item.totalFat / 200 + 14, radius: 7 }).fill('#FD9A42') + .padding({ top: 14 }) + .margin({ bottom: -28 }) + } + if (item.totalProtein > 0) { + Rect({ width: 14, height: item.totalProtein / 200 + 14, radius: 7 }) + .fill('#FBD44E') + .padding({ top: 14 }) + .margin({ bottom: -21 }) + } + if (item.totalCarbohydrates > 0) { + Rect({ width: 14, height: item.totalCarbohydrates / 200 + 14, radius: 7 }).fill('#73CD57') + .padding({ top: 7 }) + .margin({ bottom: -7 }) + } + }.clip(true) + } + + build() { + Row() { + Histogram({ + title: $r("app.string.nutrition_element"), + content: this.content, + legend: this.legend, + legendComponent: this.legendComponent + }) + } + } +} + +@Component +struct HeatHistogramContent { + private legend: HistogramLegend[] = [ + new HistogramLegend('#FD9A42', $r("app.string.high_calorie")), + new HistogramLegend('#73CD57', $r("app.string.medium_low_calories")), + ] + + @Builder legendComponent(item) { + Text(item.value).fontSize(12).fontColor('#18181A').fontFamily('HarmonyHeTi') + } + + @Builder content(item) { + Column() { + Rect({ width: 14, height: item.totalCalories / 1000 + 14, radius: 14 }) + .fill(GetColor(item.totalCalories)) + .padding({ top: 7 }) + .margin({ bottom: -7 }) + } + .clip(true) + } + + build() { + Row() { + Histogram({ + title: $r("app.string.diet_record_calorie"), + content: this.content, + legend: this.legend, + legendComponent: this.legendComponent + }) + } + } +} + +@Component +struct MealFoodDetail { + @Consume("dataChange") notifyDataChange: number + @State shown: boolean = true + @State translateX: number = 0 + private mealFoodInfo: MealFoodInfo + private panTranslateX: number = 300 + + build() { + if (this.shown) { + if (this.mealFoodInfo.weight != 0) { + Row() { + Row() { + Image(this.mealFoodInfo.image) + .width(50) + .height(50) + Column() { + Text(this.mealFoodInfo.name) + .fontSize(16) + .fontColor('#444444') + .fontFamily('HarmonyHeTi') + .margin({ bottom: 4 }) + Text($r('app.string.calorie_with_kcal_unit', (this.mealFoodInfo.calories / 100).toString())) + .fontSize(11) + .fontColor('#A3A3A3') + .fontFamily('HarmonyHeTi') + }.alignItems(HorizontalAlign.Start) + + Blank() + CustomCounter({ + // value: this.mealFoodInfo.weight + 'g', + value: this.mealFoodInfo.weight + 'g', + onDec: () => { + if (this.mealFoodInfo.weight > 0) { + this.mealFoodInfo.weight -= 50 + updateDietWeight(this.mealFoodInfo.recordId, this.mealFoodInfo.weight) + this.notifyDataChange++ + } + }, + onInc: () => { + this.mealFoodInfo.weight += 50 + updateDietWeight(this.mealFoodInfo.recordId, this.mealFoodInfo.weight) + this.notifyDataChange++ + } + }) + } + .width('100%') + + Image($r("app.media.ic_public_delete")) + .backgroundColor('#E84026') + .objectFit(ImageFit.ScaleDown) + .borderRadius(20) + .margin({ left: 50 }) + .size({ width: 40, height: 40 }) + .onClick(() => { + animateTo({ duration: 400 }, () => { + this.shown = false + }) + }) + } + .transition({ type: TransitionType.Delete, translate: { x: -350, y: 0 }, opacity: 0 }) + .translate({ x: this.translateX }) + .width('100%') + .height(70) + .gesture( + PanGesture() + .onActionUpdate((event: GestureEvent) => { + if (event.offsetX < 0) { + if (event.offsetX < -100) { + this.translateX = (event.offsetX * Math.exp(-1.848)) - 100 + } else { + this.translateX = event.offsetX + } + } + }) + ) + } + } + } +} + +@Component +struct MealCard { + @ObjectLink mealInfo: OneMealStatisticsInfo + + build() { + Column() { + if (this.mealInfo.mealFoods.length > 1) { + Text(this.mealInfo.mealTime.name) + .fontSize(24) + .fontFamily('HarmonyHeTi-Medium') + .height(56) + .width('100%') + .backgroundColor('#FFFFFF') + .padding({ left: 16, right: 16 }) + + ForEach(this.mealInfo.mealFoods, (mealItem) => { + MealFoodDetail({ mealFoodInfo: mealItem }) + }) + } + } + .backgroundColor(Color.White) + .borderRadius(12) + .padding({ left: 16, right: 16 }) + .margin(12) + } +} + +@Component +struct DietDetails { + @Consume("dietData") dietData: Array + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'sm' + + build() { + Scroll() { + Column() { + Swiper() { + HeatHistogramContent() + NutritionHistogramContent() + } + .itemSpace(12) + .height(400) + .width('100%') + .indicatorStyle({ selectedColor: $r('app.color.theme_color_green') }) + .indicator(new BreakPointType({ sm: true, md: false, lg: false }).getValue(this.currentBreakpoint)) + .displayCount(new BreakPointType({ sm: 1, md: 2, lg: 2 }).getValue(this.currentBreakpoint)) + + ForEach(this.dietData, (item) => { + MealCard({ mealInfo: item }) + }) + } + } + .backgroundColor('#EDF2F5') + } +} + +@Component +struct NoRecord { + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Start }) { + Text($r("app.string.title_record")) + .fontSize(26) + .padding({ left: 26, top: 12 }) + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Image($r("app.media.norecord")) + .height(130) + .width(130) + Text($r("app.string.no_record_content")) + .fontSize(15) + .fontColor('rgba(0, 0,0,0.4)') + } + .width('100%') + } + .width('100%') + } +} + +@Component +export struct Records { + @StorageLink('dietRecords') @Watch('onDataChange') dietRecords: Array = [] + @Provide("dietData") dietStatisticsData: Array = [] + @Provide("dataChange") @Watch('onDataChange') listenDataChange: number = 0 + + onDataChange() { + console.log('onDataChange') + this.dietStatisticsData = statistics() + } + + aboutToAppear() { + this.dietStatisticsData = statistics() + } + + build() { + Column() { + if (this.dietStatisticsData.length === 0) { + NoRecord() + } else { + DietDetails() + } + } + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/components/FlipPage.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/components/FlipPage.ets new file mode 100644 index 0000000000000000000000000000000000000000..e49f3b697b8ad05fd4388dc1476e182fd6683722 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/components/FlipPage.ets @@ -0,0 +1,126 @@ +import deviceInfo from '@ohos.deviceInfo'; + + +@Component +export struct FlipPage { + private width = 90 + private height = 110 + private fontSize = 70 + + private defaultBgColor = '#F6F6F6' + private borderRadius = 15 + // 顶层上部动画角度 + @State angleTop: number = 0 + // 顶层下部动画角度 + @State angleBottom: number = -90 + // 旧值 + @Prop oldValue: string + // 新值,加入监听 + @Link @Watch('valueChange') newValue: string + // 动画背景颜色 + @State animateBgColor: string = '#F6F6F6' + + /** + * 监听新值变化 + */ + valueChange() { + + if (this.oldValue === this.newValue) return; + this.startTopAnimate() + } + //如果是平板设备的话,修改翻页时钟的宽高和字体大小 + aboutToAppear(){ + if(deviceInfo.deviceType === 'tablet'){ + this.width = 180 + this.height = 220 + this.fontSize = 100 + this.borderRadius = 30 + } + } + + build() { + Stack() { + // 底层文字上部 + Text(this.newValue) + .commonStyle(this.fontSize, this.borderRadius, this.defaultBgColor) + .clip(new Rect({ width: this.width, height: this.height / 2 })) + + // 底层文字下部 + Text(this.oldValue) + .commonStyle(this.fontSize, this.borderRadius, this.defaultBgColor) + .margin({ top: 3 }) + .clip(new Path().commands(`M0 ${vp2px(this.height / 2)} + L${vp2px(this.width)} ${vp2px(this.height / 2)} + L${vp2px(this.width)} ${vp2px(this.height)} + L0 ${vp2px(this.height)} Z`)) + // 顶层文字上部动画 + Text(this.oldValue) + .commonStyle(this.fontSize, this.borderRadius, this.animateBgColor) + .clip(new Rect({ width: this.width, height: this.height / 2 })) + .rotate({ x: 1, centerY: '50%', angle: this.angleTop }) + + // 顶层文字下部动画 + Text(this.newValue) + .commonStyle(this.fontSize, this.borderRadius, this.animateBgColor) + .margin({ top: 3 }) + .clip(new Path().commands(`M0 ${vp2px(this.height / 2)} + L${vp2px(this.width)} ${vp2px(this.height / 2)} + L${vp2px(this.width)} ${vp2px(this.height)} + L0 ${vp2px(this.height)} Z`)) + .rotate({ x: 1, centerY: '50%', angle: this.angleBottom }) + } + + .width(this.width) + .height(this.height) + .backgroundColor(Color.White) + .borderRadius(this.borderRadius) + .shadow({ radius: 30, color: '#ffacacac', offsetY: 10 }) + } + + /** + * 启动顶层文字上部动画 + */ + startTopAnimate() { + animateTo({ + duration: 300, + onFinish: () => { + this.startBottomAnimate() + this.animateBgColor = '#F6F6F6' + } + }, () => { + this.angleTop = 90 + this.animateBgColor = '#F6F6F6' + }) + } + + /** + * 启动顶层文字下部动画 + */ + startBottomAnimate() { + animateTo({ + duration: 300, + onFinish: () => { + this.angleTop = 0 + this.angleBottom = -90 + this.animateBgColor = this.defaultBgColor + this.oldValue = this.newValue + } + }, () => { + this.angleBottom = 0 + this.animateBgColor = this.defaultBgColor + }) + } +} + +// Text公共样式 +@Extend(Text) function commonStyle (fontSize: number | string | Resource, + borderRadius: Length, + bgColor: ResourceColor) { + .width('100%') + .height('100%') + .fontColor(Color.Black) + .fontSize(fontSize) + .textAlign(TextAlign.Center) + .borderRadius(borderRadius) + .backgroundColor(bgColor) +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/components/ImageCurtain.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/components/ImageCurtain.ets new file mode 100644 index 0000000000000000000000000000000000000000..1729c0cb218e9ab3b19c2fb17b9053e7bdd30817 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/ets/MainAbility/pages/components/ImageCurtain.ets @@ -0,0 +1,189 @@ +import deviceInfo from '@ohos.deviceInfo'; + +@Component +export struct ImageCurtain{ + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + + // private image:ImageBitmap = new Image('../common/images/snipper.png') + //设置图片的宽高 + private ImgHeight: number = 600 + private ImgWidth: number = 340 + //图片的宽度随鼠标变化 + @State ImgRealWidth: number = 340 + + //鼠标的坐标 + @State mouseXBias: number = 0 + @State mouseYBias: number = 0 + @State opacity: number = 0 + //图片的起始坐标 + private ImgStartXBias: number = 10 + private ImgStartYBias: number = 10 + private imgName: string = "logo.png" + + + build() { + Stack() { + Column() { + Image($rawfile(this.imgName)) + .alt("https://img.bizhizu.com/up/dd/c9/46/ddc9462603f9ab7ecb44d88275aacb3c.jpg") + .objectFit(ImageFit.Fill) + .height(this.ImgHeight) + .width(this.ImgRealWidth) + .position({ + x: this.ImgStartXBias, + y: this.ImgStartYBias + }) + //利用裁剪模拟窗帘上下边缘卷曲效果 + .clip(new Path({ + commands: "M0 0 L" + vp2px(this.ImgRealWidth / 10) + " 0 " + "C" + vp2px(this.ImgRealWidth / 10) + " 0 " + vp2px(this.ImgRealWidth / 10 * 2) + " " + + vp2px((1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + vp2px(this.ImgRealWidth / 10 * 3) + " 0 " + "L" + vp2px(this.ImgRealWidth / 10 * 3) + " 0 L" + + vp2px(this.ImgRealWidth / 10 * 4) + " 0 C" + vp2px(this.ImgRealWidth / 10 * 4) + " 0 " + vp2px(this.ImgRealWidth / 10 * 5) + " " + vp2px((1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + + vp2px(this.ImgRealWidth / 10 * 6) + " 0 L" + vp2px(this.ImgRealWidth / 10 * 6) + " 0 L" + vp2px(this.ImgRealWidth / 10 * 7) + " 0 C" + vp2px(this.ImgRealWidth / 10 * 7) + " 0 " + + vp2px(this.ImgRealWidth / 10 * 8) + " " + vp2px((1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + vp2px(this.ImgRealWidth / 10 * 9) + " 0 L" + vp2px(this.ImgRealWidth / 10 * 9) + " 0 L" + + vp2px(this.ImgRealWidth) + " 0 L" + vp2px(this.ImgRealWidth) + " " + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 9) + " " + vp2px(this.ImgHeight) + " C" + + vp2px(this.ImgRealWidth / 10 * 9) + " " + vp2px(this.ImgHeight) + " " + vp2px(this.ImgRealWidth / 10 * 8) + " " + vp2px(this.ImgHeight - (1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + + vp2px(this.ImgRealWidth / 10 * 7) + " " + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 7) + " " + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 6) + " " + + vp2px(this.ImgHeight) + " C" + vp2px(this.ImgRealWidth / 10 * 6) + " " + vp2px(this.ImgHeight) + " " + vp2px(this.ImgRealWidth / 10 * 5) + " " + + vp2px(this.ImgHeight - (1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + vp2px(this.ImgRealWidth / 10 * 4) + " " + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 4) + " " + + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 3) + " " + vp2px(this.ImgHeight) + " C" + vp2px(this.ImgRealWidth / 10 * 3) + " " + vp2px(this.ImgHeight) + " " + + vp2px(this.ImgRealWidth / 10 * 2) + " " + vp2px(this.ImgHeight - (1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + vp2px(this.ImgRealWidth / 10 * 1) + " " + vp2px(this.ImgHeight) + " L" + + vp2px(this.ImgRealWidth / 10 * 1) + " " + vp2px(this.ImgHeight) + " L0" + " " + vp2px(this.ImgHeight) + " Z" + })) + } + .width('100%') + .height('100%') + + + Column() { + Row() + .height(this.ImgHeight) + .width(this.ImgRealWidth) + // .margin({ top: 10 }) + //拖拽回调,开始监听拖拽行为 + // .onDragStart((event: DragEvent) => { + // console.info("dragstart") + // }) + .position({ + x: this.ImgStartXBias, + y: this.ImgStartYBias + }) + //遮罩的透明度 计算 + .opacity(this.opacity) + //利用颜色渐变模拟窗帘折叠效果 + .linearGradient({ + angle: 90, + direction: GradientDirection.Left, + // colors: [["#ff030303", 0.0], ["#ff7a7878", 0.1 * (this.time / 1)],["#ffffffff", 0.2], ["#ff030303", 0.3], + // ["#ff030303", 0.4],["#ff7a7878", (0.5 - 0.1 * (this.time / 1))],["#ffffffff", 0.6],["#ff7a7878", (0.7 - 0.1 * (this.time / 1))], + // ["#ffffffff", 0.0],["#ff7a7878", (0.8 - 0.1 * (this.time / 1))],["#ff000000", 1.0],] + colors: [["#ff030303", 0.0], ["#ff7a7878", 0.11 * 0.5], ["#ffffffff", 0.22 * 0.5], ["#ff7a7878", 0.33 * 0.5], + ["#ff030303", 0.44 * 0.5], + ["#ff030303", 0.55 * 0.5], ["#ff7a7878", 0.66 * 0.5], ["#ffffffff", 0.77 * 0.5], ["#ff7a7878", 0.88 * 0.5], + ["#ff000000", 1.0 * 0.5], + ["#ff030303", 0.5], ["#ff7a7878", 0.11 * 0.5 + 0.5], ["#ffffffff", 0.22 * 0.5 + 0.5], ["#ff7a7878", 0.33 * 0.5 + 0.5], + ["#ff030303", 0.44 * 0.5 + 0.5], + ["#ff030303", 0.55 * 0.5 + 0.5], ["#ff7a7878", 0.66 * 0.5 + 0.5], ["#ffffffff", 0.77 * 0.5 + 0.5], ["#ff7a7878", 0.88 * 0.5 + 0.5], + ["#ff000000", 1.0], + ] + }) + //利用裁剪给遮罩添加模拟窗帘上下边缘卷曲效果 + .clip(new Path({ + commands: "M0 0 L" + vp2px(this.ImgRealWidth / 10) + " 0 " + "C" + vp2px(this.ImgRealWidth / 10) + " 0 " + vp2px(this.ImgRealWidth / 10 * 2) + " " + + vp2px((1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + vp2px(this.ImgRealWidth / 10 * 3) + " 0 " + "L" + vp2px(this.ImgRealWidth / 10 * 3) + " 0 L" + + vp2px(this.ImgRealWidth / 10 * 4) + " 0 C" + vp2px(this.ImgRealWidth / 10 * 4) + " 0 " + vp2px(this.ImgRealWidth / 10 * 5) + " " + vp2px((1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + + vp2px(this.ImgRealWidth / 10 * 6) + " 0 L" + vp2px(this.ImgRealWidth / 10 * 6) + " 0 L" + vp2px(this.ImgRealWidth / 10 * 7) + " 0 C" + vp2px(this.ImgRealWidth / 10 * 7) + " 0 " + + vp2px(this.ImgRealWidth / 10 * 8) + " " + vp2px((1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + vp2px(this.ImgRealWidth / 10 * 9) + " 0 L" + vp2px(this.ImgRealWidth / 10 * 9) + " 0 L" + + vp2px(this.ImgRealWidth) + " 0 L" + vp2px(this.ImgRealWidth) + " " + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 9) + " " + vp2px(this.ImgHeight) + " C" + + vp2px(this.ImgRealWidth / 10 * 9) + " " + vp2px(this.ImgHeight) + " " + vp2px(this.ImgRealWidth / 10 * 8) + " " + vp2px(this.ImgHeight - (1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + + vp2px(this.ImgRealWidth / 10 * 7) + " " + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 7) + " " + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 6) + " " + + vp2px(this.ImgHeight) + " C" + vp2px(this.ImgRealWidth / 10 * 6) + " " + vp2px(this.ImgHeight) + " " + vp2px(this.ImgRealWidth / 10 * 5) + " " + + vp2px(this.ImgHeight - (1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + vp2px(this.ImgRealWidth / 10 * 4) + " " + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 4) + " " + + vp2px(this.ImgHeight) + " L" + vp2px(this.ImgRealWidth / 10 * 3) + " " + vp2px(this.ImgHeight) + " C" + vp2px(this.ImgRealWidth / 10 * 3) + " " + vp2px(this.ImgHeight) + " " + + vp2px(this.ImgRealWidth / 10 * 2) + " " + vp2px(this.ImgHeight - (1 - this.ImgRealWidth / this.ImgWidth) * 40) + " " + vp2px(this.ImgRealWidth / 10 * 1) + " " + vp2px(this.ImgHeight) + " L" + + vp2px(this.ImgRealWidth / 10 * 1) + " " + vp2px(this.ImgHeight) + " L0" + " " + vp2px(this.ImgHeight) + " Z" + })) + } + .width('100%') + .height('100%') + + if(this.ImgRealWidth >= 50) { + Button() { + Text("《") + .fontSize(16-(1-this.ImgRealWidth/this.ImgWidth)*8) + .fontColor("#ff28664c") + } + .width(20-(1-this.ImgRealWidth/this.ImgWidth)*5) + .height(100) + .backgroundColor("#ffbabec3") + .borderWidth(1) + .borderRadius(5) + .borderColor("#ffc4bebe") + .borderStyle(BorderStyle.Solid) + .shadow({ radius: 5, color: "#ff9fd7bf" }) + .position({ + x: this.ImgRealWidth - 20 * (this.ImgRealWidth / this.ImgWidth) / 4, + y: this.ImgHeight / 2 - 50 + }) + + .onTouch((event: TouchEvent) => { + //遮罩的透明度属性opacity 用一个公式模拟计算 + this.opacity = (1 - this.ImgRealWidth / this.ImgWidth) * (0.5 + this.ImgRealWidth / this.ImgWidth) + //触摸判断 + if (event.type === TouchType.Down) { + } + if (event.type === TouchType.Up) { + + } + if (event.type === TouchType.Move) { + //将touch的坐标值赋给鼠标X变量 + this.mouseXBias = event.touches[0].screenX + //如果坐标没有超过图片的左边,并且鼠标X值不超过屏幕右侧,才改变图片的宽度 + if (this.mouseXBias > this.ImgStartXBias + 10 && this.mouseXBias <= this.ImgWidth + this.ImgStartXBias) { + //鼠标X位置减去坐标起始X位置为图片的宽度 + this.ImgRealWidth = this.mouseXBias - this.ImgStartXBias + } + } + }) + }else { + Button() { + Text("》") + .fontSize(10-(this.ImgRealWidth/this.ImgWidth)*16) + .fontColor("#ff7a5a2c") + .padding({ left: 6 }) + } + .width(20-(1-this.ImgRealWidth/this.ImgWidth)*5) + .height(100) + .backgroundColor("#ffbabec3") + .borderWidth(1) + .borderRadius(5) + .borderColor("#ffc4bebe") + .borderStyle(BorderStyle.Solid) + .shadow({ radius: 5, color: "#ff9fd7bf" }) + .position({ + x: this.ImgRealWidth - 20 * (this.ImgRealWidth / this.ImgWidth) / 4, + y: this.ImgHeight / 2 - 50 + }) + + .onTouch((event: TouchEvent) => { + //遮罩的透明度属性opacity 用一个公式模拟计算 + this.opacity = (1 - this.ImgRealWidth / this.ImgWidth) * (0.5 + this.ImgRealWidth / this.ImgWidth) + //触摸判断 + if (event.type === TouchType.Down) { + } + if (event.type === TouchType.Up) { + } + if (event.type === TouchType.Move) { + //将touch的坐标值赋给鼠标X变量 + this.mouseXBias = event.touches[0].screenX + //如果坐标没有超过图片的左边,并且鼠标X值不超过屏幕右侧,才改变图片的宽度 + if (this.mouseXBias > this.ImgStartXBias + 10 && this.mouseXBias <= this.ImgWidth + this.ImgStartXBias) { + //鼠标X位置减去坐标起始X位置为图片的宽度 + this.ImgRealWidth = this.mouseXBias - this.ImgStartXBias + } + } + }) + } + } + } +} diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/element/color.json b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..93359d97bbe8405c93420fca3d06cacb0b0d15d0 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/element/color.json @@ -0,0 +1,40 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + }, + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "high_calorie", + "value": "#EE584C" + }, + { + "name": "low_calorie", + "value": "#73CD57" + }, + { + "name": "theme_color_orange", + "value": "#FD9A42" + }, + { + "name": "theme_color_green", + "value": "#73CD57" + }, + { + "name": "theme_color_grey", + "value": "#999999" + }, + { + "name": "tab_bar_select_color", + "value": "#73CD57" + }, + { + "name": "tab_bar_normal_color", + "value": "#999999" + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/element/string.json b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d35832bbaa624c68127a9569e2269f4617d76c38 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/element/string.json @@ -0,0 +1,208 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "健康饮食" + }, + { + "name": "healthy_diet", + "value": "健康饮食" + }, + { + "name": "logo_description", + "value": "健康的生活来自均衡的饮食" + }, + { + "name": "title_record", + "value": "记录" + }, + { + "name": "no_record_content", + "value": "无记录,请返回首页添加." + }, + { + "name": "tab_bar_home", + "value": "主页" + }, + { + "name": "tab_bar_eatingTime", + "value": "用餐时间" + }, + { + "name": "tab_bar_record", + "value": "记录" + }, + { + "name": "category_all", + "value": "所有" + }, + { + "name": "category_fruit", + "value": "水果" + }, + { + "name": "category_vegetable", + "value": "蔬菜" + }, + { + "name": "category_nut", + "value": "坚果" + }, + { + "name": "category_seafood", + "value": "海鲜" + }, + { + "name": "category_dessert", + "value": "甜点" + }, + { + "name": "diet_record_calorie", + "value": "热量" + }, + { + "name": "nutrition_element", + "value": "营养元素" + }, + { + "name": "high_calorie", + "value": "高热量" + }, + { + "name": "medium_low_calories", + "value": "中低热量" + }, + { + "name": "low_calorie", + "value": "低热量" + }, + { + "name": "low_calorie_food", + "value": "低热量食物" + }, + { + "name": "high_calorie_food", + "value": "高热量食物" + }, + { + "name": "diet_record_fat", + "value": "脂肪" + }, + { + "name": "diet_record_protein", + "value": "蛋白质" + }, + { + "name": "diet_record_vitaminC", + "value": "维他命C" + }, + { + "name": "diet_record_carbohydrates", + "value": "碳水" + }, + { + "name": "title_food_detail", + "value": "食物详情" + }, + { + "name": "button_food_detail_complete", + "value": "完成" + }, + { + "name": "button_food_detail_record", + "value": "记录" + }, + { + "name": "title_food_list", + "value": "食物列表" + }, + { + "name": "meal_time_breakfast", + "value": "早餐" + }, + { + "name": "meal_time_lunch", + "value": "午餐" + }, + { + "name": "meal_time_dinner", + "value": "晚餐" + }, + { + "name": "meal_time_supper", + "value": "夜宵" + }, + { + "name": "food_name_tomato", + "value": "番茄" + }, + { + "name": "food_name_walnut", + "value": "核桃" + }, + { + "name": "food_name_cucumber", + "value": "黄瓜" + }, + { + "name": "food_name_blueberry", + "value": "蓝莓" + }, + { + "name": "food_name_crab", + "value": "螃蟹" + }, + { + "name": "food_name_ice_cream", + "value": "冰激凌" + }, + { + "name": "food_name_onion", + "value": "洋葱" + }, + { + "name": "food_name_mushroom", + "value": "蘑菇" + }, + { + "name": "food_name_kiwi", + "value": "猕猴桃" + }, + { + "name": "food_name_pitaya", + "value": "火龙果" + }, + { + "name": "food_name_avocado", + "value": "牛油果" + }, + { + "name": "food_name_strawberry", + "value": "草莓" + }, + { + "name": "unit_weight", + "value": "每100克" + }, + { + "name": "weight_with_gram_unit", + "value": "%s 克" + }, + { + "name": "weight_with_milligram_unit", + "value": "%s 毫克" + }, + { + "name": "calorie_with_kcal_unit", + "value": "%s 千卡" + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/HuaWei.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/HuaWei.png new file mode 100644 index 0000000000000000000000000000000000000000..189d6f092f72aa3f230907b949db8d55dfd7157e Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/HuaWei.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/HuaweiIcon.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/HuaweiIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..1bb1572dd988a91f5807aea168c2c6b53ea9c4fc Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/HuaweiIcon.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/avocado.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/avocado.png new file mode 100644 index 0000000000000000000000000000000000000000..a2848b10707f0f4f1c6a661826d822e678b3cceb Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/avocado.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/back.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/back.png new file mode 100644 index 0000000000000000000000000000000000000000..2b0806c99ba80ca8bd23cf65f0b8eebf01dcb460 Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/back.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/blueberry.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/blueberry.png new file mode 100644 index 0000000000000000000000000000000000000000..a07421e575d4d41e718ace47c16aaba8ac0755ac Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/blueberry.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/crab.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/crab.png new file mode 100644 index 0000000000000000000000000000000000000000..b71a627013711964e4d5d3b271e9311a2b525f65 Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/crab.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/cucumber.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/cucumber.png new file mode 100644 index 0000000000000000000000000000000000000000..6dd74778e8d76e29a269fdd0155084292504ef61 Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/cucumber.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/food.jpg b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/food.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2968f0931aff53b820e9713bd07131c5f66cf5c8 Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/food.jpg differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_bottom_eatingTime.svg b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_bottom_eatingTime.svg new file mode 100644 index 0000000000000000000000000000000000000000..904fdd60d69e4e92c57cc7417e107f6e9d35de2d --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_bottom_eatingTime.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_bottom_home.svg b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_bottom_home.svg new file mode 100644 index 0000000000000000000000000000000000000000..c74324a979a1b8ab7237ca210338a679d91db169 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_bottom_home.svg @@ -0,0 +1 @@ + Public/ic_public_home_filled \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_bottom_record.svg b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_bottom_record.svg new file mode 100644 index 0000000000000000000000000000000000000000..b3041818d9f2c6b1d9a830d71c41b78e44e3a8b3 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_bottom_record.svg @@ -0,0 +1 @@ + Public/ic_public_notes_filled \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_public_delete.svg b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_public_delete.svg new file mode 100644 index 0000000000000000000000000000000000000000..5e69d92bec10119023e8d891648ecce85d6507be --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_public_delete.svg @@ -0,0 +1,31 @@ + + + Public/ic_public_delete + + + + + + + + + + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_public_face.svg b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_public_face.svg new file mode 100644 index 0000000000000000000000000000000000000000..8ac0eaed1450bb4c7d4a728593ab80d70e2e0725 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_public_face.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_face + + + + + + + + + + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_public_history.svg b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_public_history.svg new file mode 100644 index 0000000000000000000000000000000000000000..4459ffc3bb1353640ddd0a90194e87181c834380 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_public_history.svg @@ -0,0 +1,13 @@ + + + Public/ic_public_history + + + + + + + + + + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_statusbar_alarm.svg b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_statusbar_alarm.svg new file mode 100644 index 0000000000000000000000000000000000000000..904fdd60d69e4e92c57cc7417e107f6e9d35de2d --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_statusbar_alarm.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_switch.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_switch.png new file mode 100644 index 0000000000000000000000000000000000000000..51aa0fc19aeb19ee0599d09f9802fd1f344818ec Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/ic_switch.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/icecream.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/icecream.png new file mode 100644 index 0000000000000000000000000000000000000000..13a867424f48674c3e95590ec9887d38cd00fbfd Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/icecream.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/icon.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/icon.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/kiwi.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/kiwi.png new file mode 100644 index 0000000000000000000000000000000000000000..f22fb4328a9850ddd526d165964096c1bb9778a7 Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/kiwi.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/logo.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..826c9813215ecaef36f1900b9ad37c93598181c2 Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/logo.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/mushroom.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/mushroom.png new file mode 100644 index 0000000000000000000000000000000000000000..3e984ee10df7a0ff4dae4558f17f2c6c7b89075f Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/mushroom.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/norecord.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/norecord.png new file mode 100644 index 0000000000000000000000000000000000000000..724b2e1a37f43c954e599e64d34e61e3826b8e5e Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/norecord.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/onion.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/onion.png new file mode 100644 index 0000000000000000000000000000000000000000..9c1c5a81c2ff9717df20fcec6a7a8e128b41f1ee Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/onion.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/pitaya.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/pitaya.png new file mode 100644 index 0000000000000000000000000000000000000000..2770b34deb402ab0639e861fb83e4c8a5865bf59 Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/pitaya.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/strawberry.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/strawberry.png new file mode 100644 index 0000000000000000000000000000000000000000..a8d239456cdac76fa31e919768151ed6e74cae44 Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/strawberry.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/tomato.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/tomato.png new file mode 100644 index 0000000000000000000000000000000000000000..93ad983d4862485684c34cfcf1632569a13ae5a1 Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/tomato.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/walnut.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/walnut.png new file mode 100644 index 0000000000000000000000000000000000000000..8187a4209586dae8522fb494386cc9d64aba95df Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/base/media/walnut.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/en_US/element/string.json b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..6eaa691b351ff0016058822635c44af9da2c1270 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,208 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "HealthDiet" + }, + { + "name": "healthy_diet", + "value": "Healthy Diet" + }, + { + "name": "logo_description", + "value": "Healthy life comes from a balanced diet" + }, + { + "name": "title_record", + "value": "Record" + }, + { + "name": "no_record_content", + "value": "No record, please return Home page to add." + }, + { + "name": "tab_bar_home", + "value": "Home" + }, + { + "name": "tab_bar_eatingTime", + "value": "EatingTime" + }, + { + "name": "tab_bar_record", + "value": "Records" + }, + { + "name": "category_all", + "value": "All" + }, + { + "name": "category_fruit", + "value": "Fruit" + }, + { + "name": "category_vegetable", + "value": "Vegetable" + }, + { + "name": "category_nut", + "value": "Nut" + }, + { + "name": "category_seafood", + "value": "Seafood" + }, + { + "name": "category_dessert", + "value": "Dessert" + }, + { + "name": "diet_record_calorie", + "value": "Calories" + }, + { + "name": "nutrition_element", + "value": "Nutrition Element" + }, + { + "name": "high_calorie", + "value": "High" + }, + { + "name": "medium_low_calories", + "value": "Medium-Low" + }, + { + "name": "low_calorie", + "value": "Low-Calories" + }, + { + "name": "low_calorie_food", + "value": "Low-Calories" + }, + { + "name": "high_calorie_food", + "value": "High-Calories" + }, + { + "name": "diet_record_fat", + "value": "Fat" + }, + { + "name": "diet_record_protein", + "value": "Protein" + }, + { + "name": "diet_record_vitaminC", + "value": "VitaminC" + }, + { + "name": "diet_record_carbohydrates", + "value": "Carbohydrates" + }, + { + "name": "title_food_detail", + "value": "Food Detail" + }, + { + "name": "button_food_detail_complete", + "value": "Complete" + }, + { + "name": "button_food_detail_record", + "value": "Record" + }, + { + "name": "title_food_list", + "value": "Food List" + }, + { + "name": "meal_time_breakfast", + "value": "Breakfast" + }, + { + "name": "meal_time_lunch", + "value": "Lunch" + }, + { + "name": "meal_time_dinner", + "value": "Dinner" + }, + { + "name": "meal_time_supper", + "value": "Supper" + }, + { + "name": "food_name_tomato", + "value": "Tomato" + }, + { + "name": "food_name_walnut", + "value": "Walnut" + }, + { + "name": "food_name_cucumber", + "value": "Cucumber" + }, + { + "name": "food_name_blueberry", + "value": "Blueberry" + }, + { + "name": "food_name_crab", + "value": "Crab" + }, + { + "name": "food_name_ice_cream", + "value": "IceCream" + }, + { + "name": "food_name_onion", + "value": "Onion" + }, + { + "name": "food_name_mushroom", + "value": "Mushroom" + }, + { + "name": "food_name_kiwi", + "value": "Kiwi" + }, + { + "name": "food_name_pitaya", + "value": "Pitaya" + }, + { + "name": "food_name_avocado", + "value": "Avocado" + }, + { + "name": "food_name_strawberry", + "value": "Strawberry" + }, + { + "name": "unit_weight", + "value": "per 100g" + }, + { + "name": "weight_with_gram_unit", + "value": "%s g" + }, + { + "name": "weight_with_milligram_unit", + "value": "%s mg" + }, + { + "name": "calorie_with_kcal_unit", + "value": "%s kcal" + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/rawfile/foodForPhone.jpg b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/rawfile/foodForPhone.jpg new file mode 100644 index 0000000000000000000000000000000000000000..efd1c1f81411adc2cdfe06a93af7c65e9be0c9db Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/rawfile/foodForPhone.jpg differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/rawfile/foodForTablet.jpg b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/rawfile/foodForTablet.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2968f0931aff53b820e9713bd07131c5f66cf5c8 Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/rawfile/foodForTablet.jpg differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/rawfile/logo.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/rawfile/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..826c9813215ecaef36f1900b9ad37c93598181c2 Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/rawfile/logo.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/zh_CN/element/string.json b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..fdc6f4419b8f7d9af7a5cfb3f7587f861b63d903 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,208 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "健康饮食" + }, + { + "name": "healthy_diet", + "value": "健康饮食" + }, + { + "name": "logo_description", + "value": "健康的生活来自均衡的饮食" + }, + { + "name": "title_record", + "value": "记录" + }, + { + "name": "no_record_content", + "value": "无记录,请返回首页添加." + }, + { + "name": "tab_bar_home", + "value": "主页" + }, + { + "name": "tab_bar_eatingTime", + "value": "用餐时间" + }, + { + "name": "tab_bar_record", + "value": "记录" + }, + { + "name": "category_all", + "value": "所有" + }, + { + "name": "category_fruit", + "value": "水果" + }, + { + "name": "category_vegetable", + "value": "蔬菜" + }, + { + "name": "category_nut", + "value": "坚果" + }, + { + "name": "category_seafood", + "value": "海鲜" + }, + { + "name": "category_dessert", + "value": "甜点" + }, + { + "name": "diet_record_calorie", + "value": "热量" + }, + { + "name": "nutrition_element", + "value": "营养元素" + }, + { + "name": "high_calorie", + "value": "高热量" + }, + { + "name": "medium_low_calories", + "value": "中低热量" + }, + { + "name": "low_calorie", + "value": "低热量" + }, + { + "name": "low_calorie_food", + "value": "低热量食物" + }, + { + "name": "high_calorie_food", + "value": "高热量食物" + }, + { + "name": "diet_record_fat", + "value": "脂肪" + }, + { + "name": "diet_record_protein", + "value": "蛋白质" + }, + { + "name": "diet_record_vitaminC", + "value": "维他命C" + }, + { + "name": "diet_record_carbohydrates", + "value": "碳水" + }, + { + "name": "title_food_detail", + "value": "食物详情" + }, + { + "name": "button_food_detail_complete", + "value": "完成" + }, + { + "name": "button_food_detail_record", + "value": "记录" + }, + { + "name": "title_food_list", + "value": "食物列表" + }, + { + "name": "meal_time_breakfast", + "value": "早餐" + }, + { + "name": "meal_time_lunch", + "value": "午餐" + }, + { + "name": "meal_time_dinner", + "value": "晚餐" + }, + { + "name": "meal_time_supper", + "value": "夜宵" + }, + { + "name": "food_name_tomato", + "value": "番茄" + }, + { + "name": "food_name_walnut", + "value": "核桃" + }, + { + "name": "food_name_cucumber", + "value": "黄瓜" + }, + { + "name": "food_name_blueberry", + "value": "蓝莓" + }, + { + "name": "food_name_crab", + "value": "螃蟹" + }, + { + "name": "food_name_ice_cream", + "value": "冰激凌" + }, + { + "name": "food_name_onion", + "value": "洋葱" + }, + { + "name": "food_name_mushroom", + "value": "蘑菇" + }, + { + "name": "food_name_kiwi", + "value": "猕猴桃" + }, + { + "name": "food_name_pitaya", + "value": "火龙果" + }, + { + "name": "food_name_avocado", + "value": "牛油果" + }, + { + "name": "food_name_strawberry", + "value": "草莓" + }, + { + "name": "unit_weight", + "value": "每100克" + }, + { + "name": "weight_with_gram_unit", + "value": "%s 克" + }, + { + "name": "weight_with_milligram_unit", + "value": "%s 毫克" + }, + { + "name": "calorie_with_kcal_unit", + "value": "%s 千卡" + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/config.json b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/config.json new file mode 100644 index 0000000000000000000000000000000000000000..587723a806dd8ab9d6d9f4300d6202db81594cb5 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/config.json @@ -0,0 +1,67 @@ +{ + "app": { + "bundleName": "com.example.healthdietapi8", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.healthdietapi8_test", + "name": ".entry_test", + "mainAbility": ".TestAbility", + "deviceType": [ + "phone", + "tablet" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry_test", + "moduleType": "feature", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "TestAbility", + "name": ".TestAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:TestAbility_desc", + "formsEnabled": false, + "label": "$string:TestAbility_label", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".TestAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/TestAbility/app.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/TestAbility/app.ets new file mode 100644 index 0000000000000000000000000000000000000000..b5cc21084a1d14cad575e2bf6c04299533290ebf --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/TestAbility/app.ets @@ -0,0 +1,21 @@ +import hilog from '@ohos.hilog'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../test/List.test' + +export default { + onCreate() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Application onCreate'); + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + }, + onDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'Application onDestroy'); + }, +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/TestAbility/pages/index.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/TestAbility/pages/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..64149c57788b7b362acb066fba8f64e0b571d283 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/TestAbility/pages/index.ets @@ -0,0 +1,36 @@ +import hilog from '@ohos.hilog'; + +@Entry +@Component +struct Index { + aboutToAppear() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); + } + + @State message: string = 'Hello World' + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .width('35%') + .height('5%') + .onClick(()=>{ + }) + } + .width('100%') + } + .height('100%') + } + } \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..e80942fff4a0b6bae5115f3743cb27f673867a61 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,80 @@ +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s itName', + '-s level', '-s testType', '-s size', '-s timeout', + '-s package', '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams += ' ' + key + ' ' + parameters[key] + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', + JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare'); + } + + onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') + { + cmd += ' -D' + } + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', + JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', + d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', + d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', + 'OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext'); + var context = abilityDelegator.getAppContext() + hilog.info(0x0000, 'testTag', 'getAppContext : %{public}s', + JSON.stringify(context) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +}; \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/test/Ability.test.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/test/Ability.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..460fe8c8c124c821c5451615acc8949f619dbc3f --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/test/Ability.test.ets @@ -0,0 +1,36 @@ +import hilog from '@ohos.hilog'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' + +export default function abilityTest() { + describe('ActsAbilityTest', function () { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(function () { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }) + beforeEach(function () { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }) + afterEach(function () { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }) + afterAll(function () { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }) + it('assertContain',0, function () { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let a = 'abc' + let b = 'b' + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b) + expect(a).assertEqual(a) + }) + }) +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/test/List.test.ets b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..d766fe249dfc3ada636f27e64d9b64451ce32c93 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/ets/test/List.test.ets @@ -0,0 +1,5 @@ +import abilityTest from './Ability.test' + +export default function testsuite() { + abilityTest() +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/resources/base/element/string.json b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..3ddc84b17681377c0656b3b5f306ff4c5e0c3e44 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/resources/base/media/icon.png b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/entry/src/ohosTest/resources/base/media/icon.png differ diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/hvigorfile.ts b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..69abc1cd8993964eeb2ff1f948832e8cf61b6a48 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { legacyAppTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/package-lock.json b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..70d1b4d327d20ab24f6fb6ead7159d2f671ecabb --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/package-lock.json @@ -0,0 +1,1098 @@ +{ + "name": "healthdietapi8", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@ohos/hos-sdkmanager-common": { + "version": "2.0.7", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hos-sdkmanager-common/-/@ohos/hos-sdkmanager-common-2.0.7.tgz", + "integrity": "sha512-1dbZlFPImIatThlZWds8sCe6VMKMWCNqOGhoRoEa8FJACKwlUrTybOjCi+MgR5X+vahQDLtDTvMJoZnfMMig6Q==", + "requires": { + "@ohos/sdkmanager-common": "^2.1.5" + } + }, + "@ohos/hvigor": { + "version": "1.3.1", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor/-/@ohos/hvigor-1.3.1.tgz", + "integrity": "sha512-YxIrzzKOPUrXgAe8isUG5q8CTRsP4TIF4Y4KrCeF+uLhMT2FMsd6LYkVj2X9Ib3+siZA+klIUv1Y+kKXMQ55tg==", + "requires": { + "@ohos/hvigor-base": "1.3.1", + "fs-extra": "10.0.1", + "interpret": "1.4.0", + "liftoff": "4.0.0", + "mute-stdout": "1.0.0", + "pretty-hrtime": "1.0.0", + "typescript": "4.7.4", + "v8flags": "3.2.0", + "yargs": "17.5.1" + } + }, + "@ohos/hvigor-base": { + "version": "1.3.1", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor-base/-/@ohos/hvigor-base-1.3.1.tgz", + "integrity": "sha512-0NBF9DGtrdG5YmEXPOgXokgd/ukIF7EDUqYSwYY0utwUJ08A1ukR+V+dcywrczu2erb80NCWbMyCeZOtrGNPMQ==", + "requires": { + "fs-extra": "10.0.1", + "iconv-lite": "0.6.3", + "json5": "2.2.0", + "lodash": "4.17.21", + "log4js": "6.4.1", + "once": "1.4.0", + "pretty-hrtime": "1.0.0" + } + }, + "@ohos/hvigor-ohos-plugin": { + "version": "1.3.1", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hvigor-ohos-plugin/-/@ohos/hvigor-ohos-plugin-1.3.1.tgz", + "integrity": "sha512-K6Nk2tXNMTJlNf1Ad6nV3+DIQ7iFhBibrelUfHHWqDVlfFUWMxUtpk1Nvs/5RgKIu6O+BJRWJURDgm7mUooAWA==", + "requires": { + "@ohos/hos-sdkmanager-common": "2.0.7", + "@ohos/hvigor-base": "1.3.1", + "@ohos/sdkmanager-common": "2.1.5", + "adm-zip": "0.5.9", + "ajv": "8.10.0", + "deasync": "0.1.28", + "execa": "5.1.1", + "fast-xml-parser": "4.0.3", + "fs-extra": "10.0.1", + "glob": "7.2.0", + "iconv-lite": "0.6.3", + "json5": "2.2.0", + "lodash": "4.17.21", + "pretty-hrtime": "1.0.3", + "resolve-package-path": "4.0.3" + }, + "dependencies": { + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==" + } + } + }, + "@ohos/hypium": { + "version": "1.0.3", + "resolved": "https://repo.harmonyos.com/npm/@ohos/hypium/-/@ohos/hypium-1.0.3.tgz", + "integrity": "sha512-QKh8ngJk1ySbAiKpSTLP5EJIbT8Oja1zV3zwgLD7U9+KX7w2gjNIk3qoP+d13CwpEfaSR3Lxt3exlQLwWSFx3g==" + }, + "@ohos/sdkmanager-common": { + "version": "2.1.5", + "resolved": "https://repo.harmonyos.com/npm/@ohos/sdkmanager-common/-/@ohos/sdkmanager-common-2.1.5.tgz", + "integrity": "sha512-Ka6DncGdEkZ5A9/8aR0oea/PL6yZtPudXTalAX+oXCLIGUxUu400TBcETFZ4fsIePbxmWyOSQW5T1VqUYYIdOg==", + "requires": { + "axios": "0.24.0", + "jszip": "^3.7.0" + } + }, + "adm-zip": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.9.tgz", + "integrity": "sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg==" + }, + "ajv": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", + "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==" + }, + "array-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==" + }, + "axios": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz", + "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", + "requires": { + "follow-redirects": "^1.14.4" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "requires": { + "fill-range": "^7.0.1" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "date-format": { + "version": "4.0.14", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", + "integrity": "sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==" + }, + "deasync": { + "version": "0.1.28", + "resolved": "https://registry.npmjs.org/deasync/-/deasync-0.1.28.tgz", + "integrity": "sha512-QqLF6inIDwiATrfROIyQtwOQxjZuek13WRYZ7donU5wJPLoP67MnYxA6QtqdvdBy2mMqv5m3UefBVdJjvevOYg==", + "requires": { + "bindings": "^1.5.0", + "node-addon-api": "^1.7.1" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-xml-parser": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.0.3.tgz", + "integrity": "sha512-xhQbg3a/EYNHwK0cxIG1nZmVkHX/0tWihamn5pU4Mhd9KEVE2ga8ZJiqEUgB2sApElvAATOdMTLjgqIpvYDUkQ==", + "requires": { + "strnum": "^1.0.5" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "findup-sync": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-5.0.0.tgz", + "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==", + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.3", + "micromatch": "^4.0.4", + "resolve-dir": "^1.0.1" + } + }, + "fined": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-2.0.0.tgz", + "integrity": "sha512-OFRzsL6ZMHz5s0JrsEr+TpdGNCtrVtnuG3x1yzGNiQHT0yaDnXAj8V/lWcpJVrnoDpcwXcASxAZYbuXda2Y82A==", + "requires": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^5.0.0", + "object.defaults": "^1.1.0", + "object.pick": "^1.3.0", + "parse-filepath": "^1.0.2" + } + }, + "flagged-respawn": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-2.0.0.tgz", + "integrity": "sha512-Gq/a6YCi8zexmGHMuJwahTGzXlAZAOsbCVKduWXC6TlLCjjFRlExMJc4GC2NYPYZ0r/brw9P7CpRgQmlPVeOoA==" + }, + "flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" + }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==" + }, + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==", + "requires": { + "for-in": "^1.0.1" + } + }, + "fs-extra": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", + "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" + }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==", + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "requires": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + } + }, + "is-core-module": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", + "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "requires": { + "has": "^1.0.3" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "requires": { + "is-unc-path": "^1.0.0" + } + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "requires": { + "unc-path-regex": "^0.1.2" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==" + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "requires": { + "minimist": "^1.2.5" + } + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } + }, + "jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "requires": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + }, + "lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "requires": { + "immediate": "~3.0.5" + } + }, + "liftoff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-4.0.0.tgz", + "integrity": "sha512-rMGwYF8q7g2XhG2ulBmmJgWv25qBsqRbDn5gH0+wnuyeFt7QBJlHJmtg5qEdn4pN6WVAUMgXnIxytMFRX9c1aA==", + "requires": { + "extend": "^3.0.2", + "findup-sync": "^5.0.0", + "fined": "^2.0.0", + "flagged-respawn": "^2.0.0", + "is-plain-object": "^5.0.0", + "object.map": "^1.0.1", + "rechoir": "^0.8.0", + "resolve": "^1.20.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "log4js": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.1.tgz", + "integrity": "sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==", + "requires": { + "date-format": "^4.0.3", + "debug": "^4.3.3", + "flatted": "^3.2.4", + "rfdc": "^1.3.0", + "streamroller": "^3.0.2" + } + }, + "make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "requires": { + "kind-of": "^6.0.2" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==" + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "mute-stdout": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.0.tgz", + "integrity": "sha512-MaSQenn0f9oxIjtCufclpV00MuYTiHaXPbdcfPIM+quMqoa8cXywjHHx4LhhIAZlXqPWMdcUpYviajfmHtHRJw==" + }, + "node-addon-api": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz", + "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==" + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "requires": { + "path-key": "^3.0.0" + } + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha512-c/K0mw/F11k4dEUBMW8naXUuBuhxRCfG7W+yFy8EcijU/rSmazOUd1XAEEe6bC0OuXY4HUKjTJv7xbxIMqdxrA==", + "requires": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha512-3+mAJu2PLfnSVGHwIWubpOFLscJANBKuB/6A4CxBstc4aqwQY0FWcsppuy4jU5GSB95yES5JHSI+33AWuS4k6w==", + "requires": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, + "parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==", + "requires": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg==", + "requires": { + "path-root-regex": "^0.1.0" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==" + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "pretty-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.0.tgz", + "integrity": "sha512-CU2l5CYUAptUYq/671ajexQfXuxJFwwg0n243Kdkx8bTjeenedsWgu8TGHPm03vLfNtk3aTXgySKPp3Usykudw==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rechoir": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", + "requires": { + "resolve": "^1.20.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, + "resolve": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==", + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, + "resolve-package-path": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/resolve-package-path/-/resolve-package-path-4.0.3.tgz", + "integrity": "sha512-SRpNAPW4kewOaNUt8VPqhJ0UMxawMwzJD8V7m1cJfdSTK9ieZwS6K7Dabsm4bmLFM96Z5Y/UznrpG5kt1im8yA==", + "requires": { + "path-root": "^0.1.1" + } + }, + "rfdc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "streamroller": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.1.3.tgz", + "integrity": "sha512-CphIJyFx2SALGHeINanjFRKQ4l7x2c+rXYJ4BMq0gd+ZK0gi4VT8b+eHe2wi58x4UayBAKx4xtHpXT/ea1cz8w==", + "requires": { + "date-format": "^4.0.14", + "debug": "^4.3.4", + "fs-extra": "^8.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + } + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + }, + "strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "typescript": { + "version": "4.7.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==" + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==" + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "v8flags": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yargs": { + "version": "17.5.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", + "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" + } + } +} diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/package.json b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e88b08327eab2ac5513cc657df26897643583ebf --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/HealthDietApi8/package.json @@ -0,0 +1,18 @@ +{ + "license":"ISC", + "devDependencies":{}, + "name":"healthdietapi8", + "ohos":{ + "org":"huawei", + "directoryLevel":"project", + "buildTool":"hvigor" + }, + "description":"example description", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/hypium":"1.0.3", + "@ohos/hvigor-ohos-plugin":"1.3.1", + "@ohos/hvigor":"1.3.1" + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/README.md b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/README.md new file mode 100644 index 0000000000000000000000000000000000000000..311621c95fa233841208a73ce9284ba651c7a253 --- /dev/null +++ b/2022_ArkUI_Bootcamp/2665070510@qq.com+HealthDietApi8/README.md @@ -0,0 +1,25 @@ +# HealthDietAPi8——健康饮食APP + +**该项目是基于学习华为官网HealthDiet项目,使用ArkTS语言开发的、使用ArkUI开发框架改进开发的健康饮食APP项目** + +#### 项目介绍 +- 项目名称:健康饮食 +- 编程语言:ArkTS +- 功能:可以查看App中已有食物的热量,并根据自己每顿的饮食记录每天摄入的热量。APP会将此记录下来,方便查看分析饮食健康状况。健康饮食APP还提供“用餐时间”的功能,方便用户清楚的看到自己每餐所花费的时间,从而督促自己养成细嚼慢咽的好习惯。 +- 开发版本:sdk api8、ArkTS语言、DevEco Studio 3.1.0.100 HarmonyOS +- 作者:万冬阳 +- 联系邮箱:2665070510@qq.com +- 联系电话:1807406680 + +#### 项目演示效果: +##### Previewer中的演示效果 +- ![](Resource/previewer演示.gif) + +##### 华为matepad11平板真机测试的演示效果 +![](Resource/华为matepad11平板真机测试.gif) + +#### 说明 +- 该项目在不同的对手机和平板两种设备的UI做了不同的处理。如上方的gif演示图中所示,在平板中的翻页时钟的大小和手机(previewer)中的大小是不同的,平板中的翻页时钟设计的更大,以使得在平板中的观看效果更好。而且对翻页时钟启动时的图片也针对不同设备做了适配,并且加入了一些动画。 + + +- 因为本人的真机平板最高只支持Api8,因此开发时就选择了HarmonyOS Api8的版本进行开发。