From 42265d5a2a4f235da62330a539b75e464d19fea7 Mon Sep 17 00:00:00 2001 From: linqiang Date: Thu, 13 Oct 2022 10:58:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=8C=89=E9=94=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=A0=B7=E5=BC=8F=E5=8F=8A=E7=82=B9=E5=87=BB=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/common/returnItem.ets | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 entry/src/main/ets/common/returnItem.ets diff --git a/entry/src/main/ets/common/returnItem.ets b/entry/src/main/ets/common/returnItem.ets new file mode 100644 index 0000000..2e8e539 --- /dev/null +++ b/entry/src/main/ets/common/returnItem.ets @@ -0,0 +1,52 @@ + +import { InputHandler } from '../model/InputHandler' +import styleConfiguration from '../common/styleConfiguration' + + +let inputStyle: any = styleConfiguration.getInputStyle() +let basicButtonHeight : string + + +//返回组件 +@Component +export struct returnItem { + private returnWidth: any + + @Styles pressedStyles() { + .backgroundColor("#868b95") + } + + @Styles normalStyles() { + .backgroundColor("#a8abb7") + } + + aboutToAppear() : void{ + + var dHeight = AppStorage.Get("dHeight") + if (dHeight == 1280) { + basicButtonHeight = inputStyle.basicButtonHeight_1280; + } + else{ + basicButtonHeight = inputStyle.basicButtonHeight; + } + } + + build() { + Stack() { + Image($rawfile('return.svg')) + .width(inputStyle.returnPicSize) + .height(inputStyle.returnPicSize) + } + .backgroundColor('#a8abb7') + .width(this.returnWidth) //mxg this.returnWidth + .borderRadius(4) + .height(basicButtonHeight) + .shadow({ radius: 1, color: '#76787c', offsetY: 3 }) + .onClick(() => { + InputHandler.getInstance().sendKeyFunction(); + }) + .stateStyles({ + normal: this.normalStyles, pressed: this.pressedStyles + }) + } +} \ No newline at end of file -- Gitee