diff --git a/commons/base/src/main/ets/utils/PipWindowUtil.ets b/commons/base/src/main/ets/utils/PipWindowUtil.ets index 3783988ccf83a5ab00bed163314ede4aa826b75d..8271034f4c09830eeb3b71ae76c24c57437f48b1 100644 --- a/commons/base/src/main/ets/utils/PipWindowUtil.ets +++ b/commons/base/src/main/ets/utils/PipWindowUtil.ets @@ -46,80 +46,86 @@ export class PipWindowUtil { async startPip(navId: string, mXComponentController: XComponentController, context: Context, pageInfos: NavPathStack): Promise { - if (!PiPWindow.isPiPEnabled()) { - Logger.error(`picture in picture disabled for current OS`); - return; - } - let config: PiPWindow.PiPConfiguration = { - context: context, - componentController: mXComponentController, - // Navigation ID of the current page. - navigationId: navId, - templateType: PiPWindow.PiPTemplateType.VIDEO_LIVE - }; - // Create a pip controller. - let promise : Promise = PiPWindow.create(config); - await promise.then((controller: PiPWindow.PiPController) => { - this.pipController = controller; - // Initializing the pip controller. - this.initPipController(); - // Enabling the pip function through the startPip interface. - this.pipController.startPiP().then(() => { - Logger.info(`Succeeded in starting pip.`); - if (this.avPlayerUtil === undefined) { - return; - } - this.avPlayerUtil.play(); - pageInfos.pop(); + if (canIUse('SystemCapability.Window.SessionManager')) { + if (!PiPWindow.isPiPEnabled()) { + Logger.error(`picture in picture disabled for current OS`); + return; + } + let config: PiPWindow.PiPConfiguration = { + context: context, + componentController: mXComponentController, + // Navigation ID of the current page. + navigationId: navId, + templateType: PiPWindow.PiPTemplateType.VIDEO_LIVE + }; + // Create a pip controller. + let promise: Promise = PiPWindow.create(config); + await promise.then((controller: PiPWindow.PiPController) => { + this.pipController = controller; + // Initializing the pip controller. + this.initPipController(); + // Enabling the pip function through the startPip interface. + this.pipController.startPiP().then(() => { + Logger.info(`Succeeded in starting pip.`); + if (this.avPlayerUtil === undefined) { + return; + } + this.avPlayerUtil.play(); + pageInfos.pop(); + }).catch((err: BusinessError) => { + Logger.error(`Failed to start pip. Cause: ${err.code}, message: ${err.message}`); + }); }).catch((err: BusinessError) => { - Logger.error(`Failed to start pip. Cause: ${err.code}, message: ${err.message}`); + Logger.error(`Failed to create pip controller. Cause: ${err.code}, message: ${err.message}`); }); - }).catch((err: BusinessError) => { - Logger.error(`Failed to create pip controller. Cause: ${err.code}, message: ${err.message}`); - }); + } } initPipController(): void { if (!this.pipController) { return; } - this.pipController.on('stateChange', (state: PiPWindow.PiPState, reason: string) => { - this.onStateChange(state, reason); - }); - this.pipController.on('controlPanelActionEvent', (event: PiPWindow.PiPActionEventType) => { - this.onActionEvent(event); - }); + if (canIUse('SystemCapability.Window.SessionManager')) { + this.pipController.on('stateChange', (state: PiPWindow.PiPState, reason: string) => { + this.onStateChange(state, reason); + }); + this.pipController.on('controlPanelActionEvent', (event: PiPWindow.PiPActionEventType) => { + this.onActionEvent(event); + }); + } } onStateChange(state: PiPWindow.PiPState, reason: string): void { - let curState: string = ''; - switch(state) { - case PiPWindow.PiPState.ABOUT_TO_START: - curState = "ABOUT_TO_START"; - break; - case PiPWindow.PiPState.STARTED: - curState = "STARTED"; - this.isShowingPip = true; - break; - case PiPWindow.PiPState.ABOUT_TO_STOP: - curState = "ABOUT_TO_STOP"; - break; - case PiPWindow.PiPState.STOPPED: - curState = "STOPPED"; - this.isShowingPip = false; - break; - case PiPWindow.PiPState.ABOUT_TO_RESTORE: - curState = "ABOUT_TO_RESTORE"; - this.isShowingPip = false; - break; - case PiPWindow.PiPState.ERROR: - curState = "ERROR"; - this.isShowingPip = false; - break; - default: - break; + if (canIUse('SystemCapability.Window.SessionManager')) { + let curState: string = ''; + switch (state) { + case PiPWindow.PiPState.ABOUT_TO_START: + curState = 'ABOUT_TO_START'; + break; + case PiPWindow.PiPState.STARTED: + curState = 'STARTED'; + this.isShowingPip = true; + break; + case PiPWindow.PiPState.ABOUT_TO_STOP: + curState = 'ABOUT_TO_STOP'; + break; + case PiPWindow.PiPState.STOPPED: + curState = 'STOPPED'; + this.isShowingPip = false; + break; + case PiPWindow.PiPState.ABOUT_TO_RESTORE: + curState = 'ABOUT_TO_RESTORE'; + this.isShowingPip = false; + break; + case PiPWindow.PiPState.ERROR: + curState = 'ERROR'; + this.isShowingPip = false; + break; + default: + break; + } + Logger.info(`onStateChange: ${curState}, reason: ${reason}`); } - Logger.info(`onStateChange: ${curState}, reason: ${reason}`); } onActionEvent(event: PiPWindow.PiPActionEventType) { @@ -137,20 +143,22 @@ export class PipWindowUtil { // Disable the pip function by calling stopPip. async stopPip(): Promise { - if (this.pipController) { - let promise : Promise = this.pipController.stopPiP(); - promise.then(() => { - this.isShowingPip = false; - Logger.info(`Succeeded in stopping pip.`); - try { - this.pipController?.off('stateChange'); - this.pipController?.off('controlPanelActionEvent'); - } catch (exception) { - Logger.error('Failed to unregister callbacks. Code: ' + JSON.stringify(exception)); - } - }).catch((err: BusinessError) => { - Logger.error(`Failed to stop pip. Cause: ${err.code}, message: ${err.message}`); - }); + if (canIUse('SystemCapability.Window.SessionManager')) { + if (this.pipController) { + let promise: Promise = this.pipController.stopPiP(); + promise.then(() => { + this.isShowingPip = false; + Logger.info(`Succeeded in stopping pip.`); + try { + this.pipController?.off('stateChange'); + this.pipController?.off('controlPanelActionEvent'); + } catch (exception) { + Logger.error('Failed to unregister callbacks. Code: ' + JSON.stringify(exception)); + } + }).catch((err: BusinessError) => { + Logger.error(`Failed to stop pip. Cause: ${err.code}, message: ${err.message}`); + }); + } } } } \ No newline at end of file diff --git a/commons/base/src/main/ets/utils/WindowUtil.ets b/commons/base/src/main/ets/utils/WindowUtil.ets index 3d06f4357cb751bfb45859d7104f3ad6a25463c2..05342607f968af7bf717f5fa9ffc38a4863c9a9b 100644 --- a/commons/base/src/main/ets/utils/WindowUtil.ets +++ b/commons/base/src/main/ets/utils/WindowUtil.ets @@ -80,7 +80,7 @@ export class WindowUtil { AppStorage.setOrCreate('topRectHeight', px2vp(topHeight)); } - updateBreakpoint(windowWidth: number) :void{ + updateBreakpoint(windowWidth: number): void { let windowWidthVp = windowWidth / display.getDefaultDisplaySync().densityPixels; let curBp: string = ''; if (windowWidthVp < BreakpointConstants.BREAKPOINT_RANGES[1]) { @@ -94,10 +94,12 @@ export class WindowUtil { } updateWindowStatusType(windowStatusType: window.WindowStatusType): void { - let isSplitMode: boolean = false; - if (windowStatusType === window.WindowStatusType.SPLIT_SCREEN) { - isSplitMode = true; + if (canIUse('SystemCapability.Window.SessionManager')) { + let isSplitMode: boolean = false; + if (windowStatusType === window.WindowStatusType.SPLIT_SCREEN) { + isSplitMode = true; + } + AppStorage.setOrCreate('isSplitMode', isSplitMode); } - AppStorage.setOrCreate('isSplitMode', isSplitMode); } } \ No newline at end of file diff --git a/commons/base/src/main/resources/base/media/icon.png b/commons/base/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/commons/base/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/commons/base/src/main/resources/base/media/setting.jpeg b/commons/base/src/main/resources/base/media/setting.jpeg deleted file mode 100644 index 57e67dd49d39ad64ef090f59db3db9dfe6632106..0000000000000000000000000000000000000000 Binary files a/commons/base/src/main/resources/base/media/setting.jpeg and /dev/null differ diff --git a/features/detail/oh-package.json5 b/features/detail/oh-package.json5 index 3f7c872704b2782d4beac806e3086da69bbeaea8..58b87f060f6345648a04124b3f71d955f4851fe9 100644 --- a/features/detail/oh-package.json5 +++ b/features/detail/oh-package.json5 @@ -6,7 +6,6 @@ "description": "Please describe the basic information.", "main": "Index.ets", "version": "1.0.0", - "packageType": "InterfaceHar", "dynamicDependencies": {}, "dependencies": { "@ohos/commons": "file:../../commons/base", diff --git a/features/detail/src/main/ets/view/CommentInput.ets b/features/detail/src/main/ets/view/CommentInput.ets index 1bcd9f259549574e076b950ed0599fd964e3ccf1..a6e1e1ba2e6f3a1bee4c402aa35f68415c4f2873 100644 --- a/features/detail/src/main/ets/view/CommentInput.ets +++ b/features/detail/src/main/ets/view/CommentInput.ets @@ -20,7 +20,11 @@ import { LiveConstants } from '../constants/LiveConstants'; @Component export struct CommentInput { @Prop currentBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; - @Builder shopCarBuilder() {}; + + @Builder + shopCarBuilder() { + }; + @BuilderParam shopCarButton: () => void = this.shopCarBuilder; build() { @@ -39,14 +43,18 @@ export struct CommentInput { Image($r('app.media.icon_share')) .width(ResourceUtil.getCommonImgSize()[0]) .height(ResourceUtil.getCommonImgSize()[0]) - .margin({ right: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? - $r('app.float.comment_icon_margin_right_lg') : $r('app.float.comment_icon_margin_right_sm_md') }) + .margin({ + right: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? + $r('app.float.comment_icon_margin_right_lg') : $r('app.float.comment_icon_margin_right_sm_md') + }) Image($r('app.media.icon_like')) .width(ResourceUtil.getCommonImgSize()[0]) .height(ResourceUtil.getCommonImgSize()[0]) - .margin({ right: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? - $r('app.float.comment_icon_margin_right_lg') : $r('app.float.comment_icon_margin_right_sm_md') }) + .margin({ + right: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? + $r('app.float.comment_icon_margin_right_lg') : $r('app.float.comment_icon_margin_right_sm_md') + }) this.shopCarButton() } diff --git a/features/detail/src/main/ets/view/CommonView.ets b/features/detail/src/main/ets/view/CommonView.ets index 155889f36095b896786aac4922966c043bf685d5..e0cf50c8cb3c5415410b794bc5aebf91bdd81997 100644 --- a/features/detail/src/main/ets/view/CommonView.ets +++ b/features/detail/src/main/ets/view/CommonView.ets @@ -18,7 +18,7 @@ import { DetailConstants } from '../constants/DetailConstants'; @Component export struct ProductsConfigText { - private configText: string = ''; + public configText: string = ''; build() { Text(this.configText) @@ -51,7 +51,7 @@ export struct ConfigTipIcon { @Component export struct ConfigTipText { - private tipText: string = ''; + public tipText: string = ''; build() { Text(this.tipText) @@ -68,7 +68,7 @@ export struct UtilIcon { @StorageLink('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; @StorageLink('isShowingSidebar') isShowingSidebar: boolean = false; @Link isMoreDetail: boolean; - private iconImg: Resource = $r('app.media.tab_home'); + public iconImg: Resource = $r('app.media.tab_home'); build() { Row() { @@ -88,7 +88,7 @@ export struct UtilIcon { @Component export struct DetailTopIcon { - private imageResource: Resource = $r('app.media.ic_back'); + public imageResource: Resource = $r('app.media.ic_back'); build() { Image(this.imageResource) diff --git a/features/detail/src/main/ets/view/CustomerServiceView.ets b/features/detail/src/main/ets/view/CustomerServiceView.ets index c89a2d2501803c1ae7ce23a5f5d0900512e76688..735daf9177b2e3b090a3cb4fa7f0d97f03294d26 100644 --- a/features/detail/src/main/ets/view/CustomerServiceView.ets +++ b/features/detail/src/main/ets/view/CustomerServiceView.ets @@ -202,7 +202,7 @@ export struct CustomerServiceView { @Component struct NormalImage { - private imageResource: Resource = $r('app.media.ic_public_back'); + public imageResource: Resource = $r('app.media.ic_public_back'); build() { Image(this.imageResource) @@ -213,9 +213,9 @@ struct NormalImage { @Component struct MessageView { - private messageContent: string = ''; - private isReceiving: boolean = false; - private isSameSender: boolean = false; + public messageContent: string = ''; + public isReceiving: boolean = false; + public isSameSender: boolean = false; build() { Flex({ diff --git a/features/detail/src/main/ets/view/LiveHome.ets b/features/detail/src/main/ets/view/LiveHome.ets index f0b522a7650fe00fe9af495ad6e4fc01c4ed4d98..e7a71e79cb2e5989701d2edabc2b4bd60303b4cc 100644 --- a/features/detail/src/main/ets/view/LiveHome.ets +++ b/features/detail/src/main/ets/view/LiveHome.ets @@ -35,25 +35,31 @@ export struct LiveHome { @State utilCustomerService: boolean = false; @Consume('pageInfos') pageInfos: NavPathStack; private onFoldStatusChange: Callback = (data: display.FoldStatus) => { - if (data === display.FoldStatus.FOLD_STATUS_FOLDED && this.detailType === CommonConstants.BIND_SHEET_PAGE_TYPES[2]) - { - this.isMoreDetail = false; + if (canIUse('SystemCapability.Window.SessionManager')) { + if (data === display.FoldStatus.FOLD_STATUS_FOLDED && + this.detailType === CommonConstants.BIND_SHEET_PAGE_TYPES[2]) { + this.isMoreDetail = false; + } } }; aboutToAppear(): void { - try { - display.on('foldStatusChange', this.onFoldStatusChange); - } catch (exception) { - Logger.error('Failed to register the fold status callback. Code: ' + JSON.stringify(exception)); + if (canIUse('SystemCapability.Window.SessionManager')) { + try { + display.on('foldStatusChange', this.onFoldStatusChange); + } catch (exception) { + Logger.error('Failed to register the fold status callback. Code: ' + JSON.stringify(exception)); + } } } aboutToDisappear(): void { - try { - display.off('foldStatusChange'); - } catch (exception) { - Logger.error('Failed to unregister the fold status callback. Code: ' + JSON.stringify(exception)); + if (canIUse('SystemCapability.Window.SessionManager')) { + try { + display.off('foldStatusChange'); + } catch (exception) { + Logger.error('Failed to unregister the fold status callback. Code: ' + JSON.stringify(exception)); + } } } @@ -62,7 +68,9 @@ export struct LiveHome { Column() { ShopBag({ isMoreDetail: $isMoreDetail, - PayCardButton: (): void => { this.PayCardButton() } + PayCardButton: (): void => { + this.PayCardButton() + } }) .visibility(this.detailType === CommonConstants.BIND_SHEET_PAGE_TYPES[0] ? Visibility.Visible : Visibility.None) @@ -73,9 +81,11 @@ export struct LiveHome { }) .visibility(this.detailType === CommonConstants.BIND_SHEET_PAGE_TYPES[1] ? Visibility.Visible : Visibility.None) } - .padding({ top: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? (this.detailType === + .padding({ + top: this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM ? (this.detailType === CommonConstants.BIND_SHEET_PAGE_TYPES[0] ? $r('app.float.index_col_padding_top_1') : - $r('app.float.index_col_padding_top_2')) : 0 }) + $r('app.float.index_col_padding_top_2')) : 0 + }) .width(CommonConstants.FULL_PERCENT) .height(CommonConstants.FULL_PERCENT) } @@ -92,7 +102,9 @@ export struct LiveHome { .bindSheet((this.currentBreakpoint === BreakpointConstants.BREAKPOINT_SM && this.isMoreDetail), this.ShopBagBuilder(), { detents: [$r('app.float.index_bind_detents'), LiveConstants.NINETY_PERCENT], - onDisappear: () => { this.isMoreDetail = false }, + onDisappear: () => { + this.isMoreDetail = false + }, showClose: false, backgroundColor: ResourceUtil.getCommonBackgroundColor()[0], dragBar: false @@ -120,7 +132,9 @@ export struct LiveHome { Row() { Column() { Live({ - shopCarButton: (): void => { this.shopCarButton() }, + shopCarButton: (): void => { + this.shopCarButton() + }, currentBreakpoint: this.isMoreDetail ? new BreakpointType(BreakpointConstants.BREAKPOINT_SM, BreakpointConstants.BREAKPOINT_SM, BreakpointConstants.BREAKPOINT_MD).getValue(this.currentBreakpoint) : this.currentBreakpoint, @@ -133,7 +147,9 @@ export struct LiveHome { Column() { ShopBag({ isMoreDetail: $isMoreDetail, - PayCardButton: (): void => { this.PayCardButton() } + PayCardButton: (): void => { + this.PayCardButton() + } }) .visibility(this.detailType === CommonConstants.BIND_SHEET_PAGE_TYPES[0] ? Visibility.Visible : Visibility.None) @@ -152,8 +168,10 @@ export struct LiveHome { ProductPicture({ pageBreakpoint: BreakpointConstants.BREAKPOINT_SM, isMoreLiveDetail: $isMoreDetail }) ProductInfo({ pageBreakpoint: BreakpointConstants.BREAKPOINT_SM }) } - .padding({ bottom: deviceInfo.deviceType !== CommonConstants.DEVICE_TYPES[0] ? - CommonConstants.BOTTOM_RECT_HEIGHT : 0 }) + .padding({ + bottom: deviceInfo.deviceType !== CommonConstants.DEVICE_TYPES[0] ? + CommonConstants.BOTTOM_RECT_HEIGHT : 0 + }) } .scrollBar(BarState.Off) .layoutWeight(1) @@ -161,8 +179,13 @@ export struct LiveHome { .visibility(this.currentBreakpoint !== BreakpointConstants.BREAKPOINT_SM && this.detailType === CommonConstants.BIND_SHEET_PAGE_TYPES[2] ? Visibility.Visible : Visibility.None) - ProductUtilView({ isMoreDetail: $utilMoreDetail, isShoppingBag: $utilShoppingBag, isCustomerService: - $utilCustomerService, isLivePage: true }) + ProductUtilView({ + isMoreDetail: $utilMoreDetail, + isShoppingBag: $utilShoppingBag, + isCustomerService: + $utilCustomerService, + isLivePage: true + }) } .height(CommonConstants.FULL_PERCENT) .width(CommonConstants.FULL_PERCENT) diff --git a/features/detail/src/main/ets/view/PayCard.ets b/features/detail/src/main/ets/view/PayCard.ets index 983fb5cd85a591f0e57847af174f4d63680513a6..accc96567103986ae3192d0d13e57cd3e76aaf8b 100644 --- a/features/detail/src/main/ets/view/PayCard.ets +++ b/features/detail/src/main/ets/view/PayCard.ets @@ -25,7 +25,7 @@ export struct PayCard { @Link isOpen: boolean; @Link detailType: string; private payCardSelectList: SelectProjectItem[] = new PayCardViewModel().getPayCardSelectList(); - private dialogController?: CustomDialogController; + public dialogController?: CustomDialogController; build() { Column(){ diff --git a/features/detail/src/main/ets/view/ProductConfig.ets b/features/detail/src/main/ets/view/ProductConfig.ets index 82d94b324b643798b93e40dba76694b5bedb32b6..7ea5537765ecb434aa4bdad04de40a1311f49555 100644 --- a/features/detail/src/main/ets/view/ProductConfig.ets +++ b/features/detail/src/main/ets/view/ProductConfig.ets @@ -262,7 +262,7 @@ export struct AllComments { @Component struct CommentsTag { - private tagText: string = ''; + public tagText: string = ''; build() { Row() { diff --git a/features/detail/src/main/ets/view/ProductUtilView.ets b/features/detail/src/main/ets/view/ProductUtilView.ets index ece8d3f0237ce2e41e3235d2d6f0ab9490c6ca41..33b778bd6dee6cf3e2a3fc7399420919d3a9f451 100644 --- a/features/detail/src/main/ets/view/ProductUtilView.ets +++ b/features/detail/src/main/ets/view/ProductUtilView.ets @@ -31,7 +31,7 @@ export struct ProductUtilView { @State isDialogOpen: boolean = false; @State detailType: string = CommonConstants.BIND_SHEET_PAGE_TYPES[3]; @Consume('pageInfos') pageInfos: NavPathStack; - private isLivePage: boolean = false; + public isLivePage: boolean = false; private dialogController: CustomDialogController | null = new CustomDialogController({ builder: PayCardDialog(), customStyle: true diff --git a/features/detail/src/main/ets/view/ShopBagHeader.ets b/features/detail/src/main/ets/view/ShopBagHeader.ets index 79375d4578322f671312e08510d2388f4cf359cc..573a206dd0f3618db223051e58d49750b518f055 100644 --- a/features/detail/src/main/ets/view/ShopBagHeader.ets +++ b/features/detail/src/main/ets/view/ShopBagHeader.ets @@ -48,8 +48,8 @@ export struct ShopBagHeader { @Component struct ShopBagIconView { @StorageLink('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; - private iconResource: Resource = $r('app.media.icon_bag'); - private iconName: string = ''; + public iconResource: Resource = $r('app.media.icon_bag'); + public iconName: string = ''; build() { Column() { diff --git a/features/detail/src/main/resources/base/media/ic_public_back.svg b/features/detail/src/main/resources/base/media/ic_public_back.svg deleted file mode 100644 index 454d0aa4b65c47c8281eb78cbc6b9e4b3c9ee454..0000000000000000000000000000000000000000 --- a/features/detail/src/main/resources/base/media/ic_public_back.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - Public/ic_public_back - - - - - - - - - - \ No newline at end of file diff --git a/features/detail/src/main/resources/base/media/ic_public_comments.svg b/features/detail/src/main/resources/base/media/ic_public_comments.svg deleted file mode 100644 index 0211e560e1825ca9b607e21470d5ca8e309acd0e..0000000000000000000000000000000000000000 --- a/features/detail/src/main/resources/base/media/ic_public_comments.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - Public/ic_public_comments - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/detail/src/main/resources/base/media/icon.png b/features/detail/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/features/detail/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/features/detail/src/main/resources/base/media/setting.jpeg b/features/detail/src/main/resources/base/media/setting.jpeg deleted file mode 100644 index 57e67dd49d39ad64ef090f59db3db9dfe6632106..0000000000000000000000000000000000000000 Binary files a/features/detail/src/main/resources/base/media/setting.jpeg and /dev/null differ diff --git a/features/detail/src/main/resources/base/media/tab_home.svg b/features/detail/src/main/resources/base/media/tab_home.svg deleted file mode 100644 index ff026a99092323be572eb3f9e08aade115048a00..0000000000000000000000000000000000000000 --- a/features/detail/src/main/resources/base/media/tab_home.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - BottomNavigationBar/item/icon_actived首页-2 - - - - - - - - - - \ No newline at end of file diff --git a/features/detail/src/main/resources/base/media/tab_shopping_bag.svg b/features/detail/src/main/resources/base/media/tab_shopping_bag.svg deleted file mode 100644 index 3db480cb716220eca74972f4a009624fa54d4b0e..0000000000000000000000000000000000000000 --- a/features/detail/src/main/resources/base/media/tab_shopping_bag.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - Public/ic_public_appstore - - - - - - - - - - \ No newline at end of file diff --git a/features/home/src/main/ets/view/CommonView.ets b/features/home/src/main/ets/view/CommonView.ets index 42fbe1ab8d0af705114561284f88090469ddda90..10c0db1f1708086a4ee2e9ff5a0057b3691b49ea 100644 --- a/features/home/src/main/ets/view/CommonView.ets +++ b/features/home/src/main/ets/view/CommonView.ets @@ -18,7 +18,7 @@ import { HomeConstants } from '../constants/HomeConstants'; @Component export struct HomeButton { - private buttonText: string = ''; + public buttonText: string = ''; build() { Button(this.buttonText) @@ -34,7 +34,7 @@ export struct HomeButton { @Component export struct TitleView { - private titleText: string = ''; + public titleText: string = ''; build() { Row() { @@ -66,7 +66,7 @@ export struct TitleView { @Component export struct ProductTitle { @State isCenter: boolean = true; - private title: string[] = []; + public title: string[] = []; build() { Row() { @@ -104,7 +104,7 @@ export struct ProductTitle { @Component export struct ProductInfo { - private info: string = ''; + public info: string = ''; build() { if (this.info === '') { @@ -125,8 +125,8 @@ export struct ProductInfo { @Component export struct ProductPrice { - private price: string = ''; - private originalPrice: string = ''; + public price: string = ''; + public originalPrice: string = ''; build() { Row() { @@ -154,7 +154,7 @@ export struct ProductPrice { @Component export struct ProductFeature { - private feature: string[] = []; + public feature: string[] = []; build() { Row() { @@ -187,7 +187,7 @@ export struct ProductFeature { @Component export struct ProductComments { - private comments: string = ''; + public comments: string = ''; build() { Text(this.comments) diff --git a/features/home/src/main/ets/view/ShoppingBagContent.ets b/features/home/src/main/ets/view/ShoppingBagContent.ets index 8800d84480dcf35126fe079384766cbb2ba635e4..12cdb74177c6fc6358905ad7085e999af2671ff5 100644 --- a/features/home/src/main/ets/view/ShoppingBagContent.ets +++ b/features/home/src/main/ets/view/ShoppingBagContent.ets @@ -88,7 +88,7 @@ export struct DetailShoppingBagView { @StorageLink('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; @StorageLink('topRectHeight') topRectHeight: number = 0; @Consume('pageInfos') pageInfos: NavPathStack; - private isMoreDetail: boolean = false; + public isMoreDetail: boolean = false; build() { Column() { @@ -191,7 +191,7 @@ export struct ShoppingBagCard { .width(CommonConstants.FULL_PERCENT) List() { - ForEach(this.ShoppingBagList, (item: ShoppingBagProduct, index: number) => { + ForEach(this.ShoppingBagList, (item: ShoppingBagProduct) => { ListItem() { Row() { Column() { diff --git a/features/home/src/main/ets/view/ShoppingCardFoot.ets b/features/home/src/main/ets/view/ShoppingCardFoot.ets index d151164f21e37937016c3fa397092b33bce44177..09cd6b9de3ecc952d22404b6d402b6817629f007 100644 --- a/features/home/src/main/ets/view/ShoppingCardFoot.ets +++ b/features/home/src/main/ets/view/ShoppingCardFoot.ets @@ -19,7 +19,7 @@ import { ShoppingBagConstants } from '../constants/ShoppingBagConstants'; @Component export struct ShoppingCardFoot { @StorageLink('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; - private isMoreDetail: boolean = false; + public isMoreDetail: boolean = false; build() { Row(){ diff --git a/features/home/src/main/ets/view/ShoppingCardItem.ets b/features/home/src/main/ets/view/ShoppingCardItem.ets index 27c313c55cf77f73089ba6cf86051313b2c73fc3..88de4c93b8a9189f29d981f62f042a260dd8020e 100644 --- a/features/home/src/main/ets/view/ShoppingCardItem.ets +++ b/features/home/src/main/ets/view/ShoppingCardItem.ets @@ -19,8 +19,8 @@ import { ShoppingBagListViewModel, ShoppingBagProduct } from '../viewmodel/Shopp @Component export struct ShoppingCardItem { - private shoppingBagProductItem: ShoppingBagProduct = new ShoppingBagListViewModel().getShoppingBagItemData()[2]; - private titleEllipsis?: boolean; + public shoppingBagProductItem: ShoppingBagProduct = new ShoppingBagListViewModel().getShoppingBagItemData()[2]; + public titleEllipsis?: boolean; build() { Row(){ diff --git a/features/home/src/main/ets/viewmodel/ShopListViewModel.ets b/features/home/src/main/ets/viewmodel/ShopListViewModel.ets index 77b7b310f911ee4e8a96a97099f067cb7dfa956d..554f2f5ff7ba1d24f967440ccff2345f3a93e6e1 100644 --- a/features/home/src/main/ets/viewmodel/ShopListViewModel.ets +++ b/features/home/src/main/ets/viewmodel/ShopListViewModel.ets @@ -87,7 +87,7 @@ export class BannerList { private bannerList: Array = []; constructor() { - ClassifyConstants.BANNER_IMAGE.forEach((item: Resource, index: number)=>{ + ClassifyConstants.BANNER_IMAGE.forEach((item: Resource)=>{ this.bannerList.push(item) }) } diff --git a/features/home/src/main/resources/base/media/icon.png b/features/home/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/features/home/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/features/home/src/main/resources/base/media/setting.jpeg b/features/home/src/main/resources/base/media/setting.jpeg deleted file mode 100644 index 57e67dd49d39ad64ef090f59db3db9dfe6632106..0000000000000000000000000000000000000000 Binary files a/features/home/src/main/resources/base/media/setting.jpeg and /dev/null differ diff --git a/products/phone/src/main/ets/entryability/EntryAbility.ets b/products/phone/src/main/ets/entryability/EntryAbility.ets index a43263c0509f044a5677ee8561af29003d4885d4..b45999d587953df4f31e05c4177faa2e89a855bd 100644 --- a/products/phone/src/main/ets/entryability/EntryAbility.ets +++ b/products/phone/src/main/ets/entryability/EntryAbility.ets @@ -17,7 +17,7 @@ import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; import { window } from '@kit.ArkUI'; import { hilog } from '@kit.PerformanceAnalysisKit'; import { deviceInfo } from '@kit.BasicServicesKit'; -import { CommonConstants, Logger, WindowUtil } from '@ohos/commons'; +import { CommonConstants, WindowUtil } from '@ohos/commons'; export default class EntryAbility extends UIAbility { private windowObj?: window.Window; @@ -31,7 +31,7 @@ export default class EntryAbility extends UIAbility { this.windowUtil?.updateWindowStatusType(windowStatusType); }; - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + onCreate(_want: Want, _launchParam: AbilityConstant.LaunchParam): void { this.windowUtil = WindowUtil.getInstance(); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); } @@ -49,7 +49,9 @@ export default class EntryAbility extends UIAbility { this.windowUtil?.updateBreakpoint(this.windowObj.getWindowProperties().windowRect.width); AppStorage.setOrCreate('windowWidth', this.windowObj.getWindowProperties().windowRect.width); this.windowObj.on('windowSizeChange', this.onWindowSizeChange); - this.windowObj.on('windowStatusChange', this.onWindowStatusChange); + if (canIUse('SystemCapability.Window.SessionManager')) { + this.windowObj.on('windowStatusChange', this.onWindowStatusChange); + } }) if (this.windowUtil !== undefined) { diff --git a/products/phone/src/main/ets/pages/Index.ets b/products/phone/src/main/ets/pages/Index.ets index 8bf43fc8f814089480985cc1f9ec26945952069a..eb322ec839e619885e7072435a7d1030d23b47ec 100644 --- a/products/phone/src/main/ets/pages/Index.ets +++ b/products/phone/src/main/ets/pages/Index.ets @@ -45,7 +45,9 @@ struct Index { } try { this.mainWindow.off('windowSizeChange'); - this.mainWindow.off('windowStatusChange'); + if (canIUse('SystemCapability.Window.SessionManager')) { + this.mainWindow.off('windowStatusChange'); + } } catch (exception) { Logger.error('Failed to unregister the window callback. Code: ' + JSON.stringify(exception)); } diff --git a/products/phone/src/main/ets/secondability/SecondAbility.ets b/products/phone/src/main/ets/secondability/SecondAbility.ets index 82b806067f72e59ea6e7c7f6730d06e5d5285f52..b40b43f2d8fc58e5afd84f5639cff5051b60f4e0 100644 --- a/products/phone/src/main/ets/secondability/SecondAbility.ets +++ b/products/phone/src/main/ets/secondability/SecondAbility.ets @@ -28,20 +28,24 @@ export default class SecondAbility extends UIAbility { AppStorage.setOrCreate('windowWidth', windowSize.width); }; private onFoldStatusChange: (foldStatus: display.FoldStatus) => void = (foldStatus: display.FoldStatus) => { - let isSplitMode: boolean | undefined = AppStorage.get('isSplitMode'); - if (foldStatus === display.FoldStatus.FOLD_STATUS_FOLDED && isSplitMode) { - this.context.terminateSelf(); + if (canIUse('SystemCapability.Window.SessionManager')) { + let isSplitMode: boolean | undefined = AppStorage.get('isSplitMode'); + if (foldStatus === display.FoldStatus.FOLD_STATUS_FOLDED && isSplitMode) { + this.context.terminateSelf(); + } } }; - onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + onCreate(_want: Want, _launchParam: AbilityConstant.LaunchParam): void { this.windowUtil = WindowUtil.getSecondInstance(); hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); } onDestroy(): void { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); - display.off('foldStatusChange'); + if (canIUse('SystemCapability.Window.SessionManager')) { + display.off('foldStatusChange'); + } if (this.windowUtil === undefined) { return; } @@ -66,8 +70,9 @@ export default class SecondAbility extends UIAbility { AppStorage.setOrCreate('windowWidth', this.windowObj.getWindowProperties().windowRect.width); this.windowObj.on('windowSizeChange', this.onWindowSizeChange); }) - - display.on(`foldStatusChange`, this.onFoldStatusChange); + if (canIUse('SystemCapability.Window.SessionManager')) { + display.on(`foldStatusChange`, this.onFoldStatusChange); + } if (this.windowUtil !== undefined) { this.windowUtil.setWindowStage(windowStage);