diff --git a/entry/src/main/ets/common/returnItem.ets b/entry/src/main/ets/common/returnItem.ets new file mode 100644 index 0000000000000000000000000000000000000000..2e8e539b7ca4e3004c7c37f5ffb930056e4f0e53 --- /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