张善主

fix(意见反馈):UI页面

... ... @@ -297,6 +297,21 @@ export class HttpUrlUtils {
*/
static readonly ATTENTION_BATCH_DATA_PATH: string = "/api/rmrb-interact/interact/zh/c/attention/batch";
/**
* 获取oss 配置
*/
static readonly OSS_PARAMS_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/oss/configs";
/**
* 获取上传OSS token
*/
static readonly STS_TOKEN_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/oss/stsToken";
/**
* 获取意见反馈类型
*/
static readonly FEEDBACK_TYPE_PATH: string = "/api/rmrb-interact/interact/c/user/optionClassify/list";
static getHost(): string {
return HostManager.getHost();
... ...
... ... @@ -168,4 +168,6 @@ export { GoldenPositionExtraBean } from './src/main/ets/bean/content/GoldenPosit
export { ClassBean } from './src/main/ets/bean/content/ClassBean';
export { CreatorsBean } from './src/main/ets/bean/content/CreatorsBean';
export { MasterDetailRes } from './src/main/ets/bean/user/MasterDetailRes';
\ No newline at end of file
export { MasterDetailRes } from './src/main/ets/bean/user/MasterDetailRes';
export { FeedbackTypeBean } from './src/main/ets/bean/detail/FeedbackTypeBean';
\ No newline at end of file
... ...
export interface FeedbackTypeBean {
classifyName: string;
id: number;
isselect: boolean;
}
\ No newline at end of file
... ...
... ... @@ -57,6 +57,8 @@ export { AudioDetailComponent } from "./src/main/ets/components/AudioDetailCompo
export { DynamicDetailComponent } from "./src/main/ets/components/DynamicDetailComponent"
export { FeedBackActivity } from "./src/main/ets/components/FeedBackActivity"
export { AudioSuspensionModel } from "./src/main/ets/viewmodel/AudioSuspensionModel"
export { BroadcastPageComponent } from "./src/main/ets/components/broadcast/BroadcastPageComponent"
... ...
import { FeedbackTypeBean } from 'wdBean/Index';
import { NetworkUtil } from 'wdKit/Index';
import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
import { CustomTitleUI } from './reusable/CustomTitleUI'
import { ArrayList } from '@kit.ArkTS';
const TAG = 'FeedBackActivity'
// 意见反馈页面
@Component
export struct FeedBackActivity {
//UI
scroller: Scroller = new Scroller();
@State isNetConnected: boolean = true
@State feedbackTypeBeans: FeedbackTypeBean[] = [] as FeedbackTypeBean[]
async aboutToAppear() {
await this.getContentDetailData()
}
build() {
Column() {
//标题栏目
CustomTitleUI({ titleName: "意见反馈" })
Stack({ alignContent: Alignment.Bottom }) {
Scroll(this.scroller) {
Column() {
Text('请选择问题类型')
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Bold)
.margin({ left: $r('app.float.vp_15'), top: $r('app.float.vp_14') })
GridRow({
gutter: { x: 2, y: 2 }
}) {
ForEach(this.feedbackTypeBeans, (item: FeedbackTypeBean, index: number) => {
GridCol({
span: 12
}) {
Row(){
Toggle({ type: ToggleType.Checkbox, isOn: false })
Text(item.classifyName)
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_14'))
.fontWeight(FontWeight.Bold)
.margin({ left: $r('app.float.vp_4') })
}
.width(115)
.height(22)
.backgroundColor($r('app.color.color_fff'))
}
})
}
Blank()
.height(0.5)
.margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12'), right: $r('app.float.vp_16') })
.backgroundColor($r('app.color.color_EDEDED'))
Text('描述您的问题')
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Bold)
.margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12') })
Stack() {
TextInput({ placeholder: '您的宝贵意见是我们前行的动力' }) {
}
GridRow({
gutter: { x: 2, y: 2 }
}) {
ForEach(this.feedbackTypeBeans, (item: FeedbackTypeBean, index: number) => {
GridCol({
span: 12
}) {
}
})
}
Text('0/500')
}
.height(200)
.width('100%')
.margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12'), right: $r('app.float.vp_16') })
.backgroundColor($r('app.color.color_F5F5F5'))
.borderRadius(4)
Text('期待您留下联系方式,我们将提供更好的服务')
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_14'))
.fontWeight(FontWeight.Bold)
.margin({ left: $r('app.float.vp_16'), top: $r('app.float.margin_24') })
Row() {
Text('电话或者邮箱')
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_14'))
.fontWeight(FontWeight.Bold)
.margin({ left: $r('app.float.vp_12') })
TextInput({ placeholder: '请输入电话或者邮箱' }) {
}
}
.height(44)
.margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_12'), top: $r('app.float.margin_16') })
.backgroundColor($r('app.color.color_F5F5F5'))
.borderRadius(4)
}
}
Text($r('app.string.submit'))
.height(44)
.fontColor($r('app.color.color_9E9E9E_40'))
.fontSize($r('app.float.font_size_18'))
.margin({ left: $r('app.float.vp_16'), top: $r('app.float.vp_16'), top: $r('app.float.vp_15') })
.backgroundColor($r('app.color.color_ED2800_99'))
.borderRadius(4)
}
}
}
/**
* 请求接口数据
* */
private async getContentDetailData() {
this.isNetConnected = NetworkUtil.isNetConnected()
try {
this.feedbackTypeBeans = await MultiPictureDetailViewModel.getFeedbackTypeList()
} catch (exception) {
console.log('请求失败',JSON.stringify(exception))
}
}
}
\ No newline at end of file
... ...
... ... @@ -23,9 +23,11 @@ import {
postExecuteLikeParams,
postInteractAccentionOperateParams,
postRecommendListParams,
GoldenPositionExtraBean
GoldenPositionExtraBean,
FeedbackTypeBean
} from 'wdBean';
import { PageUIReqBean } from '../components/page/bean/PageUIReqBean';
import { ArrayList } from '@kit.ArkTS';
const TAG = 'HttpRequest';
... ... @@ -462,4 +464,10 @@ export class PageRepository {
Logger.info(TAG, "postThemeList url = " + url + JSON.stringify(params))
return WDHttp.post<ResponseDTO<LiveReviewDTO>>(url, params)
};
static getFeedbackTypeList() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.FEEDBACK_TYPE_PATH;
url = url + "?dictCode=" + "CN_OPINION_TYPE";
return WDHttp.get<ResponseDTO<FeedbackTypeBean[]>>(url)
};
}
... ...
... ... @@ -6,9 +6,11 @@ import { ContentDetailDTO,
postBatchAttentionStatusParams,
postBatchAttentionStatusResult,
postInteractBrowsOperateParams,
InteractDataDTO
InteractDataDTO,
FeedbackTypeBean
} from 'wdBean';
import { PageRepository } from '../repository/PageRepository';
import { ArrayList } from '@kit.ArkTS';
const TAG = 'MultiPictureDetailViewModel';
... ... @@ -131,4 +133,27 @@ export class MultiPictureDetailViewModel {
})
}
static async getFeedbackTypeList(): Promise<FeedbackTypeBean[]> {
return new Promise<FeedbackTypeBean[]>((success, error) => {
Logger.info(TAG, `fetchDetailData start`);
PageRepository.getFeedbackTypeList().then((resDTO: ResponseDTO<FeedbackTypeBean[]>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'fetchDetailData is empty');
error('resDTO is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `fetchDetailData then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
Logger.info(TAG, "fetchDetailData then,navResDTO.timestamp:" + resDTO.timestamp);
success(resDTO.data);
}).catch((err: Error) => {
Logger.error(TAG, `fetchDetailData catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
}
... ...
... ... @@ -160,5 +160,15 @@
"name": "res_color_general_000000_30",
"value": "#4D000000"
}
,
{
"name": "color_9E9E9E_40",
"value": "#40FFFFFF"
}
,
{
"name": "color_ED2800_99",
"value": "#99ED2800"
}
]
}
\ No newline at end of file
... ...
... ... @@ -241,6 +241,10 @@
"value": "12vp"
},
{
"name": "vp_4",
"value": "4vp"
},
{
"name": "vp_8",
"value": "8vp"
},
... ... @@ -281,6 +285,10 @@
"value": "14vp"
},
{
"name": "vp_15",
"value": "15vp"
},
{
"name": "vp_18",
"value": "18vp"
},
... ...
... ... @@ -57,5 +57,15 @@
"name": "location_reason",
"value": " "
}
,
{
"name": "submit",
"value": "提交"
}
,
{
"name": "feedback",
"value": "意见反馈"
}
]
}
\ No newline at end of file
... ...