diff --git a/entry/src/main/ets/component/product/ProductContent.ets b/entry/src/main/ets/component/product/ProductContent.ets index bcdc5606d6873e7cb4075a3d4f6d3da7a03a4143..b2b11fd9212449da6eee84a91f48f4223b71fe56 100644 --- a/entry/src/main/ets/component/product/ProductContent.ets +++ b/entry/src/main/ets/component/product/ProductContent.ets @@ -26,17 +26,14 @@ interface ParamsType {} // [Start hm_router] @HMRouter({pageUrl: 'ProductContent'}) - // [Start page_url] @Component export struct ProductContent { // [StartExclude hm_router] - // [StartExclude page_url] // [StartExclude hm_router_get_current_param] @State product: ProductMsg = new ProductMsg(DetailConstants.COLOR_SELECT_NAME_LIST[0], DetailConstants.CAPACITY_SELECT_NAME_LIST[0], DetailConstants.PRODUCT_PRICE_NAMES[1]); // [EndExclude hm_router_get_current_param] - // [EndExclude page_url] // [EndExclude hm_router] @State param: ParamsType | null = null; @@ -44,7 +41,6 @@ export struct ProductContent { this.param = HMRouterMgr.getCurrentParam() as ParamsType; } // [StartExclude hm_router] - // [StartExclude page_url] // [StartExclude hm_router_get_current_param] build() { Column() { @@ -67,8 +63,6 @@ export struct ProductContent { } // [EndExclude hm_router] // [EndExclude hm_router_get_current_param] - // [EndExclude page_url] } // [End hm_router] -// [End page_url] // [End hm_router_get_current_param] \ No newline at end of file diff --git a/entry/src/main/ets/component/product/elements/ProductContent.ets b/entry/src/main/ets/component/product/elements/ProductContent.ets new file mode 100644 index 0000000000000000000000000000000000000000..33fcf6629cd3e91c564080ae3ee23e6187ab7be9 --- /dev/null +++ b/entry/src/main/ets/component/product/elements/ProductContent.ets @@ -0,0 +1,17 @@ +import { HMRouterMgr } from "@hadss/hmrouter"; +class ParamsType{ + +} +// [Start page_url] +@Component +export struct ProductContent { + // ... + @State param: ParamsType | null = null; + aboutToAppear(): void { + this.param = HMRouterMgr.getCurrentParam() as ParamsType; + } + // [StartExclude page_url] + build() {} + // [EndExclude page_url] +} +// [End page_url] diff --git a/entry/src/main/ets/lifecycle/ExitAppLifecycle.ets b/entry/src/main/ets/lifecycle/ExitAppLifecycle.ets index 42be9a6c871beac6468cdcd8ce74918a4b69974b..4c317a06da1fb79769e5772b8f98680d56fe064b 100644 --- a/entry/src/main/ets/lifecycle/ExitAppLifecycle.ets +++ b/entry/src/main/ets/lifecycle/ExitAppLifecycle.ets @@ -29,7 +29,7 @@ export class ExitAppLifecycle implements IHMLifecycle { if(time - this.lastTime > 1000) { this.lastTime = time; ctx.uiContext.getPromptAction().showToast({ - message: '再次返回退出应用', + message: 'Return to exit the application again.', duration: 1000 }); return true;