diff --git a/features/detail/src/main/ets/view/ProductUtilView.ets b/features/detail/src/main/ets/view/ProductUtilView.ets index 5f328547dbcac9e1c96b1bea7cf433a96ac4810e..0e406421983cbf21ef3948508111675f08f3beed 100644 --- a/features/detail/src/main/ets/view/ProductUtilView.ets +++ b/features/detail/src/main/ets/view/ProductUtilView.ets @@ -32,17 +32,8 @@ export struct ProductUtilView { @State detailType: string = CommonConstants.BIND_SHEET_PAGE_TYPES[3]; @Consume('pageInfos') pageInfos: NavPathStack; public isLivePage: boolean = false; - // [Start dialog_controller] - private dialogController: CustomDialogController | null = new CustomDialogController({ - builder: PayCardDialog(), - customStyle: true - }); - // [End dialog_controller] private context: Context = this.getUIContext().getHostContext()! - aboutToDisappear(): void { - this.dialogController = null; - } // [Start pay_card_builder] @Builder PayCardBuilder() { @@ -134,7 +125,7 @@ export struct ProductUtilView { height: '620vp', preferType: SheetType.CENTER, dragBar: false, - enableOutsideInteractive: true, + enableOutsideInteractive: false, onDisappear: () => { this.isDialogOpen = false }, showClose: false, backgroundColor: '#F1F3F5' @@ -143,15 +134,7 @@ export struct ProductUtilView { if (this.isLivePage || this.isSplitMode) { return; } - if (this.currentBreakpoint === 'sm') { - this.isDialogOpen = true; - } else { - if (this.dialogController === null) { - return; - } - this.dialogController.open(); - this.isDialogOpen = false; - } + this.isDialogOpen = true; }) // [End dialog_btn] } @@ -166,54 +149,12 @@ export struct ProductUtilView { }) } } - .onBreakpointChange((breakPoints) => { - if (breakPoints === BreakpointConstants.BREAKPOINT_LG) { - if (this.dialogController === null) { - return; - } - this.dialogController.close(); - } else { - this.isShowingSidebar = false; - if (this.dialogController === null) { - return; - } - this.dialogController.close(); - this.isDialogOpen = false; - } + .onBreakpointChange(() => { + this.isDialogOpen = false; }) } } -// [Start pay_card_dialog] -@CustomDialog -struct PayCardDialog { - // [StartExclude pay_card_dialog] - @StorageLink('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; - @State isDialogOpen: boolean = false; - @State detailType: string = CommonConstants.BIND_SHEET_PAGE_TYPES[3]; - private dialogController?: CustomDialogController; - // [EndExclude pay_card_dialog] - build() { - Column() { - PayCard({ - // [StartExclude pay_card_dialog] - isOpen: $isDialogOpen, - detailType: $detailType, - currentBreakpoint: this.currentBreakpoint, - dialogController: this.dialogController - // [EndExclude pay_card_dialog] - }) - } - // [StartExclude pay_card_dialog] - .backgroundColor(ResourceUtil.getCommonBackgroundColor()[0]) - .padding({ top: $r('app.float.pay_dialog_padding') }) - .width(this.currentBreakpoint === BreakpointConstants.BREAKPOINT_LG ? $r('app.float.pay_dialog_width_lg') : - $r('app.float.pay_dialog_width')) - .height(DetailConstants.EIGHTY_PERCENT) - .borderRadius(ResourceUtil.getCommonBorderRadius()[8]) - // [EndExclude pay_card_dialog] - } -} // [End pay_card_dialog] export class NavParams { viewName: string = '';