张善主

fix(17814):功能缺陷-【uat】意见反馈-点击提交按钮没有反应

@@ -175,3 +175,6 @@ export { ReserveItemBean } from './src/main/ets/bean/live/ReserveItemBean'; @@ -175,3 +175,6 @@ export { ReserveItemBean } from './src/main/ets/bean/live/ReserveItemBean';
175 175
176 176
177 export { FeedbackTypeBean } from './src/main/ets/bean/detail/FeedbackTypeBean'; 177 export { FeedbackTypeBean } from './src/main/ets/bean/detail/FeedbackTypeBean';
  178 +export { FeedBackParams } from './src/main/ets/bean/content/FeedBackParams';
  179 +
  180 +
  1 +export interface FeedBackParams {
  2 + content:string
  3 + classifyFlagIds:string
  4 + userContact:string
  5 + userName:string
  6 + appVersion:string
  7 + appDevice:string
  8 +}
1 export interface FeedbackTypeBean { 1 export interface FeedbackTypeBean {
2 classifyName: string; 2 classifyName: string;
3 id: number; 3 id: number;
4 - isselect: boolean; 4 + isSelect: boolean;
5 } 5 }
1 -import { FeedbackTypeBean, PhotoListBean } from 'wdBean/Index'; 1 +import { FeedBackParams, FeedbackTypeBean, PhotoListBean } from 'wdBean/Index';
2 import { AppUtils, 2 import { AppUtils,
3 DeviceUtil, 3 DeviceUtil,
4 FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'; 4 FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index';
@@ -60,9 +60,9 @@ export struct FeedBackActivity { @@ -60,9 +60,9 @@ export struct FeedBackActivity {
60 GridCol({ 60 GridCol({
61 }) { 61 }) {
62 Row(){ 62 Row(){
63 - Toggle({ type: ToggleType.Checkbox, isOn: false }) 63 + Toggle({ type: ToggleType.Checkbox, isOn: feedbackTypeBean.isSelect })
64 .onChange((select) => { 64 .onChange((select) => {
65 - feedbackTypeBean.isselect = select 65 + feedbackTypeBean.isSelect = select
66 this.canSubmit = this.checkSubmit() 66 this.canSubmit = this.checkSubmit()
67 }) 67 })
68 Text(feedbackTypeBean.classifyName) 68 Text(feedbackTypeBean.classifyName)
@@ -325,8 +325,8 @@ export struct FeedBackActivity { @@ -325,8 +325,8 @@ export struct FeedBackActivity {
325 //问题类型必选 325 //问题类型必选
326 let selectType = "" 326 let selectType = ""
327 this.feedbackTypeBeans.forEach((value) => { 327 this.feedbackTypeBeans.forEach((value) => {
328 - if(value.isselect){  
329 - selectType = selectType+"," 328 + if(value.isSelect){
  329 + selectType = selectType+value.id+","
330 } 330 }
331 }) 331 })
332 if(!StringUtils.isEmpty(selectType)){ 332 if(!StringUtils.isEmpty(selectType)){
@@ -343,29 +343,31 @@ export struct FeedBackActivity { @@ -343,29 +343,31 @@ export struct FeedBackActivity {
343 } 343 }
344 344
345 try { 345 try {
346 - let map: HashMap<String,String> = {} as HashMap<String,String> 346 + let feedBackParams: FeedBackParams = {
347 //反馈内容 347 //反馈内容
348 - map.set("content", this.contact); 348 + "content": this.contact,
349 //投诉类型 id 349 //投诉类型 id
350 - map.set("classifyFlagIds", selectType);  
351 - if(!StringUtils.isEmpty(this.email)){ 350 + "classifyFlagIds": selectType,
  351 + //设备
  352 + "appVersion": "V" + AppUtils.getAppVersionName(),
  353 + "appDevice": "harmony" + DeviceUtil.getDisplayVersion() + " " + DeviceUtil.getProductModel()
  354 + } as FeedBackParams
352 //邮箱 355 //邮箱
353 - map.set("userContact", this.email); 356 + if(!StringUtils.isEmpty(this.email)){
  357 + feedBackParams.userContact = this.email
354 } 358 }
355 //用户名称 359 //用户名称
356 - if (!StringUtils.isEmpty(UserDataLocal.getUserName())) {  
357 - map.set("userName", UserDataLocal.getUserName()); 360 + if(!StringUtils.isEmpty(UserDataLocal.getUserName())){
  361 + feedBackParams.userName = UserDataLocal.getUserName()
358 } 362 }
359 - //设备  
360 - map.set("appVersion", "V" + AppUtils.getAppVersionName());  
361 - map.set("appDevice", "harmony" + DeviceUtil.getDisplayVersion() + " " + DeviceUtil.getProductModel()); 363 +
362 // //投诉图片 364 // //投诉图片
363 // if (imageUrl.size() > 0) { 365 // if (imageUrl.size() > 0) {
364 // String[] str = imageUrl.toArray(new String[imageUrl.size()]); 366 // String[] str = imageUrl.toArray(new String[imageUrl.size()]);
365 // map.set("imageUrls", str); 367 // map.set("imageUrls", str);
366 // } 368 // }
367 - await MultiPictureDetailViewModel.feedBackCommit(map)  
368 - 369 + await MultiPictureDetailViewModel.feedBackCommit(feedBackParams)
  370 + router.back();
369 } catch (exception) { 371 } catch (exception) {
370 console.log('请求失败',JSON.stringify(exception)) 372 console.log('请求失败',JSON.stringify(exception))
371 } 373 }
@@ -8,11 +8,12 @@ import { ContentDetailDTO, @@ -8,11 +8,12 @@ import { ContentDetailDTO,
8 postBatchAttentionStatusResult, 8 postBatchAttentionStatusResult,
9 postInteractBrowsOperateParams, 9 postInteractBrowsOperateParams,
10 InteractDataDTO, 10 InteractDataDTO,
11 - FeedbackTypeBean 11 + FeedbackTypeBean,
  12 + FeedBackParams
12 } from 'wdBean'; 13 } from 'wdBean';
13 import { PageRepository } from '../repository/PageRepository'; 14 import { PageRepository } from '../repository/PageRepository';
14 import { ArrayList } from '@kit.ArkTS'; 15 import { ArrayList } from '@kit.ArkTS';
15 - 16 +import { ToastUtils} from 'wdKit/Index';
16 const TAG = 'MultiPictureDetailViewModel'; 17 const TAG = 'MultiPictureDetailViewModel';
17 18
18 export class MultiPictureDetailViewModel { 19 export class MultiPictureDetailViewModel {
@@ -158,15 +159,16 @@ export class MultiPictureDetailViewModel { @@ -158,15 +159,16 @@ export class MultiPictureDetailViewModel {
158 }) 159 })
159 } 160 }
160 161
161 - static async feedBackCommit(params:HashMap<String,String>): Promise<ResponseDTO> {  
162 - return new Promise<ResponseDTO>((success, error) => { 162 + static async feedBackCommit(params:FeedBackParams): Promise<object> {
  163 + return new Promise<object>((success, error) => {
163 Logger.info(TAG, `fetchDetailData start`); 164 Logger.info(TAG, `fetchDetailData start`);
164 - WDHttp.post(HttpUrlUtils.getHost() + HttpUrlUtils.FEEDBACK_COMMIT_PATH,params).then((resDTO: ResponseDTO) => {  
165 - 165 + WDHttp.post(HttpUrlUtils.getHost() + HttpUrlUtils.FEEDBACK_COMMIT_PATH,params).then((resDTO: object) => {
166 success(resDTO); 166 success(resDTO);
  167 + ToastUtils.shortToast('反馈成功')
167 }).catch((err: Error) => { 168 }).catch((err: Error) => {
168 Logger.error(TAG, `fetchDetailData catch, error.name : ${err.name}, error.message:${err.message}`); 169 Logger.error(TAG, `fetchDetailData catch, error.name : ${err.name}, error.message:${err.message}`);
169 error(err); 170 error(err);
  171 + ToastUtils.shortToast('反馈失败')
170 }) 172 })
171 }) 173 })
172 } 174 }