diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/.gitignore b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..91d237bb144c7fb1777e50271857ef0f593286fc --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/.gitignore @@ -0,0 +1,5 @@ +/node_modules +/local.properties +/.idea +**/build +/.hvigor \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/AppScope/app.json5 b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..36aa9a7959aa7a73b70cc28930fccda7199ba593 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/AppScope/app.json5 @@ -0,0 +1,11 @@ +{ + "app": { + "bundleName": "com.example.foodlist", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true + } +} diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/AppScope/resources/base/element/string.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..334e65cdb3d5ddc83d27f36528ffa6e56be85376 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "FoodList" + } + ] +} diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/AppScope/resources/base/media/app_icon.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/AppScope/resources/base/media/app_icon.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/build-profile.json5 b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d7b1117cdb34aab2983ac65026d9e8dcc91332d1 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/build-profile.json5 @@ -0,0 +1,27 @@ +{ + "app": { + "signingConfigs": [], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, + "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/13786079813_FoodCalculator/FoodList/entry/.gitignore b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5a6ba80fa3d9498a23ae8ae7d9518f8743fa8a96 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/.gitignore @@ -0,0 +1,4 @@ +/node_modules +/.preview +/build +/.cxx \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/build-profile.json5 b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f8f03407f77914b43168aeca6bb0929efd6700b4 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/build-profile.json5 @@ -0,0 +1,13 @@ +{ + "apiType": 'stageMode', + "buildOption": { + }, + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/hvigorfile.js b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/hvigorfile.js new file mode 100644 index 0000000000000000000000000000000000000000..d7720ee6a7aad5c617d1fd2f6fc8c87067bfa32c --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/hvigorfile.js @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/package-lock.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..15bc7145be1490029883067847743ea7134cf545 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "entry", + "version": "1.0.0", + "lockfileVersion": 1 +} diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/package.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c4e988f30f2ec9e3430a4d0c8f05e89fabbc2659 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/package.json @@ -0,0 +1,13 @@ +{ + "name": "entry", + "version": "1.0.0", + "ohos": { + "org": "huawei", + "buildTool": "hvigor", + "directoryLevel": "module" + }, + "description": "example description", + "repository": {}, + "license": "ISC", + "dependencies": {} +} diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Application/MyAbilityStage.ts b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Application/MyAbilityStage.ts new file mode 100644 index 0000000000000000000000000000000000000000..4bea34b35db86d55f1a555e4bfb97778968567d6 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Application/MyAbilityStage.ts @@ -0,0 +1,9 @@ +import hilog from '@ohos.hilog'; +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'AbilityStage onCreate'); + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Common/BreakpointSystem.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Common/BreakpointSystem.ets new file mode 100644 index 0000000000000000000000000000000000000000..5d61364398c287a7b51293fbfa2c8ed06b16f427 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/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/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Common/Constants.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Common/Constants.ets new file mode 100644 index 0000000000000000000000000000000000000000..fe044131faf7dc83055eaa9d9dd897d0096cf662 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Common/Constants.ets @@ -0,0 +1,2 @@ +export let APP_COLOR_ACTIVE: Color = 0xFFE032 +export let APP_COLOR_TEXT_BLACK: Color = 0x202020 \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Http/index.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Http/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..c2e66aab1c708a0f067a8658862b72bd02ce6aab --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Http/index.ets @@ -0,0 +1,40 @@ +import { mockFoods } from '../Mock/MockData' +import { CategoryId } from '../model/DataModels' + +// 获取分类 +export let getCategory = () => { + return [ + { + id: CategoryId.Fruit, + name: $r('app.string.category_fruit') + }, + { + id: CategoryId.Vegetable, + name: $r('app.string.category_vegetable') + }, + { + 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 let getFoods = () => { + return mockFoods +} + +// 获取食品详情 +export let getFoodInfo = (id) => { + return mockFoods.find((row) => { + return row.id === id + }) +} diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/MainAbility/MainAbility.ts b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..131d2dd061c9e71fd3c2422243a37fddf412edd3 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,51 @@ +import hilog from '@ohos.hilog'; +import Ability from '@ohos.application.Ability' +import Window from '@ohos.window' + +export default class MainAbility 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/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Mock/MockData.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Mock/MockData.ets new file mode 100644 index 0000000000000000000000000000000000000000..28633b68d992a4d2a42fd06f3722a31d30fb29f4 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Mock/MockData.ets @@ -0,0 +1,148 @@ +import { FoodInfo, CategoryId } 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 + } +] \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Model/DataModels.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Model/DataModels.ets new file mode 100644 index 0000000000000000000000000000000000000000..af0e872246faa9159a328ff90ad620a4b7922d74 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/Model/DataModels.ets @@ -0,0 +1,101 @@ +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: number | MealTimeId + + constructor(id) { + 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 + userId: number + foodId: number + categoryId: number + foodName: string | Resource + foodImage: Resource + mealTime: number | MealTime + weight: number + calories: number + protein: number + fat: number + carbohydrates: number + vitaminC: number + + constructor( + id: number, + userId: number, + foodId: number, + categoryId: number, + foodName: string | Resource, + foodImage: Resource, + mealTime: number | MealTime, + weight: number, + calories: number, + protein: number, + fat: number, + carbohydrates: number, + vitaminC: number + ) { + this.id = id + this.userId = userId + this.foodId = foodId + this.categoryId = categoryId + this.foodName = foodName + this.foodImage = foodImage + this.mealTime = mealTime + this.weight = weight + this.calories = calories + this.protein = protein + this.fat = fat + this.carbohydrates = carbohydrates + this.vitaminC = vitaminC + } +} diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/Dashboard/Dashboard.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/Dashboard/Dashboard.ets new file mode 100644 index 0000000000000000000000000000000000000000..f69b0ead5fe0091cee4a9a6673db82adfc033906 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/Dashboard/Dashboard.ets @@ -0,0 +1,393 @@ +import router from '@ohos.router' +import prompt from '@ohos.prompt' +import { BreakPointType } from '../../Common/BreakpointSystem' +import { MealTimeId, MealTime } from '../../Model/DataModels' +import { TargetChart } from '../components/TargetChart/TargetChart' +import { RecordChart } from '../components/RecordChart/RecordChart' +import { EmptyText } from '../components/EmptyText/EmptyText' + +@Entry +@Component +struct DashboardPage { + build() { + } +} + +@Component +export struct Dashboard { + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'md' + @StorageLink('recordData') @Watch('onRecordDataChange') recordData: any = [] + @StorageLink('selectUserIndex') @Watch('onSelectUserIndexChange') selectUserIndex: number = 0 + @State currentTabIndex: number = 0 //tab栏选中 + @State selectedDate: string = `${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDate()}` //选中的时间 + + // 统计数据 + @State total: number = 1800 + @State recordDataCaloriesTotal: number = 0 + @State breakfastTotal: number = 0 + @State lunchTotal: number = 0 + @State dinnerTotal: number = 0 + @State supperTotal: number = 0 + + // 高亮色 + private getTabBarColor(index: number) { + return this.currentTabIndex == index ? $r('app.color.tab_bar_select_color') : $r('app.color.tab_bar_normal_color') + } + + private onSelectUserIndexChange() { + this.onRecordDataChange() + } + + // 数据处理与统计 + private onRecordDataChange() { + this.recordDataCaloriesTotal = 0 + this.breakfastTotal = 0 + this.lunchTotal = 0 + this.dinnerTotal = 0 + this.supperTotal = 0 + + if (this.recordData.length > 0) { + this.recordData.forEach((row) => { + if (row.userId === this.selectUserIndex) { + if (row.mealTime === MealTimeId.Breakfast) { + this.breakfastTotal += row.calories + } else if (row.mealTime === MealTimeId.Lunch) { + this.lunchTotal += row.calories + } else if (row.mealTime === MealTimeId.Dinner) { + this.dinnerTotal += row.calories + } else if (row.mealTime === MealTimeId.Supper) { + this.supperTotal += row.calories + } + this.recordDataCaloriesTotal += row.calories + } + }) + } + } + + aboutToAppear() { + this.onRecordDataChange() + } + + // TabBar子项 + @Builder barItemBuilder(name: string | 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 + }) { + Text(name) + .margin(1) + .fontSize(14) + .fontColor(this.getTabBarColor(index)) + } + .width('100%') + .height('100%') + } + // 时间选择弹窗 + dialogController: CustomDialogController = new CustomDialogController({ + builder: CustomDialogExample({ + selectedDate: $selectedDate, + }), + autoCancel: true, + alignment: DialogAlignment.Bottom, + customStyle: true + }) + + build() { + Scroll(new Scroller()) { + Column() { + // 选择日期 + Flex({ + alignItems: ItemAlign.Center, + }) { + Text($r('app.string.date')) + .fontSize(14) + .padding({ + left: 10 + }) + Text(this.selectedDate) + .fontSize(14) + .onClick(() => { + this.dialogController.open() + }) + } + + + // 统计数据图表 + Column() { + //Text('统计图表:').fontSize(18).width('100%').padding(10) + // 图表 + Swiper(new SwiperController()) { + Row() { + TargetChart() + } + + Row() { + RecordChart() + } + } + .height(300) + .indicatorStyle({ bottom: 0, selectedColor: '#FEB319' }) + .autoPlay(false) + .loop(false) + .indicator(new BreakPointType({ + sm: true, + md: false, + lg: false + }).getValue(this.currentBreakpoint)) + .displayCount(new BreakPointType({ + sm: 1, + md: 2, + lg: 2 + }).getValue(this.currentBreakpoint)) + .disableSwipe(new BreakPointType({ + sm: false, + md: true, + lg: true + }).getValue(this.currentBreakpoint)) + }.width('100%').margin(10) + + // 统计数据卡片 + Column() { + Text($r('app.string.statistical_data')).fontSize(14).width('100%').padding(10) + GridRow({ + columns: new BreakPointType({ + sm: 2, + md: 3, + lg: 3 + }).getValue(this.currentBreakpoint) + }) { + GridCol() { + Column() { + Text(`${this.recordDataCaloriesTotal}`).fontSize(24).fontColor(Color.White).fontWeight(600) + Blank() + Text($r('app.string.card_text_01')).fontSize(14).fontColor(Color.White) + } + .padding(5) + .height(60) + .borderRadius(5) + .backgroundColor('#B5C7FA') + }.margin(5) + + GridCol() { + Column() { + Text(`${this.total - this.recordDataCaloriesTotal}`) + .fontSize(24) + .fontColor(Color.White) + .fontWeight(600) + Blank() + Text($r('app.string.card_text_02')).fontSize(14).fontColor(Color.White) + } + .padding(5) + .height(60) + .borderRadius(5) + .backgroundColor('#FEB319') + }.margin(5) + + GridCol() { + Column() { + Text(`${this.breakfastTotal}`).fontSize(24).fontColor(Color.White).fontWeight(600) + Blank() + Text($r('app.string.card_text_03')).fontSize(14).fontColor(Color.White) + } + .padding(5) + .height(60) + .borderRadius(5) + .backgroundColor('#FDB5CD') + }.margin(5) + + GridCol() { + Column() { + Text(`${this.lunchTotal}`).fontSize(24).fontColor(Color.White).fontWeight(600) + Blank() + Text($r('app.string.card_text_04')).fontSize(14).fontColor(Color.White) + } + .padding(5) + .height(60) + .borderRadius(5) + .backgroundColor('#A0E4CB') + }.margin(5) + + GridCol() { + Column() { + Text(`${this.dinnerTotal}`).fontSize(24).fontColor(Color.White).fontWeight(600) + Blank() + Text($r('app.string.card_text_05')).fontSize(14).fontColor(Color.White) + } + .padding(5) + .height(60) + .borderRadius(5) + .backgroundColor('#81C6E8') + }.margin(5) + + GridCol() { + Column() { + Text(`${this.supperTotal}`).fontSize(24).fontColor(Color.White).fontWeight(600) + Blank() + Text($r('app.string.card_text_06')).fontSize(14).fontColor(Color.White) + } + .padding(5) + .height(60) + .borderRadius(5) + .backgroundColor('#C689C6') + }.margin(5) + } + }.width('100%').margin(10) + + // 食物列表 + Column() { + Tabs({ barPosition: BarPosition.Start, controller: new TabsController() }) { + ForEach([MealTimeId.Breakfast, MealTimeId.Lunch, MealTimeId.Dinner, MealTimeId.Supper], (mealRow: number, index) => { + TabContent() { + if (this.recordData && this.recordData.length > 0 && this.recordData.find(row => row.userId === this.selectUserIndex && row.mealTime === mealRow)) { + List() { + ForEach(this.recordData, (row, index) => { + if (row.mealTime === mealRow && row.userId === this.selectUserIndex) { + ListItem() { + Flex({ + justifyContent: FlexAlign.SpaceBetween, + alignItems: ItemAlign.Center + }) { + Row() { + Image(row.foodImage) + .width(80) + .height(80) + .objectFit(ImageFit.Contain) + .sharedTransition('sharedImage' + row.foodId) + Text(row.foodName).fontSize(16) + } + + Text(`${row.calories}千卡`).fontSize(16) + } + .padding({ + right: 10 + }) + .margin({ + top: 5 + }) + } + .width('100%') + .onClick(() => { + router.push({ + url: 'pages/FoodDetail/FoodDetail', + params: { + id: row.foodId, + recordId: row.id, + edit: true, + }, + }) + }) + .gesture( + LongPressGesture() + .onAction(() => { + prompt.showDialog({ + message: '确认删除这条记录吗?', + buttons: [ + { + text: '确认删除', + color: '#e00', + } + ], + }) + .then(() => { + this.recordData.splice(index, 1) + }) + }) + ) + } + }) + } + .width('100%') + .height('100%') + .lanes(new BreakPointType({ + sm: 1, + md: 2, + lg: 2 + }).getValue(this.currentBreakpoint)) + } else { + EmptyText({ titleText: 'No data!' }) + } + + }.tabBar(this.barItemBuilder(new MealTime(mealRow).name, index)) + }) + } + .scrollable(false) + .barMode(BarMode.Fixed) + .barWidth('100%') + .barHeight(40) + .onChange((index: number) => { + this.currentTabIndex = index + }) + .width('100%') + } + .padding({ bottom: '56vp' }) + .width('100%') + .height(445) + .margin({ top: 5 }) + + } + } + } +} + +// 时间选择器 +@CustomDialog +struct CustomDialogExample { + controller: CustomDialogController + @Link selectedDate: string + private select: string + + aboutToAppear() { + this.select = this.selectedDate + } + + build() { + Column() { + Flex({ direction: FlexDirection.RowReverse }) { + Button('确认') + .padding(20) + .fontSize(16) + .onClick(() => { + this.controller.close() + this.selectedDate = this.select + }) + .backgroundColor(Color.White) + .fontColor('#FEB319') + } + + DatePicker({ + start: new Date('2000-1-1'), + end: new Date(), + selected: new Date(this.select) + }) + .height('30%') + .onChange((value: DatePickerResult) => { + let year: string = `${value.year}` + let month: string + let day: string + if (value.month + 1 > 10) { + month = `${value.month + 1}` + } else { + month = `0${value.month + 1}` + } + if (value.day > 10) { + day = `${value.day}` + } else { + day = `0${value.day}` + } + this.select = `${year}-${month}-${day}` + //console.info('选择时间改变 ' + this.select) + }) + } + .borderRadius({ + topLeft: 20, + topRight: 20, + }) + .width('100%') + .backgroundColor(Color.White) + } +} diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/FoodDetail/FoodDetail.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/FoodDetail/FoodDetail.ets new file mode 100644 index 0000000000000000000000000000000000000000..aede41d62f429bbb0bfbe8c0c0ae454dcff3ce02 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/FoodDetail/FoodDetail.ets @@ -0,0 +1,339 @@ +import router from '@ohos.router' +import prompt from '@ohos.prompt' +import { getFoodInfo } from '../../Http/index' +import { DietRecord } from '../../Model/DataModels'; + +@Entry +@Component +@Preview +struct FoodDetail { + @StorageProp('selectUserIndex') selectUserIndex: number = 0 + @StorageLink('recordData') recordData: any = [] + @State weight: number = 0 + @State foodMealTime: number = 0 + @State edit: boolean = false + private foodDetail + private foodId: number + private recordId: number + + aboutToAppear() { + if (router.getParams()) { + // 获取食物详情 + this.foodId = router.getParams()['id'] + this.foodDetail = getFoodInfo(this.foodId) + if (router.getParams()['edit'] && router.getParams()['recordId']) { + this.edit = true + this.recordId = router.getParams()['recordId'] + let recordData = this.recordData.find(row => row.id === this.recordId) + if (recordData) { + this.weight = recordData.weight + this.foodMealTime = recordData.mealTime + } + } + } + } + + build() { + Column() { + Navigation() { + }.height(60).backgroundColor('#FEB319') + + Stack() { + Column() { + Image(this.foodDetail.image) + .width('100%') + .height(250) + .objectFit(ImageFit.Contain) + .sharedTransition('sharedImage' + this.foodId, { duration: 600, curve: Curve.Linear, delay: 0 }) + + }.height(350).backgroundColor('#FEB319') + + + Column() { + Text(this.foodDetail.name).width('100%').fontSize(22).fontWeight(500) + Text() { + Span($r("app.string.nutrition_element")).fontSize(16) + Span(':').fontSize(16) + }.width('100%').margin({ top: 20 }) + + Flex() { + Row() { + Row() { + Text() { + Span($r("app.string.diet_record_protein")).fontSize(12) + Span(':').fontSize(12) + }.margin({ right: 10 }) + + Text() { + Span(`${this.foodDetail.protein}`).fontSize(12) + Span($r("app.string.weight_with_gram_unit")).fontSize(12) + } + }.layoutWeight(1) + + Row() { + Text() { + Span($r("app.string.diet_record_fat")).fontSize(12) + Span(':').fontSize(12) + }.margin({ right: 10 }) + + Text() { + Span(`${this.foodDetail.fat}`).fontSize(12) + Span($r("app.string.weight_with_gram_unit")).fontSize(12) + } + }.layoutWeight(1) + } + }.margin({ + top: 10, + left: 10 + }) + + Flex() { + Row() { + Row() { + Text() { + Span($r("app.string.diet_record_carbohydrates")).fontSize(12) + Span(':').fontSize(12) + }.margin({ right: 10 }) + + Text() { + Span(`${this.foodDetail.carbohydrates}`).fontSize(12) + Span($r("app.string.weight_with_gram_unit")).fontSize(12) + } + }.layoutWeight(1) + + Row() { + Text() { + Span($r("app.string.diet_record_vitaminC")).fontSize(12) + Span(':').fontSize(12) + }.margin({ right: 10 }) + + Text() { + Span(`${this.foodDetail.fat}`).fontSize(12) + Span($r("app.string.weight_with_milligram_unit")).fontSize(12) + } + }.layoutWeight(1) + } + }.margin({ + top: 10, + left: 10 + }) + + Flex() { + Text() { + Span($r("app.string.diet_record_calorie")).fontSize(16) + Span(': ').fontSize(16) + Span(`${this.foodDetail.calories}`).fontSize(16) + Span($r("app.string.calorie_with_kcal_unit")).fontSize(16) + } + }.margin({ + top: 10 + }) + + + Flex() { + Text() { + Span($r("app.string.meal_time")).fontSize(16) + Span(': ').fontSize(16) + }.margin({ right: 20 }) + + Row() { + SelectMealTime({ + selectIndex: $foodMealTime + }) + } + }.margin({ + top: 10 + }) + + Flex() { + Text() { + Span($r("app.string.intake")).fontSize(16) + Span(': ').fontSize(16) + }.margin({ right: 20 }) + + Counter() { + TextInput({ placeholder: '请输入摄入量', text: this.weight.toString() }) + .type(InputType.Number) + .textAlign(TextAlign.Center) + .backgroundColor(Color.White) + .width('100%') + .height('100%') + .borderRadius(0) + .style(TextInputStyle.Inline) + .onChange((value) => { + if (Number(value) < 0) { + prompt.showToast({ + message: '摄入量不能小于0!', + bottom: '50%' + }); + return false + } + this.weight = Number(value) || 0 + }) + .onSubmit(() => { + console.log(this.weight.toString()) + }) + } + .width(150) + .margin({ right: 20 }) + .onInc(() => { + this.weight++ + }) + .onDec(() => { + if (this.weight > 0) { + this.weight-- + } + }) + + Text($r("app.string.weight_with_gram_unit")).fontSize(16) + }.margin({ + top: 10 + }) + + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.End }) { + Text(`${this.foodDetail.calories * this.weight}`).fontSize(50) + Text($r("app.string.calorie_with_kcal_unit")).fontSize(14).margin({ bottom: 10 }) + }.margin({ + top: 10 + }) + + if (this.edit) { + // 编辑模式 + //this.recordData + Button('确认修改') + .width('100%') + .backgroundColor('#FEB319') + .margin({ + top: 10 + }) + .onClick(() => { + if (!this.weight) { + prompt.showToast({ + message: '请输入摄入量!', + bottom: '50%' + }); + return false + } + let recordData: any = AppStorage.Get('recordData') + recordData.forEach((row) => { + if (this.recordId === row.id) { + row.mealTime = this.foodMealTime + row.weight = this.weight + row.calories = this.weight * this.foodDetail.calories + row.protein = this.weight * this.foodDetail.protein + row.fat = this.weight * this.foodDetail.fat + row.carbohydrates = this.weight * this.foodDetail.carbohydrates + row.vitaminC = this.weight * this.foodDetail.vitaminC * 100 + } + }) + AppStorage.Set('recordData', []) + AppStorage.Set('recordData', recordData) + prompt.showToast({ + message: '操作成功!', + bottom: '50%' + }); + }) + } else { + // 添加模式 + Button('确认添加') + .width('100%') + .backgroundColor('#FEB319') + .margin({ + top: 10 + }) + .onClick(() => { + if (!this.weight) { + prompt.showToast({ + message: '请输入摄入量!', + bottom: '50%' + }); + return false + } + let recordData: any = AppStorage.Get('recordData') + if (recordData == undefined || recordData.length === 0) { + let tempData = new DietRecord( + 1, + this.selectUserIndex, + this.foodId, + this.foodDetail.categoryId, + this.foodDetail.name, + this.foodDetail.image, + this.foodMealTime, + this.weight, + this.weight * this.foodDetail.calories, + this.weight * this.foodDetail.protein, + this.weight * this.foodDetail.fat, + this.weight * this.foodDetail.carbohydrates, + this.weight * this.foodDetail.vitaminC * 100, + ) + recordData = [tempData] + } else { + let tempData = new DietRecord( + recordData.length + 1, + this.selectUserIndex, + this.foodId, + this.foodDetail.categoryId, + this.foodDetail.name, + this.foodDetail.image, + this.foodMealTime, + this.weight, + this.weight * this.foodDetail.calories, + this.weight * this.foodDetail.protein, + this.weight * this.foodDetail.fat, + this.weight * this.foodDetail.carbohydrates, + this.weight * this.foodDetail.vitaminC * 100, + ) + recordData.push(tempData) + } + AppStorage.SetOrCreate('recordData', recordData) + prompt.showToast({ + message: '操作成功!', + bottom: '50%' + }); + return false + }) + } + + } + .padding(20) + .margin({ top: 200 }) + .width('90%') + .height(400) + .borderRadius(20) + .backgroundColor(Color.White) + .shadow({ + radius: 20, + color: '#eeeeee', + offsetY: 15, + }) + } + .width('100%') + } + .width('100%') + .height('100%') + } +} + +@Component +struct SelectMealTime { + @Link selectIndex: number + private selectList = [ + { value: $r('app.string.meal_time_breakfast'), icon: $r("app.media.ic_breakfast") }, + { value: $r('app.string.meal_time_lunch'), icon: $r("app.media.ic_lunch") }, + { value: $r('app.string.meal_time_dinner'), icon: $r("app.media.ic_dinner") }, + { value: $r('app.string.meal_time_supper'), icon: $r("app.media.ic_supper") }, + ] + + build() { + Column() { + Select(this.selectList) + .selected(this.selectIndex) + .font({ size: 16, weight: 500 }) + .selectedOptionFont({ size: 16, weight: 500, }) + .optionFont({ size: 16, weight: 400 }) + .onSelect((index: number,) => { + this.selectIndex = index + }) + } + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/Foods/Foods.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/Foods/Foods.ets new file mode 100644 index 0000000000000000000000000000000000000000..347efeeb8ce62c65c66393c0f0e17d735024c559 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/Foods/Foods.ets @@ -0,0 +1,134 @@ +import router from '@ohos.router' +import { BreakPointType } from '../../Common/BreakpointSystem' +import { getCategory, getFoods } from '../../Http/index' +//import { FoodInfo, Category } from '../../Model/DataModels' + + +@Entry +@Component +struct FoodsPage { + build() { + } +} + +@Component +export struct Foods { + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'md' + @State selectTab: number = 0 + private categories + private mockFoods + private foodsList + + // 选中高亮 + private getTabActive = (index: number) => { + if (index === this.selectTab) { + return true + } else { + return false + } + } + + // 过滤出当前分类食品列表 + private getFoodsAndCategory = (categoryId: number) => { + this.foodsList = [] + this.mockFoods.forEach((row) => { + if (row.categoryId == categoryId) { + this.foodsList.push(row) + } + }) + } + + aboutToAppear() { + this.mockFoods = getFoods() + this.categories = getCategory() + this.selectTab = this.categories[0].id + this.getFoodsAndCategory(this.selectTab) + } + + build() { + Flex({ + justifyContent: FlexAlign.SpaceBetween + }) { + // 左 + Column() { + List() { + ForEach(this.categories, (row) => { + ListItem() { + Text(row.name) + .fontSize(16) + .fontWeight(this.getTabActive(row.id) ? 500 : 400) + .fontColor(this.getTabActive(row.id) ? $r('app.color.tab_bar_select_color') : undefined) + } + .width('100%') + .height(40) + .backgroundColor(this.getTabActive(row.id) ? Color.White : undefined) + .onClick(() => { + this.selectTab = row.id + this.getFoodsAndCategory(this.selectTab) + }) + }) + } + .backgroundColor('#f5f5f5') + .width('100%') + .height('100%') + } + .width(130) + .height('100%') + + // 右 + Column() { + List() { + ForEach(this.foodsList, (row) => { + ListItem() { + Flex({ + justifyContent: FlexAlign.SpaceBetween, + alignItems: ItemAlign.Center + }) { + Row() { + Image(row.image) + .width(80) + .height(80) + .objectFit(ImageFit.Contain) + .sharedTransition('sharedImage' + row.id) + + Text(row.name).fontSize(16) + } + + Text() { + Span(`${row.calories}`).fontSize(16) + Span($r("app.string.calorie_with_kcal_unit")).fontSize(16) + }.fontSize(16) + } + .padding({ + right: 10 + }) + .margin({ + top: 5 + }) + } + .width('100%') + .onClick(() => { + router.push({ + url: 'pages/FoodDetail/FoodDetail', + params: { + id: row.id, + }, + }) + }) + }) + } + .width('100%') + .height('100%') + .lanes(new BreakPointType({ + sm: 1, + md: 2, + lg: 2 + }).getValue(this.currentBreakpoint)) + } + .padding({ bottom: '56vp' }) + .width('100%') + .height('100%') + + }.height('100%') + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/Home/Home.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/Home/Home.ets new file mode 100644 index 0000000000000000000000000000000000000000..8f3c379f525ae13cf95329c1a0835c777f8ba271 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/Home/Home.ets @@ -0,0 +1,342 @@ +import router from '@ohos.router' +import camera from '@ohos.multimedia.camera'; +import audio from '@ohos.multimedia.audio'; +import { BreakPointType } from '../../Common/BreakpointSystem' +import { MealTimeId } from '../../Model/DataModels' +import { TargetChart } from '../components/TargetChart/TargetChart' +import { RecordChart } from '../components/RecordChart/RecordChart' + + +@Entry +@Component +struct HomePage { + build() { + + } +} + +@Component +export struct Home { + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'md' + @StorageLink('selectUserIndex') @Watch('onSelectUserIndexChange') selectUserIndex: number = 0 + @StorageLink('recordData') @Watch('onRecordDataChange') recordData: any = [] + @State breakfastTotal: number = 0 + @State breakfastFoods: any = [] + @State lunchTotal: number = 0 + @State lunchFoods: any = [] + @State dinnerTotal: number = 0 + @State dinnerFoods: any = [] + @State supperTotal: number = 0 + @State supperFoods: any = [] + + // 数据处理与统计 + private onRecordDataChange() { + this.breakfastTotal = 0 + this.breakfastFoods = [] + this.lunchTotal = 0 + this.lunchFoods = [] + this.dinnerTotal = 0 + this.dinnerFoods = [] + this.supperTotal = 0 + this.supperFoods = [] + if (this.recordData.length > 0) { + this.recordData.forEach((row) => { + //console.log(`userId:${row.userId}-selectUserId${this.selectUserIndex}`) + if (row.userId === this.selectUserIndex) { + if (row.mealTime === MealTimeId.Breakfast) { + this.breakfastTotal += row.calories + let haveFood = this.breakfastFoods.find((item) => { + return item.foodId == row.foodId + }) + if (!haveFood) { + this.breakfastFoods.push({ + foodId: row.foodId, + foodName: row.foodName + }) + } + } else if (row.mealTime === MealTimeId.Lunch) { + this.lunchTotal += row.calories + let haveFood = this.lunchFoods.find((item) => { + return item.foodId == row.foodId + }) + if (!haveFood) { + this.lunchFoods.push({ + foodId: row.foodId, + foodName: row.foodName + }) + } + } else if (row.mealTime === MealTimeId.Dinner) { + this.dinnerTotal += row.calories + let haveFood = this.dinnerFoods.find((item) => { + return item.foodId == row.foodId + }) + if (!haveFood) { + this.dinnerFoods.push({ + foodId: row.foodId, + foodName: row.foodName + }) + } + } else if (row.mealTime === MealTimeId.Supper) { + this.supperTotal += row.calories + let haveFood = this.supperFoods.find((item) => { + return item.foodId == row.foodId + }) + if (!haveFood) { + this.supperFoods.push({ + foodId: row.foodId, + foodName: row.foodName + }) + } + } + } + }) + console.info(`早餐总摄入:${this.breakfastTotal}`) + console.info(`中餐总摄入:${this.lunchTotal}`) + console.info(`晚餐总摄入:${this.dinnerTotal}`) + console.info(`加餐总摄入:${this.supperTotal}`) + } + } + + private onSelectUserIndexChange() { + this.onRecordDataChange() + } + + aboutToAppear() { + this.onRecordDataChange() + } + + build() { + Scroll(new Scroller()) { + Column() { + // 搜索框 $r('app.string.serach_placeholder_text') + Search({ placeholder: '快速搜索食物(仅限英文名称)' }) + .margin({ + left: 20, + right: 20, + top: 5, + bottom: 5, + }) + .placeholderFont({ + size: 16 + }) + .textFont({ + size: 16 + }) + .onSubmit((value: string) => { + if (value && value.trim()) { + router.push({ + url: 'pages/Search/Search', + params: { + value: value.trim(), + }, + }) + } + }) + + // 快捷输入 + Row({ space: 5 }) { + Column() { + Image($r("app.media.ic_camera")).width(30).height(30).fillColor(Color.White) + Blank() + Text($r('app.string.camera_serach')).fontSize(16).fontColor(Color.White) + } + .padding(5) + .margin(5) + .height('100%') + .borderRadius(5) + .layoutWeight(1) + .backgroundColor('#B5C7FA') + .onClick(() => { + let context + camera.getCameraManager(context).then((cameraManager) => { + console.log('已经获取到相机实例'); + }) + }) + + Column() { + Image($r("app.media.ic_voice")).width(30).height(30).fillColor(Color.White) + Blank() + Text($r('app.string.voice_input')).fontSize(16).fontColor(Color.White) + } + .padding(5) + .margin(5) + .height('100%') + .borderRadius(5) + .layoutWeight(1) + .backgroundColor('#FEB319') + .onClick(() => { + var audioManager = audio.getAudioManager(); + console.log('已经获取到音频实例'); + }) + } + .height(70) + .margin({ top: 10, bottom: 10 }) + + // 图表 + Swiper(new SwiperController()) { + Row() { + TargetChart() + } + + Row() { + RecordChart() + } + } + .height(300) + .indicatorStyle({ bottom: 0, selectedColor: '#FEB319' }) + .autoPlay(false) + .loop(false) + .indicator(new BreakPointType({ + sm: true, + md: false, + lg: false + }).getValue(this.currentBreakpoint)) + .displayCount(new BreakPointType({ + sm: 1, + md: 2, + lg: 2 + }).getValue(this.currentBreakpoint)) + .disableSwipe(new BreakPointType({ + sm: false, + md: true, + lg: true + }).getValue(this.currentBreakpoint)) + + // 记录列表 + Flex({ wrap: FlexWrap.Wrap }) { + Row({ space: 10 }) { + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + Image($r("app.media.ic_breakfast")).width(30).height(30).fillColor(Color.White) + } + .width(50) + .height(50) + .backgroundColor('#FDB5CD') + .borderRadius(50) + + Column({ space: 5 }) { + Text($r("app.string.meal_time_breakfast")).width('100%').fontSize(16) + Flex({}) { + ForEach(this.breakfastFoods, (row, index) => { + Text(row.foodName).fontColor('#999999') + Text(',').fontColor('#999999') + }) + }.width('100%') + + }.width(100) + + Blank() + Text() { + Span(`${this.breakfastTotal}`).fontSize(16) + Span($r("app.string.calorie_with_kcal_unit")).fontSize(16) + }.fontSize(16) + } + .width(new BreakPointType({ + sm: '100%', + md: '50%', + lg: '50%' + }).getValue(this.currentBreakpoint)) + .padding(10) + + Row({ space: 10 }) { + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + Image($r("app.media.ic_lunch")).width(30).height(30).fillColor(Color.White) + } + .width(50) + .height(50) + .backgroundColor('#A0E4CB') + .borderRadius(50) + + Column({ space: 5 }) { + Text($r("app.string.meal_time_lunch")).width('100%').fontSize(16) + Flex({}) { + ForEach(this.lunchFoods, (row, index) => { + Text(row.foodName).fontColor('#999999') + Text(',').fontColor('#999999') + }) + }.width('100%') + }.width(100) + + Blank() + Text() { + Span(`${this.lunchTotal}`).fontSize(16) + Span($r("app.string.calorie_with_kcal_unit")).fontSize(16) + }.fontSize(16) + } + .width(new BreakPointType({ + sm: '100%', + md: '50%', + lg: '50%' + }).getValue(this.currentBreakpoint)) + .padding(10) + + Row({ space: 10 }) { + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + Image($r("app.media.ic_dinner")).width(30).height(30).fillColor(Color.White) + } + .width(50) + .height(50) + .backgroundColor('#81C6E8') + .borderRadius(50) + + Column({ space: 5 }) { + Text($r("app.string.meal_time_dinner")).width('100%').fontSize(16) + Flex({}) { + ForEach(this.dinnerFoods, (row, index) => { + Text(row.foodName).fontColor('#999999') + Text(',').fontColor('#999999') + }) + }.width('100%') + }.width(100) + + Blank() + Text() { + Span(`${this.dinnerTotal}`).fontSize(16) + Span($r("app.string.calorie_with_kcal_unit")).fontSize(16) + }.fontSize(16) + } + .width(new BreakPointType({ + sm: '100%', + md: '50%', + lg: '50%' + }).getValue(this.currentBreakpoint)) + .padding(10) + + Row({ space: 10 }) { + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + Image($r("app.media.ic_supper")).width(30).height(30).fillColor(Color.White) + } + .width(50) + .height(50) + .backgroundColor('#C689C6') + .borderRadius(50) + + Column({ space: 5 }) { + Text($r("app.string.meal_time_supper")).width('100%').fontSize(16) + Flex({}) { + ForEach(this.supperFoods, (row, index) => { + Text(row.foodName).fontColor('#999999') + Text(',').fontColor('#999999') + }) + }.width('100%') + }.width(100) + + Blank() + Text() { + Span(`${this.supperTotal}`).fontSize(16) + Span($r("app.string.calorie_with_kcal_unit")).fontSize(16) + }.fontSize(16) + } + .width(new BreakPointType({ + sm: '100%', + md: '50%', + lg: '50%' + }).getValue(this.currentBreakpoint)) + .padding(10) + }.width('100%') + } + .padding({ bottom: '56vp' }) + .width('100%') + } + } +} + diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/Search/Search.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/Search/Search.ets new file mode 100644 index 0000000000000000000000000000000000000000..90a9e4a3fb0f5ef0a5537a54acce8e596a32b876 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/Search/Search.ets @@ -0,0 +1,116 @@ +import router from '@ohos.router' +import { BreakPointType } from '../../Common/BreakpointSystem' +import { getFoods } from '../../Http/index' +import { EmptyText } from '../components/EmptyText/EmptyText' + + +@Entry +@Component +@Preview +struct SearchPage { + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'md' + @State foodsList: any[] = [] + private searchText: string = '' + private mockFoods + + + // 过滤出相同名称的食品列表 + private getFoodsAndName = (name: string) => { + this.foodsList = [] + this.mockFoods.forEach((row) => { + if (row.letter.includes(name)) { + this.foodsList.push(row) + } + }) + } + + aboutToAppear() { + this.mockFoods = getFoods() + if (router.getParams()) { + this.searchText = router.getParams()['value'] + this.getFoodsAndName(this.searchText) + } + } + + build() { + Column() { + // 搜索框 + Column() { + Navigation() { + }.height(60) + + Search({ value: this.searchText, placeholder: '快速搜索食物' }) + .margin({ + left: 20, + right: 20, + top: 5, + bottom: 5, + }) + .placeholderFont({ + size: 16 + }) + .textFont({ + size: 16 + }) + .onSubmit((value: string) => { + if (value && value.trim()) { + this.searchText = value + this.getFoodsAndName(this.searchText) + } + }) + }.margin({ top: 20, bottom: 20 }) + + // 搜索结果 + Column() + if (this.foodsList && this.foodsList.length > 0) { + List() { + ForEach(this.foodsList, (row) => { + ListItem() { + Flex({ + justifyContent: FlexAlign.SpaceBetween, + alignItems: ItemAlign.Center + }) { + Row() { + Image(row.image) + .width(80) + .height(80) + .objectFit(ImageFit.Contain) + .sharedTransition('sharedImage' + row.id) + Text(row.name).fontSize(16) + } + + Text(`${row.calories}千卡`).fontSize(16) + } + .padding({ + right: 10 + }) + .margin({ + top: 5 + }) + } + .width('100%') + .onClick(() => { + router.push({ + url: 'pages/FoodDetail/FoodDetail', + params: { + id: row.id, + }, + }) + }) + }) + } + .width('100%') + .height('100%') + .lanes(new BreakPointType({ + sm: 1, + md: 2, + lg: 2 + }).getValue(this.currentBreakpoint)) + } else { + EmptyText({ titleText: 'The food has not been found at present!' }) + } + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/components/EmptyText/EmptyText.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/components/EmptyText/EmptyText.ets new file mode 100644 index 0000000000000000000000000000000000000000..5967d70ada72f956905417a2eb09128e656c0c9d --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/components/EmptyText/EmptyText.ets @@ -0,0 +1,18 @@ +@Entry +@Component +struct EmptyTextPage { + build() { + } +} + +@Component +export struct EmptyText { + @Prop titleText: string + + build() { + Column() { + Image($r('app.media.norecord')).width(200).height(200).objectFit(ImageFit.Auto) + Text(this.titleText).fontSize(16).fontColor('#999999').width('100%').textAlign(TextAlign.Center) + } + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/components/PageHeader/PageHeader.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/components/PageHeader/PageHeader.ets new file mode 100644 index 0000000000000000000000000000000000000000..5f5b02cfb3b40078def67004b762c6686e716b13 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/components/PageHeader/PageHeader.ets @@ -0,0 +1,42 @@ +@Entry +@Component +struct PageHeaderPage { + build() { + + } +} + +@Component +export struct PageHeader { + build() { + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + SelectUser() + } + .width('100%') + .height(40) + } +} + +@Component +struct SelectUser { + @StorageLink('selectUserIndex') selectUserIndex: number = 0 + private selectList = [ + { value: $r('app.string.user_my'), icon: $r("app.media.ic_my") }, + { value: $r('app.string.user_baby'), icon: $r("app.media.ic_baby") }, + { value: $r('app.string.user_older'), icon: $r("app.media.ic_older") }, + ] + + build() { + Column() { + Select(this.selectList) + .selected(this.selectUserIndex) + .fontColor($r('app.color.tab_bar_normal_color')) + .font({ size: 16, weight: 500 }) + .selectedOptionFont({ size: 16, weight: 500, }) + .optionFont({ size: 16, weight: 400 }) + .onSelect((index: number, value: string) => { + this.selectUserIndex = index + }) + } + } +} diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/components/RecordChart/RecordChart.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/components/RecordChart/RecordChart.ets new file mode 100644 index 0000000000000000000000000000000000000000..ff5a23ab966a92e071716af72743812b311353d0 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/components/RecordChart/RecordChart.ets @@ -0,0 +1,121 @@ +import { MealTimeId } from '../../../Model/DataModels' + +@Entry +@Component +struct RecordChartPage { + build() { + + } +} + +// 今日目标图表 +@Component +export struct RecordChart { + @StorageLink('recordData') @Watch('onRecordDataChange') recordData: any = [] + @StorageLink('selectUserIndex') @Watch('onSelectUserIndexChange') selectUserIndex: number = 0 + @State total: number = 0 + @State breakfastTotal: number = 0 + @State lunchTotal: number = 0 + @State dinnerTotal: number = 0 + @State supperTotal: number = 0 + + private onRecordDataChange() { + this.total = 0 + this.breakfastTotal = 0 + this.lunchTotal = 0 + this.dinnerTotal = 0 + this.supperTotal = 0 + if (this.recordData.length > 0) { + this.recordData.forEach((row) => { + if (row.userId === this.selectUserIndex) { + if (row.mealTime === MealTimeId.Breakfast) { + this.breakfastTotal += row.calories + } else if (row.mealTime === MealTimeId.Lunch) { + this.lunchTotal += row.calories + } else if (row.mealTime === MealTimeId.Dinner) { + this.dinnerTotal += row.calories + } else if (row.mealTime === MealTimeId.Supper) { + this.supperTotal += row.calories + } + this.total += row.calories + } + }) + // console.info(`今日总摄入:${this.total}`) + // console.info(`早餐总摄入:${this.breakfastTotal}`) + // console.info(`中餐总摄入:${this.lunchTotal}`) + // console.info(`晚餐总摄入:${this.dinnerTotal}`) + // console.info(`加餐总摄入:${this.supperTotal}`) + } + } + + private onSelectUserIndexChange() { + this.onRecordDataChange() + } + + aboutToAppear() { + this.onRecordDataChange() + } + + build() { + Column({ space: 10 }) { + Text($r("app.string.record_chart_title")).fontSize(14).width('100%').padding(10) + Stack({ alignContent: Alignment.Bottom }) { + Column() { + ForEach(new Array(4), (item) => { + Divider() + .strokeWidth(1) + .color('#D8D8D8') + }) + } + .height('100%') + .justifyContent(FlexAlign.SpaceBetween) + + Column() { + Flex({ + direction: FlexDirection.Row, + justifyContent: FlexAlign.SpaceEvenly, + alignItems: ItemAlign.Start + }) { + Column() { + Column().width('20').height(`${this.breakfastTotal / this.total * 90}%`).backgroundColor('#FDB5CD') + Text($r("app.string.meal_time_breakfast")).fontSize(14) + .fontColor('#7E7E7E') + .margin({ top: 5 }) + } + .justifyContent(FlexAlign.End) + .height('100%') + + Column() { + Column().width('20').height(`${this.lunchTotal / this.total * 90}%`).backgroundColor('#A0E4CB') + Text($r("app.string.meal_time_lunch")).fontSize(14) + .fontColor('#7E7E7E') + .margin({ top: 5 }) + } + .justifyContent(FlexAlign.End) + .height('100%') + + Column() { + Column().width('20').height(`${this.dinnerTotal / this.total * 90}%`).backgroundColor('#81C6E8') + Text($r("app.string.meal_time_dinner")).fontSize(14) + .fontColor('#7E7E7E') + .margin({ top: 5 }) + } + .justifyContent(FlexAlign.End) + .height('100%') + + Column() { + Column().width('20').height(`${this.supperTotal / this.total * 90}%`).backgroundColor('#C689C6') + Text($r("app.string.meal_time_supper")).fontSize(14) + .fontColor('#7E7E7E') + .margin({ top: 5 }) + } + .justifyContent(FlexAlign.End) + .height('100%') + } + } + .width('100%') + .height(200) + }.height(180).margin({ bottom: 20 }) + } + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/components/TargetChart/TargetChart.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/components/TargetChart/TargetChart.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3d30a8dbe7e637e0158296df5f05e3833690639 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/components/TargetChart/TargetChart.ets @@ -0,0 +1,71 @@ +@Entry +@Component +struct TargetChartPage { + build() { + + } +} + +// 今日目标图表 +@Component +export struct TargetChart { + @StorageLink('recordData') @Watch('onRecordDataChange') recordData: any = [] + @StorageLink('selectUserIndex') @Watch('onSelectUserIndexChange') selectUserIndex: number = 0 + @State total: number = 1800 + @State recordDataCaloriesTotal: number = 0 + + private onRecordDataChange() { + // console.info('recordData-' + this.recordData) + this.recordDataCaloriesTotal = 0 + if (this.recordData.length > 0) { + this.recordData.forEach((row) => { + if (row.userId === this.selectUserIndex) { + this.recordDataCaloriesTotal += row.calories + } + }) + } + } + + private onSelectUserIndexChange() { + this.onRecordDataChange() + } + + aboutToAppear() { + this.onRecordDataChange() + } + + build() { + Column({ space: 10 }) { + Text($r("app.string.target_chart_title")).fontSize(14).width('100%').padding(10) + Stack() { + Progress({ value: this.recordDataCaloriesTotal / this.total * 100, type: ProgressType.Ring, }) + .color('#FEB319') + .backgroundColor('#999999') + .width(200) + .height(200) + .style({ strokeWidth: 10, scaleCount: 100, }) + Column({ space: 5 }) { + Text($r("app.string.remain")).fontSize(14).fontColor('#999999') + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.End }) { + Text(`${this.total - this.recordDataCaloriesTotal}`).fontSize(26).fontWeight(600).height(26) + Text($r("app.string.calorie_with_kcal_unit")).fontSize(14).height(16) + } + + Text() { + Span($r("app.string.have_taken_in")) + .fontSize(12) + .fontColor('#999999') + Span(`${this.recordDataCaloriesTotal}`) + .fontSize(12) + .fontColor('#999999') + Span($r("app.string.calorie_with_kcal_unit")) + .fontSize(12) + .fontColor('#999999') + } + .fontSize(12) + .fontColor('#999999') + } + } + } + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/index.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..f471a579198a08f5b87d68b42446d8a84a6a7e4c --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/ets/pages/index.ets @@ -0,0 +1,87 @@ +import { BreakpointSystem, BreakPointType } from '../Common/BreakpointSystem' +import { PageHeader } from './components/PageHeader/PageHeader' +import { Home } from './Home/Home' +import { Foods } from './Foods/Foods' +import { Dashboard } from './Dashboard/Dashboard' + + +@Entry +@Component +@Preview +struct Index { + @State currentTabIndex: number = 0 + @StorageProp('currentBreakpoint') currentBreakpoint: string = 'md' + private breakpointSystem: BreakpointSystem = new BreakpointSystem() + // 高亮色 + private getTabBarColor(index: number) { + return this.currentTabIndex == index ? $r('app.color.tab_bar_select_color') : $r('app.color.tab_bar_normal_color') + } + // TabBar子项 + @Builder bottomBarItemBuilder(name: string | 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(5) + .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() { + Column() { + PageHeader() + Home() + } + }.tabBar(this.bottomBarItemBuilder($r('app.string.tab_bar_home'), $r("app.media.ic_bottom_home"), 0)) + + TabContent() { + Column() { + PageHeader() + Foods() + } + }.tabBar(this.bottomBarItemBuilder($r('app.string.tab_bar_food'), $r("app.media.ic_bottom_food"), 1)) + + TabContent() { + Column() { + PageHeader() + Dashboard() + } + }.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: '80vp' }).getValue(this.currentBreakpoint)) + .barHeight(new BreakPointType({ sm: '56vp', md: '56vp', lg: '100%' }).getValue(this.currentBreakpoint)) + .scrollable(false) + .animationDuration(0) + .onChange((index: number) => { + this.currentTabIndex = index + }) + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/module.json5 b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..834457315c2982f2cd726f7278eed0d352e22d66 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/module.json5 @@ -0,0 +1,38 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "srcEntrance": "./ets/Application/MyAbilityStage.ts", + "description": "$string:entry_desc", + "mainElement": "MainAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:MainAbility_desc", + "icon": "$media:icon", + "label": "$string:MainAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:white", + "visible": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + }, +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/element/color.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..6ec917d7c84328dff5f1c93f0a808294f39951cd --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/element/color.json @@ -0,0 +1,16 @@ +{ + "color": [ + { + "name": "white", + "value": "#FFFFFF" + }, + { + "name": "tab_bar_select_color", + "value": "#FFC232" + }, + { + "name": "tab_bar_normal_color", + "value": "#202020" + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/element/string.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..c43461878da39efe2d5296529eed092d281dd587 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/element/string.json @@ -0,0 +1,92 @@ +{ + "string": [ + { + "name": "entry_desc", + "value": "description" + }, + { + "name": "MainAbility_desc", + "value": "description" + }, + { + "name": "MainAbility_label", + "value": "label" + }, + { + "name": "camera_serach", + "value": "camera_serach" + }, + { + "name": "voice_input", + "value": "voice_input" + }, + { + "name": "target_chart_title", + "value": "target_chart_title" + }, + { + "name": "record_chart_title", + "value": "record_chart_title" + }, + { + "name": "remain", + "value": "remain" + }, + { + "name": "have_taken_in", + "value": "have_taken_in" + }, + { + "name": "serach_placeholder_text", + "value": "serach_placeholder_text" + }, + { + "name": "meal_time", + "value": "meal_time" + }, + { + "name": "intake", + "value": "intake" + }, + { + "name": "serach_empty_text", + "value": "serach_empty_text" + }, + { + "name": "list_empty_text", + "value": "list_empty_text" + }, + { + "name": "date", + "value": "date" + }, + { + "name": "statistical_data", + "value": "statistical_data" + }, + { + "name": "card_text_01", + "value": "card_text_01" + }, + { + "name": "card_text_02", + "value": "card_text_02" + }, + { + "name": "card_text_03", + "value": "card_text_03" + }, + { + "name": "card_text_04", + "value": "card_text_04" + }, + { + "name": "card_text_05", + "value": "card_text_05" + }, + { + "name": "card_text_06", + "value": "card_text_06" + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/avocado.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/avocado.png new file mode 100644 index 0000000000000000000000000000000000000000..a2848b10707f0f4f1c6a661826d822e678b3cceb Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/avocado.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/back.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/back.png new file mode 100644 index 0000000000000000000000000000000000000000..2b0806c99ba80ca8bd23cf65f0b8eebf01dcb460 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/back.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/blueberry.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/blueberry.png new file mode 100644 index 0000000000000000000000000000000000000000..a07421e575d4d41e718ace47c16aaba8ac0755ac Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/blueberry.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/crab.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/crab.png new file mode 100644 index 0000000000000000000000000000000000000000..b71a627013711964e4d5d3b271e9311a2b525f65 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/crab.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/cucumber.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/cucumber.png new file mode 100644 index 0000000000000000000000000000000000000000..6dd74778e8d76e29a269fdd0155084292504ef61 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/cucumber.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_baby.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_baby.svg new file mode 100644 index 0000000000000000000000000000000000000000..685fbeb62af70182562da88c97b42ca5c8ebe713 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_baby.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_bottom_food.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_bottom_food.svg new file mode 100644 index 0000000000000000000000000000000000000000..d2f57928501db611cb743b5eebf7806129c49d3e --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_bottom_food.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_bottom_home.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_bottom_home.svg new file mode 100644 index 0000000000000000000000000000000000000000..e417c826e4769f21059cba2eabe2c76d4f2a06a3 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_bottom_home.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_bottom_record.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_bottom_record.svg new file mode 100644 index 0000000000000000000000000000000000000000..b3041818d9f2c6b1d9a830d71c41b78e44e3a8b3 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/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/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_breakfast.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_breakfast.svg new file mode 100644 index 0000000000000000000000000000000000000000..e852feabab05c79ea4c8174c471f9f305f30289c --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_breakfast.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_camera.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_camera.svg new file mode 100644 index 0000000000000000000000000000000000000000..7aef783f5a04d56a1772a26b2dacf0c81669a294 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_camera.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_dinner.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_dinner.svg new file mode 100644 index 0000000000000000000000000000000000000000..45acc51c316dd00309c09447af8fcc7313e09663 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_dinner.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_lunch.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_lunch.svg new file mode 100644 index 0000000000000000000000000000000000000000..d499cd51f81a7e996400124cee15e8dba30c2a5f --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_lunch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_my.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_my.svg new file mode 100644 index 0000000000000000000000000000000000000000..4a636656aefd6826441128f7c410bc1f3fedd74c --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_my.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_older.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_older.svg new file mode 100644 index 0000000000000000000000000000000000000000..d973abd7860548763a9e4d8674cd3e0c1930b01d --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_older.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_public_delete.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_public_delete.svg new file mode 100644 index 0000000000000000000000000000000000000000..5e69d92bec10119023e8d891648ecce85d6507be --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/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/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_stting.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_stting.svg new file mode 100644 index 0000000000000000000000000000000000000000..7857fceb6fc4872165d64ed7ff94aee9ab95d339 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_stting.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_supper.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_supper.svg new file mode 100644 index 0000000000000000000000000000000000000000..ab331297ffa416e3cec44c9b04fdfd491b396fb1 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_supper.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_switch.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/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/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_switch.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_triangle_bottom.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_triangle_bottom.svg new file mode 100644 index 0000000000000000000000000000000000000000..090621ae77fd6bce03c063c5ce449439abb209ff --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_triangle_bottom.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_voice.svg b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_voice.svg new file mode 100644 index 0000000000000000000000000000000000000000..ba3d585b5b0516e634b0d8d8251115becc5fa58b --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/ic_voice.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/icecream.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/icecream.png new file mode 100644 index 0000000000000000000000000000000000000000..13a867424f48674c3e95590ec9887d38cd00fbfd Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/icecream.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/icon.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/icon.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/kiwi.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/kiwi.png new file mode 100644 index 0000000000000000000000000000000000000000..f22fb4328a9850ddd526d165964096c1bb9778a7 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/kiwi.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/logo.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..826c9813215ecaef36f1900b9ad37c93598181c2 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/logo.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/mushroom.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/mushroom.png new file mode 100644 index 0000000000000000000000000000000000000000..3e984ee10df7a0ff4dae4558f17f2c6c7b89075f Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/mushroom.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/norecord.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/norecord.png new file mode 100644 index 0000000000000000000000000000000000000000..724b2e1a37f43c954e599e64d34e61e3826b8e5e Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/norecord.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/onion.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/onion.png new file mode 100644 index 0000000000000000000000000000000000000000..9c1c5a81c2ff9717df20fcec6a7a8e128b41f1ee Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/onion.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/pitaya.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/pitaya.png new file mode 100644 index 0000000000000000000000000000000000000000..2770b34deb402ab0639e861fb83e4c8a5865bf59 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/pitaya.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/strawberry.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/strawberry.png new file mode 100644 index 0000000000000000000000000000000000000000..a8d239456cdac76fa31e919768151ed6e74cae44 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/strawberry.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/tomato.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/tomato.png new file mode 100644 index 0000000000000000000000000000000000000000..93ad983d4862485684c34cfcf1632569a13ae5a1 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/tomato.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/walnut.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/walnut.png new file mode 100644 index 0000000000000000000000000000000000000000..8187a4209586dae8522fb494386cc9d64aba95df Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/media/walnut.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/profile/main_pages.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..615ce738f5bc22b71ead843341c22110eaf90b89 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,7 @@ +{ + "src": [ + "pages/index", + "pages/FoodDetail/FoodDetail", + "pages/Search/Search" + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/en_GB/element/string.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/en_GB/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..dbf51861116ed6eb1c407eda755e3fa051d951ad --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/en_GB/element/string.json @@ -0,0 +1,284 @@ +{ + "string": [ + { + "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_food", + "value": "Foods" + }, + { + "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" + }, + { + "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": "g" + }, + { + "name": "weight_with_milligram_unit", + "value": "mg" + }, + { + "name": "calorie_with_kcal_unit", + "value": "kcal" + }, + { + "name": "user_my", + "value": "Me" + }, + { + "name": "user_baby", + "value": "Baby" + }, + { + "name": "user_older", + "value": "Older" + }, + { + "name": "camera_serach", + "value": "Camera Serach" + }, + { + "name": "voice_input", + "value": "Voice Input" + }, + { + "name": "target_chart_title", + "value": "Total intake" + }, + { + "name": "record_chart_title", + "value": "Intake per meal" + }, + { + "name": "remain", + "value": "Remain" + }, + { + "name": "have_taken_in", + "value": "Have taken in" + }, + { + "name": "serach_placeholder_text", + "value": "Quick Food Search (English name only)" + }, + { + "name": "meal_time", + "value": "Meal Time" + }, + { + "name": "intake", + "value": "Intake" + }, + { + "name": "serach_empty_text", + "value": "The food has not been found at present!" + }, + { + "name": "list_empty_text", + "value": "no data!" + }, + { + "name": "date", + "value": "Date:" + }, + { + "name": "statistical_data", + "value": "Statistical Data" + }, + { + "name": "card_text_01", + "value": "Total intake (kcal)" + }, + { + "name": "card_text_02", + "value": "Remaining intake (kcal)" + }, + { + "name": "card_text_03", + "value": "Breakfast intake (kcal)" + }, + { + "name": "card_text_04", + "value": "Lunch intake (kcal)" + }, + { + "name": "card_text_05", + "value": "Dinner intake (kcal)" + }, + { + "name": "card_text_06", + "value": "Supper intake (kcal)" + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/zh_CN/element/string.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..bc62f21ba8efa24ca75076ff2718f665515ecfe0 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,284 @@ +{ + "string": [ + { + "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_food", + "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": "克" + }, + { + "name": "weight_with_milligram_unit", + "value": "毫克" + }, + { + "name": "calorie_with_kcal_unit", + "value": "千卡" + }, + { + "name": "user_my", + "value": "本人" + }, + { + "name": "user_baby", + "value": "宝宝" + }, + { + "name": "user_older", + "value": "老人" + }, + { + "name": "camera_serach", + "value": "拍照扫描" + }, + { + "name": "voice_input", + "value": "语音输入" + }, + { + "name": "target_chart_title", + "value": "总计摄入量" + }, + { + "name": "record_chart_title", + "value": "各餐摄入量" + }, + { + "name": "remain", + "value": "剩余" + }, + { + "name": "have_taken_in", + "value": "已摄入" + }, + { + "name": "serach_placeholder_text", + "value": "快速搜索食物(仅限英文名称)" + }, + { + "name": "meal_time", + "value": "餐次" + }, + { + "name": "intake", + "value": "摄入" + }, + { + "name": "serach_empty_text", + "value": "暂时未搜索到该食品!" + }, + { + "name": "list_empty_text", + "value": "暂无数据!" + }, + { + "name": "date", + "value": "日期:" + }, + { + "name": "statistical_data", + "value": "统计数据:" + }, + { + "name": "card_text_01", + "value": "总计摄入量(千卡)" + }, + { + "name": "card_text_02", + "value": "剩余摄入量(千卡)" + }, + { + "name": "card_text_03", + "value": "早餐摄入量(千卡)" + }, + { + "name": "card_text_04", + "value": "午餐摄入量(千卡)" + }, + { + "name": "card_text_05", + "value": "晚餐摄入量(千卡)" + }, + { + "name": "card_text_06", + "value": "夜宵摄入量(千卡)" + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/Application/TestAbilityStage.ts b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/Application/TestAbilityStage.ts new file mode 100644 index 0000000000000000000000000000000000000000..e68b50ad31acfcaa9b79f8d9dd3706297efdce51 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/Application/TestAbilityStage.ts @@ -0,0 +1,9 @@ +import hilog from '@ohos.hilog'; +import AbilityStage from "@ohos.application.AbilityStage" + +export default class TestAbilityStage extends AbilityStage { + onCreate() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbilityStage onCreate'); + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/TestAbility/TestAbility.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/TestAbility/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..b1a1a7717a0b74e464b0244323d4c3c465703acf --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/TestAbility/TestAbility.ets @@ -0,0 +1,59 @@ +import hilog from '@ohos.hilog'; +import Ability from '@ohos.application.Ability' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from '../test/List.test' +import Window from '@ohos.window' + +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + 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', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: Window.WindowStage) { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('TestAbility/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) ?? ''); + }); + + globalThis.abilityContext = this.context; + } + + onWindowStageDestroy() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/TestAbility/pages/index.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/TestAbility/pages/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..954dfe0e29874c9ef11a5ace1673f79e27999864 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/TestAbility/pages/index.ets @@ -0,0 +1,35 @@ +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/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..94579b9c1535bc11ee56ee53b48fc90a9977e33a --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,71 @@ +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 it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${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 '); + } + + async onRun() { + hilog.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -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.isLoggable(0x0000, 'testTag', hilog.LogLevel.INFO); + 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 end'); + } +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/test/Ability.test.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/test/Ability.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..460fe8c8c124c821c5451615acc8949f619dbc3f --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/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/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/test/List.test.ets b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/ets/test/List.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..d766fe249dfc3ada636f27e64d9b64451ce32c93 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/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/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/module.json5 b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..12ee37445568e17ac80024a39a3da9a283215e61 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/module.json5 @@ -0,0 +1,38 @@ +{ + "module": { + "name": "entry_test", + "type": "feature", + "srcEntrance": "./ets/Application/TestAbilityStage.ts", + "description": "$string:entry_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:white", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/resources/base/element/color.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..1bbc9aa9617e97c45440e1d3d66afc1154837012 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "white", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/resources/base/element/string.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..36d4230c53e9f5a07ae343ad8dc9808341975e3b --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_test_desc", + "value": "test ability description" + }, + { + "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/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/resources/base/media/icon.png b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/resources/base/media/icon.png differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/resources/base/profile/test_pages.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..fcef82b4dfc18e28106ff9ecd1c8b48ec74d18a4 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/index" + ] +} diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/hvigorfile.js b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/hvigorfile.js new file mode 100644 index 0000000000000000000000000000000000000000..5f2735e3deeaf655828407544bbed9365c258278 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/hvigorfile.js @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +module.exports = require('@ohos/hvigor-ohos-plugin').appTasks \ No newline at end of file diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/package-lock.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..3357744c4fe36969eb7ea9635f7955f51258507e --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/package-lock.json @@ -0,0 +1,1098 @@ +{ + "name": "foodlist", + "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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/adm-zip/-/adm-zip-0.5.9.tgz", + "integrity": "sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg==" + }, + "ajv": { + "version": "8.10.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==" + }, + "array-slice": { + "version": "1.1.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==" + }, + "axios": { + "version": "0.24.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/axios/-/axios-0.24.0.tgz", + "integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==", + "requires": { + "follow-redirects": "^1.14.4" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "core-util-is": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "date-format": { + "version": "4.0.14", + "resolved": "https://repo.huaweicloud.com/repository/npm/date-format/-/date-format-4.0.14.tgz", + "integrity": "sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==" + }, + "deasync": { + "version": "0.1.28", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, + "execa": { + "version": "5.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==", + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/flagged-respawn/-/flagged-respawn-2.0.0.tgz", + "integrity": "sha512-Gq/a6YCi8zexmGHMuJwahTGzXlAZAOsbCVKduWXC6TlLCjjFRlExMJc4GC2NYPYZ0r/brw9P7CpRgQmlPVeOoA==" + }, + "flatted": { + "version": "3.2.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" + }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==" + }, + "for-own": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://repo.huaweicloud.com/repository/npm/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" + }, + "glob": { + "version": "7.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" + }, + "has": { + "version": "1.0.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ini": { + "version": "1.3.8", + "resolved": "https://repo.huaweicloud.com/repository/npm/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + }, + "is-absolute": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" + }, + "is-relative": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, + "is-unc-path": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==" + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "json5": { + "version": "2.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + }, + "lie": { + "version": "3.3.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "requires": { + "immediate": "~3.0.5" + } + }, + "liftoff": { + "version": "4.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "log4js": { + "version": "6.4.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==" + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "mute-stdout": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/mute-stdout/-/mute-stdout-1.0.0.tgz", + "integrity": "sha512-MaSQenn0f9oxIjtCufclpV00MuYTiHaXPbdcfPIM+quMqoa8cXywjHHx4LhhIAZlXqPWMdcUpYviajfmHtHRJw==" + }, + "node-addon-api": { + "version": "1.7.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/node-addon-api/-/node-addon-api-1.7.2.tgz", + "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==" + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "pako": { + "version": "1.0.11", + "resolved": "https://repo.huaweicloud.com/repository/npm/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, + "parse-filepath": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ==" + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "pretty-hrtime": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/pretty-hrtime/-/pretty-hrtime-1.0.0.tgz", + "integrity": "sha512-CU2l5CYUAptUYq/671ajexQfXuxJFwwg0n243Kdkx8bTjeenedsWgu8TGHPm03vLfNtk3aTXgySKPp3Usykudw==" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/rfdc/-/rfdc-1.3.0.tgz", + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://repo.huaweicloud.com/repository/npm/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://repo.huaweicloud.com/repository/npm/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + }, + "streamroller": { + "version": "3.1.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + } + } + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + }, + "strnum": { + "version": "1.0.5", + "resolved": "https://repo.huaweicloud.com/repository/npm/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==" + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==" + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://repo.huaweicloud.com/repository/npm/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "v8flags": { + "version": "3.2.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://repo.huaweicloud.com/repository/npm/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yargs": { + "version": "17.5.1", + "resolved": "https://repo.huaweicloud.com/repository/npm/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://repo.huaweicloud.com/repository/npm/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" + } + } +} diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/package.json b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/package.json new file mode 100644 index 0000000000000000000000000000000000000000..07a7294146b2985b213f7e86d7e6edd1bbbbcf34 --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/FoodList/package.json @@ -0,0 +1,17 @@ +{ + "name": "foodlist", + "version": "1.0.0", + "ohos": { + "org": "huawei", + "buildTool": "hvigor", + "directoryLevel": "project" + }, + "description": "example description", + "repository": {}, + "license": "ISC", + "dependencies": { + "@ohos/hypium": "1.0.3", + "@ohos/hvigor": "1.3.1", + "@ohos/hvigor-ohos-plugin": "1.3.1" + } +} diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/README.md b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ae089452ffa7e99ef3379cbc1cbbf5a2c2cfb33b --- /dev/null +++ b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/README.md @@ -0,0 +1,153 @@ +# 计食器-FoodCalculator(饮食健康) + +## 一、项目环境 + +- 开发系统:windows10 +- 开发工具:DevEco Studio 3.1 Canary1 (3.1.0.100,) +- API9(以 api8 为主,但使用了少量 api9 的配置项) +- node v16.15.1 +- npm v8.13.2 +- 项目类型 openharmony + +## 二、项目运行 + +1. ### 以peges/index.ets为入口 开启预览器 +2. 注:本项目入口限 peges/index.ets + +## 三、功能介绍 + +1. ### **食品搜索功能**(\*创意功能) + +- 通过英文字符名称进行匹配搜索食品 +- 预留了拍照识别搜索、语言输入搜索入口卡片 +- 入口-首页搜索框/搜索页搜索框 + +!['食品搜索功能'](./doc/gif/1_serach_page.gif) + +2. ### **添加食品记录**(基本功能) + +- 通过选择摄入餐次和适配克数添加食品记录 +- 支持加减按钮输入和手动输入食品克数 +- 实时计算显示当前重量食品摄入热量值 +- 入口-食品详情页(新增) + +!['添加食品记录'](./doc/gif/2_save_page.gif) + +3. ### **修改食品记录**(基本功能) + +- 通过记录列表点击单个食品记录进入修改页 +- 功能同添加食品记录 +- 入口-食品详情页(编辑) + +!['修改食品记录'](./doc/gif/3_update_page.gif) + +4. ### **删除食品记录**(基本功能) + +- 通过记录列表长按单个食品记录显示删除弹窗 +- 删除弹窗确认即可删除取消则不删除 +- 入口-记录页食品记录列表(编辑) + +!['删除食品记录'](./doc/gif/4_delete_page.gif) + +5. ### **多用户切换记录**(\*创意功能) + +- 通过下拉菜单选择需要记录的用户 +- 目前支持本人/宝宝/老人 +- 不同用户记录数据相互隔离互不影响 +- 切换用户后所有页面数据实时更新 +- 入口-三个 tab 主页面顶部的下拉菜单 + +!['多用户切换记录'](./doc/gif/5_select_user_page.gif) + +6. ### **剩余摄入量环形图**(\*创意功能) + +- 通过环形图表实时显示已摄入量与目标摄入量占比 +- 暂时设置目标摄入量 1800 千卡 +- 入口-首页/记录页 + +!['剩余摄入量环形图'](./doc/gif/6_annular_page.gif) + +7. ### **各餐摄入量柱状图**(基础功能) + +- 通过柱状图表实时显示各餐已摄入量 +- 暂时设置目标摄入量 1800 千卡 +- 入口-首页/记录页 + +!['各餐摄入量柱状图'](./doc/gif/7_columnar_page.gif) + +8. ### **各餐摄入量列表**(基础功能) + +- 通过列表简约实时显示各餐摄入量及各食品 +- 入口-首页 + +!['各餐摄入量列表'](./doc/gif/8_meal_time_list_page.gif) + +9. ### **各餐摄入量卡片**(基础功能) + +- 通过列表实时显示各餐各食品摄入量 +- 入口-记录页 + +!['各餐摄入量卡片'](./doc/gif/9_meal_time_card_page.gif) + +10. ### **各餐摄入明细列表**(基础功能) + +- 通过列表实时显示各餐各食品摄入量 +- 入口-记录页 + + +!['各餐摄入明细列表'](./doc/gif/10_meal_time_tab_list_page.gif) + +11. ### **左右联动食品选择页**(\*创意功能) + +- 通过左右联动列表按类型显示各类食品 +- 入口-食品页 + +!['左右联动食品选择页'](./doc/gif/11_foods_page.gif) + +12. ### **全项目响应式设计**(基础功能) + +- 本项目首页页面兼容多尺寸设备 + +!['全项目响应式设计'](./doc/gif/12_flex_page.gif) + +13. ### **全项目多语言支持**(基础功能) + +- 本项目兼容中英文(在预览器中设置切换) + +!['全项目多语言支持'](./doc/gif/13_i18n_page.gif) + +## 四、项目结构 +1. ### **主要目录结构**(基础功能) +``` +src/main/ets + ├─Application + ├─Common 公共方法 + ├─Http 数据接口 + ├─MainAbility + ├─Mock 原始数据 + ├─Model 数据模型 + └─pages + ├─components + │ ├─EmptyText 空占位组件 + │ ├─PageHeader 头部组件 + │ ├─RecordChart 各餐摄入量柱状图表组件 + │ └─TargetChart 剩余摄入量环形图表组件 + ├─Dashboard 记录页 + ├─FoodDetail 食品详情 + ├─Foods 食品列表页 + ├─Home 主页 + └─Search 搜素页 +``` + +## 五、项目未来 +1. ### **AI** +- 通过AI物体识别帮助用户快速搜索到该食品 +- 通过AI分析识别多种类食品混食的热量 + +2. ### **物联网** +- 通过智能餐具、智能餐桌、智能摄像头,甚至是具有多维感知能力的智能餐厅场景配合软件实现自动记录摄入热量和营养。 +- 通过软件数据给智能冰箱、智能电饭煲、智能料理机提供个性化定制化烹饪方案。 + +3. ### **食品品牌合作** +- 通过与食品品牌合作,推出智能代餐或其他食品种类,通过生产的精确热量营养数据餐食配合软件实现饮食健康化、科学化、智能化。 +- 通过软件内设智选食品板块、推荐板块、为项目变现提供途径维持项目稳定发展。 diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/10_meal_time_tab_list_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/10_meal_time_tab_list_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..ad65a5e3948cea0d764c3f943fa19bf535431c7b Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/10_meal_time_tab_list_page.gif differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/11_foods_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/11_foods_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..01ad7bb619090bbacd2163885983ee644245349f Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/11_foods_page.gif differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/12_flex_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/12_flex_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..6339ff480e50d5d2f1cb22a5e664da6c2fa1f509 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/12_flex_page.gif differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/13_i18n_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/13_i18n_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..789fe104112dfaf9a5cbeb0c095aa7fcc8569673 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/13_i18n_page.gif differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/1_serach_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/1_serach_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..5401939b7f09011933463fb4af9754be70c9294b Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/1_serach_page.gif differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/2_save_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/2_save_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..22d9751a0e0af9dcbc7eaade3761d9eceaabba7f Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/2_save_page.gif differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/3_update_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/3_update_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..77bf9e406e009aa598d155534bd5713c80118b11 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/3_update_page.gif differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/4_delete_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/4_delete_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..2b993597cb0b362a18020a1ac61d826c7c81029e Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/4_delete_page.gif differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/5_select_user_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/5_select_user_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..157f35d166df57cc72663d16eb44c393d7bba0db Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/5_select_user_page.gif differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/6_annular_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/6_annular_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..aba1f4b68eb322b546c17c310dfb0c9b95af97dd Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/6_annular_page.gif differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/7_columnar_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/7_columnar_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..445d47b59db6ccd5b433f691741f5e99bb00c529 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/7_columnar_page.gif differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/8_meal_time_list_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/8_meal_time_list_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..dfcfa313b1fe4273fc434720e4c9d711036eca86 Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/8_meal_time_list_page.gif differ diff --git a/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/9_meal_time_card_page.gif b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/9_meal_time_card_page.gif new file mode 100644 index 0000000000000000000000000000000000000000..4a569edacd5bd5979ff6a801c8cc0c6acc952a7b Binary files /dev/null and b/2022_ArkUI_Bootcamp/13786079813_FoodCalculator/doc/gif/9_meal_time_card_page.gif differ