diff --git a/applications/Shopping/README.md b/applications/Shopping/README.md deleted file mode 100644 index 0824ebd49cca2dfbe4c4bca50919106bd6309fe2..0000000000000000000000000000000000000000 --- a/applications/Shopping/README.md +++ /dev/null @@ -1,25 +0,0 @@ -### How to build -1. Download OHOS-SDK -``` -cd /tools -KOALA_BZ=1 OPENLAB_USERNAME= OPENLAB_PASSWORD= npm run sdk1.2:download -``` - -2. Download command-line-tools -``` -cd /tools -KOALA_BZ=1 OPENLAB_USERNAME= OPENLAB_PASSWORD= npm run clt1.2:download -``` -3. Setup env -``` -export USE_KOALA_LIBARKTS=1 -export USE_KOALA_MEMO_PLUGIN=1 -export USE_KOALA_UI_PLUGIN=1 - -export DEVECO_SDK_HOME=/tools/ohos-tools/ohos-sdk1.2/ohos-sdk -``` - -4. Build application -``` -cd /applications/Shopping -npm run relaunch \ No newline at end of file diff --git a/applications/Shopping/app/entry/src/main/Page.ts b/applications/Shopping/app/entry/src/main/Page.ts new file mode 100644 index 0000000000000000000000000000000000000000..f06ed9b66fc9d13df843495d3f7a3be89e76ca03 --- /dev/null +++ b/applications/Shopping/app/entry/src/main/Page.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 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 { IndexGeneratedEntry } from "app/pages/index-entry" +import { registerRoutes } from "app/__router_initialization" + +export class ComExampleShoppingApplication extends IndexGeneratedEntry { + constructor() { + super() + registerRoutes() + } +} diff --git a/applications/Shopping/app/entry/src/main/ets/entry.ets b/applications/Shopping/app/entry/src/main/ets/entry.ets new file mode 100644 index 0000000000000000000000000000000000000000..382b0a0776109105e81b8910a2f5c556d0b42f0f --- /dev/null +++ b/applications/Shopping/app/entry/src/main/ets/entry.ets @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2025 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 { UserView, UserViewBuilder } from "@ohos.arkui" +import { Index } from "./pages/index-entry" + + +@memo +function RunEntry() { + Index() +} + +export class Entry extends UserView { + constructor() { + super() + } + getBuilder(): UserViewBuilder { + return RunEntry + } +} diff --git a/applications/Shopping/app/entry/src/main/ets/entryability/EntryAbility.ets b/applications/Shopping/app/entry/src/main/ets/entryability/EntryAbility.ets deleted file mode 100644 index 383b70a79a76ebd79404ef616d4879d0ea6bf1ec..0000000000000000000000000000000000000000 --- a/applications/Shopping/app/entry/src/main/ets/entryability/EntryAbility.ets +++ /dev/null @@ -1,31 +0,0 @@ -import UIAbility from '@ohos.app.ability.UIAbility'; -import AbilityConstant from '@ohos.app.ability.AbilityConstant'; -import Want from '@ohos.app.ability.Want'; -import window from '@ohos.window'; -import { BusinessError } from '@ohos.base'; -import hilog from '@ohos.hilog'; -import { MyCallback } from '../models/MyCallback'; - - -class EntryAbility extends UIAbility { - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { - hilog.info(0x0000, 'testTag', 'EntryAbility onCreate'); - } - - onWindowStageCreate(windowStage: window.WindowStage): void { - hilog.info(0x0000, 'testTag', 'EntryAbility onWindowStageCreate'); - try { - windowStage.loadContent('pages/Index', (err: BusinessError | null): void => { - hilog.info(0x0000, 'testTag', 'loadContent entering'); - MyCallback.runCasesOfCallback(); - if (err) { - hilog.info(0x0000, 'testTag', 'loadContent error'); - return; - } - hilog.info(0x0000, 'testTag', 'loadContent ok'); - }); - } catch (e: Error) { - hilog.info(0x0000, 'testTag', 'loadContent catch error:-----------' + e.message); - } - } -} \ No newline at end of file diff --git a/applications/Shopping/app/entry/src/main/ets/etsconfig.json b/applications/Shopping/app/entry/src/main/ets/etsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..74920713ba4ea3b1aa6040cc55ebba359f79c94c --- /dev/null +++ b/applications/Shopping/app/entry/src/main/ets/etsconfig.json @@ -0,0 +1,29 @@ +{ + "extends": "../../../../arkui/config/etsconfig-base.json", + "include": [ + "./**/*.ets" + ], + "compilerOptions": { + "types": [], + "baseUrl": ".", + "rootDirs": [ + "." + ], + "outDir": "../../build/ets-junk", + "plugins": [ + { + "transform": "@koalaui/ets-plugin/build/lib/src/ArkExpander.js", + "destination": "../../build/generated", + "arkui": "@ohos.arkui" + } + ], + "paths": { + "@ohos.*": [ + "../../../../arkui/types/@ohos.*" + ], + "@system.*": [ + "../../../../arkui/types/@system.*" + ] + } + } +} diff --git a/applications/Shopping/app/entry/src/main/ets/hello.ets b/applications/Shopping/app/entry/src/main/ets/hello.ets new file mode 100644 index 0000000000000000000000000000000000000000..98430d2dd834fd4a8b28a65c9bee3abb207a7ec8 --- /dev/null +++ b/applications/Shopping/app/entry/src/main/ets/hello.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2025 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 { Button, Column, ClickEvent } from "@ohos.arkui.component" + +@Component +struct Hello { + @State state: number = 1 + build() { + Column() { + Button("One").width(200).height(100) + Button("Two").width(200).height(100) + Button("Click! " + this.state).width(200).height(100) + .width(50) + .onClick((e?: ClickEvent) => { + this.state++ + console.log(">>> Set Button onClick! #" + this.state) + }) + ProvideExample() + console.log("Yay! #" + this.state) + } + } +} + +@Component +struct ProvideExample { + @Provide("name") x: string = "provided text" + + build() { + ConsumeExample() + } +} + + +@Component +struct ConsumeExample { + @Consume("name") x: string + + build() { + Button(this.x).width(200).height(100) + } +} diff --git a/applications/Shopping/app/entry/src/main/ets/models/MyCallback.ets b/applications/Shopping/app/entry/src/main/ets/models/MyCallback.ets deleted file mode 100644 index 1bf1b9d48d826244ac63fe97bdf281bd9279c93d..0000000000000000000000000000000000000000 --- a/applications/Shopping/app/entry/src/main/ets/models/MyCallback.ets +++ /dev/null @@ -1,40 +0,0 @@ -import { AsyncCallback, BusinessError, Callback, ErrorCallback } from '@ohos.base'; -import hilog from '@ohos.hilog'; - -const SYNTAX_ERROR_CODE: int = 1002; - -export class MyCallback { - static myCallback(callback: Callback): void { - hilog.info(0x0000, 'testTag', 'myCallback'); - callback('myCallback'); - } - - static myAsyncCallback(callback: AsyncCallback): void { - hilog.info(0x0000, 'testTag', 'myAsyncCallback'); - let error = new Error('Business Error', 'basicError2 message', undefined); - let be2: BusinessError = new BusinessError(SYNTAX_ERROR_CODE, error); - callback(be2, 'myAsyncCallback'); - } - - static myErrorCallback(callback: ErrorCallback>): void { - hilog.info(0x0000, 'testTag', 'myErrorCallback'); - let error = new Error('Business Error', 'myErrorCallback message', undefined); - let result: string = 'test'; - let be: BusinessError = new BusinessError(SYNTAX_ERROR_CODE, result, error); - callback(be); - } - - static runCasesOfCallback() { - MyCallback.myCallback((data: string) => { - hilog.info(0x0000, 'testTag', 'MyCallback' + data); - }) - MyCallback.myAsyncCallback((error: BusinessError | null, result: string | undefined) => { - if (error && result) { - hilog.info(0x0000, 'testTag', `myAsyncCallback, error: ${error?.message}, result:${result}`); - } - }) - MyCallback.myErrorCallback((error: BusinessError) => { - hilog.info(0x0000, 'testTag', `myAsyncCallback, error: ${error.message}`); - }) - } -} \ No newline at end of file diff --git a/applications/Shopping/app/entry/src/main/ets/pages/collect/collected.ets b/applications/Shopping/app/entry/src/main/ets/pages/collect/collected.ets index 2fd132794de0027ed06dc2fbe68346689a6ca0e3..35e63af50f7e5b2094a67ddacab80ee6832a3522 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/collect/collected.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/collect/collected.ets @@ -35,9 +35,9 @@ struct CollectedPage { //listener = mediaQuery.matchMediaSync('(orientation:landscape)') onPageShow() { - // const params = router.getParams() as SearchParam; // 获取传递过来的参数对象 - // this.width1 = params.num - // this.ratio = params.ratio + const params = router.getParams() as SearchParam; // 获取传递过来的参数对象 + this.width1 = params.num + this.ratio = params.ratio } aboutToAppear() { @@ -63,7 +63,7 @@ struct CollectedPage { .width(30 * this.ratio) .aspectRatio(1) .onClick((e?: ClickEvent) => { - //router.back() + router.back() }) Text("", { controller: new TextController() }) { Span('我的收藏') diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/User.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/User.ets index 1f74962acb5b3d3790bb2513a60ed84a6151d18b..0a12db80b7bd1e5636379c9f9ae13b2f07b679f6 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/User.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/User.ets @@ -20,7 +20,6 @@ import { Core2 } from './core2' import { SearchParam } from '../../model/routeModel' import { cacheId } from './utils' import { Padding, FlexDirection, Image, Scroll, Column, Row, Flex, FlexAlign, Text, ItemAlign, FontWeight, TextOverflow, TextOverflowOptions, BorderOptions, ImageFit, Margin, ClickEvent, Color, ForEach, HorizontalAlign, BarState } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' @Component export struct User { @@ -108,14 +107,14 @@ export struct User { .fontSize(10 * this.ratio) } .onClick((e?: ClickEvent) => { - // router.pushUrl({ - // url: item.uri, - // params: { - // num: this.num, - // ratio: this.ratio, - // message: 'undefined' - // } as SearchParam - // }) + router.pushUrl({ + url: item.uri, + params: { + num: this.num, + ratio: this.ratio, + message: 'undefined' + } as SearchParam + }) }) }, (item: RecordModel): string => cacheId(item)) } diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/boutique.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/boutique.ets index 83ed0b4bf9edd56da02c3ca735e517ac8b549db7..c89d565498f8f7da7d03b55c69c13536846250d4 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/boutique.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/boutique.ets @@ -17,7 +17,6 @@ import { BoutiqueModel } from '../../model/homeModel' import { boutiqueData } from '../../data/homeData' import { cacheId } from './utils' import { Image, Column, Flex, Text, Row, ImageFit, FlexDirection, HorizontalAlign, ForEach, FlexWrap } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' @Component export struct Boutique { diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/cart.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/cart.ets index 49422882da183bbde7de7a5d049f094c53481ffc..fe3c02a27ffd562477112fc516e20bad7a3d1e65 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/cart.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/cart.ets @@ -13,7 +13,6 @@ * limitations under the License. */ import { ImageFit, FlexDirection, Counter, Toggle, Image, Column, Flex, Row, Text, ItemAlign, FontWeight, HorizontalAlign, FlexAlign, Margin, ClickEvent, Color, BorderOptions, ToggleType } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' @Component export struct Cart { diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/core1.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/core1.ets index b6a8f78c17e505a605910783df3c2c4be730b233..7a6d9fe541250cedd1a38b4aab58b8ba07ff2367 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/core1.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/core1.ets @@ -17,7 +17,6 @@ import { CoreDataModel } from '../../model/homeModel' import { coreData } from '../../data/homeData' import { cacheId } from './utils' import { List, Image, Column, ForEach, ListItem, Grid, GridItem, Text, Margin, ImageFit, Axis } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' @Component export struct Core1 { @@ -35,11 +34,11 @@ export struct Core1 { ForEach(this.rows, (item2: Number) => { GridItem({}) { Column() { - Image(`${this.coreData[(item1.valueOf() * 2 + item2.valueOf()).toInt()].uri}`) + Image(`${this.coreData[item1.valueOf() * 2 + item2.valueOf()].uri}`) .width(40 * this.ratio) .aspectRatio(1) .objectFit(ImageFit.Contain) - Text(`${this.coreData[(item1.valueOf() * 2 + item2.valueOf()).toInt()].title}`) + Text(`${this.coreData[item1.valueOf() * 2 + item2.valueOf()].title}`) .fontSize(15 * this.ratio) .margin({ top: 5 } as Margin) } diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/core2.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/core2.ets index e8a34e0588491a4ab234508cc2b52e37df539c2b..96290c1b673c3107504a104cc3d2261b0d07ceb3 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/core2.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/core2.ets @@ -17,7 +17,6 @@ import { CoreDataModel } from '../../model/homeModel' import { coreData } from '../../data/homeData' import { cacheId } from './utils' import { List, Image, Column, ForEach, ListItem, GridItem, Text, ImageFit, Grid, Margin, Axis } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' @Component export struct Core2 { @@ -35,11 +34,11 @@ export struct Core2 { ForEach(this.rows, (item2: Number) => { GridItem({}) { Column() { - Image(`${this.coreData[(item1.valueOf() * 2 + item2.valueOf()).toInt()].uri}`) + Image(`${this.coreData[item1.valueOf() * 2 + item2.valueOf()].uri}`) .width(30 * this.ratio) .aspectRatio(1) .objectFit(ImageFit.Contain) - Text(`${this.coreData[(item1.valueOf() * 2 + item2.valueOf()).toInt()].title}`) + Text(`${this.coreData[item1.valueOf() * 2 + item2.valueOf()].title}`) .fontSize(15 * this.ratio) .margin({ top: 5 } as Margin) } diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/find.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/find.ets index 83cf0e08e4695e5bdeb374c5f31cd74d090255d9..22b17a47ad4f482480eb917b96dfcc8c61602785 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/find.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/find.ets @@ -18,7 +18,6 @@ import { findSearchTextData, findTitleTextData } from '../../data/homeData' import { ImageItem } from './imageItem' import { cacheId } from './utils' import { List, Image, Column, Flex, Divider, Swiper, ImageFit, ItemAlign, Text, ForEach, Color, ListItem, Row, Padding, FlexAlign, Margin, BorderOptions, Position } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' const items = new Array(1, 2, 3, 4, 5, 6, 7, 8, 9) diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/goodsList.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/goodsList.ets index 61f452da582622c6244a2e392ab0820de6de2610..75dcf49cecda37becb4ef658f2f765b12cd64d6f 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/goodsList.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/goodsList.ets @@ -17,7 +17,6 @@ import { ProductDataModel } from '../../model/homeModel' import { productData } from '../../data/homeData' import { cacheId } from './utils' import { LazyForEach, Image, IDataSource, DataChangeListener, GridItem, Column, Text, Row, Margin, BorderOptions, Padding, Grid, ImageFit, Color, HorizontalAlign } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' class GoodListSource implements IDataSource { totalCount(): number { @@ -115,7 +114,7 @@ export struct GoodsList { Column() { Grid({}, undefined) { LazyForEach(this.data, (item: Number, index: number): void => { - GGGItem({ data: this.productData[(item.valueOf() % 14).toInt()], ratio: this.ratio }) + GGGItem({ data: this.productData[item.valueOf() % 14], ratio: this.ratio }) }, (item: Number, index: number): string => cacheId(item.valueOf())) } .columnsTemplate('1fr 1fr') diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/imageItem.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/imageItem.ets index ba97c14140873bc2398cf3029e3c3d33ffcb73d5..fdcba2e2734be7ea06553c94e390504321684e9b 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/imageItem.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/imageItem.ets @@ -16,7 +16,6 @@ import { FindImgSrcModel, FindImgIntroModel, FindImgNameModel, FindIconSrcModel } from '../../model/homeModel' import { findImgSrcData, findImgIntroData, findImgNameData, findIconSrcData } from '../../data/homeData' import { Image, ImageFit, Margin, ClickEvent, Column, Row, Flex, FlexAlign, TextOverflowOptions, ItemAlign, TextOverflow, BorderOptions, Text } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' @Component export struct ImageItem { @@ -31,25 +30,25 @@ export struct ImageItem { build() { Column() { - Image(this.imgSrc[this.itemNum.toInt()].imgSrc) + Image(this.imgSrc[this.itemNum].imgSrc) .width('100%') .height('70%') .objectFit(ImageFit.Cover) .border({ radius: 10 * this.ratio } as BorderOptions) - Text(this.imgIntro[this.itemNum.toInt()].imgIntro) + Text(this.imgIntro[this.itemNum].imgIntro) .fontSize(15 * this.ratio) .maxLines(2) .textOverflow({ overflow: TextOverflow.Ellipsis } as TextOverflowOptions) .height('15%') Row() { Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - Image(this.iconSrc[this.itemNum.toInt()].iconSrc) + Image(this.iconSrc[this.itemNum].iconSrc) .width(20 * this.ratio) .aspectRatio(1) .objectFit(ImageFit.Contain) .border({ radius: 10 * this.ratio } as BorderOptions) .margin({ right: 5 } as Margin) - Text(this.imgName[this.itemNum.toInt()].imgName) + Text(this.imgName[this.itemNum].imgName) .fontSize(12 * this.ratio) .maxLines(1) .textOverflow({ overflow: TextOverflow.Ellipsis } as TextOverflowOptions) diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/informance.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/informance.ets index db2ec53297c2caba3f7199dd61ad1c54362e3792..d2e36834f42cef704cf4f103e89c9e92ffa544bc 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/informance.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/informance.ets @@ -16,7 +16,6 @@ import { InformationModel } from '../../model/homeModel' import { informationData } from '../../data/homeData' import { Button, ClickEvent, Column, Color, FlexAlign } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' @Component export struct Information { diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/main.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/main.ets index 86aeb35f3b8a9ec84a2cca276655f416dd7ede9d..195c08b27d4665d9d4984fe75630263633fb87b0 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/main.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/main.ets @@ -21,7 +21,6 @@ import { GoodsList } from './goodsList' import { cacheId } from './utils' import { BaseRouteParam, SearchParam } from '../../model/routeModel' import { Text, HorizontalAlign, Row, Margin, Tabs, BarState, List, Axis, FontWeight, ListItem, TabContent, Image, Color, ImageFit, FlexAlign, ItemAlign, Swiper, BorderOptions, Scroll, ForEach, TabsController, NavPathStack, Column, Flex, Stack, Padding, NavPathInfo, ClickEvent } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' @Component export struct MainPage { diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/other.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/other.ets index 95877f6afabe0cab37f876f1838d08543b798b5a..adc5223cdcce3d0c77458fc9b616aaade8142413 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/other.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/other.ets @@ -16,7 +16,6 @@ import { ShopCartItemDataModel } from '../../model/homeModel' import { shopCartItemData } from '../../data/homeData' import { Image, Flex, Row, Column, TextOptions, TextController, Span, Text,ImageFit, TextOverflowOptions, FlexAlign, Margin, ItemAlign, TextOverflow, Color, BorderOptions, HorizontalAlign, Padding } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' @Component export struct Other { @@ -26,11 +25,11 @@ export struct Other { build() { Column() { - Image(this.shopCartItem[this.item.toInt()].img) + Image(this.shopCartItem[this.item].img) .width('95%') .aspectRatio(0.8) .objectFit(ImageFit.Contain) - Text(this.shopCartItem[this.item.toInt()].title) + Text(this.shopCartItem[this.item].title) .fontSize(14 * this.ratio) .lineHeight(25 * this.ratio) .maxLines(2) diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/shopCart.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/shopCart.ets index 02ec75c580bdf674774b01674584e934bc6e8d0f..5c925260b40f19f01b20466f370431cd30e0c86b 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/shopCart.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/shopCart.ets @@ -17,7 +17,6 @@ import { Cart } from './cart' import { Other } from './other' import { cacheId } from './utils' import { Image, Scroll, Column, Flex, Text, FlexAlign, FontWeight, ItemAlign, Row, ForEach, BorderOptions, Color, ImageFit, Padding, Margin, VerticalAlign, BarState } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' @Component export struct ShopCart { diff --git a/applications/Shopping/app/entry/src/main/ets/pages/homePage/visitPage.ets b/applications/Shopping/app/entry/src/main/ets/pages/homePage/visitPage.ets index 973c595fd0bcc84338860fdb0ca6e90ac83d9ba7..169b3170570a7a0d68464814b4e9d49b29195f43 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/homePage/visitPage.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/homePage/visitPage.ets @@ -15,7 +15,6 @@ import { FindPage } from './find' import { Image, Column, Flex, Text, BorderOptions, ImageFit, ItemAlign, Tabs, TabContent, TabsController, FlexAlign, Padding, Margin } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' @Component export struct VisitPage { diff --git a/applications/Shopping/app/entry/src/main/ets/pages/Index.ets b/applications/Shopping/app/entry/src/main/ets/pages/index-entry.ets similarity index 86% rename from applications/Shopping/app/entry/src/main/ets/pages/Index.ets rename to applications/Shopping/app/entry/src/main/ets/pages/index-entry.ets index 3c0d64f9d51b718d00ae35b628d3fbd073716d84..0ace12253184541839f375e7fb90682cdf895735 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/Index.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/index-entry.ets @@ -24,8 +24,7 @@ import { SearchPage } from './search/searchPage' //import mediaquery from '@ohos.mediaquery'; import { SearchParam } from '../model/routeModel' import { cacheId } from './homePage/utils' -import { State, Provide } from '@ohos.arkui.stateManagement' -import { Stack, TabBarOptions,NavPathStack, Navigation, Tabs, Color, NavigationMode, BarPosition, TabContent, TabsController, ForEach, Padding, FlexDirection, Image, Scroll, Column, Row, Flex, FlexAlign, Text, ItemAlign, ImageFit, ClickEvent } from '@ohos.arkui.component' +import { Stack, TabBarOptions, PageTransitionEnter, PageTransitionExit, RouteType, NavPathStack, Navigation, Curve, Tabs, Color, NavigationMode, BarPosition, TabContent, TabsController, ForEach, Padding, FlexDirection, Image, Scroll, Column, Row, Flex, FlexAlign, Text, ItemAlign, ImageFit, ClickEvent } from '@ohos.arkui.component' @Builder @@ -133,15 +132,15 @@ struct Index { .margin({top:50, bottom: 50} as Padding) } - // @Builder - // pageTransition() { - // PageTransitionEnter({ duration: 0, curve: Curve.Linear, delay: 0 }) - // .onEnter((type: RouteType, progress: number) => { - // this.opacity1 = 1 - // }) - // PageTransitionExit({ duration: 0, curve: Curve.Linear, delay: 0 }) - // .onExit((type: RouteType, progress: number) => { - // this.opacity1 = 1 - // }) - // } + @Builder + pageTransition() { + PageTransitionEnter({ duration: 0, curve: Curve.Linear, delay: 0 }) + .onEnter((type: RouteType, progress: number) => { + this.opacity1 = 1 + }) + PageTransitionExit({ duration: 0, curve: Curve.Linear, delay: 0 }) + .onExit((type: RouteType, progress: number) => { + this.opacity1 = 1 + }) + } } diff --git a/applications/Shopping/app/entry/src/main/ets/pages/search/searchPage.ets b/applications/Shopping/app/entry/src/main/ets/pages/search/searchPage.ets index 3664b5c544ed67d19c895a1b1da3b75f4139520e..1cb2c6019e8ce30e70f37cfbe72593d27aedbee6 100644 --- a/applications/Shopping/app/entry/src/main/ets/pages/search/searchPage.ets +++ b/applications/Shopping/app/entry/src/main/ets/pages/search/searchPage.ets @@ -20,7 +20,6 @@ import { exampleData, searchData } from '../../data/searchData' import { BaseRouteParam, SearchParam } from '../../model/routeModel' import { cacheId } from '../homePage/utils' import { Image, Button, List, FontWeight, Stack, Alignment, FlexWrap, ForEach, Row, HorizontalAlign, Axis, Visibility, ListItem, ImageRepeat, SizeOptions, ItemAlign, ImageFit, Font, Color, EnterKeyType, Padding, BorderOptions, Text, NavDestination, Column, Flex, NavPathStack, TextInput, ClickEvent, FlexAlign, Margin } from '@ohos.arkui.component' -import { State } from '@ohos.arkui.stateManagement' @Entry @Component diff --git a/applications/Shopping/app/entry/src/main/module.json5 b/applications/Shopping/app/entry/src/main/module.json5 index d6cb71b1e1563d06efa68be83032b5f969f3ed99..7c6698c425bd7c8a02ea156796f79fd4fd1b3fc2 100644 --- a/applications/Shopping/app/entry/src/main/module.json5 +++ b/applications/Shopping/app/entry/src/main/module.json5 @@ -1,18 +1,3 @@ -/* - * Copyright (c) 2025 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. - */ - { "module": { "name": "entry", @@ -49,4 +34,4 @@ } ] } -} +} \ No newline at end of file diff --git a/applications/Shopping/app/entry/src/main/resources/base/element/color.json b/applications/Shopping/app/entry/src/main/resources/base/element/color.json index 6a20c650b149de9ea82d6ff44adc2cdf496056d0..3c712962da3c2751c2b9ddb53559afcbd2b54a02 100644 --- a/applications/Shopping/app/entry/src/main/resources/base/element/color.json +++ b/applications/Shopping/app/entry/src/main/resources/base/element/color.json @@ -3,10 +3,6 @@ { "name": "start_window_background", "value": "#FFFFFF" - }, - { - "name": "my_color", - "value": "#2e2e33" } ] } \ No newline at end of file diff --git a/applications/Shopping/app/entry/src/main/resources/base/element/float.json b/applications/Shopping/app/entry/src/main/resources/base/element/float.json new file mode 100644 index 0000000000000000000000000000000000000000..33ea22304f9b1485b5f22d811023701b5d4e35b6 --- /dev/null +++ b/applications/Shopping/app/entry/src/main/resources/base/element/float.json @@ -0,0 +1,8 @@ +{ + "float": [ + { + "name": "page_text_font_size", + "value": "50fp" + } + ] +} diff --git a/applications/Shopping/app/entry/src/main/resources/base/element/string.json b/applications/Shopping/app/entry/src/main/resources/base/element/string.json index d1c869602797ec927e55d7c7ca6e4633d8430acb..f94595515a99e0c828807e243494f57f09251930 100644 --- a/applications/Shopping/app/entry/src/main/resources/base/element/string.json +++ b/applications/Shopping/app/entry/src/main/resources/base/element/string.json @@ -11,10 +11,6 @@ { "name": "EntryAbility_label", "value": "label" - }, - { - "name": "my_text", - "value": "some_text" } ] } \ No newline at end of file diff --git a/applications/Shopping/app/entry/src/main/resources/base/media/background.png b/applications/Shopping/app/entry/src/main/resources/base/media/background.png index f939c9fa8cc8914832e602198745f592a0dfa34d..923f2b3f27e915d6871871deea0420eb45ce102f 100644 Binary files a/applications/Shopping/app/entry/src/main/resources/base/media/background.png and b/applications/Shopping/app/entry/src/main/resources/base/media/background.png differ diff --git a/applications/Shopping/app/entry/src/main/resources/base/media/foreground.png b/applications/Shopping/app/entry/src/main/resources/base/media/foreground.png index 4483ddad1f079e1089d685bd204ee1cfe1d01902..97014d3e10e5ff511409c378cd4255713aecd85f 100644 Binary files a/applications/Shopping/app/entry/src/main/resources/base/media/foreground.png and b/applications/Shopping/app/entry/src/main/resources/base/media/foreground.png differ diff --git a/applications/Shopping/app/entry/src/main/resources/dark/element/color.json b/applications/Shopping/app/entry/src/main/resources/dark/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..79b11c2747aec33e710fd3a7b2b3c94dd9965499 --- /dev/null +++ b/applications/Shopping/app/entry/src/main/resources/dark/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#000000" + } + ] +} \ No newline at end of file diff --git a/applications/Shopping/app/entry/src/main/resources/en_US/element/string.json b/applications/Shopping/app/entry/src/main/resources/en_US/element/string.json deleted file mode 100644 index f94595515a99e0c828807e243494f57f09251930..0000000000000000000000000000000000000000 --- a/applications/Shopping/app/entry/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "module description" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/applications/Shopping/app/entry/src/main/resources/zh_CN/element/string.json b/applications/Shopping/app/entry/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 597ecf95e61d7e30367c22fe2f8638008361b044..0000000000000000000000000000000000000000 --- a/applications/Shopping/app/entry/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "module_desc", - "value": "模块描述" - }, - { - "name": "EntryAbility_desc", - "value": "description" - }, - { - "name": "EntryAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/applications/Shopping/app/generated/signature/com.example.helloworld.p7b b/applications/Shopping/app/generated/signature/com.example.helloworld.p7b deleted file mode 100644 index c2aec6fcae9939f5346b5c48c83b02d37bc7f0e4..0000000000000000000000000000000000000000 Binary files a/applications/Shopping/app/generated/signature/com.example.helloworld.p7b and /dev/null differ diff --git a/applications/Shopping/app/generated/signature/com.example.helloworld.profile.json b/applications/Shopping/app/generated/signature/com.example.helloworld.profile.json deleted file mode 100644 index d52afbc79b542e5251eb6a2abf9ccdcff60ead18..0000000000000000000000000000000000000000 --- a/applications/Shopping/app/generated/signature/com.example.helloworld.profile.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version-name": "2.0.0", - "version-code": 2, - "app-distribution-type": "os_integration", - "uuid": "5027b99e-5f9e-465d-9508-a9e0134ffe18", - "validity": { - "not-before": 1594865258, - "not-after": 1689473258 - }, - "type": "release", - "bundle-info": { - "developer-id": "OpenHarmony", - "distribution-certificate": "-----BEGIN CERTIFICATE-----\nMIICMzCCAbegAwIBAgIEaOC/zDAMBggqhkjOPQQDAwUAMGMxCzAJBgNVBAYTAkNO\nMRQwEgYDVQQKEwtPcGVuSGFybW9ueTEZMBcGA1UECxMQT3Blbkhhcm1vbnkgVGVh\nbTEjMCEGA1UEAxMaT3Blbkhhcm1vbnkgQXBwbGljYXRpb24gQ0EwHhcNMjEwMjAy\nMTIxOTMxWhcNNDkxMjMxMTIxOTMxWjBoMQswCQYDVQQGEwJDTjEUMBIGA1UEChML\nT3Blbkhhcm1vbnkxGTAXBgNVBAsTEE9wZW5IYXJtb255IFRlYW0xKDAmBgNVBAMT\nH09wZW5IYXJtb255IEFwcGxpY2F0aW9uIFJlbGVhc2UwWTATBgcqhkjOPQIBBggq\nhkjOPQMBBwNCAATbYOCQQpW5fdkYHN45v0X3AHax12jPBdEDosFRIZ1eXmxOYzSG\nJwMfsHhUU90E8lI0TXYZnNmgM1sovubeQqATo1IwUDAfBgNVHSMEGDAWgBTbhrci\nFtULoUu33SV7ufEFfaItRzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0OBBYEFPtxruhl\ncRBQsJdwcZqLu9oNUVgaMAwGCCqGSM49BAMDBQADaAAwZQIxAJta0PQ2p4DIu/ps\nLMdLCDgQ5UH1l0B4PGhBlMgdi2zf8nk9spazEQI/0XNwpft8QAIwHSuA2WelVi/o\nzAlF08DnbJrOOtOnQq5wHOPlDYB4OtUzOYJk9scotrEnJxJzGsh/\n-----END CERTIFICATE-----\n", - "bundle-name": "com.example.helloworld", - "apl": "normal", - "app-feature": "hos_normal_app" - }, - "acls": { - "allowed-acls": [ - "" - ] - }, - "permissions": { - "restricted-permissions": [] - }, - "issuer": "pki_internal" -}