From 1517d982e0a7357affe47ff59187299ab359bf1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=8B=A4=E6=B0=91?= Date: Mon, 17 Nov 2025 17:05:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(schedule):=E4=BC=98=E5=8C=96=E6=97=A5?= =?UTF-8?q?=E7=A8=8B=E7=BC=96=E8=BE=91=E4=B8=8E=E5=B1=95=E7=A4=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD-=20=E6=96=B0=E5=BB=BA=E6=97=A5=E7=A8=8B=E6=97=B6?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=97=B6=E9=97=B4=E8=AE=BE=E7=BD=AE=E4=B8=BA?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E6=97=B6=E9=97=B4=E5=8A=A06=E5=88=86?= =?UTF-8?q?=E9=92=9F=20-=20=E5=A2=9E=E5=8A=A0=E6=97=A5=E7=A8=8B=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=89=8D=E7=9A=84=E6=97=B6=E9=97=B4=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E9=98=B2=E6=AD=A2=E8=BF=87=E5=8E=BB?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8F=8A=E4=B8=B4=E7=95=8C=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=88=9B=E5=BB=BA-=20=E6=97=A5=E7=A8=8B=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B9=E5=A2=9E=E5=8A=A0=E6=BB=91=E5=8A=A8=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=20-=20=E9=99=90=E5=88=B6=E6=97=A5=E7=A8=8B?= =?UTF-8?q?=E5=A4=87=E6=B3=A8=E8=BE=93=E5=85=A5=E9=95=BF=E5=BA=A6=E4=B8=8D?= =?UTF-8?q?=E8=B6=85=E8=BF=87100=E5=AD=97=E7=AC=A6=20-=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E6=96=87=E4=BB=B6=E7=9B=AE=E5=BD=95=E7=BB=93=E6=9E=84?= =?UTF-8?q?=EF=BC=8C=E5=B0=86=E5=8F=8D=E9=A6=88=E5=92=8C=E6=97=A5=E7=A8=8B?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2=E7=A7=BB=E8=87=B3modules?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E4=B8=8B=20-=20=E6=9B=B4=E6=96=B0=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=BC=95=E7=94=A8=E8=B7=AF=E5=BE=84=E4=BB=A5=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=96=B0=E7=9A=84=E6=96=87=E4=BB=B6=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=20-=E4=BF=AE=E5=A4=8DSentry=E5=BC=82=E5=B8=B8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=AE=B0=E5=BD=95=E4=B8=8D=E5=87=86=E7=A1=AE=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20-=20SwipeView=E7=BB=84=E4=BB=B6=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=9B=B4=E5=A4=9A=E8=87=AA=E5=AE=9A=E4=B9=89=E8=BE=B9?= =?UTF-8?q?=E8=B7=9D=E5=92=8C=E5=9C=86=E8=A7=92=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ets/view/SwipeView.ets | 34 ++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/main/ets/view/SwipeView.ets b/src/main/ets/view/SwipeView.ets index b68d066..191473d 100644 --- a/src/main/ets/view/SwipeView.ets +++ b/src/main/ets/view/SwipeView.ets @@ -3,7 +3,13 @@ import { SZYXLocalStorageHelper, ToolsHelper } from '../../../../Index' @Component export struct SwipeView { private _scroller: Scroller = new Scroller() - @State h: Length = 40 + @State h: number = 40 + marginBottom: number = 0 + marginTop: number = 0 + brtLeft: number = 0 + brtRight: number = 0 + brbLeft: number = 0 + brbRight: number = 0 @State downX: number = 0 onItemClick?: () => void onDelete?: () => void @@ -23,6 +29,16 @@ export struct SwipeView { doNothingBuilder() { } + toNumber(len?: Length): number { + if (typeof len === "number") { + return len; + } + if (typeof len === "string") { + return Number(len); + } + return 70 + } + @BuilderParam customBuilderParam: () => void = this.doNothingBuilder // @BuilderParam btnBuilder: () => void = this.doNothingBuilder @@ -45,9 +61,15 @@ export struct SwipeView { .backgroundColor('red') .width(70) .fontColor('white') - .height(this.h) + .height(this.h - this.marginBottom - this.marginTop) .textAlign(TextAlign.Center) .fontSize(16) + .borderRadius({ + topLeft: this.brtLeft, + topRight: this.brtRight, + bottomLeft: this.brbLeft, + bottomRight: this.brbRight + }) .onClick(() => { // SZYXLocalStorageHelper.storage.setOrCreate('XBasicSwipeClick', this.ids) this._scroller.scrollTo({ @@ -56,14 +78,8 @@ export struct SwipeView { }) this.onDelete && this.onDelete() }) - // if (this.btnBuilder === this.doNothingBuilder) { - // Text('删除') - // } - // if (this.btnBuilder !== this.doNothingBuilder) { - // this.btnBuilder() - // } }.onSizeChange((oldValue: SizeOptions, newValue: SizeOptions) => { - this.h = newValue.height ?? 40 + this.h = this.toNumber(newValue.height) ?? 40 }).alignItems(VerticalAlign.Center) }.width('100%').scrollable(ScrollDirection.Horizontal).scrollBar(BarState.Off)