fix(17807):功能缺陷-【uat】意见反馈-描述您的问题-输入框输入超过500字未提示“请输入 10-500 个字以内”且500数字未标红,框框缺标红了。并且输入框变成了圆角,看图
Showing
1 changed file
with
30 additions
and
12 deletions
| @@ -11,6 +11,7 @@ import { router } from '@kit.ArkUI'; | @@ -11,6 +11,7 @@ import { router } from '@kit.ArkUI'; | ||
| 11 | import { CommonConstants } from 'wdConstant/Index'; | 11 | import { CommonConstants } from 'wdConstant/Index'; |
| 12 | import { ProcessUtils } from 'wdRouter/Index'; | 12 | import { ProcessUtils } from 'wdRouter/Index'; |
| 13 | import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index'; | 13 | import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index'; |
| 14 | +import inputMethod from '@ohos.inputMethod'; | ||
| 14 | 15 | ||
| 15 | const TAG = 'FeedBackActivity' | 16 | const TAG = 'FeedBackActivity' |
| 16 | 17 | ||
| @@ -23,14 +24,15 @@ const TAG = 'FeedBackActivity' | @@ -23,14 +24,15 @@ const TAG = 'FeedBackActivity' | ||
| 23 | export struct FeedBackActivity { | 24 | export struct FeedBackActivity { |
| 24 | pageShowTime:number = 0; | 25 | pageShowTime:number = 0; |
| 25 | @State canSubmit: boolean = false; | 26 | @State canSubmit: boolean = false; |
| 26 | - @State textNumLabel: string = '0/500'; | ||
| 27 | - contact: string = ""; | 27 | + @State textNumLabel: number = 0; |
| 28 | email: string = ""; | 28 | email: string = ""; |
| 29 | //UI | 29 | //UI |
| 30 | scroller: Scroller = new Scroller(); | 30 | scroller: Scroller = new Scroller(); |
| 31 | 31 | ||
| 32 | @State isNetConnected: boolean = true | 32 | @State isNetConnected: boolean = true |
| 33 | 33 | ||
| 34 | + @State editValue: FeedbackTypeBean = {classifyName:''} as FeedbackTypeBean | ||
| 35 | + | ||
| 34 | @State feedbackTypeBeans: FeedbackTypeBean[] = [] as FeedbackTypeBean[] | 36 | @State feedbackTypeBeans: FeedbackTypeBean[] = [] as FeedbackTypeBean[] |
| 35 | //添加图片 | 37 | //添加图片 |
| 36 | addPic: PhotoListBean = {itemType:1} as PhotoListBean | 38 | addPic: PhotoListBean = {itemType:1} as PhotoListBean |
| @@ -107,7 +109,7 @@ export struct FeedBackActivity { | @@ -107,7 +109,7 @@ export struct FeedBackActivity { | ||
| 107 | .width(CommonConstants.FULL_WIDTH) | 109 | .width(CommonConstants.FULL_WIDTH) |
| 108 | .margin({ left: 24, top: $r('app.float.vp_12') }) | 110 | .margin({ left: 24, top: $r('app.float.vp_12') }) |
| 109 | Stack({ alignContent: Alignment.BottomEnd }) { | 111 | Stack({ alignContent: Alignment.BottomEnd }) { |
| 110 | - TextArea({ placeholder: $r('app.string.feedback_comments') }) | 112 | + TextArea({ placeholder: $r('app.string.feedback_comments'),text: this.editValue.classifyName}) |
| 111 | .width(CommonConstants.FULL_WIDTH) | 113 | .width(CommonConstants.FULL_WIDTH) |
| 112 | .height(CommonConstants.FULL_HEIGHT) | 114 | .height(CommonConstants.FULL_HEIGHT) |
| 113 | .fontColor($r('app.color.color_222222')) | 115 | .fontColor($r('app.color.color_222222')) |
| @@ -116,12 +118,20 @@ export struct FeedBackActivity { | @@ -116,12 +118,20 @@ export struct FeedBackActivity { | ||
| 116 | .placeholderFont({size:$r('app.float.font_size_13_2')}) | 118 | .placeholderFont({size:$r('app.float.font_size_13_2')}) |
| 117 | .padding({bottom:96}) | 119 | .padding({bottom:96}) |
| 118 | .backgroundColor($r('app.color.color_F5F5F5')) | 120 | .backgroundColor($r('app.color.color_F5F5F5')) |
| 121 | + .outlineColor($r('app.color.color_F5F5F5')) | ||
| 119 | .align(Alignment.TopStart) | 122 | .align(Alignment.TopStart) |
| 120 | - .maxLength(500) | ||
| 121 | .onChange((value) => { | 123 | .onChange((value) => { |
| 122 | - // Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent) | ||
| 123 | - this.contact = value | ||
| 124 | - this.textNumLabel = value.length+"/500" | 124 | + if(value.length> 500){ |
| 125 | + //隐藏键盘 | ||
| 126 | + inputMethod.getController().stopInputSession(); | ||
| 127 | + ToastUtils.shortToast($r('app.string.res_feedback_commentsFail')) | ||
| 128 | + // Logger.debug(TAG, "onChange > 500 " + value) | ||
| 129 | + this.editValue = {classifyName:value.substring(0,500)} as FeedbackTypeBean | ||
| 130 | + }else{ | ||
| 131 | + this.editValue.classifyName = value | ||
| 132 | + } | ||
| 133 | + // Logger.debug(TAG, "onChange " + value) | ||
| 134 | + this.textNumLabel = value.length | ||
| 125 | this.canSubmit = this.checkSubmit() | 135 | this.canSubmit = this.checkSubmit() |
| 126 | }) | 136 | }) |
| 127 | GridRow({ | 137 | GridRow({ |
| @@ -185,9 +195,17 @@ export struct FeedBackActivity { | @@ -185,9 +195,17 @@ export struct FeedBackActivity { | ||
| 185 | }) | 195 | }) |
| 186 | } | 196 | } |
| 187 | .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_12'),left: $r('app.float.vp_12')}) | 197 | .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_12'),left: $r('app.float.vp_12')}) |
| 188 | - Text(this.textNumLabel) | 198 | + Text(){ |
| 199 | + ContainerSpan(){ | ||
| 200 | + if(this.textNumLabel<500){ | ||
| 201 | + Span(this.textNumLabel+'/500').fontColor($r('app.color.color_999999')) | ||
| 202 | + }else{ | ||
| 203 | + Span(this.textNumLabel+'').fontColor($r('app.color.color_ED2800')) | ||
| 204 | + Span('/500').fontColor($r('app.color.color_999999')) | ||
| 205 | + } | ||
| 206 | + } | ||
| 207 | + } | ||
| 189 | .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')}) | 208 | .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')}) |
| 190 | - .fontColor($r('app.color.color_999999')) | ||
| 191 | .fontSize($r('app.float.font_size_13_5')) | 209 | .fontSize($r('app.float.font_size_13_5')) |
| 192 | } | 210 | } |
| 193 | .height(200) | 211 | .height(200) |
| @@ -279,7 +297,7 @@ export struct FeedBackActivity { | @@ -279,7 +297,7 @@ export struct FeedBackActivity { | ||
| 279 | * */ | 297 | * */ |
| 280 | checkSubmit(): boolean { | 298 | checkSubmit(): boolean { |
| 281 | 299 | ||
| 282 | - if(StringUtils.isEmpty(this.contact) || this.contact.length < 10){ | 300 | + if(StringUtils.isEmpty(this.editValue.classifyName) || this.editValue.classifyName.length < 10){ |
| 283 | return false | 301 | return false |
| 284 | } | 302 | } |
| 285 | 303 | ||
| @@ -395,7 +413,7 @@ export struct FeedBackActivity { | @@ -395,7 +413,7 @@ export struct FeedBackActivity { | ||
| 395 | return | 413 | return |
| 396 | } | 414 | } |
| 397 | //内容必填 | 415 | //内容必填 |
| 398 | - if(StringUtils.isEmpty(this.contact) || this.contact.length < 10 || this.contact.length>500){ | 416 | + if(StringUtils.isEmpty(this.editValue.classifyName) || this.editValue.classifyName.length < 10 || this.editValue.classifyName.length>500){ |
| 399 | ToastUtils.shortToast($r('app.string.res_feedback_commentsFail')) | 417 | ToastUtils.shortToast($r('app.string.res_feedback_commentsFail')) |
| 400 | return | 418 | return |
| 401 | } | 419 | } |
| @@ -403,7 +421,7 @@ export struct FeedBackActivity { | @@ -403,7 +421,7 @@ export struct FeedBackActivity { | ||
| 403 | try { | 421 | try { |
| 404 | let feedBackParams: FeedBackParams = { | 422 | let feedBackParams: FeedBackParams = { |
| 405 | //反馈内容 | 423 | //反馈内容 |
| 406 | - "content": this.contact, | 424 | + "content": this.editValue.classifyName, |
| 407 | //投诉类型 id | 425 | //投诉类型 id |
| 408 | "classifyFlagIds": selectType, | 426 | "classifyFlagIds": selectType, |
| 409 | //设备 | 427 | //设备 |
-
Please register or login to post a comment