diff --git a/entry/src/main/ets/entryability/EntryAbility.ets b/entry/src/main/ets/entryability/EntryAbility.ets index a22b15e..ca594b5 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ets +++ b/entry/src/main/ets/entryability/EntryAbility.ets @@ -74,7 +74,7 @@ export default class EntryAbility extends UIAbility { AppStorage.setOrCreate('windowClass', windowClass) await windowClass.setWindowLayoutFullScreen(true) // await windowClass.setWindowSystemBarEnable([]) //全屏 - windowStage.loadContent('pages/ExaminerLogin', (err, data) => { + windowStage.loadContent('pages/Index', (err, data) => { if (err.code) { hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); return; diff --git a/entry/src/main/ets/pages/ExaminerLogin.ets b/entry/src/main/ets/pages/ExaminerLogin.ets index 078b73b..44e1f4c 100644 --- a/entry/src/main/ets/pages/ExaminerLogin.ets +++ b/entry/src/main/ets/pages/ExaminerLogin.ets @@ -53,6 +53,7 @@ struct ExaminerLoginPage { inputComponent({ active: this.selectIndex === "1", value: this.password, + isPassword: true, placeholder: "请输入密码", onSelect: () => { this.selectIndex = "1" @@ -77,8 +78,11 @@ struct ExaminerLoginPage { this.password = this.password.slice(0, -1); } } else if (item === "清空") { - this.userName = ""; - this.password = ""; + if (this.selectIndex === "0") { + this.userName = ""; + } else { + this.password = ""; + } } else if (item === "X") { this.selectIndex = "0"; } else { @@ -155,6 +159,10 @@ struct ExaminerLoginPage { .margin({ top: 20 }) + .shadow({ + radius: 30, + color: "#E7B544" + }) }.width("100%").height("100%").padding(20) }.backgroundColor("#232424").height("100%").width("100%").padding({ bottom: 10 @@ -190,32 +198,42 @@ struct inputComponent { @State placeholder: string = "请输入用户名"; @Prop value: string = ""; @Prop active: boolean = false; + @State isPassword: boolean = false; onSelect: () => void = () => { }; build() { Row() { - TextInput({ - text: this.value, - placeholder: this.placeholder - }) - .placeholderColor("#fff") - .onFocus(() => { - this.onSelect() - }) - .fontColor("#fff") - .fontSize(40) - .placeholderFont({ - size: 40 - }) - .margin({ - left: 20 - }) - }.backgroundImage( + if (this.isPassword) { + Text(this.value !== "" ? "*".repeat(this.value.length) : this.placeholder) + .fontSize(40) + .fontColor("#fff") + .margin({ + left: 20 + }) + } else { + Text(this.value !== "" ? this.value : this.placeholder) + .fontSize(40) + .fontColor("#fff") + .margin({ + left: 20 + }) + } + } + .backgroundImage( this.active ? $r("app.media.kuang_pre") : $r("app.media.kuang_nor") - ).backgroundImageSize({ + ) + .backgroundImageSize({ width: "100%", height: "100%" - }).width(750).height(100) + }) + .width(750) + .height(120) + .padding({ + left: 20 + }) + .onClick(() => { + this.onSelect() + }) } } \ No newline at end of file