Showing
14 changed files
with
217 additions
and
46 deletions
| @@ -7,6 +7,7 @@ import { HostEnum, HostManager } from './HttpHostManager'; | @@ -7,6 +7,7 @@ import { HostEnum, HostManager } from './HttpHostManager'; | ||
| 7 | * 网络请求参数工具类,TODO 不对外暴露,收缩权限 | 7 | * 网络请求参数工具类,TODO 不对外暴露,收缩权限 |
| 8 | */ | 8 | */ |
| 9 | export class HttpParams { | 9 | export class HttpParams { |
| 10 | + | ||
| 10 | static buildHeaders(): Record<string, string> { | 11 | static buildHeaders(): Record<string, string> { |
| 11 | let headers: Record<string, string> = {}; | 12 | let headers: Record<string, string> = {}; |
| 12 | // 通用请求头 | 13 | // 通用请求头 |
| @@ -90,8 +91,17 @@ export class HttpParams { | @@ -90,8 +91,17 @@ export class HttpParams { | ||
| 90 | return '10000'; | 91 | return '10000'; |
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | - private static getVersionName() { | 94 | + public static getVersionName() { |
| 94 | // TODO 读取配置 | 95 | // TODO 读取配置 |
| 95 | return '1.0.0'; | 96 | return '1.0.0'; |
| 96 | } | 97 | } |
| 98 | + | ||
| 99 | + //获取机型 | ||
| 100 | + static getPhoneModel() { | ||
| 101 | + return 'getPhoneModel' | ||
| 102 | + } | ||
| 103 | + //获取当前手机系统版本号 | ||
| 104 | + static getSystemVersion() { | ||
| 105 | + return 'getSystemVersion' | ||
| 106 | + } | ||
| 97 | } | 107 | } |
| @@ -329,6 +329,11 @@ export class HttpUrlUtils { | @@ -329,6 +329,11 @@ export class HttpUrlUtils { | ||
| 329 | */ | 329 | */ |
| 330 | static readonly MESSAGE_UN_READ_DATA_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/polymerizationInfo?createTime="; | 330 | static readonly MESSAGE_UN_READ_DATA_PATH: string = "/api/rmrb-inside-mail/zh/c/inside-mail/private/polymerizationInfo?createTime="; |
| 331 | 331 | ||
| 332 | + /** | ||
| 333 | + * 意见反馈-提交 | ||
| 334 | + */ | ||
| 335 | + static readonly FEEDBACK_COMMIT_PATH: string = "/api/rmrb-interact/interact/zh/c/user/feedBack"; | ||
| 336 | + | ||
| 332 | static getHost(): string { | 337 | static getHost(): string { |
| 333 | return HostManager.getHost(); | 338 | return HostManager.getHost(); |
| 334 | } | 339 | } |
| 1 | import { Action, ContentDTO, Params, PhotoListBean, commentInfo } from 'wdBean'; | 1 | import { Action, ContentDTO, Params, PhotoListBean, commentInfo } from 'wdBean'; |
| 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | 2 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; |
| 3 | -import { Logger } from 'wdKit'; | 3 | +import { Logger, SPHelper } from 'wdKit'; |
| 4 | import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; | 4 | import { StringUtils } from 'wdKit/src/main/ets/utils/StringUtils'; |
| 5 | import { WDRouterRule, WDRouterPage } from '../../../../Index'; | 5 | import { WDRouterRule, WDRouterPage } from '../../../../Index'; |
| 6 | -import { ContentConstants } from 'wdConstant'; | 6 | +import { ContentConstants, SpConstants } from 'wdConstant'; |
| 7 | import { common, Want } from '@kit.AbilityKit'; | 7 | import { common, Want } from '@kit.AbilityKit'; |
| 8 | import { BusinessError } from '@kit.BasicServicesKit'; | 8 | import { BusinessError } from '@kit.BasicServicesKit'; |
| 9 | import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; | 9 | import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; |
| @@ -449,7 +449,13 @@ export class ProcessUtils { | @@ -449,7 +449,13 @@ export class ProcessUtils { | ||
| 449 | /** | 449 | /** |
| 450 | * 意见反馈 | 450 | * 意见反馈 |
| 451 | */ | 451 | */ |
| 452 | - public static gotoFeedBackActivity() { | 452 | + public static async gotoFeedBackActivity() { |
| 453 | + // 未登录,跳转登录 | ||
| 454 | + const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | ||
| 455 | + if (!user_id) { | ||
| 456 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 457 | + return | ||
| 458 | + } | ||
| 453 | let taskAction: Action = { | 459 | let taskAction: Action = { |
| 454 | type: 'JUMP_INNER_NEW_PAGE', | 460 | type: 'JUMP_INNER_NEW_PAGE', |
| 455 | params: { | 461 | params: { |
| @@ -122,7 +122,8 @@ function handleJsCallReceiveH5Data(data: Message) { | @@ -122,7 +122,8 @@ function handleJsCallReceiveH5Data(data: Message) { | ||
| 122 | width: item.width, | 122 | width: item.width, |
| 123 | height: item.height, | 123 | height: item.height, |
| 124 | picPath: item.pic, | 124 | picPath: item.pic, |
| 125 | - picDesc: '' | 125 | + picDesc: '', |
| 126 | + itemType:2 | ||
| 126 | } | 127 | } |
| 127 | return photo | 128 | return photo |
| 128 | }) | 129 | }) |
| @@ -175,4 +175,3 @@ export { ReserveItemBean } from './src/main/ets/bean/live/ReserveItemBean'; | @@ -175,4 +175,3 @@ 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 { FeedbackImageItem } from './src/main/ets/bean/detail/FeedbackImageItem'; |
| @@ -8,6 +8,8 @@ export interface PhotoListBean { | @@ -8,6 +8,8 @@ export interface PhotoListBean { | ||
| 8 | width: number; | 8 | width: number; |
| 9 | picPath: string; | 9 | picPath: string; |
| 10 | picDesc: string; | 10 | picDesc: string; |
| 11 | + //1添加图片,2图片 | ||
| 12 | + itemType: number; | ||
| 11 | } | 13 | } |
| 12 | 14 | ||
| 13 | export interface InputMethodProperty { | 15 | export interface InputMethodProperty { |
| @@ -45,6 +45,10 @@ import { detailedSkeleton } from './skeleton/detailSkeleton'; | @@ -45,6 +45,10 @@ import { detailedSkeleton } from './skeleton/detailSkeleton'; | ||
| 45 | const TAG = 'DynamicDetailComponent' | 45 | const TAG = 'DynamicDetailComponent' |
| 46 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; | 46 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; |
| 47 | 47 | ||
| 48 | + | ||
| 49 | +/** | ||
| 50 | + * @author wd-zsz | ||
| 51 | + * */ | ||
| 48 | // @Preview | 52 | // @Preview |
| 49 | @Component | 53 | @Component |
| 50 | export struct DynamicDetailComponent { | 54 | export struct DynamicDetailComponent { |
| 1 | -import { FeedbackImageItem, FeedbackTypeBean } from 'wdBean/Index'; | ||
| 2 | -import { FastClickUtil, Logger, NetworkUtil } from 'wdKit/Index'; | 1 | +import { FeedbackTypeBean, PhotoListBean } from 'wdBean/Index'; |
| 2 | +import { FastClickUtil, Logger, NetworkUtil, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'; | ||
| 3 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | 3 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; |
| 4 | import { CustomTitleUI } from './reusable/CustomTitleUI' | 4 | import { CustomTitleUI } from './reusable/CustomTitleUI' |
| 5 | -import { ArrayList } from '@kit.ArkTS'; | ||
| 6 | import { picker } from '@kit.CoreFileKit'; | 5 | import { picker } from '@kit.CoreFileKit'; |
| 7 | import { BusinessError } from '@kit.BasicServicesKit'; | 6 | import { BusinessError } from '@kit.BasicServicesKit'; |
| 8 | import { router } from '@kit.ArkUI'; | 7 | import { router } from '@kit.ArkUI'; |
| 8 | +import { CommonConstants } from 'wdConstant/Index'; | ||
| 9 | +import { ProcessUtils } from 'wdRouter/Index'; | ||
| 10 | +import { HashMap } from '@kit.ArkTS'; | ||
| 11 | +import { HttpParams } from 'wdNetwork/src/main/ets/http/HttpCommonParams'; | ||
| 9 | 12 | ||
| 10 | const TAG = 'FeedBackActivity' | 13 | const TAG = 'FeedBackActivity' |
| 11 | -// 意见反馈页面 | 14 | + |
| 15 | +/** | ||
| 16 | + * 意见反馈页面 | ||
| 17 | + * @author wd-zsz | ||
| 18 | + * */ | ||
| 12 | @Entry | 19 | @Entry |
| 13 | @Component | 20 | @Component |
| 14 | export struct FeedBackActivity { | 21 | export struct FeedBackActivity { |
| 22 | + contact: string = ""; | ||
| 23 | + email: string = ""; | ||
| 15 | //UI | 24 | //UI |
| 16 | scroller: Scroller = new Scroller(); | 25 | scroller: Scroller = new Scroller(); |
| 17 | 26 | ||
| @@ -19,8 +28,8 @@ export struct FeedBackActivity { | @@ -19,8 +28,8 @@ export struct FeedBackActivity { | ||
| 19 | 28 | ||
| 20 | @State feedbackTypeBeans: FeedbackTypeBean[] = [] as FeedbackTypeBean[] | 29 | @State feedbackTypeBeans: FeedbackTypeBean[] = [] as FeedbackTypeBean[] |
| 21 | //添加图片 | 30 | //添加图片 |
| 22 | - addPic: FeedbackImageItem = {itemType:1} as FeedbackImageItem | ||
| 23 | - @State pics: FeedbackImageItem[] = [this.addPic] as FeedbackImageItem[] | 31 | + addPic: PhotoListBean = {itemType:1} as PhotoListBean |
| 32 | + @State pics: PhotoListBean[] = [this.addPic] as PhotoListBean[] | ||
| 24 | // 选择媒体文件的最大数目 | 33 | // 选择媒体文件的最大数目 |
| 25 | selectNum = 3; | 34 | selectNum = 3; |
| 26 | 35 | ||
| @@ -31,58 +40,66 @@ export struct FeedBackActivity { | @@ -31,58 +40,66 @@ export struct FeedBackActivity { | ||
| 31 | build() { | 40 | build() { |
| 32 | Column() { | 41 | Column() { |
| 33 | //标题栏目 | 42 | //标题栏目 |
| 34 | - CustomTitleUI({ titleName: "意见反馈" }) | 43 | + CustomTitleUI({ titleName: $r('app.string.feedback') }) |
| 35 | Stack({ alignContent: Alignment.Bottom }) { | 44 | Stack({ alignContent: Alignment.Bottom }) { |
| 36 | Scroll(this.scroller) { | 45 | Scroll(this.scroller) { |
| 37 | Column() { | 46 | Column() { |
| 38 | - Text('请选择问题类型') | 47 | + Text($r('app.string.feedback_opinion_type')) |
| 39 | .fontColor($r('app.color.color_222222')) | 48 | .fontColor($r('app.color.color_222222')) |
| 40 | .fontSize($r('app.float.font_size_16')) | 49 | .fontSize($r('app.float.font_size_16')) |
| 41 | .fontWeight(FontWeight.Bold) | 50 | .fontWeight(FontWeight.Bold) |
| 51 | + .width('100%') | ||
| 42 | .margin({ left: $r('app.float.vp_15'), top: $r('app.float.vp_14') }) | 52 | .margin({ left: $r('app.float.vp_15'), top: $r('app.float.vp_14') }) |
| 43 | GridRow({ | 53 | GridRow({ |
| 44 | - gutter: { x: 2, y: 2 } | 54 | + columns:3, |
| 45 | }) { | 55 | }) { |
| 46 | ForEach(this.feedbackTypeBeans, (feedbackTypeBean: FeedbackTypeBean, index: number) => { | 56 | ForEach(this.feedbackTypeBeans, (feedbackTypeBean: FeedbackTypeBean, index: number) => { |
| 47 | GridCol({ | 57 | GridCol({ |
| 48 | - span: 12 | ||
| 49 | }) { | 58 | }) { |
| 50 | Row(){ | 59 | Row(){ |
| 51 | Toggle({ type: ToggleType.Checkbox, isOn: false }) | 60 | Toggle({ type: ToggleType.Checkbox, isOn: false }) |
| 52 | Text(feedbackTypeBean.classifyName) | 61 | Text(feedbackTypeBean.classifyName) |
| 53 | .fontColor($r('app.color.color_222222')) | 62 | .fontColor($r('app.color.color_222222')) |
| 54 | .fontSize($r('app.float.font_size_14')) | 63 | .fontSize($r('app.float.font_size_14')) |
| 55 | - .fontWeight(FontWeight.Bold) | ||
| 56 | .margin({ left: $r('app.float.vp_4') }) | 64 | .margin({ left: $r('app.float.vp_4') }) |
| 57 | } | 65 | } |
| 58 | - .width(115) | ||
| 59 | - .height(22) | 66 | + .width($r('app.float.margin_115')) |
| 67 | + .height($r('app.float.vp_22')) | ||
| 68 | + .margin({bottom:$r('app.float.margin_16')}) | ||
| 60 | .backgroundColor($r('app.color.color_fff')) | 69 | .backgroundColor($r('app.color.color_fff')) |
| 61 | } | 70 | } |
| 62 | }) | 71 | }) |
| 63 | } | 72 | } |
| 64 | - | 73 | + .width('100%') |
| 74 | + .margin({top:$r('app.float.vp_16')}) | ||
| 65 | Blank() | 75 | Blank() |
| 66 | - .height(0.5) | ||
| 67 | - .margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12'), right: $r('app.float.vp_16') }) | ||
| 68 | - .backgroundColor($r('app.color.color_EDEDED')) | ||
| 69 | - Text('描述您的问题') | 76 | + .height($r('app.float.margin_5')) |
| 77 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 78 | + Text($r('app.string.feedback_opinion_tv')) | ||
| 70 | .fontColor($r('app.color.color_222222')) | 79 | .fontColor($r('app.color.color_222222')) |
| 71 | .fontSize($r('app.float.font_size_16')) | 80 | .fontSize($r('app.float.font_size_16')) |
| 72 | .fontWeight(FontWeight.Bold) | 81 | .fontWeight(FontWeight.Bold) |
| 82 | + .width(CommonConstants.FULL_WIDTH) | ||
| 73 | .margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12') }) | 83 | .margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12') }) |
| 74 | - Stack() { | ||
| 75 | - TextInput({ placeholder: '您的宝贵意见是我们前行的动力' }) | 84 | + Stack({ alignContent: Alignment.BottomEnd }) { |
| 85 | + TextInput({ placeholder: $r('app.string.feedback_comments') }) | ||
| 86 | + .width(CommonConstants.FULL_WIDTH) | ||
| 87 | + .height(CommonConstants.FULL_HEIGHT) | ||
| 88 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 89 | + .align(Alignment.TopStart) | ||
| 90 | + .onChange((value) => { | ||
| 91 | + // Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent) | ||
| 92 | + this.contact = value | ||
| 93 | + }) | ||
| 76 | GridRow({ | 94 | GridRow({ |
| 77 | - gutter: { x: 2, y: 2 } | 95 | + columns:3, |
| 78 | }) { | 96 | }) { |
| 79 | 97 | ||
| 80 | - ForEach(this.pics, (feedbackImageItem: FeedbackImageItem, index: number) => { | 98 | + ForEach(this.pics, (feedbackImageItem: PhotoListBean, index: number) => { |
| 81 | GridCol({ | 99 | GridCol({ |
| 82 | - span: 12 | ||
| 83 | }) { | 100 | }) { |
| 84 | if(1 == feedbackImageItem.itemType){ | 101 | if(1 == feedbackImageItem.itemType){ |
| 85 | - Image($r('app.media.icon_add_attention')) | 102 | + Image($r('app.media.feekback_add')) |
| 86 | .width(60) | 103 | .width(60) |
| 87 | .height(60) | 104 | .height(60) |
| 88 | .onClick(async (event: ClickEvent) => { | 105 | .onClick(async (event: ClickEvent) => { |
| @@ -93,7 +110,7 @@ export struct FeedBackActivity { | @@ -93,7 +110,7 @@ export struct FeedBackActivity { | ||
| 93 | }) | 110 | }) |
| 94 | }else{ | 111 | }else{ |
| 95 | Stack({alignContent: Alignment.TopEnd}) { | 112 | Stack({alignContent: Alignment.TopEnd}) { |
| 96 | - Image(feedbackImageItem.path) | 113 | + Image(feedbackImageItem.picPath) |
| 97 | .width(60) | 114 | .width(60) |
| 98 | .height(60) | 115 | .height(60) |
| 99 | .borderRadius($r('app.float.margin_1')) | 116 | .borderRadius($r('app.float.margin_1')) |
| @@ -104,12 +121,21 @@ export struct FeedBackActivity { | @@ -104,12 +121,21 @@ export struct FeedBackActivity { | ||
| 104 | } | 121 | } |
| 105 | .width(60) | 122 | .width(60) |
| 106 | .height(60) | 123 | .height(60) |
| 124 | + .onClick(async (event: ClickEvent) => { | ||
| 125 | + if(await FastClickUtil.isMinDelayTime()){ | ||
| 126 | + return | ||
| 127 | + } | ||
| 128 | + //查看图片 fixme 去除添加按钮 | ||
| 129 | + ProcessUtils.gotoMultiPictureListPage(this.pics, index) | ||
| 130 | + }) | ||
| 107 | } | 131 | } |
| 108 | } | 132 | } |
| 109 | }) | 133 | }) |
| 110 | } | 134 | } |
| 111 | - | 135 | + .width(CommonConstants.FULL_WIDTH) |
| 136 | + .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_12'),left: $r('app.float.vp_12')}) | ||
| 112 | Text('0/500') | 137 | Text('0/500') |
| 138 | + .margin({bottom: $r('app.float.vp_12'), right: $r('app.float.vp_11')}) | ||
| 113 | } | 139 | } |
| 114 | .height(200) | 140 | .height(200) |
| 115 | .width('100%') | 141 | .width('100%') |
| @@ -117,26 +143,39 @@ export struct FeedBackActivity { | @@ -117,26 +143,39 @@ export struct FeedBackActivity { | ||
| 117 | .backgroundColor($r('app.color.color_F5F5F5')) | 143 | .backgroundColor($r('app.color.color_F5F5F5')) |
| 118 | .borderRadius(4) | 144 | .borderRadius(4) |
| 119 | 145 | ||
| 120 | - Text('期待您留下联系方式,我们将提供更好的服务') | 146 | + Text($r('app.string.feedback_email')) |
| 121 | .fontColor($r('app.color.color_222222')) | 147 | .fontColor($r('app.color.color_222222')) |
| 122 | .fontSize($r('app.float.font_size_14')) | 148 | .fontSize($r('app.float.font_size_14')) |
| 123 | .fontWeight(FontWeight.Bold) | 149 | .fontWeight(FontWeight.Bold) |
| 150 | + .width('100%') | ||
| 124 | .margin({ left: $r('app.float.vp_16'), top: $r('app.float.margin_24') }) | 151 | .margin({ left: $r('app.float.vp_16'), top: $r('app.float.margin_24') }) |
| 125 | Row() { | 152 | Row() { |
| 126 | - Text('电话或者邮箱') | 153 | + Text($r('app.string.feedback_mail')) |
| 127 | .fontColor($r('app.color.color_222222')) | 154 | .fontColor($r('app.color.color_222222')) |
| 128 | .fontSize($r('app.float.font_size_14')) | 155 | .fontSize($r('app.float.font_size_14')) |
| 129 | .fontWeight(FontWeight.Bold) | 156 | .fontWeight(FontWeight.Bold) |
| 130 | .margin({ left: $r('app.float.vp_12') }) | 157 | .margin({ left: $r('app.float.vp_12') }) |
| 131 | - TextInput({ placeholder: '请输入电话或者邮箱' }) | 158 | + TextInput({ placeholder: $r('app.string.feedback_hideemail') }) |
| 159 | + .width(CommonConstants.FULL_WIDTH) | ||
| 160 | + .height(CommonConstants.FULL_HEIGHT) | ||
| 161 | + .backgroundColor($r('app.color.color_F5F5F5')) | ||
| 162 | + .onChange((value) => { | ||
| 163 | + // Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent) | ||
| 164 | + this.email = value | ||
| 165 | + }) | ||
| 132 | } | 166 | } |
| 133 | .height(44) | 167 | .height(44) |
| 134 | .margin({ left: $r('app.float.vp_16'), right: $r('app.float.vp_12'), top: $r('app.float.margin_16') }) | 168 | .margin({ left: $r('app.float.vp_16'), right: $r('app.float.vp_12'), top: $r('app.float.margin_16') }) |
| 135 | .backgroundColor($r('app.color.color_F5F5F5')) | 169 | .backgroundColor($r('app.color.color_F5F5F5')) |
| 136 | .borderRadius(4) | 170 | .borderRadius(4) |
| 171 | + Blank().layoutWeight(1) | ||
| 137 | } | 172 | } |
| 138 | } | 173 | } |
| 139 | - | 174 | + .width(CommonConstants.FULL_WIDTH) |
| 175 | + .height(CommonConstants.FULL_HEIGHT) | ||
| 176 | + .scrollBar(BarState.Off) | ||
| 177 | + .alignSelf(ItemAlign.Start) | ||
| 178 | + .padding({ bottom: 44 }) | ||
| 140 | Text($r('app.string.submit')) | 179 | Text($r('app.string.submit')) |
| 141 | .height(44) | 180 | .height(44) |
| 142 | .fontColor($r('app.color.color_9E9E9E_40')) | 181 | .fontColor($r('app.color.color_9E9E9E_40')) |
| @@ -144,6 +183,12 @@ export struct FeedBackActivity { | @@ -144,6 +183,12 @@ export struct FeedBackActivity { | ||
| 144 | .margin({ left: $r('app.float.vp_16'), right: $r('app.float.vp_16'), top: $r('app.float.vp_15') }) | 183 | .margin({ left: $r('app.float.vp_16'), right: $r('app.float.vp_16'), top: $r('app.float.vp_15') }) |
| 145 | .backgroundColor($r('app.color.color_ED2800_99')) | 184 | .backgroundColor($r('app.color.color_ED2800_99')) |
| 146 | .borderRadius(4) | 185 | .borderRadius(4) |
| 186 | + .onClick(async (event: ClickEvent) => { | ||
| 187 | + if(await FastClickUtil.isMinDelayTime()){ | ||
| 188 | + return | ||
| 189 | + } | ||
| 190 | + this.reportCommit() | ||
| 191 | + }) | ||
| 147 | } | 192 | } |
| 148 | } | 193 | } |
| 149 | } | 194 | } |
| @@ -188,7 +233,7 @@ export struct FeedBackActivity { | @@ -188,7 +233,7 @@ export struct FeedBackActivity { | ||
| 188 | let startIndex = this.pics.length-1; | 233 | let startIndex = this.pics.length-1; |
| 189 | 234 | ||
| 190 | array.forEach((value) => { | 235 | array.forEach((value) => { |
| 191 | - let pic: FeedbackImageItem = {itemType:2,path:value} as FeedbackImageItem | 236 | + let pic: PhotoListBean = {itemType:2,picPath:value} as PhotoListBean |
| 192 | this.pics[startIndex] = pic | 237 | this.pics[startIndex] = pic |
| 193 | startIndex = startIndex+1; | 238 | startIndex = startIndex+1; |
| 194 | mediaFlag = true; | 239 | mediaFlag = true; |
| @@ -219,4 +264,55 @@ export struct FeedBackActivity { | @@ -219,4 +264,55 @@ export struct FeedBackActivity { | ||
| 219 | }, router.RouterMode.Standard); | 264 | }, router.RouterMode.Standard); |
| 220 | } | 265 | } |
| 221 | 266 | ||
| 267 | + //提交 | ||
| 268 | + async reportCommit(){ | ||
| 269 | + //问题类型必选 | ||
| 270 | + let selectType = "" | ||
| 271 | + this.feedbackTypeBeans.forEach((value) => { | ||
| 272 | + if(value.isselect){ | ||
| 273 | + selectType = selectType+"," | ||
| 274 | + } | ||
| 275 | + }) | ||
| 276 | + if(!StringUtils.isEmpty(selectType)){ | ||
| 277 | + selectType = selectType.substring(0,selectType.length-1) | ||
| 278 | + }else{ | ||
| 279 | + // | ||
| 280 | + ToastUtils.shortToast($r('app.string.feedback_opinion_type')) | ||
| 281 | + return | ||
| 282 | + } | ||
| 283 | + //内容必填 | ||
| 284 | + if(StringUtils.isEmpty(this.contact) || this.contact.length < 10 || this.contact.length>500){ | ||
| 285 | + ToastUtils.shortToast($r('app.string.res_feedback_commentsFail')) | ||
| 286 | + return | ||
| 287 | + } | ||
| 288 | + | ||
| 289 | + try { | ||
| 290 | + let map: HashMap<String,String> = {} as HashMap<String,String> | ||
| 291 | + //反馈内容 | ||
| 292 | + map.set("content", this.contact); | ||
| 293 | + //投诉类型 id | ||
| 294 | + map.set("classifyFlagIds", selectType); | ||
| 295 | + if(!StringUtils.isEmpty(this.email)){ | ||
| 296 | + //邮箱 | ||
| 297 | + map.set("userContact", this.email); | ||
| 298 | + } | ||
| 299 | + //用户名称 | ||
| 300 | + if (!StringUtils.isEmpty(UserDataLocal.getUserName())) { | ||
| 301 | + map.set("userName", UserDataLocal.getUserName()); | ||
| 302 | + } | ||
| 303 | + //设备 | ||
| 304 | + map.set("appVersion", "V" + HttpParams.getVersionName()); | ||
| 305 | + map.set("appDevice", "harmony" + HttpParams.getSystemVersion() + " " + HttpParams.getPhoneModel()); | ||
| 306 | + // //投诉图片 | ||
| 307 | + // if (imageUrl.size() > 0) { | ||
| 308 | + // String[] str = imageUrl.toArray(new String[imageUrl.size()]); | ||
| 309 | + // map.set("imageUrls", str); | ||
| 310 | + // } | ||
| 311 | + await MultiPictureDetailViewModel.feedBackCommit(map) | ||
| 312 | + | ||
| 313 | + } catch (exception) { | ||
| 314 | + console.log('请求失败',JSON.stringify(exception)) | ||
| 315 | + } | ||
| 316 | + } | ||
| 317 | + | ||
| 222 | } | 318 | } |
| @@ -40,7 +40,8 @@ export struct Card19Component { | @@ -40,7 +40,8 @@ export struct Card19Component { | ||
| 40 | width: item.weight, | 40 | width: item.weight, |
| 41 | height: item.height, | 41 | height: item.height, |
| 42 | picPath: item.fullUrl, | 42 | picPath: item.fullUrl, |
| 43 | - picDesc: '' | 43 | + picDesc: '', |
| 44 | + itemType:2 | ||
| 44 | } | 45 | } |
| 45 | return photo | 46 | return photo |
| 46 | }) | 47 | }) |
| @@ -3,7 +3,7 @@ import router from '@ohos.router' | @@ -3,7 +3,7 @@ import router from '@ohos.router' | ||
| 3 | @Component | 3 | @Component |
| 4 | export struct CustomTitleUI { | 4 | export struct CustomTitleUI { |
| 5 | imgBack:boolean = true | 5 | imgBack:boolean = true |
| 6 | - titleName:string = "默认标题" | 6 | + titleName:ResourceStr = "默认标题" |
| 7 | 7 | ||
| 8 | build() { | 8 | build() { |
| 9 | RelativeContainer() { | 9 | RelativeContainer() { |
| 1 | import { Logger } from 'wdKit'; | 1 | import { Logger } from 'wdKit'; |
| 2 | -import { ResponseDTO } from 'wdNetwork'; | 2 | +import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 3 | +import { HashMap } from '@kit.ArkTS'; | ||
| 3 | import { ContentDetailDTO, | 4 | import { ContentDetailDTO, |
| 4 | batchLikeAndCollectParams, | 5 | batchLikeAndCollectParams, |
| 5 | batchLikeAndCollectResult, | 6 | batchLikeAndCollectResult, |
| @@ -156,4 +157,17 @@ export class MultiPictureDetailViewModel { | @@ -156,4 +157,17 @@ export class MultiPictureDetailViewModel { | ||
| 156 | }) | 157 | }) |
| 157 | }) | 158 | }) |
| 158 | } | 159 | } |
| 160 | + | ||
| 161 | + static async feedBackCommit(params:HashMap<String,String>): Promise<ResponseDTO> { | ||
| 162 | + return new Promise<ResponseDTO>((success, error) => { | ||
| 163 | + Logger.info(TAG, `fetchDetailData start`); | ||
| 164 | + WDHttp.post(HttpUrlUtils.getHost() + HttpUrlUtils.FEEDBACK_COMMIT_PATH,params).then((resDTO: ResponseDTO) => { | ||
| 165 | + | ||
| 166 | + success(resDTO); | ||
| 167 | + }).catch((err: Error) => { | ||
| 168 | + Logger.error(TAG, `fetchDetailData catch, error.name : ${err.name}, error.message:${err.message}`); | ||
| 169 | + error(err); | ||
| 170 | + }) | ||
| 171 | + }) | ||
| 172 | + } | ||
| 159 | } | 173 | } |
| @@ -67,5 +67,40 @@ | @@ -67,5 +67,40 @@ | ||
| 67 | "name": "feedback", | 67 | "name": "feedback", |
| 68 | "value": "意见反馈" | 68 | "value": "意见反馈" |
| 69 | } | 69 | } |
| 70 | + , | ||
| 71 | + { | ||
| 72 | + "name": "res_feedback_commentsFail", | ||
| 73 | + "value": "请输入 10-500 个字以内" | ||
| 74 | + } | ||
| 75 | + , | ||
| 76 | + { | ||
| 77 | + "name": "feedback_opinion_type", | ||
| 78 | + "value": "请选择问题类型" | ||
| 79 | + } | ||
| 80 | + , | ||
| 81 | + { | ||
| 82 | + "name": "feedback_comments", | ||
| 83 | + "value": "您的宝贵意见是我们前行的动力" | ||
| 84 | + } | ||
| 85 | + , | ||
| 86 | + { | ||
| 87 | + "name": "feedback_opinion_tv", | ||
| 88 | + "value": "描述您的问题" | ||
| 89 | + } | ||
| 90 | + , | ||
| 91 | + { | ||
| 92 | + "name": "feedback_email", | ||
| 93 | + "value": "期待您留下联系方式,我们将提供更好的服务" | ||
| 94 | + } | ||
| 95 | + , | ||
| 96 | + { | ||
| 97 | + "name": "feedback_mail", | ||
| 98 | + "value": "电话或者邮箱" | ||
| 99 | + } | ||
| 100 | + , | ||
| 101 | + { | ||
| 102 | + "name": "feedback_hideemail", | ||
| 103 | + "value": "请输入电话或者邮箱" | ||
| 104 | + } | ||
| 70 | ] | 105 | ] |
| 71 | } | 106 | } |
-
Please register or login to post a comment