From 6fca06c15e8a12db1b9e807a12b1a8afa1f0abbc Mon Sep 17 00:00:00 2001 From: 26thE <962961353@qq.com> Date: Mon, 9 Jun 2025 18:32:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/view/TrafficView.ets | 43 +++++++++++++------------ 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/entry/src/main/ets/view/TrafficView.ets b/entry/src/main/ets/view/TrafficView.ets index c41c0f8..f5b1856 100644 --- a/entry/src/main/ets/view/TrafficView.ets +++ b/entry/src/main/ets/view/TrafficView.ets @@ -125,14 +125,9 @@ export struct TrafficView { .objectFit(ImageFit.Contain) .height(new BreakpointType(70, 80, 80).getValue(this.horizontalBreakpoint)) } - .margin({ - left: new BreakpointType($r('sys.float.padding_level36'), $r('sys.float.padding_level12'), - $r('sys.float.padding_level16')).getValue(this.horizontalBreakpoint), - top: $r('sys.float.padding_level2'), - }) .width(new BreakpointType('100%', '40%', '30%').getValue(this.horizontalBreakpoint)) } - .padding({ + .margin({ left: new BreakpointType($r('sys.float.padding_level0'), $r('sys.float.padding_level12'), $r('sys.float.padding_level16')).getValue(this.horizontalBreakpoint), top: new BreakpointType($r('sys.float.padding_level0'), $r('sys.float.padding_level16'), @@ -170,23 +165,29 @@ export struct TrafficView { Blank() - if (this.horizontalBreakpoint !== Constants.BREAK_POINT_SM || - this.verticalBreakpoint !== Constants.BREAK_POINT_MD) { - Row() { - TrafficInfoView() + Row(){ + if (this.horizontalBreakpoint !== Constants.BREAK_POINT_SM || + this.verticalBreakpoint !== Constants.BREAK_POINT_MD) { + Row() { + TrafficInfoView() + } + .onSizeChange(() => { + this.isShow = false; + }) + .margin({ + left: new BreakpointType($r('sys.float.padding_level0'), $r('sys.float.padding_level12'), + $r('sys.float.padding_level16')).getValue(this.horizontalBreakpoint), + }) + .backgroundColor($r('sys.color.background_secondary')) + .width(new BreakpointType('100%', '50%', '30%').getValue(this.horizontalBreakpoint)) + .height(120) + .borderRadius({ + topLeft: 32, + topRight: 32, + }) } - .margin({ - left: new BreakpointType($r('sys.float.padding_level0'), $r('sys.float.padding_level12'), - $r('sys.float.padding_level16')).getValue(this.horizontalBreakpoint), - }) - .backgroundColor($r('sys.color.background_secondary')) - .width(new BreakpointType('100%', '50%', '30%').getValue(this.horizontalBreakpoint)) - .height(120) - .borderRadius({ - topLeft: 32, - topRight: 32, - }) } + .width('100%') } .bindSheet($$this.isShow, this.myBuilder(), { height: 90, -- Gitee