xugenyuan

ref |> 调整评论输入框发布按钮高亮逻辑

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -15,6 +15,7 @@ export struct CommentCustomDialog {
@State private emojiSwitch: boolean = false
textInputController: TextAreaController = new TextAreaController()
@State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 }
@State publishButtonOpacity: number = 0.5
aboutToAppear(): void {
}
... ... @@ -55,8 +56,15 @@ export struct CommentCustomDialog {
.height('100%')
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
.caretColor("#ED2800")
.onChange(value => {
this.publishCommentModel.commentContent = value;
if (value.length > 0) {
this.publishButtonOpacity = 1.0
} else {
this.publishButtonOpacity = 0.5
}
})
.onFocus(() => {
if (this.emojiSwitch) {
... ... @@ -98,13 +106,14 @@ export struct CommentCustomDialog {
Row() {
Text('发布')
.backgroundColor('#F89381')
.backgroundColor("#ED2800")
.width(80)
.height(30)
.fontSize(15)
.fontColor(Color.White)
.textAlign(TextAlign.Center)
.borderRadius(4)
.opacity(this.publishButtonOpacity)
.onClick(() => {
if (this.publishCommentModel.commentContent.length > 0) {
//请求评论接口
... ...