xugenyuan

ref |> 处理精选评论页点击用户头像进入对应主页

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
@@ -167,3 +167,5 @@ export { @@ -167,3 +167,5 @@ export {
167 export { GoldenPositionExtraBean } from './src/main/ets/bean/content/GoldenPositionExtraBean'; 167 export { GoldenPositionExtraBean } from './src/main/ets/bean/content/GoldenPositionExtraBean';
168 export { ClassBean } from './src/main/ets/bean/content/ClassBean'; 168 export { ClassBean } from './src/main/ets/bean/content/ClassBean';
169 export { CreatorsBean } from './src/main/ets/bean/content/CreatorsBean'; 169 export { CreatorsBean } from './src/main/ets/bean/content/CreatorsBean';
  170 +
  171 +export { MasterDetailRes } from './src/main/ets/bean/user/MasterDetailRes';
  1 +export class MasterDetailRes {
  2 + shareUrl = "";
  3 + contentPublish = 0;
  4 + authId = 0;
  5 + cnLiveCommentControl = 0;
  6 + liveGiftControl = 0;
  7 + livePublish = 0;
  8 + province = "";
  9 + fansNum = 0;
  10 + articleCreation = 0;
  11 + cnIsComment = 0;
  12 + cnIsLike = 0;
  13 + creatorId = "";
  14 + browseNum = 0;
  15 + cnLiveLikeControl = 0;
  16 + cnLiveShareControl = 0;
  17 + banControl = 0;
  18 + userId = "";
  19 + videoCreation = 0;
  20 + avatarFrame = "";
  21 + headPhotoUrl = "";
  22 + subjectType = 0;
  23 + liveLikeControl = 0;
  24 + region = "";
  25 + isAttention = 0;
  26 + cnContentPublish = 0;
  27 + authIcon = "";
  28 + honoraryTitle = "";
  29 + videoCollectionCreation = 0;
  30 + pictureCollectionCreation = 0;
  31 + liveSwitch = 0;
  32 + shareControl = 0;
  33 + isComment = 0;
  34 + district = "";
  35 + originUserId = "";
  36 + liveCommentControl = 0;
  37 + posterShareControl = 0;
  38 + honoraryIcon = "";
  39 + isLike = 0;
  40 + registTime: number = 0;
  41 + dynamicCreation = 0;
  42 + userName = "";
  43 + attentionNum = 0;
  44 + cnShareControl = 0;
  45 + cnLivePublish = 0;
  46 + categoryAuth = "";
  47 + cnLiveGiftControl = 0;
  48 + city = "";
  49 + dynamicControl = 0;
  50 + userType = "";
  51 + authTitle = "";
  52 + introduction = "";
  53 + liveShareControl = 0;
  54 + authPersonal = "";
  55 + mainControl: number = -1;
  56 +}
1 import { ViewType } from 'wdConstant/Index' 1 import { ViewType } from 'wdConstant/Index'
2 -import { DateTimeUtils, LazyDataSource, WindowModel } from 'wdKit/Index' 2 +import { DateTimeUtils, LazyDataSource, ToastUtils, WindowModel } from 'wdKit/Index'
3 import { commentItemModel } from '../model/CommentModel' 3 import { commentItemModel } from '../model/CommentModel'
4 import commentViewModel from '../viewmodel/CommentViewModel' 4 import commentViewModel from '../viewmodel/CommentViewModel'
5 import { router, window } from '@kit.ArkUI' 5 import { router, window } from '@kit.ArkUI'
6 -import { HttpUtils } from 'wdNetwork/Index' 6 +import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork/Index'
7 import { ErrorComponent } from '../../view/ErrorComponent' 7 import { ErrorComponent } from '../../view/ErrorComponent'
8 import { EmptyComponent, WDViewDefaultType } from '../../view/EmptyComponent' 8 import { EmptyComponent, WDViewDefaultType } from '../../view/EmptyComponent'
9 import NoMoreLayout from '../../page/NoMoreLayout' 9 import NoMoreLayout from '../../page/NoMoreLayout'
10 import { CommentCustomDialog } from './CommentCustomDialog' 10 import { CommentCustomDialog } from './CommentCustomDialog'
11 import { publishCommentModel } from '../model/PublishCommentModel' 11 import { publishCommentModel } from '../model/PublishCommentModel'
12 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index' 12 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'
13 -import { ContentDTO } from 'wdBean/Index' 13 +import { ContentDTO, MasterDetailRes } from 'wdBean/Index'
14 14
15 const TAG = 'QualityCommentsComponent'; 15 const TAG = 'QualityCommentsComponent';
16 16
@@ -303,6 +303,9 @@ struct QualityCommentItem { @@ -303,6 +303,9 @@ struct QualityCommentItem {
303 y: -16 303 y: -16
304 } 304 }
305 ) 305 )
  306 + .onClick(() => {
  307 + this.jumpToAccountOwner()
  308 + })
306 Text(this.item.fromUserName) 309 Text(this.item.fromUserName)
307 .fontSize(14) 310 .fontSize(14)
308 .fontColor('#222222') 311 .fontColor('#222222')
@@ -423,6 +426,37 @@ struct QualityCommentItem { @@ -423,6 +426,37 @@ struct QualityCommentItem {
423 426
424 } 427 }
425 428
  429 + jumpToAccountOwner() {
  430 +
  431 + let url = HttpUrlUtils.getOtherUserDetailDataUrl()
  432 + let item : Record<string, string >= {
  433 + "creatorId": this.item.fromCreatorId || "",
  434 + "userType": `${this.item.fromUserType}`,
  435 + "userId": this.item.fromUserId || "-1",
  436 + }
  437 + HttpBizUtil.post<ResponseDTO<MasterDetailRes>>(url, item).then((result) => {
  438 + if (!result.data || result.data.mainControl != 1) {
  439 + ToastUtils.longToast("暂时无法查看该创作者主页")
  440 + return
  441 + }
  442 +
  443 + if (result.data.banControl == 1) {
  444 + ToastUtils.longToast("该账号已封禁,不予访问")
  445 + return
  446 + }
  447 +
  448 + if (result.data.userType === "1") { // 普通用户
  449 + let params: Record<string, string> = {'userId': result.data.userId};
  450 + WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params)
  451 + } else { // 非普通用户
  452 + ProcessUtils.gotoPeopleShipHomePage(result.data.creatorId)
  453 + }
  454 +
  455 + }).catch(() => {
  456 + ToastUtils.longToast("暂时无法查看该创作者主页")
  457 + })
  458 + }
  459 +
426 jumpToDetail() { 460 jumpToDetail() {
427 // programInfoModel.api_isCommentAction = YES; 461 // programInfoModel.api_isCommentAction = YES;
428 462