Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
69 changed files
with
689 additions
and
266 deletions
| @@ -12,6 +12,8 @@ export class ContentConstants { | @@ -12,6 +12,8 @@ export class ContentConstants { | ||
| 12 | * 2:直播 | 12 | * 2:直播 |
| 13 | */ | 13 | */ |
| 14 | static readonly TYPE_LIVE: string = "2"; | 14 | static readonly TYPE_LIVE: string = "2"; |
| 15 | + | ||
| 16 | + static readonly TYPE_FOUR: string = "4"; | ||
| 15 | /** | 17 | /** |
| 16 | * 5:专题详情 | 18 | * 5:专题详情 |
| 17 | */ | 19 | */ |
| @@ -17,6 +17,14 @@ export enum EmitterEventId { | @@ -17,6 +17,14 @@ export enum EmitterEventId { | ||
| 17 | 17 | ||
| 18 | // 关注,取消关注 | 18 | // 关注,取消关注 |
| 19 | PEOPLE_SHIP_ATTENTION = 7, | 19 | PEOPLE_SHIP_ATTENTION = 7, |
| 20 | + // 我的关注 为null | ||
| 21 | + MY_FOLLOW_EMPTY = 8, | ||
| 22 | + | ||
| 23 | + // 登录成功 | ||
| 24 | + LOGIN_SUCCESS = 8, | ||
| 25 | + | ||
| 26 | + // 换绑成功 | ||
| 27 | + PHONE_CHANGE_SUCCESS = 9, | ||
| 20 | 28 | ||
| 21 | // App回到前台 | 29 | // App回到前台 |
| 22 | APP_ENTER_FOREGROUD = 100, | 30 | APP_ENTER_FOREGROUD = 100, |
| @@ -441,6 +441,12 @@ export class HttpUrlUtils { | @@ -441,6 +441,12 @@ export class HttpUrlUtils { | ||
| 441 | return url; | 441 | return url; |
| 442 | } | 442 | } |
| 443 | 443 | ||
| 444 | + //游客评论合并 | ||
| 445 | + static visitorMergeComment() { | ||
| 446 | + let url = HttpUrlUtils.getHost() + "/api/rmrb-comment/comment/zh/c/visitorMerge"; | ||
| 447 | + return url; | ||
| 448 | + } | ||
| 449 | + | ||
| 444 | static getAppointmentListDataUrl() { | 450 | static getAppointmentListDataUrl() { |
| 445 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH | 451 | let url = HttpUrlUtils.getHost() + HttpUrlUtils.APPOINTMENT_LIST_DATA_PATH |
| 446 | return url | 452 | return url |
| @@ -100,6 +100,9 @@ export class ProcessUtils { | @@ -100,6 +100,9 @@ export class ProcessUtils { | ||
| 100 | case ContentConstants.TYPE_LIVE: | 100 | case ContentConstants.TYPE_LIVE: |
| 101 | ProcessUtils.gotoLive(content) | 101 | ProcessUtils.gotoLive(content) |
| 102 | break | 102 | break |
| 103 | + case ContentConstants.TYPE_FOUR: | ||
| 104 | + ProcessUtils.gotoDefaultWeb(content); | ||
| 105 | + break | ||
| 103 | case ContentConstants.TYPE_AUDIO: | 106 | case ContentConstants.TYPE_AUDIO: |
| 104 | ProcessUtils.gotoAudio(content) | 107 | ProcessUtils.gotoAudio(content) |
| 105 | break; | 108 | break; |
| @@ -9,13 +9,17 @@ import router from '@ohos.router'; | @@ -9,13 +9,17 @@ import router from '@ohos.router'; | ||
| 9 | import Url from '@ohos.url' | 9 | import Url from '@ohos.url' |
| 10 | import { ContentDTO, PhotoListBean } from 'wdBean'; | 10 | import { ContentDTO, PhotoListBean } from 'wdBean'; |
| 11 | import { handleJsCallAppService } from './JsCallAppService' | 11 | import { handleJsCallAppService } from './JsCallAppService' |
| 12 | - | 12 | +import { HttpUtils } from 'wdNetwork/Index'; |
| 13 | const TAG = 'JsBridgeBiz' | 13 | const TAG = 'JsBridgeBiz' |
| 14 | 14 | ||
| 15 | class AppInfo { | 15 | class AppInfo { |
| 16 | plat: string = '' | 16 | plat: string = '' |
| 17 | system: string = '' | 17 | system: string = '' |
| 18 | networkStatus: number = 1 | 18 | networkStatus: number = 1 |
| 19 | + screenStatusBarHeight: number = 40 // TODO 这里需要动态获取 | ||
| 20 | + screenTabbarSafeHeight: number = 42 // TODO 这里需要动态获取 | ||
| 21 | + imei: string = HttpUtils.getImei() | ||
| 22 | + device_id: string = HttpUtils.getDeviceId() | ||
| 19 | // TODO 完善 | 23 | // TODO 完善 |
| 20 | } | 24 | } |
| 21 | 25 |
| @@ -80,4 +80,6 @@ export interface ContentDTO { | @@ -80,4 +80,6 @@ export interface ContentDTO { | ||
| 80 | commentInfo?: commentInfo | 80 | commentInfo?: commentInfo |
| 81 | //底部导航栏 id(用于频道跳转) | 81 | //底部导航栏 id(用于频道跳转) |
| 82 | bottomNavId:string; | 82 | bottomNavId:string; |
| 83 | + // 链接类型: 0:无链接;1:内链(文章);2:外链 | ||
| 84 | + openType:string | ||
| 83 | } | 85 | } |
| @@ -44,7 +44,7 @@ export struct CompParser { | @@ -44,7 +44,7 @@ export struct CompParser { | ||
| 44 | 44 | ||
| 45 | @Builder | 45 | @Builder |
| 46 | componentBuilder(compDTO: CompDTO, compIndex: number) { | 46 | componentBuilder(compDTO: CompDTO, compIndex: number) { |
| 47 | - // if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 | 47 | + //if (compDTO.operDataList[0]?.objectType !== '3' && compDTO.operDataList[0]?.objectType !== '13') { //暂时屏蔽活动和音频详情入口 |
| 48 | if (compDTO.compStyle === CompStyle.Label_03) { | 48 | if (compDTO.compStyle === CompStyle.Label_03) { |
| 49 | LabelComponent({ compDTO: compDTO }) | 49 | LabelComponent({ compDTO: compDTO }) |
| 50 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 50 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| @@ -77,8 +77,8 @@ export struct CompParser { | @@ -77,8 +77,8 @@ export struct CompParser { | ||
| 77 | ZhSingleRow04({ compDTO: compDTO }) | 77 | ZhSingleRow04({ compDTO: compDTO }) |
| 78 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 78 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 79 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_05) { | 79 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_05) { |
| 80 | - ZhSingleRow05({ compDTO }) | ||
| 81 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 80 | + // ZhSingleRow05({ compDTO }) |
| 81 | + // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | ||
| 82 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) { | 82 | } else if (compDTO.compStyle === CompStyle.Zh_Single_Row_06) { |
| 83 | ZhSingleRow06({ compDTO }) | 83 | ZhSingleRow06({ compDTO }) |
| 84 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 84 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| @@ -119,6 +119,6 @@ export struct CompParser { | @@ -119,6 +119,6 @@ export struct CompParser { | ||
| 119 | } | 119 | } |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | - // } | 122 | + // } |
| 123 | } | 123 | } |
| 124 | 124 |
| 1 | -import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils } from 'wdKit'; | 1 | +import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils, DisplayUtils } from 'wdKit'; |
| 2 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; | 2 | import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; |
| 3 | import { ContentDetailDTO,postBatchAttentionStatusParams, | 3 | import { ContentDetailDTO,postBatchAttentionStatusParams, |
| 4 | PhotoListBean, | 4 | PhotoListBean, |
| @@ -53,7 +53,7 @@ export struct DynamicDetailComponent { | @@ -53,7 +53,7 @@ export struct DynamicDetailComponent { | ||
| 53 | //跳转 | 53 | //跳转 |
| 54 | private mJumpInfo: ContentDTO = {} as ContentDTO; | 54 | private mJumpInfo: ContentDTO = {} as ContentDTO; |
| 55 | 55 | ||
| 56 | - @State publishCommentModel: publishCommentModel = new publishCommentModel() | 56 | + |
| 57 | 57 | ||
| 58 | async aboutToAppear() { | 58 | async aboutToAppear() { |
| 59 | await this.getContentDetailData() | 59 | await this.getContentDetailData() |
| @@ -83,7 +83,7 @@ export struct DynamicDetailComponent { | @@ -83,7 +83,7 @@ export struct DynamicDetailComponent { | ||
| 83 | Image($r('app.media.ic_news_detail_division')) | 83 | Image($r('app.media.ic_news_detail_division')) |
| 84 | .width('100%') | 84 | .width('100%') |
| 85 | .height($r('app.float.margin_7')) | 85 | .height($r('app.float.margin_7')) |
| 86 | - .margin({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} ) | 86 | + .padding({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} ) |
| 87 | Stack({ alignContent: Alignment.Bottom }) { | 87 | Stack({ alignContent: Alignment.Bottom }) { |
| 88 | Scroll(this.scroller) { | 88 | Scroll(this.scroller) { |
| 89 | Column() { | 89 | Column() { |
| @@ -97,15 +97,29 @@ export struct DynamicDetailComponent { | @@ -97,15 +97,29 @@ export struct DynamicDetailComponent { | ||
| 97 | .height($r('app.float.margin_32')) | 97 | .height($r('app.float.margin_32')) |
| 98 | .objectFit(ImageFit.Cover) | 98 | .objectFit(ImageFit.Cover) |
| 99 | .borderRadius($r('app.float.margin_16')) | 99 | .borderRadius($r('app.float.margin_16')) |
| 100 | - Image($r('app.media.icon_border_test')) | 100 | + Image(this.contentDetailData.rmhInfo?.honoraryIcon) |
| 101 | .width($r('app.float.margin_48')) | 101 | .width($r('app.float.margin_48')) |
| 102 | .height($r('app.float.margin_48')) | 102 | .height($r('app.float.margin_48')) |
| 103 | .objectFit(ImageFit.Cover) | 103 | .objectFit(ImageFit.Cover) |
| 104 | .borderRadius($r('app.float.margin_24')) | 104 | .borderRadius($r('app.float.margin_24')) |
| 105 | + if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){ | ||
| 106 | + Stack() { | ||
| 107 | + Image(this.contentDetailData.rmhInfo?.authIcon) | ||
| 108 | + .width($r('app.float.vp_12')) | ||
| 109 | + .height($r('app.float.vp_12')) | ||
| 110 | + .objectFit(ImageFit.Cover) | ||
| 111 | + } | ||
| 112 | + .width($r('app.float.margin_48')) | ||
| 113 | + .height($r('app.float.margin_48')) | ||
| 114 | + .alignContent(Alignment.BottomEnd) | ||
| 115 | + } | ||
| 105 | } | 116 | } |
| 106 | .width($r('app.float.margin_48')) | 117 | .width($r('app.float.margin_48')) |
| 107 | .height($r('app.float.margin_48')) | 118 | .height($r('app.float.margin_48')) |
| 108 | .alignContent(Alignment.Center) | 119 | .alignContent(Alignment.Center) |
| 120 | + .onClick(() => { | ||
| 121 | + ProcessUtils.gotoPeopleShipHomePage(this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhId) | ||
| 122 | + }) | ||
| 109 | Column(){ | 123 | Column(){ |
| 110 | //昵称 | 124 | //昵称 |
| 111 | Text(this.contentDetailData.rmhInfo?.rmhName) | 125 | Text(this.contentDetailData.rmhInfo?.rmhName) |
| @@ -128,7 +142,7 @@ export struct DynamicDetailComponent { | @@ -128,7 +142,7 @@ export struct DynamicDetailComponent { | ||
| 128 | .margin({right: $r('app.float.margin_6')}) | 142 | .margin({right: $r('app.float.margin_6')}) |
| 129 | if(!StringUtils.isEmpty(this.followStatus)){ | 143 | if(!StringUtils.isEmpty(this.followStatus)){ |
| 130 | if (this.followStatus == '0') { | 144 | if (this.followStatus == '0') { |
| 131 | - Text('关注') | 145 | + Text('+关注') |
| 132 | .width($r('app.float.margin_54')) | 146 | .width($r('app.float.margin_54')) |
| 133 | .height($r('app.float.margin_24')) | 147 | .height($r('app.float.margin_24')) |
| 134 | .textAlign(TextAlign.Center) | 148 | .textAlign(TextAlign.Center) |
| @@ -275,8 +289,8 @@ export struct DynamicDetailComponent { | @@ -275,8 +289,8 @@ export struct DynamicDetailComponent { | ||
| 275 | Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)? | 289 | Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)? |
| 276 | this.contentDetailData.fullColumnImgUrls[0].url: | 290 | this.contentDetailData.fullColumnImgUrls[0].url: |
| 277 | this.contentDetailData.videoInfo[0].firstFrameImageUri) | 291 | this.contentDetailData.videoInfo[0].firstFrameImageUri) |
| 278 | - .width(CommonConstants.FULL_WIDTH) | ||
| 279 | - .aspectRatio(16 / 9) | 292 | + .width(DisplayUtils.getDeviceWidth()- 32) |
| 293 | + .height((DisplayUtils.getDeviceWidth()-32)* 9 / 16) | ||
| 280 | .borderRadius($r('app.float.image_border_radius')) | 294 | .borderRadius($r('app.float.image_border_radius')) |
| 281 | CardMediaInfo({ contentDTO: this.mJumpInfo }) | 295 | CardMediaInfo({ contentDTO: this.mJumpInfo }) |
| 282 | } | 296 | } |
| @@ -291,7 +305,8 @@ export struct DynamicDetailComponent { | @@ -291,7 +305,8 @@ export struct DynamicDetailComponent { | ||
| 291 | Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)? | 305 | Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)? |
| 292 | this.contentDetailData.fullColumnImgUrls[0].url: | 306 | this.contentDetailData.fullColumnImgUrls[0].url: |
| 293 | this.contentDetailData.videoInfo[0].firstFrameImageUri) | 307 | this.contentDetailData.videoInfo[0].firstFrameImageUri) |
| 294 | - .width(CommonConstants.FULL_WIDTH) | 308 | + .width(DisplayUtils.getDeviceWidth()/2) |
| 309 | + .height(DisplayUtils.getDeviceWidth()/2* 4 / 3) | ||
| 295 | .borderRadius($r('app.float.image_border_radius')) | 310 | .borderRadius($r('app.float.image_border_radius')) |
| 296 | CardMediaInfo({ contentDTO: this.mJumpInfo }) | 311 | CardMediaInfo({ contentDTO: this.mJumpInfo }) |
| 297 | } | 312 | } |
| @@ -299,7 +314,7 @@ export struct DynamicDetailComponent { | @@ -299,7 +314,7 @@ export struct DynamicDetailComponent { | ||
| 299 | } | 314 | } |
| 300 | } | 315 | } |
| 301 | } | 316 | } |
| 302 | - .margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')}) | 317 | + .padding({ left: this.contentDetailData.videoInfo[0].videoLandScape === 1?0: 25,top: $r('app.float.margin_8')}) |
| 303 | .onClick((event: ClickEvent) => { | 318 | .onClick((event: ClickEvent) => { |
| 304 | ProcessUtils.processPage(this.mJumpInfo) | 319 | ProcessUtils.processPage(this.mJumpInfo) |
| 305 | }) | 320 | }) |
| @@ -311,8 +326,8 @@ export struct DynamicDetailComponent { | @@ -311,8 +326,8 @@ export struct DynamicDetailComponent { | ||
| 311 | .fontSize($r('app.float.font_size_12')) | 326 | .fontSize($r('app.float.font_size_12')) |
| 312 | .lineHeight($r('app.float.margin_16')) | 327 | .lineHeight($r('app.float.margin_16')) |
| 313 | .margin({ top: $r('app.float.margin_16') | 328 | .margin({ top: $r('app.float.margin_16') |
| 314 | - ,left: $r('app.float.margin_16') | ||
| 315 | - ,right: $r('app.float.margin_16') }) | 329 | + ,left: $r('app.float.vp_12') |
| 330 | + ,right: $r('app.float.vp_12') }) | ||
| 316 | //微信/朋友圈/微博 | 331 | //微信/朋友圈/微博 |
| 317 | Row(){ | 332 | Row(){ |
| 318 | Image($r('app.media.xxhdpi_pic_wechat')) | 333 | Image($r('app.media.xxhdpi_pic_wechat')) |
| @@ -362,9 +377,17 @@ export struct DynamicDetailComponent { | @@ -362,9 +377,17 @@ export struct DynamicDetailComponent { | ||
| 362 | }) | 377 | }) |
| 363 | // 评论 | 378 | // 评论 |
| 364 | if (this.contentDetailData?.openComment) { | 379 | if (this.contentDetailData?.openComment) { |
| 365 | - Divider().strokeWidth(6).color('#f5f5f5') | 380 | + Divider().strokeWidth(6).color('#f5f5f5').margin({top:$r('app.float.margin_24')}) |
| 366 | CommentComponent({ | 381 | CommentComponent({ |
| 367 | - publishCommentModel: this.publishCommentModel | 382 | + publishCommentModel: { |
| 383 | + targetId: String(this.contentDetailData?.newsId || ''), | ||
| 384 | + targetRelId: this.contentDetailData?.reLInfo?.relId, | ||
| 385 | + targetTitle: this.contentDetailData?.newsTitle, | ||
| 386 | + targetRelType: this.contentDetailData?.reLInfo?.relType, | ||
| 387 | + targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId), | ||
| 388 | + keyArticle: String(this.contentDetailData?.keyArticle), | ||
| 389 | + targetType: String(this.contentDetailData?.newsType), | ||
| 390 | + } as publishCommentModel | ||
| 368 | }) | 391 | }) |
| 369 | } | 392 | } |
| 370 | Blank().layoutWeight(1) | 393 | Blank().layoutWeight(1) |
| @@ -379,7 +402,15 @@ export struct DynamicDetailComponent { | @@ -379,7 +402,15 @@ export struct DynamicDetailComponent { | ||
| 379 | OperRowListView({ contentDetailData: this.contentDetailData | 402 | OperRowListView({ contentDetailData: this.contentDetailData |
| 380 | ,interactData:this.interactDataDTO | 403 | ,interactData:this.interactDataDTO |
| 381 | ,newsStatusOfUser:this.newsStatusOfUser | 404 | ,newsStatusOfUser:this.newsStatusOfUser |
| 382 | - ,publishCommentModel: this.publishCommentModel | 405 | + ,publishCommentModel: { |
| 406 | + targetId: String(this.contentDetailData?.newsId || ''), | ||
| 407 | + targetRelId: this.contentDetailData?.reLInfo?.relId, | ||
| 408 | + targetTitle: this.contentDetailData?.newsTitle, | ||
| 409 | + targetRelType: this.contentDetailData?.reLInfo?.relType, | ||
| 410 | + targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId), | ||
| 411 | + keyArticle: String(this.contentDetailData?.keyArticle), | ||
| 412 | + targetType: String(this.contentDetailData?.newsType), | ||
| 413 | + } as publishCommentModel | ||
| 383 | ,needLike:false}) | 414 | ,needLike:false}) |
| 384 | } | 415 | } |
| 385 | } | 416 | } |
| @@ -399,17 +430,6 @@ export struct DynamicDetailComponent { | @@ -399,17 +430,6 @@ export struct DynamicDetailComponent { | ||
| 399 | } catch (exception) { | 430 | } catch (exception) { |
| 400 | console.log('请求失败',JSON.stringify(exception)) | 431 | console.log('请求失败',JSON.stringify(exception)) |
| 401 | } | 432 | } |
| 402 | - if (this.contentDetailData.openComment) { | ||
| 403 | - this.publishCommentModel = { | ||
| 404 | - targetId: String(this.contentDetailData?.newsId || ''), | ||
| 405 | - targetRelId: this.contentDetailData?.reLInfo?.relId, | ||
| 406 | - targetTitle: this.contentDetailData?.newsTitle, | ||
| 407 | - targetRelType: this.contentDetailData?.reLInfo?.relType, | ||
| 408 | - targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId), | ||
| 409 | - keyArticle: String(this.contentDetailData?.keyArticle), | ||
| 410 | - targetType: String(this.contentDetailData?.newsType), | ||
| 411 | - } as publishCommentModel | ||
| 412 | - } | ||
| 413 | this.getBatchAttentionStatus() | 433 | this.getBatchAttentionStatus() |
| 414 | this.getInteractDataStatus() | 434 | this.getInteractDataStatus() |
| 415 | this.makeJumpInfo() | 435 | this.makeJumpInfo() |
| @@ -21,7 +21,7 @@ export struct CardMediaInfo { | @@ -21,7 +21,7 @@ export struct CardMediaInfo { | ||
| 21 | Row() { | 21 | Row() { |
| 22 | Image($r('app.media.card_play')) | 22 | Image($r('app.media.card_play')) |
| 23 | .mediaLogo() | 23 | .mediaLogo() |
| 24 | - if(this.contentDTO.videoInfo!=null){ | 24 | + if (this.contentDTO.videoInfo != null) { |
| 25 | Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000)) | 25 | Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000)) |
| 26 | .mediaText() | 26 | .mediaText() |
| 27 | } | 27 | } |
| @@ -30,7 +30,7 @@ export struct CardMediaInfo { | @@ -30,7 +30,7 @@ export struct CardMediaInfo { | ||
| 30 | // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 30 | // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 31 | // 显示直播信息 | 31 | // 显示直播信息 |
| 32 | Row() { | 32 | Row() { |
| 33 | - if(this.contentDTO.liveInfo.liveState === 'wait') { | 33 | + if (this.contentDTO.liveInfo.liveState === 'wait') { |
| 34 | Image($r('app.media.card_wait')) | 34 | Image($r('app.media.card_wait')) |
| 35 | .mediaLogo() | 35 | .mediaLogo() |
| 36 | Text('预约') | 36 | Text('预约') |
| @@ -45,7 +45,7 @@ export struct CardMediaInfo { | @@ -45,7 +45,7 @@ export struct CardMediaInfo { | ||
| 45 | .mediaLogo() | 45 | .mediaLogo() |
| 46 | Text('回看') | 46 | Text('回看') |
| 47 | .mediaText() | 47 | .mediaText() |
| 48 | - } else if(this.contentDTO.liveInfo.liveState === 'end' && this.contentDTO.liveInfo | 48 | + } else if (this.contentDTO.liveInfo.liveState === 'end' && this.contentDTO.liveInfo |
| 49 | .replayUri) { | 49 | .replayUri) { |
| 50 | // Image($r('app.media.card_live')) | 50 | // Image($r('app.media.card_live')) |
| 51 | // .mediaLogo() | 51 | // .mediaLogo() |
| @@ -69,6 +69,15 @@ export struct CardMediaInfo { | @@ -69,6 +69,15 @@ export struct CardMediaInfo { | ||
| 69 | Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000)) | 69 | Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000)) |
| 70 | .mediaText() | 70 | .mediaText() |
| 71 | } | 71 | } |
| 72 | + } else if (this.contentDTO.objectType === '4') {//广告标签 | ||
| 73 | + Text($r('app.string.comp_advertisement')) | ||
| 74 | + .fontSize('10fp') | ||
| 75 | + .fontColor($r('app.color.white')) | ||
| 76 | + .width(28) | ||
| 77 | + .height(16) | ||
| 78 | + .backgroundColor('#4D000000') | ||
| 79 | + .borderRadius(3) | ||
| 80 | + .textAlign(TextAlign.Center) | ||
| 72 | } | 81 | } |
| 73 | } | 82 | } |
| 74 | .margin(6) | 83 | .margin(6) |
| @@ -20,14 +20,12 @@ export struct CardAdvBigImageComponent { | @@ -20,14 +20,12 @@ export struct CardAdvBigImageComponent { | ||
| 20 | 20 | ||
| 21 | aboutToAppear(): void { | 21 | aboutToAppear(): void { |
| 22 | 22 | ||
| 23 | - console.error('ZZZXXXXX', '----大图卡----aboutToAppear-----') | ||
| 24 | 23 | ||
| 25 | 24 | ||
| 26 | } | 25 | } |
| 27 | 26 | ||
| 28 | aboutToDisappear(): void { | 27 | aboutToDisappear(): void { |
| 29 | 28 | ||
| 30 | - console.error('ZZZXXXXX', '---大图卡-----aboutToDisappear-----') | ||
| 31 | } | 29 | } |
| 32 | 30 | ||
| 33 | build() { | 31 | build() { |
| @@ -25,8 +25,6 @@ export struct CardAdvGanMiComponent { | @@ -25,8 +25,6 @@ export struct CardAdvGanMiComponent { | ||
| 25 | 25 | ||
| 26 | aboutToAppear(): void { | 26 | aboutToAppear(): void { |
| 27 | 27 | ||
| 28 | - console.error('ZZZXXXXX', '--冠名广告------aboutToAppear-----') | ||
| 29 | - | ||
| 30 | let extraData = this.compDTO.matInfo.extraData | 28 | let extraData = this.compDTO.matInfo.extraData |
| 31 | let labelDTO = JSON.parse(extraData) as AdvExtraData | 29 | let labelDTO = JSON.parse(extraData) as AdvExtraData |
| 32 | this.advExtraData = labelDTO | 30 | this.advExtraData = labelDTO |
| @@ -37,7 +35,6 @@ export struct CardAdvGanMiComponent { | @@ -37,7 +35,6 @@ export struct CardAdvGanMiComponent { | ||
| 37 | 35 | ||
| 38 | aboutToDisappear(): void { | 36 | aboutToDisappear(): void { |
| 39 | 37 | ||
| 40 | - console.error('ZZZXXXXX', '--冠名广告------aboutToDisappear-----') | ||
| 41 | } | 38 | } |
| 42 | 39 | ||
| 43 | build() { | 40 | build() { |
sight_harmony/features/wdComponent/src/main/ets/components/cardViewAdv/CardAdvLongImageComponent.ets
| @@ -26,14 +26,12 @@ export struct CardAdvLongImageComponent { | @@ -26,14 +26,12 @@ export struct CardAdvLongImageComponent { | ||
| 26 | 26 | ||
| 27 | aboutToAppear(): void { | 27 | aboutToAppear(): void { |
| 28 | 28 | ||
| 29 | - console.error('ZZZXXXXX', '--长通栏广告 和 顶部长通栏广告------aboutToAppear-----') | ||
| 30 | 29 | ||
| 31 | this.haveTitle = this.compDTO.matInfo.advSubType === CompStyle.Card_Adv_7; | 30 | this.haveTitle = this.compDTO.matInfo.advSubType === CompStyle.Card_Adv_7; |
| 32 | } | 31 | } |
| 33 | 32 | ||
| 34 | aboutToDisappear(): void { | 33 | aboutToDisappear(): void { |
| 35 | 34 | ||
| 36 | - console.error('ZZZXXXXX', '--长通栏广告 和 顶部长通栏广告------aboutToDisappear-----') | ||
| 37 | } | 35 | } |
| 38 | 36 | ||
| 39 | build() { | 37 | build() { |
| @@ -42,7 +40,7 @@ export struct CardAdvLongImageComponent { | @@ -42,7 +40,7 @@ export struct CardAdvLongImageComponent { | ||
| 42 | 40 | ||
| 43 | //新闻标题 | 41 | //新闻标题 |
| 44 | if(this.haveTitle ){ | 42 | if(this.haveTitle ){ |
| 45 | - Text(this.compDTO.matInfo.advTitle).bottomTextStyle().margin({ bottom: 8, }) | 43 | + Text(this.compDTO.matInfo.advTitle).width('100%').bottomTextStyle().margin({ bottom: 8, }) |
| 46 | } | 44 | } |
| 47 | 45 | ||
| 48 | //长图 | 46 | //长图 |
| @@ -23,7 +23,6 @@ export struct CardAdvSmallImageComponent { | @@ -23,7 +23,6 @@ export struct CardAdvSmallImageComponent { | ||
| 23 | 23 | ||
| 24 | aboutToAppear(): void { | 24 | aboutToAppear(): void { |
| 25 | 25 | ||
| 26 | - console.error('ZZZXXXXX', '----小图卡----aboutToAppear-----') | ||
| 27 | // 计算标题文本行数 | 26 | // 计算标题文本行数 |
| 28 | let screenWith = DisplayUtils.getDeviceWidth(); | 27 | let screenWith = DisplayUtils.getDeviceWidth(); |
| 29 | screenWith = screenWith * 0.62 | 28 | screenWith = screenWith * 0.62 |
| @@ -33,7 +32,6 @@ export struct CardAdvSmallImageComponent { | @@ -33,7 +32,6 @@ export struct CardAdvSmallImageComponent { | ||
| 33 | 32 | ||
| 34 | aboutToDisappear(): void { | 33 | aboutToDisappear(): void { |
| 35 | 34 | ||
| 36 | - console.error('ZZZXXXXX', '---小图卡-----aboutToDisappear-----') | ||
| 37 | } | 35 | } |
| 38 | 36 | ||
| 39 | build() { | 37 | build() { |
| @@ -22,12 +22,10 @@ export struct CardAdvThreeImageComponent { | @@ -22,12 +22,10 @@ export struct CardAdvThreeImageComponent { | ||
| 22 | 22 | ||
| 23 | aboutToAppear(): void { | 23 | aboutToAppear(): void { |
| 24 | 24 | ||
| 25 | - console.error('ZZZXXXXX', '---三图卡-----aboutToAppear-----') | ||
| 26 | } | 25 | } |
| 27 | 26 | ||
| 28 | aboutToDisappear(): void { | 27 | aboutToDisappear(): void { |
| 29 | 28 | ||
| 30 | - console.error('ZZZXXXXX', '----三图卡----aboutToDisappear-----') | ||
| 31 | } | 29 | } |
| 32 | 30 | ||
| 33 | build() { | 31 | build() { |
| @@ -22,8 +22,6 @@ export struct CardAdvVideoComponent { | @@ -22,8 +22,6 @@ export struct CardAdvVideoComponent { | ||
| 22 | @State contentDTO: ContentDTO = {} as ContentDTO | 22 | @State contentDTO: ContentDTO = {} as ContentDTO |
| 23 | 23 | ||
| 24 | aboutToAppear(): void { | 24 | aboutToAppear(): void { |
| 25 | - console.error('ZZZXXXXX', '--视频广告------aboutToAppear-----') | ||
| 26 | - | ||
| 27 | 25 | ||
| 28 | // this.contentDTO.objectType = '1' | 26 | // this.contentDTO.objectType = '1' |
| 29 | // this.contentDTO.videoInfo = { videoDuration: 1000 } as VideoInfoDTO | 27 | // this.contentDTO.videoInfo = { videoDuration: 1000 } as VideoInfoDTO |
| @@ -31,7 +29,6 @@ export struct CardAdvVideoComponent { | @@ -31,7 +29,6 @@ export struct CardAdvVideoComponent { | ||
| 31 | 29 | ||
| 32 | aboutToDisappear(): void { | 30 | aboutToDisappear(): void { |
| 33 | 31 | ||
| 34 | - console.error('ZZZXXXXX', '---视频广告-----aboutToDisappear-----') | ||
| 35 | } | 32 | } |
| 36 | 33 | ||
| 37 | build() { | 34 | build() { |
| @@ -21,7 +21,6 @@ export struct CardAdvVideoExComponent { | @@ -21,7 +21,6 @@ export struct CardAdvVideoExComponent { | ||
| 21 | 21 | ||
| 22 | aboutToAppear(): void { | 22 | aboutToAppear(): void { |
| 23 | 23 | ||
| 24 | - console.error('ZZZXXXXX', '--展会广告------aboutToAppear-----') | ||
| 25 | 24 | ||
| 26 | let extraData = this.compDTO.matInfo.extraData | 25 | let extraData = this.compDTO.matInfo.extraData |
| 27 | let labelDTO = JSON.parse(extraData) as AdvExtraData | 26 | let labelDTO = JSON.parse(extraData) as AdvExtraData |
| @@ -30,7 +29,6 @@ export struct CardAdvVideoExComponent { | @@ -30,7 +29,6 @@ export struct CardAdvVideoExComponent { | ||
| 30 | 29 | ||
| 31 | aboutToDisappear(): void { | 30 | aboutToDisappear(): void { |
| 32 | 31 | ||
| 33 | - console.error('ZZZXXXXX', '----展会广告----aboutToDisappear-----') | ||
| 34 | } | 32 | } |
| 35 | 33 | ||
| 36 | build() { | 34 | build() { |
| 1 | import { ContentDTO, slideShows } from 'wdBean'; | 1 | import { ContentDTO, slideShows } from 'wdBean'; |
| 2 | -import { CommonConstants } from 'wdConstant' | ||
| 3 | -import { DateTimeUtils } from 'wdKit'; | 2 | +import { CommonConstants } from 'wdConstant'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 5 | -import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | ||
| 6 | -import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 4 | +import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| 7 | 5 | ||
| 8 | /** | 6 | /** |
| 9 | * 大专题卡--CompStyle: 10 | 7 | * 大专题卡--CompStyle: 10 |
| @@ -25,6 +23,9 @@ export struct Card10Component { | @@ -25,6 +23,9 @@ export struct Card10Component { | ||
| 25 | .maxLines(2) | 23 | .maxLines(2) |
| 26 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 24 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 27 | .margin({ bottom: 19 }) | 25 | .margin({ bottom: 19 }) |
| 26 | + .onClick((event: ClickEvent) => { | ||
| 27 | + ProcessUtils.processPage(this.contentDTO) | ||
| 28 | + }) | ||
| 28 | } | 29 | } |
| 29 | // 大图 | 30 | // 大图 |
| 30 | Stack() { | 31 | Stack() { |
| 1 | import { ContentDTO, slideShows } from 'wdBean'; | 1 | import { ContentDTO, slideShows } from 'wdBean'; |
| 2 | -import { CommonConstants } from 'wdConstant' | 2 | +import { CommonConstants } from 'wdConstant'; |
| 3 | import { DateTimeUtils } from 'wdKit'; | 3 | import { DateTimeUtils } from 'wdKit'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | 5 | ||
| @@ -104,10 +104,12 @@ export struct Card9Component { | @@ -104,10 +104,12 @@ export struct Card9Component { | ||
| 104 | Column() { | 104 | Column() { |
| 105 | Row() { | 105 | Row() { |
| 106 | // 标题 | 106 | // 标题 |
| 107 | - Image($r("app.media.timeline_rect")) | 107 | + Image($r("app.media.timeAxis")) |
| 108 | .width(9) | 108 | .width(9) |
| 109 | .height(9) | 109 | .height(9) |
| 110 | .margin({ right: 5 }) | 110 | .margin({ right: 5 }) |
| 111 | + .fillColor(item.newsTitleColor) | ||
| 112 | + | ||
| 111 | Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm")) | 113 | Text(DateTimeUtils.formatDate(item.publishTime, "MM月dd日 HH:mm")) |
| 112 | .fontSize($r('app.float.font_size_12')) | 114 | .fontSize($r('app.float.font_size_12')) |
| 113 | .fontColor($r('app.color.color_222222')) | 115 | .fontColor($r('app.color.color_222222')) |
| @@ -180,7 +180,7 @@ struct CarouselLayout01CardView { | @@ -180,7 +180,7 @@ struct CarouselLayout01CardView { | ||
| 180 | }) | 180 | }) |
| 181 | Column() { | 181 | Column() { |
| 182 | // 这里用于展示轮播图右上角信息,这里只对直播类型的展示 | 182 | // 这里用于展示轮播图右上角信息,这里只对直播类型的展示 |
| 183 | - if (this.item.objectType === '2') { | 183 | + if (this.item.objectType === '2' || this.item.objectType ==='4') { |
| 184 | CardMediaInfo({ contentDTO: this.item }) | 184 | CardMediaInfo({ contentDTO: this.item }) |
| 185 | .width(CommonConstants.FULL_PARENT) | 185 | .width(CommonConstants.FULL_PARENT) |
| 186 | } | 186 | } |
| @@ -19,7 +19,7 @@ export struct FollowChildComponent{ | @@ -19,7 +19,7 @@ export struct FollowChildComponent{ | ||
| 19 | Row() { | 19 | Row() { |
| 20 | Row(){ | 20 | Row(){ |
| 21 | Stack({alignContent: Alignment.Bottom}){ | 21 | Stack({alignContent: Alignment.Bottom}){ |
| 22 | - Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl) | 22 | + Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.icon_default_head_mater'):this.data.headPhotoUrl) |
| 23 | .objectFit(ImageFit.Auto) | 23 | .objectFit(ImageFit.Auto) |
| 24 | .width('92lpx') | 24 | .width('92lpx') |
| 25 | .height('92lpx') | 25 | .height('92lpx') |
| @@ -128,7 +128,7 @@ export struct FollowChildComponent{ | @@ -128,7 +128,7 @@ export struct FollowChildComponent{ | ||
| 128 | Row() { | 128 | Row() { |
| 129 | Row(){ | 129 | Row(){ |
| 130 | Stack({alignContent: Alignment.Bottom}){ | 130 | Stack({alignContent: Alignment.Bottom}){ |
| 131 | - Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.default_head'):this.data.headPhotoUrl) | 131 | + Image(StringUtils.isEmpty(this.data.headPhotoUrl)?$r('app.media.icon_default_head_mater'):this.data.headPhotoUrl) |
| 132 | .objectFit(ImageFit.Auto) | 132 | .objectFit(ImageFit.Auto) |
| 133 | .width('92lpx') | 133 | .width('92lpx') |
| 134 | .height('92lpx') | 134 | .height('92lpx') |
| 1 | +import { EmitterUtils, EmitterEventId, Logger } from 'wdKit/Index' | ||
| 1 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 2 | import { FollowListItem } from '../../../viewmodel/FollowListItem' | 3 | import { FollowListItem } from '../../../viewmodel/FollowListItem' |
| 3 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' | 4 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' |
| @@ -20,16 +21,26 @@ export struct FollowFirstTabsComponent{ | @@ -20,16 +21,26 @@ export struct FollowFirstTabsComponent{ | ||
| 20 | }) | 21 | }) |
| 21 | 22 | ||
| 22 | if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ | 23 | if(this.controller != null && this.data.length>1 && this.changeIndex === 1){ |
| 23 | - //个人主页 跳转 关注页 tab 2 | ||
| 24 | - let intervalID = setInterval(() => { | ||
| 25 | - this.currentIndex = this.changeIndex | ||
| 26 | - this.controller.changeIndex(this.currentIndex) | ||
| 27 | - clearInterval(intervalID); | ||
| 28 | - }, 500); | 24 | + this.jumpFollowNextPage() |
| 29 | } | 25 | } |
| 30 | }).catch((err:Error)=>{ | 26 | }).catch((err:Error)=>{ |
| 31 | console.log(TAG,JSON.stringify(err)) | 27 | console.log(TAG,JSON.stringify(err)) |
| 32 | }) | 28 | }) |
| 29 | + | ||
| 30 | + EmitterUtils.receiveEvent(EmitterEventId.MY_FOLLOW_EMPTY, (() => { | ||
| 31 | + if(this.controller != null && this.data.length>1 ){ | ||
| 32 | + this.jumpFollowNextPage() | ||
| 33 | + } | ||
| 34 | + })) | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + jumpFollowNextPage(){ | ||
| 38 | + //个人主页 跳转 关注页 tab 2 | ||
| 39 | + let intervalID = setInterval(() => { | ||
| 40 | + this.currentIndex = 1 | ||
| 41 | + this.controller.changeIndex(this.currentIndex) | ||
| 42 | + clearInterval(intervalID); | ||
| 43 | + }, 500); | ||
| 33 | } | 44 | } |
| 34 | 45 | ||
| 35 | @Builder TabBuilder(index: number, item: FollowListItem) { | 46 | @Builder TabBuilder(index: number, item: FollowListItem) { |
| 1 | -import { LazyDataSource, SPHelper, UserDataLocal } from 'wdKit'; | 1 | +import { EmitterEventId, EmitterUtils, LazyDataSource, SPHelper, UserDataLocal } from 'wdKit'; |
| 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 3 | import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel'; | 3 | import SearcherAboutDataModel from '../../../model/SearcherAboutDataModel'; |
| 4 | import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem'; | 4 | import { CreatorDetailRequestItem } from '../../../viewmodel/CreatorDetailRequestItem'; |
| @@ -70,7 +70,7 @@ export struct FollowListDetailUI { | @@ -70,7 +70,7 @@ export struct FollowListDetailUI { | ||
| 70 | Column() { | 70 | Column() { |
| 71 | if (this.count === 0) { | 71 | if (this.count === 0) { |
| 72 | if (this.isGetRequest == true) { | 72 | if (this.isGetRequest == true) { |
| 73 | - EmptyComponent({ emptyType: 14 }) | 73 | + EmptyComponent({ emptyType: 14,emptyHeight:"100%" }) |
| 74 | .layoutWeight(1) | 74 | .layoutWeight(1) |
| 75 | .width('100%') | 75 | .width('100%') |
| 76 | } | 76 | } |
| @@ -156,10 +156,12 @@ export struct FollowListDetailUI { | @@ -156,10 +156,12 @@ export struct FollowListDetailUI { | ||
| 156 | } | 156 | } |
| 157 | this.isLoading = false | 157 | this.isLoading = false |
| 158 | this.isGetRequest = true | 158 | this.isGetRequest = true |
| 159 | + this.sendFollowMessage() | ||
| 159 | }).catch((err: Error) => { | 160 | }).catch((err: Error) => { |
| 160 | console.log(TAG, "请求失败") | 161 | console.log(TAG, "请求失败") |
| 161 | this.isGetRequest = true | 162 | this.isGetRequest = true |
| 162 | this.isLoading = false | 163 | this.isLoading = false |
| 164 | + this.sendFollowMessage() | ||
| 163 | }) | 165 | }) |
| 164 | } else { | 166 | } else { |
| 165 | this.isLoading = false | 167 | this.isLoading = false |
| @@ -167,6 +169,12 @@ export struct FollowListDetailUI { | @@ -167,6 +169,12 @@ export struct FollowListDetailUI { | ||
| 167 | } | 169 | } |
| 168 | } | 170 | } |
| 169 | 171 | ||
| 172 | + sendFollowMessage(){ | ||
| 173 | + if(this.count === 0){ | ||
| 174 | + EmitterUtils.sendEvent(EmitterEventId.MY_FOLLOW_EMPTY) | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + | ||
| 170 | getNewPageData() { | 178 | getNewPageData() { |
| 171 | //我的关注列表 | 179 | //我的关注列表 |
| 172 | if (this.creatorDirectoryId === -1) { | 180 | if (this.creatorDirectoryId === -1) { |
| @@ -179,6 +187,7 @@ export struct FollowListDetailUI { | @@ -179,6 +187,7 @@ export struct FollowListDetailUI { | ||
| 179 | if (!this.data || value.list.length == 0) { | 187 | if (!this.data || value.list.length == 0) { |
| 180 | this.hasMore = false | 188 | this.hasMore = false |
| 181 | this.isLoading = false | 189 | this.isLoading = false |
| 190 | + this.isGetRequest = true | ||
| 182 | } else { | 191 | } else { |
| 183 | this.getFollowListStatus(value) | 192 | this.getFollowListStatus(value) |
| 184 | } | 193 | } |
| @@ -226,6 +235,8 @@ export struct FollowListDetailUI { | @@ -226,6 +235,8 @@ export struct FollowListDetailUI { | ||
| 226 | }) | 235 | }) |
| 227 | }) | 236 | }) |
| 228 | this.getFollowStatus(data_temp, result.totalCount) | 237 | this.getFollowStatus(data_temp, result.totalCount) |
| 238 | + }else{ | ||
| 239 | + this.isGetRequest = true | ||
| 229 | } | 240 | } |
| 230 | }).catch((err: Error) => { | 241 | }).catch((err: Error) => { |
| 231 | console.log(TAG, JSON.stringify(err)) | 242 | console.log(TAG, JSON.stringify(err)) |
| @@ -146,7 +146,7 @@ export struct HomePageBottomComponent{ | @@ -146,7 +146,7 @@ export struct HomePageBottomComponent{ | ||
| 146 | 146 | ||
| 147 | LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { | 147 | LazyForEach(this.data_follow, (item: FollowListDetailItem, index: number = 0) => { |
| 148 | ListItem() { | 148 | ListItem() { |
| 149 | - FollowChildComponent({data: item,type:1}) | 149 | + FollowChildComponent({data: item,type:2}) |
| 150 | } | 150 | } |
| 151 | .onClick(() => { | 151 | .onClick(() => { |
| 152 | }) | 152 | }) |
| @@ -284,6 +284,7 @@ export struct HomePageBottomComponent{ | @@ -284,6 +284,7 @@ export struct HomePageBottomComponent{ | ||
| 284 | if (!this.data_comment || value.list.length == 0){ | 284 | if (!this.data_comment || value.list.length == 0){ |
| 285 | this.hasMore = false | 285 | this.hasMore = false |
| 286 | this.isLoading = false | 286 | this.isLoading = false |
| 287 | + this.isGetRequest = true | ||
| 287 | }else{ | 288 | }else{ |
| 288 | this.getCommentListStatus(value) | 289 | this.getCommentListStatus(value) |
| 289 | } | 290 | } |
| @@ -101,6 +101,7 @@ export struct OtherHomePageBottomCommentComponent { | @@ -101,6 +101,7 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 101 | if (!this.data_comment || value.list.length == 0) { | 101 | if (!this.data_comment || value.list.length == 0) { |
| 102 | this.hasMore = false | 102 | this.hasMore = false |
| 103 | this.isLoading = false | 103 | this.isLoading = false |
| 104 | + this.isGetRequest = true | ||
| 104 | } else { | 105 | } else { |
| 105 | this.getCommentListStatus(value) | 106 | this.getCommentListStatus(value) |
| 106 | } | 107 | } |
| @@ -449,7 +449,7 @@ struct ChannelDialog { | @@ -449,7 +449,7 @@ struct ChannelDialog { | ||
| 449 | }.width('100%').height('100%') | 449 | }.width('100%').height('100%') |
| 450 | .scrollBar(BarState.Off) | 450 | .scrollBar(BarState.Off) |
| 451 | } | 451 | } |
| 452 | - .padding({ top: 40, right: 15, bottom: 20, left: 15 }) | 452 | + .padding({ top: 40, right: 15, bottom: 40, left: 15 }) |
| 453 | .backgroundColor('#ffffff') | 453 | .backgroundColor('#ffffff') |
| 454 | } | 454 | } |
| 455 | } | 455 | } |
| @@ -526,10 +526,9 @@ struct ChannelSubscriptionLayout { | @@ -526,10 +526,9 @@ struct ChannelSubscriptionLayout { | ||
| 526 | .width(18) | 526 | .width(18) |
| 527 | } | 527 | } |
| 528 | .width(36) | 528 | .width(36) |
| 529 | - .height(36) | 529 | + .height(40) |
| 530 | .justifyContent(FlexAlign.Center) | 530 | .justifyContent(FlexAlign.Center) |
| 531 | - .padding({ bottom: 6 }) | ||
| 532 | - .backgroundColor('#ffffff') | 531 | + .backgroundColor(Color.White) |
| 533 | .onClick(() => { | 532 | .onClick(() => { |
| 534 | if (this.dialogController != null) { | 533 | if (this.dialogController != null) { |
| 535 | this.dialogController.open() | 534 | this.dialogController.open() |
| @@ -8,6 +8,7 @@ import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' | @@ -8,6 +8,7 @@ import MinePageMoreFunctionUI from '../mine/MinePageMoreFunctionUI' | ||
| 8 | import { SPHelper, StringUtils } from 'wdKit' | 8 | import { SPHelper, StringUtils } from 'wdKit' |
| 9 | import { SpConstants } from 'wdConstant' | 9 | import { SpConstants } from 'wdConstant' |
| 10 | import dataPreferences from '@ohos.data.preferences'; | 10 | import dataPreferences from '@ohos.data.preferences'; |
| 11 | +import { MergeRecordDialog } from '../../dialog/MergeRecordDialog' | ||
| 11 | 12 | ||
| 12 | const TAG = 'MinePageComponent'; | 13 | const TAG = 'MinePageComponent'; |
| 13 | 14 | ||
| @@ -30,9 +31,23 @@ export struct MinePageComponent { | @@ -30,9 +31,23 @@ export struct MinePageComponent { | ||
| 30 | this.isLogin = false | 31 | this.isLogin = false |
| 31 | }else { | 32 | }else { |
| 32 | this.isLogin = true | 33 | this.isLogin = true |
| 34 | + this.addRecordDialog() | ||
| 33 | } | 35 | } |
| 34 | } | 36 | } |
| 35 | } | 37 | } |
| 38 | + mergeDialogController: CustomDialogController = new CustomDialogController({ | ||
| 39 | + builder: MergeRecordDialog({ | ||
| 40 | + cancel: () => { | ||
| 41 | + this.clearMergeRecord() | ||
| 42 | + }, | ||
| 43 | + confirm: () => { | ||
| 44 | + this.dealMergeRecordData() | ||
| 45 | + } | ||
| 46 | + }), | ||
| 47 | + customStyle: true, | ||
| 48 | + alignment: DialogAlignment.Center, | ||
| 49 | + autoCancel: false | ||
| 50 | + }) | ||
| 36 | 51 | ||
| 37 | aboutToAppear(){ | 52 | aboutToAppear(){ |
| 38 | this.getUserLogin() | 53 | this.getUserLogin() |
| @@ -112,5 +127,29 @@ export struct MinePageComponent { | @@ -112,5 +127,29 @@ export struct MinePageComponent { | ||
| 112 | } | 127 | } |
| 113 | } | 128 | } |
| 114 | 129 | ||
| 130 | + addRecordDialog() { | ||
| 131 | + setTimeout(() => { | ||
| 132 | + this.dealMergeRecordDialog() | ||
| 133 | + }, 300) | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + dealMergeRecordDialog() { | ||
| 137 | + let commentTime = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, "") | ||
| 138 | + if (StringUtils.isNotEmpty(commentTime)) { | ||
| 139 | + this.mergeDialogController.open() | ||
| 140 | + } | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + dealMergeRecordData() { | ||
| 144 | + MinePageDatasModel.visitorMergeComment().then(() => { | ||
| 145 | + this.mergeDialogController.close() | ||
| 146 | + }).catch(() => { | ||
| 147 | + this.mergeDialogController.close() | ||
| 148 | + }) | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + clearMergeRecord(){ | ||
| 152 | + SPHelper.default.saveSync(SpConstants.FIRSTCOMMENTTIME, "") | ||
| 153 | + } | ||
| 115 | } | 154 | } |
| 116 | 155 |
| @@ -5,12 +5,15 @@ import { RefreshConstants } from '../../utils/RefreshConstants' | @@ -5,12 +5,15 @@ import { RefreshConstants } from '../../utils/RefreshConstants' | ||
| 5 | */ | 5 | */ |
| 6 | @Component | 6 | @Component |
| 7 | export default struct NoMoreLayout { | 7 | export default struct NoMoreLayout { |
| 8 | + | ||
| 9 | + | ||
| 8 | build() { | 10 | build() { |
| 9 | - Row() { | 11 | + Column() { |
| 10 | Text($r('app.string.footer_text')) | 12 | Text($r('app.string.footer_text')) |
| 11 | - .margin({ left: RefreshConstants.NoMoreLayoutConstant_NORMAL_PADDING }) | ||
| 12 | .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT) | 13 | .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT) |
| 13 | .textAlign(TextAlign.Center) | 14 | .textAlign(TextAlign.Center) |
| 15 | + .fontColor('#CCCCCC') | ||
| 16 | + .margin({bottom:40}) | ||
| 14 | } | 17 | } |
| 15 | .width(RefreshConstants.FULL_WIDTH) | 18 | .width(RefreshConstants.FULL_WIDTH) |
| 16 | .justifyContent(FlexAlign.Center) | 19 | .justifyContent(FlexAlign.Center) |
| @@ -246,6 +246,7 @@ export struct PageComponent { | @@ -246,6 +246,7 @@ export struct PageComponent { | ||
| 246 | this.pageModel.groupId = this.pageId; | 246 | this.pageModel.groupId = this.pageId; |
| 247 | this.pageModel.channelId = this.channelId; | 247 | this.pageModel.channelId = this.channelId; |
| 248 | this.pageModel.currentPage = 1; | 248 | this.pageModel.currentPage = 1; |
| 249 | + this.pageModel.pageTotalCompSize = 0; | ||
| 249 | PageHelper.getInitData(this.pageModel, this.pageAdvModel) | 250 | PageHelper.getInitData(this.pageModel, this.pageAdvModel) |
| 250 | } | 251 | } |
| 251 | } | 252 | } |
| @@ -99,8 +99,12 @@ struct PeopleShipHomePage { | @@ -99,8 +99,12 @@ struct PeopleShipHomePage { | ||
| 99 | 99 | ||
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | - async aboutToAppear() { | 102 | + aboutToAppear() { |
| 103 | 103 | ||
| 104 | + this.getData() | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + private async getData() { | ||
| 104 | try { | 108 | try { |
| 105 | // 获取页面信息 | 109 | // 获取页面信息 |
| 106 | this.detailModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageDetailInfo(this.creatorId, '', '') | 110 | this.detailModel = await PeopleShipHomePageDataModel.getPeopleShipHomePageDetailInfo(this.creatorId, '', '') |
| @@ -117,8 +121,6 @@ struct PeopleShipHomePage { | @@ -117,8 +121,6 @@ struct PeopleShipHomePage { | ||
| 117 | } catch (exception) { | 121 | } catch (exception) { |
| 118 | 122 | ||
| 119 | } | 123 | } |
| 120 | - | ||
| 121 | - | ||
| 122 | } | 124 | } |
| 123 | 125 | ||
| 124 | findFollowStata(followList: QueryListIsFollowedItem[]) { | 126 | findFollowStata(followList: QueryListIsFollowedItem[]) { |
| @@ -156,8 +158,10 @@ struct PeopleShipHomePage { | @@ -156,8 +158,10 @@ struct PeopleShipHomePage { | ||
| 156 | PageRepository.postInteractAccentionOperate(params).then(res => { | 158 | PageRepository.postInteractAccentionOperate(params).then(res => { |
| 157 | if (this.isAttention == '1') { | 159 | if (this.isAttention == '1') { |
| 158 | this.isAttention = '0' | 160 | this.isAttention = '0' |
| 161 | + this.detailModel.fansNum -= 1 | ||
| 159 | } else { | 162 | } else { |
| 160 | this.isAttention = '1' | 163 | this.isAttention = '1' |
| 164 | + this.detailModel.fansNum += 1 | ||
| 161 | } | 165 | } |
| 162 | this.isLoadingAttention = false | 166 | this.isLoadingAttention = false |
| 163 | }) | 167 | }) |
| @@ -7,6 +7,7 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent | @@ -7,6 +7,7 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent | ||
| 7 | import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; | 7 | import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; |
| 8 | import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils'; | 8 | import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils'; |
| 9 | import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; | 9 | import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; |
| 10 | +import { WDRouterPage, WDRouterRule } from 'wdRouter' | ||
| 10 | 11 | ||
| 11 | 12 | ||
| 12 | const TAG = 'TopNavigationComponent'; | 13 | const TAG = 'TopNavigationComponent'; |
| @@ -63,6 +64,8 @@ export struct TopNavigationComponent { | @@ -63,6 +64,8 @@ export struct TopNavigationComponent { | ||
| 63 | @State indicatorLeftMargin: number = 0 | 64 | @State indicatorLeftMargin: number = 0 |
| 64 | @State indicatorWidth: number = 0 | 65 | @State indicatorWidth: number = 0 |
| 65 | private tabsWidth: number = 0 | 66 | private tabsWidth: number = 0 |
| 67 | + //定时器延时处理切换至版面、播报tab时 返回上一个tab | ||
| 68 | + @State tabTimmer: number = 0 | ||
| 66 | 69 | ||
| 67 | topOrBottomNavChange() { | 70 | topOrBottomNavChange() { |
| 68 | if (this.currentBottomNavName === this.currentBottomNavInfo?.name) { | 71 | if (this.currentBottomNavName === this.currentBottomNavInfo?.name) { |
| @@ -260,6 +263,9 @@ export struct TopNavigationComponent { | @@ -260,6 +263,9 @@ export struct TopNavigationComponent { | ||
| 260 | }) | 263 | }) |
| 261 | .animationDuration(this.animationDuration) | 264 | .animationDuration(this.animationDuration) |
| 262 | .onChange((index: number) => { | 265 | .onChange((index: number) => { |
| 266 | + if(this.tabTimmer){ | ||
| 267 | + clearTimeout(this.tabTimmer) | ||
| 268 | + } | ||
| 263 | this.currentTopNavName = | 269 | this.currentTopNavName = |
| 264 | this._currentNavIndex === 0 ? this.myChannelList[index].name : this.topNavList[index].name | 270 | this._currentNavIndex === 0 ? this.myChannelList[index].name : this.topNavList[index].name |
| 265 | Logger.info(TAG, `onChange index : ${index}`); | 271 | Logger.info(TAG, `onChange index : ${index}`); |
| @@ -271,11 +277,15 @@ export struct TopNavigationComponent { | @@ -271,11 +277,15 @@ export struct TopNavigationComponent { | ||
| 271 | if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { | 277 | if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { |
| 272 | // 跳转到播报页面 | 278 | // 跳转到播报页面 |
| 273 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | 279 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) |
| 274 | - this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | 280 | + this.tabTimmer = setTimeout(() => { |
| 281 | + this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | ||
| 282 | + }, 500) | ||
| 275 | } | 283 | } |
| 276 | if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { | 284 | if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { |
| 277 | ProcessUtils.gotoENewsPaper() | 285 | ProcessUtils.gotoENewsPaper() |
| 278 | - this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | 286 | + this.tabTimmer = setTimeout(() => { |
| 287 | + this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | ||
| 288 | + }, 500) | ||
| 279 | } | 289 | } |
| 280 | }) | 290 | }) |
| 281 | .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { | 291 | .onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => { |
| @@ -326,6 +336,20 @@ export struct TopNavigationComponent { | @@ -326,6 +336,20 @@ export struct TopNavigationComponent { | ||
| 326 | this.tabsController.changeIndex(index) | 336 | this.tabsController.changeIndex(index) |
| 327 | } | 337 | } |
| 328 | }) | 338 | }) |
| 339 | + }else { | ||
| 340 | + Row() { | ||
| 341 | + Image($r('app.media.icon_search')) | ||
| 342 | + .width('24vp') | ||
| 343 | + .height('24vp') | ||
| 344 | + } | ||
| 345 | + .height('40vp') | ||
| 346 | + .width('40vp') | ||
| 347 | + .margin({ right: 10 }) | ||
| 348 | + .alignItems(VerticalAlign.Center) | ||
| 349 | + .justifyContent(FlexAlign.Center) | ||
| 350 | + .onClick(() => { | ||
| 351 | + WDRouterRule.jumpWithPage(WDRouterPage.searchPage) | ||
| 352 | + }) | ||
| 329 | } | 353 | } |
| 330 | } | 354 | } |
| 331 | } | 355 | } |
| @@ -24,7 +24,7 @@ import PageAdModel from '../../viewmodel/PageAdvModel'; | @@ -24,7 +24,7 @@ import PageAdModel from '../../viewmodel/PageAdvModel'; | ||
| 24 | import PageHelper from '../../viewmodel/PageHelper'; | 24 | import PageHelper from '../../viewmodel/PageHelper'; |
| 25 | import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentionContentListTopComponent' | 25 | import { PeopleShipAttentionContentListTopComponent } from './PeopleShipAttentionContentListTopComponent' |
| 26 | import { CardParser } from '../CardParser' | 26 | import { CardParser } from '../CardParser' |
| 27 | -import NoMoreLayout from '../page/NoMoreLayout'; | 27 | +import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; |
| 28 | 28 | ||
| 29 | @Preview | 29 | @Preview |
| 30 | @Component | 30 | @Component |
| @@ -161,7 +161,7 @@ export struct PeopleShipMainComponent { | @@ -161,7 +161,7 @@ export struct PeopleShipMainComponent { | ||
| 161 | // 加载更多 | 161 | // 加载更多 |
| 162 | ListItem() { | 162 | ListItem() { |
| 163 | if (!this.hasMore && !this.isLoading) { | 163 | if (!this.hasMore && !this.isLoading) { |
| 164 | - NoMoreLayout() | 164 | + PeopleShipNoMoreData() |
| 165 | } | 165 | } |
| 166 | } | 166 | } |
| 167 | } | 167 | } |
| @@ -280,6 +280,7 @@ export struct PeopleShipMainComponent { | @@ -280,6 +280,7 @@ export struct PeopleShipMainComponent { | ||
| 280 | //批量查询各类型内容动态数据接口 | 280 | //批量查询各类型内容动态数据接口 |
| 281 | this.checkContentInteractData(listData.list, resolve) | 281 | this.checkContentInteractData(listData.list, resolve) |
| 282 | } else { | 282 | } else { |
| 283 | + this.hasMore = false; | ||
| 283 | this.resolveEnd(true, resolve) | 284 | this.resolveEnd(true, resolve) |
| 284 | } | 285 | } |
| 285 | 286 |
| 1 | import { PeopleShipRecommendHeadComponent } from './PeopleShipRecommendHeadComponent' | 1 | import { PeopleShipRecommendHeadComponent } from './PeopleShipRecommendHeadComponent' |
| 2 | import { RmhRecommendDTO } from 'wdBean'; | 2 | import { RmhRecommendDTO } from 'wdBean'; |
| 3 | -import { Logger } from 'wdKit/Index'; | ||
| 4 | -import NoMoreLayout from '../page/NoMoreLayout'; | 3 | +import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData'; |
| 5 | 4 | ||
| 6 | @Component | 5 | @Component |
| 7 | export struct PeopleShipRecommendComponent { | 6 | export struct PeopleShipRecommendComponent { |
| @@ -87,7 +86,8 @@ export struct PeopleShipRecommendComponent { | @@ -87,7 +86,8 @@ export struct PeopleShipRecommendComponent { | ||
| 87 | // 为你推荐 | 86 | // 为你推荐 |
| 88 | Button(this.rmhSelectedList.length == 0 ? '一键关注' : `一键关注 (${this.rmhSelectedList.length})`, { type: ButtonType.Normal, stateEffect: this.rmhSelectedList.length != 0 }) | 87 | Button(this.rmhSelectedList.length == 0 ? '一键关注' : `一键关注 (${this.rmhSelectedList.length})`, { type: ButtonType.Normal, stateEffect: this.rmhSelectedList.length != 0 }) |
| 89 | .margin({ | 88 | .margin({ |
| 90 | - top: '24vp' | 89 | + top: '24vp', |
| 90 | + bottom: '10vp' | ||
| 91 | }) | 91 | }) |
| 92 | .width('120vp') | 92 | .width('120vp') |
| 93 | .height('36vp') | 93 | .height('36vp') |
| @@ -104,7 +104,7 @@ export struct PeopleShipRecommendComponent { | @@ -104,7 +104,7 @@ export struct PeopleShipRecommendComponent { | ||
| 104 | } | 104 | } |
| 105 | }) | 105 | }) |
| 106 | // 没有更多 | 106 | // 没有更多 |
| 107 | - NoMoreLayout() | 107 | + PeopleShipNoMoreData() |
| 108 | } | 108 | } |
| 109 | .width('100%') | 109 | .width('100%') |
| 110 | } | 110 | } |
| @@ -25,12 +25,27 @@ export struct PeopleShipRecommendHeadComponent { | @@ -25,12 +25,27 @@ export struct PeopleShipRecommendHeadComponent { | ||
| 25 | }) | 25 | }) |
| 26 | }.margin({ top: 12, bottom: 8 }) | 26 | }.margin({ top: 12, bottom: 8 }) |
| 27 | 27 | ||
| 28 | - Text(this.rmhInfo.userName) | ||
| 29 | - .fontColor($r('app.color.color_222222')) | ||
| 30 | - .fontSize($r('app.float.vp_14')) | ||
| 31 | - .fontWeight(600) | ||
| 32 | - .maxLines(1) | ||
| 33 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | 28 | + Row() { |
| 29 | + Text(this.rmhInfo.userName) | ||
| 30 | + .fontColor($r('app.color.color_222222')) | ||
| 31 | + .fontSize($r('app.float.vp_14')) | ||
| 32 | + .fontWeight(600) | ||
| 33 | + .maxLines(1) | ||
| 34 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 35 | + if (this.rmhInfo.authIcon) { | ||
| 36 | + Image(this.rmhInfo.authIcon) | ||
| 37 | + .width('12vp') | ||
| 38 | + .height('12vp') | ||
| 39 | + .borderRadius(6) | ||
| 40 | + .objectFit(ImageFit.Cover) | ||
| 41 | + .margin({ | ||
| 42 | + left: '2vp' | ||
| 43 | + }) | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + .alignItems(VerticalAlign.Center) | ||
| 47 | + .justifyContent(FlexAlign.Center) | ||
| 48 | + | ||
| 34 | 49 | ||
| 35 | Text(this.rmhInfo.introduction) | 50 | Text(this.rmhInfo.introduction) |
| 36 | .fontColor($r('app.color.color_B0B0B0')) | 51 | .fontColor($r('app.color.color_B0B0B0')) |
| @@ -18,9 +18,9 @@ import { CardParser } from '../CardParser' | @@ -18,9 +18,9 @@ import { CardParser } from '../CardParser' | ||
| 18 | import { PageRepository } from '../../repository/PageRepository' | 18 | import { PageRepository } from '../../repository/PageRepository' |
| 19 | import { RefreshLayoutBean } from '../page/RefreshLayoutBean' | 19 | import { RefreshLayoutBean } from '../page/RefreshLayoutBean' |
| 20 | import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' | 20 | import CustomRefreshLoadLayout from '../page/CustomRefreshLoadLayout' |
| 21 | -import { ErrorComponent } from '../view/ErrorComponent'; | ||
| 22 | -import NoMoreLayout from '../page/NoMoreLayout'; | 21 | +import { ErrorComponent } from '../view/ErrorComponent' |
| 23 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh' | 22 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh' |
| 23 | +import { PeopleShipNoMoreData } from '../reusable/PeopleShipNoMoreData' | ||
| 24 | 24 | ||
| 25 | const TAG = 'PeopleShipHomeArticleListComponent'; | 25 | const TAG = 'PeopleShipHomeArticleListComponent'; |
| 26 | 26 | ||
| @@ -104,7 +104,7 @@ export struct PeopleShipHomeArticleListComponent { | @@ -104,7 +104,7 @@ export struct PeopleShipHomeArticleListComponent { | ||
| 104 | // 加载更多 | 104 | // 加载更多 |
| 105 | ListItem() { | 105 | ListItem() { |
| 106 | if (!this.hasMore && !this.isLoading) { | 106 | if (!this.hasMore && !this.isLoading) { |
| 107 | - NoMoreLayout() | 107 | + PeopleShipNoMoreData() |
| 108 | } | 108 | } |
| 109 | } | 109 | } |
| 110 | } | 110 | } |
| @@ -24,7 +24,7 @@ export struct PeopleShipHomeListComponent { | @@ -24,7 +24,7 @@ export struct PeopleShipHomeListComponent { | ||
| 24 | // 列表 | 24 | // 列表 |
| 25 | else if (this.publishCount == 0) { | 25 | else if (this.publishCount == 0) { |
| 26 | // 无数据展示 | 26 | // 无数据展示 |
| 27 | - EmptyComponent({emptyType: 13}).height(DisplayUtils.getDeviceHeight() - this.topHeight) | 27 | + EmptyComponent({emptyType: 12}).height(DisplayUtils.getDeviceHeight() - this.topHeight) |
| 28 | } else { | 28 | } else { |
| 29 | Column() { | 29 | Column() { |
| 30 | Column() { | 30 | Column() { |
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | import { PeopleShipUserDetailData } from 'wdBean' | 2 | import { PeopleShipUserDetailData } from 'wdBean' |
| 3 | import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' | 3 | import { PeopleShipHomePageHeadComponent } from './PeopleShipHomePageHeadComponent' |
| 4 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 4 | 5 | ||
| 5 | @Component | 6 | @Component |
| 6 | export struct PeopleShipHomePageNavComponent { | 7 | export struct PeopleShipHomePageNavComponent { |
| @@ -38,8 +39,13 @@ export struct PeopleShipHomePageNavComponent { | @@ -38,8 +39,13 @@ export struct PeopleShipHomePageNavComponent { | ||
| 38 | iconDiameter: 10, | 39 | iconDiameter: 10, |
| 39 | headPhotoUrl: (this.detailModel.headPhotoUrl && this.detailModel.headPhotoUrl.length > 0 ) ? this.detailModel.headPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon'), | 40 | headPhotoUrl: (this.detailModel.headPhotoUrl && this.detailModel.headPhotoUrl.length > 0 ) ? this.detailModel.headPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon'), |
| 40 | authIcon: this.detailModel.authIcon | 41 | authIcon: this.detailModel.authIcon |
| 41 | - }) | ||
| 42 | - .margin({ | 42 | + }).onClick(()=>{ |
| 43 | + let params = { | ||
| 44 | + 'headPhotoUrl': this.detailModel.headPhotoUrl, | ||
| 45 | + 'headType': '1' | ||
| 46 | + } as Record<string, string>; | ||
| 47 | + WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params) | ||
| 48 | + }).margin({ | ||
| 43 | left: '10vp', | 49 | left: '10vp', |
| 44 | }) | 50 | }) |
| 45 | .visibility((this.topOpacity > 0.5 ? Visibility.Visible : Visibility.Hidden)) | 51 | .visibility((this.topOpacity > 0.5 ? Visibility.Visible : Visibility.Hidden)) |
| @@ -56,7 +62,7 @@ export struct PeopleShipHomePageNavComponent { | @@ -56,7 +62,7 @@ export struct PeopleShipHomePageNavComponent { | ||
| 56 | 62 | ||
| 57 | if (this.isAttention == '0') { | 63 | if (this.isAttention == '0') { |
| 58 | // 关注 | 64 | // 关注 |
| 59 | - Button('+关注', { type: ButtonType.Normal, stateEffect: true }) | 65 | + Button('+ 关注', { type: ButtonType.Normal, stateEffect: true }) |
| 60 | .borderRadius(4) | 66 | .borderRadius(4) |
| 61 | .backgroundColor($r('app.color.color_ED2800')) | 67 | .backgroundColor($r('app.color.color_ED2800')) |
| 62 | .width('54vp') | 68 | .width('54vp') |
| @@ -9,6 +9,7 @@ export struct PeopleShipHomePageHeadComponent { | @@ -9,6 +9,7 @@ export struct PeopleShipHomePageHeadComponent { | ||
| 9 | Stack({ alignContent: Alignment.BottomEnd }) { | 9 | Stack({ alignContent: Alignment.BottomEnd }) { |
| 10 | // 头像 | 10 | // 头像 |
| 11 | Image( this.headPhotoUrl ) | 11 | Image( this.headPhotoUrl ) |
| 12 | + .alt($r('app.media.WDAccountOwnerHedaerDefaultIcon')) | ||
| 12 | .width(this.diameter) | 13 | .width(this.diameter) |
| 13 | .height(this.diameter) | 14 | .height(this.diameter) |
| 14 | .borderRadius(this.diameter/2) | 15 | .borderRadius(this.diameter/2) |
| @@ -7,6 +7,7 @@ import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageD | @@ -7,6 +7,7 @@ import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageD | ||
| 7 | import { InfluenceData, PeopleShipUserDetailData } from 'wdBean' | 7 | import { InfluenceData, PeopleShipUserDetailData } from 'wdBean' |
| 8 | import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent' | 8 | import { PeopleShipHomeAttentionComponent } from './PeopleShipHomeAttentionComponent' |
| 9 | import { HWLocationUtils } from 'wdHwAbility' | 9 | import { HWLocationUtils } from 'wdHwAbility' |
| 10 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 10 | 11 | ||
| 11 | 12 | ||
| 12 | @Component | 13 | @Component |
| @@ -51,6 +52,12 @@ export struct PeopleShipHomePageTopComponent { | @@ -51,6 +52,12 @@ export struct PeopleShipHomePageTopComponent { | ||
| 51 | }).margin({ | 52 | }).margin({ |
| 52 | left: '10vp', | 53 | left: '10vp', |
| 53 | bottom: '20vp' | 54 | bottom: '20vp' |
| 55 | + }).onClick(()=>{ | ||
| 56 | + let params = { | ||
| 57 | + 'headPhotoUrl': this.detailModel.headPhotoUrl, | ||
| 58 | + 'headType': '1' | ||
| 59 | + } as Record<string, string>; | ||
| 60 | + WDRouterRule.jumpWithPage(WDRouterPage.showUserHeaderPage,params) | ||
| 54 | }) | 61 | }) |
| 55 | 62 | ||
| 56 | 63 |
sight_harmony/features/wdComponent/src/main/ets/components/reusable/PeopleShipNoMoreData.ets
0 → 100644
| 1 | +@Component | ||
| 2 | +export struct PeopleShipNoMoreData{ | ||
| 3 | + | ||
| 4 | + @State title: string = '已显示全部内容' | ||
| 5 | + build(){ | ||
| 6 | + Row(){ | ||
| 7 | + Text("已显示全部内容") | ||
| 8 | + .fontColor($r('app.color.color_999999')) | ||
| 9 | + .fontWeight(400) | ||
| 10 | + .fontSize('14vp') | ||
| 11 | + } | ||
| 12 | + .justifyContent(FlexAlign.Center) | ||
| 13 | + .alignItems(VerticalAlign.Center) | ||
| 14 | + .width('100%') | ||
| 15 | + .margin({top:'24vp',bottom:'24vp'}) | ||
| 16 | + } | ||
| 17 | +} |
| @@ -29,11 +29,19 @@ export struct FirstTabTopSearchComponent { | @@ -29,11 +29,19 @@ export struct FirstTabTopSearchComponent { | ||
| 29 | if (value != null) { | 29 | if (value != null) { |
| 30 | this.searchTextData = value | 30 | this.searchTextData = value |
| 31 | } | 31 | } |
| 32 | + this.setDefaultHitData() | ||
| 32 | }).catch((err: Error) => { | 33 | }).catch((err: Error) => { |
| 33 | console.log(TAG, JSON.stringify(err)) | 34 | console.log(TAG, JSON.stringify(err)) |
| 35 | + this.setDefaultHitData() | ||
| 34 | }) | 36 | }) |
| 35 | } | 37 | } |
| 36 | 38 | ||
| 39 | + setDefaultHitData(){ | ||
| 40 | + if(this.searchTextData.length === 0){ | ||
| 41 | + this.searchTextData.push("搜索") | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + | ||
| 37 | build() { | 45 | build() { |
| 38 | Row() { | 46 | Row() { |
| 39 | Image($r('app.media.icon_search')) | 47 | Image($r('app.media.icon_search')) |
| @@ -13,14 +13,18 @@ const TAG = "SearchComponent" | @@ -13,14 +13,18 @@ const TAG = "SearchComponent" | ||
| 13 | @Component | 13 | @Component |
| 14 | export struct SearchComponent { | 14 | export struct SearchComponent { |
| 15 | @State searchTextData: string[] = [] | 15 | @State searchTextData: string[] = [] |
| 16 | + @State hasNoSearchTextData: boolean = false | ||
| 17 | + @State curHintSearchData: string = "" | ||
| 16 | @State hasInputContent: boolean = false | 18 | @State hasInputContent: boolean = false |
| 17 | @State hasChooseSearch: boolean = false | 19 | @State hasChooseSearch: boolean = false |
| 18 | - @State isClickedHistory: boolean = false | ||
| 19 | - @State isClickedHot: boolean = false | ||
| 20 | - @State isClickedRelated: boolean = false | 20 | + @State isClickedHistorySearch: boolean = false |
| 21 | + @State isClickedHotSearch: boolean = false | ||
| 22 | + @State isClickedRelatedSearch: boolean = false | ||
| 23 | + @State isClickedInputSearch: boolean = false | ||
| 24 | + @State isClickedHintSearch: boolean = false | ||
| 21 | private swiperController: SwiperController = new SwiperController() | 25 | private swiperController: SwiperController = new SwiperController() |
| 22 | @State searchText: string = '' | 26 | @State searchText: string = '' |
| 23 | - controller: TextInputController = new TextInputController() | 27 | + controller: SearchController = new SearchController() |
| 24 | @State searchHistoryData: SearchHistoryItem[] = [] | 28 | @State searchHistoryData: SearchHistoryItem[] = [] |
| 25 | @State relatedSearchContentsData: SearchRelatedItem[] = [] | 29 | @State relatedSearchContentsData: SearchRelatedItem[] = [] |
| 26 | scroller: Scroller = new Scroller() | 30 | scroller: Scroller = new Scroller() |
| @@ -30,6 +34,8 @@ export struct SearchComponent { | @@ -30,6 +34,8 @@ export struct SearchComponent { | ||
| 30 | aboutToAppear() { | 34 | aboutToAppear() { |
| 31 | //获取提示滚动 | 35 | //获取提示滚动 |
| 32 | this.getSearchHint() | 36 | this.getSearchHint() |
| 37 | + //清除缓存 | ||
| 38 | + SearcherAboutDataModel.searchHistoryData = [] | ||
| 33 | //获取搜索历史 | 39 | //获取搜索历史 |
| 34 | this.getSearchHistoryData() | 40 | this.getSearchHistoryData() |
| 35 | } | 41 | } |
| @@ -75,10 +81,18 @@ export struct SearchComponent { | @@ -75,10 +81,18 @@ export struct SearchComponent { | ||
| 75 | if (value != null) { | 81 | if (value != null) { |
| 76 | this.searchTextData = value | 82 | this.searchTextData = value |
| 77 | } | 83 | } |
| 84 | + this.setDefaultHitData() | ||
| 78 | }).catch((err: Error) => { | 85 | }).catch((err: Error) => { |
| 79 | console.log(TAG, JSON.stringify(err)) | 86 | console.log(TAG, JSON.stringify(err)) |
| 87 | + this.setDefaultHitData() | ||
| 80 | }) | 88 | }) |
| 81 | } | 89 | } |
| 90 | + setDefaultHitData(){ | ||
| 91 | + if(this.searchTextData.length === 0){ | ||
| 92 | + this.hasNoSearchTextData = true | ||
| 93 | + this.searchTextData.push("搜索感兴趣的内容") | ||
| 94 | + } | ||
| 95 | + } | ||
| 82 | 96 | ||
| 83 | getSearchHistoryData() { | 97 | getSearchHistoryData() { |
| 84 | this.searchHistoryData = SearcherAboutDataModel.getSearchHistoryData() | 98 | this.searchHistoryData = SearcherAboutDataModel.getSearchHistoryData() |
| @@ -131,7 +145,7 @@ export struct SearchComponent { | @@ -131,7 +145,7 @@ export struct SearchComponent { | ||
| 131 | getSearchHistoryResData(content:string,index:number){ | 145 | getSearchHistoryResData(content:string,index:number){ |
| 132 | //删除单条记录 | 146 | //删除单条记录 |
| 133 | SearcherAboutDataModel.delSearchSingleHistoryData(index) | 147 | SearcherAboutDataModel.delSearchSingleHistoryData(index) |
| 134 | - this.isClickedHistory = true | 148 | + this.isClickedHistorySearch = true |
| 135 | this.searchResData(content) | 149 | this.searchResData(content) |
| 136 | } | 150 | } |
| 137 | 151 | ||
| @@ -148,6 +162,16 @@ export struct SearchComponent { | @@ -148,6 +162,16 @@ export struct SearchComponent { | ||
| 148 | //查询 操作 TODO | 162 | //查询 操作 TODO |
| 149 | this.hasChooseSearch = true | 163 | this.hasChooseSearch = true |
| 150 | this.getSearchResultCountData() | 164 | this.getSearchResultCountData() |
| 165 | + this.controller.stopEditing() | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + /** | ||
| 169 | + * 点击hint搜索列表回调 | ||
| 170 | + * @param content | ||
| 171 | + */ | ||
| 172 | + getSearchHintResData(content:string){ | ||
| 173 | + this.isClickedHintSearch = true | ||
| 174 | + this.searchResData(content) | ||
| 151 | } | 175 | } |
| 152 | 176 | ||
| 153 | /** | 177 | /** |
| @@ -155,7 +179,7 @@ export struct SearchComponent { | @@ -155,7 +179,7 @@ export struct SearchComponent { | ||
| 155 | * @param content | 179 | * @param content |
| 156 | */ | 180 | */ |
| 157 | getSearchRelatedResData(content:string){ | 181 | getSearchRelatedResData(content:string){ |
| 158 | - this.isClickedRelated = true | 182 | + this.isClickedRelatedSearch = true |
| 159 | this.searchResData(content) | 183 | this.searchResData(content) |
| 160 | } | 184 | } |
| 161 | 185 | ||
| @@ -164,10 +188,18 @@ export struct SearchComponent { | @@ -164,10 +188,18 @@ export struct SearchComponent { | ||
| 164 | * @param content | 188 | * @param content |
| 165 | */ | 189 | */ |
| 166 | getSearchHotResData(content:string){ | 190 | getSearchHotResData(content:string){ |
| 167 | - this.isClickedHot = true | 191 | + this.isClickedHotSearch = true |
| 168 | this.searchResData(content) | 192 | this.searchResData(content) |
| 169 | } | 193 | } |
| 170 | 194 | ||
| 195 | + /** | ||
| 196 | + * 点击输入法搜索搜索列表回调 | ||
| 197 | + * @param content | ||
| 198 | + */ | ||
| 199 | + getSearchInputResData(content:string){ | ||
| 200 | + this.isClickedInputSearch = true | ||
| 201 | + this.searchResData(content) | ||
| 202 | + } | ||
| 171 | 203 | ||
| 172 | //搜索框 | 204 | //搜索框 |
| 173 | @Builder searchInputComponent() { | 205 | @Builder searchInputComponent() { |
| @@ -185,7 +217,7 @@ export struct SearchComponent { | @@ -185,7 +217,7 @@ export struct SearchComponent { | ||
| 185 | .textAlign(TextAlign.Start) | 217 | .textAlign(TextAlign.Start) |
| 186 | .maxLines(1) | 218 | .maxLines(1) |
| 187 | .textOverflow({ overflow: TextOverflow.Clip }) | 219 | .textOverflow({ overflow: TextOverflow.Clip }) |
| 188 | - .margin({ left: '40lpx' }) | 220 | + .margin({ left: '70lpx' }) |
| 189 | }) | 221 | }) |
| 190 | } | 222 | } |
| 191 | .loop(true) | 223 | .loop(true) |
| @@ -195,42 +227,57 @@ export struct SearchComponent { | @@ -195,42 +227,57 @@ export struct SearchComponent { | ||
| 195 | .vertical(true) | 227 | .vertical(true) |
| 196 | .enabled(false) | 228 | .enabled(false) |
| 197 | .focusable(false) | 229 | .focusable(false) |
| 230 | + .onChange((index: number) => { | ||
| 231 | + this.curHintSearchData = this.searchTextData[index] | ||
| 232 | + }) | ||
| 198 | } | 233 | } |
| 199 | Row(){ | 234 | Row(){ |
| 200 | - TextInput({ text: this.searchText, placeholder: '', controller: this.controller }) | ||
| 201 | - .caretColor(Color.Pink) | ||
| 202 | - .fontSize('27lpx') | 235 | + Search({ value: this.searchText, placeholder: '', controller: this.controller}) |
| 203 | .layoutWeight(1) | 236 | .layoutWeight(1) |
| 204 | - .fontColor(Color.Black) | ||
| 205 | - .onChange((value: string) => { | ||
| 206 | - this.searchText = value | ||
| 207 | - if (this.searchText.length > 0) { | ||
| 208 | - this.hasInputContent = true | ||
| 209 | - } else { | ||
| 210 | - this.hasInputContent = false | ||
| 211 | - } | ||
| 212 | - if(this.isClickedHistory || this.isClickedHot || this.isClickedRelated){ | ||
| 213 | - this.isClickedHistory = false | ||
| 214 | - this.isClickedHot = false | ||
| 215 | - this.isClickedRelated = false | ||
| 216 | - }else{ | ||
| 217 | - this.getRelatedSearchContent() | ||
| 218 | - } | ||
| 219 | - }) | ||
| 220 | - .backgroundColor($r('app.color.color_transparent')) | ||
| 221 | - .defaultFocus(true) | ||
| 222 | - if(this.hasInputContent){ | ||
| 223 | - Image($r('app.media.search_input_del_icon')) | ||
| 224 | - .width('31lpx') | ||
| 225 | - .height('31lpx') | ||
| 226 | - .objectFit(ImageFit.Cover) | ||
| 227 | - .interpolation(ImageInterpolation.High) | ||
| 228 | - .onClick(()=>{ | ||
| 229 | - this.searchText = "" | ||
| 230 | - this.hasInputContent = false | 237 | + .height('69lpx') |
| 238 | + .backgroundColor($r('app.color.color_transparent')) | ||
| 239 | + .textFont({ size: "27lpx", weight: "400lpx" }) | ||
| 240 | + .defaultFocus(true) | ||
| 241 | + .caretStyle({color:Color.Pink}) | ||
| 242 | + .onSubmit((value: string) => { | ||
| 243 | + if(StringUtils.isNotEmpty(this.searchText)){ | ||
| 244 | + SearcherAboutDataModel.putSearchHistoryData(this.searchText) | ||
| 245 | + this.getSearchHistoryData() | ||
| 246 | + this.getSearchInputResData(this.searchText) | ||
| 247 | + }else{ | ||
| 248 | + if(!this.hasNoSearchTextData){ | ||
| 249 | + if(StringUtils.isEmpty(this.curHintSearchData)){ | ||
| 250 | + this.curHintSearchData = this.searchTextData[0] | ||
| 251 | + } | ||
| 252 | + this.getSearchHintResData(this.curHintSearchData) | ||
| 253 | + }else{ | ||
| 254 | + ToastUtils.shortToast("请输入搜索关键词") | ||
| 255 | + } | ||
| 256 | + } | ||
| 257 | + }) | ||
| 258 | + .onChange((value: string) => { | ||
| 259 | + this.searchText = value | ||
| 260 | + if(this.isClickedHistorySearch || this.isClickedHotSearch || this.isClickedRelatedSearch || this.isClickedInputSearch|| this.isClickedHintSearch){ | ||
| 261 | + this.hasChooseSearch = true | ||
| 262 | + }else{ | ||
| 231 | this.hasChooseSearch = false | 263 | this.hasChooseSearch = false |
| 232 | - }) | ||
| 233 | - } | 264 | + } |
| 265 | + | ||
| 266 | + if (this.searchText.length > 0) { | ||
| 267 | + this.hasInputContent = true | ||
| 268 | + } else { | ||
| 269 | + this.hasInputContent = false | ||
| 270 | + } | ||
| 271 | + | ||
| 272 | + if(this.isClickedHistorySearch || this.isClickedHotSearch || this.isClickedRelatedSearch || this.isClickedInputSearch|| this.isClickedHintSearch){ | ||
| 273 | + this.resetSearch() | ||
| 274 | + }else{ | ||
| 275 | + if(this.hasInputContent){ | ||
| 276 | + this.getRelatedSearchContent() | ||
| 277 | + } | ||
| 278 | + } | ||
| 279 | + }) | ||
| 280 | + | ||
| 234 | }.padding({right:'30lpx'}) | 281 | }.padding({right:'30lpx'}) |
| 235 | .layoutWeight(1) | 282 | .layoutWeight(1) |
| 236 | } | 283 | } |
| @@ -241,7 +288,7 @@ export struct SearchComponent { | @@ -241,7 +288,7 @@ export struct SearchComponent { | ||
| 241 | 288 | ||
| 242 | //TODO 需要修改输入法 换行 | 289 | //TODO 需要修改输入法 换行 |
| 243 | //右 | 290 | //右 |
| 244 | - Text(this.hasInputContent?"搜索":"取消") | 291 | + Text("取消") |
| 245 | .textAlign(TextAlign.Center) | 292 | .textAlign(TextAlign.Center) |
| 246 | .fontWeight('400lpx') | 293 | .fontWeight('400lpx') |
| 247 | .fontSize('31lpx') | 294 | .fontSize('31lpx') |
| @@ -250,16 +297,7 @@ export struct SearchComponent { | @@ -250,16 +297,7 @@ export struct SearchComponent { | ||
| 250 | .width('125lpx') | 297 | .width('125lpx') |
| 251 | .height('58lpx') | 298 | .height('58lpx') |
| 252 | .onClick(() => { | 299 | .onClick(() => { |
| 253 | - if(this.hasInputContent){ | ||
| 254 | - if(StringUtils.isNotEmpty(this.searchText)){ | ||
| 255 | - SearcherAboutDataModel.putSearchHistoryData(this.searchText) | ||
| 256 | - this.getSearchHistoryData() | ||
| 257 | - | ||
| 258 | - this.getSearchHotResData(this.searchText) | ||
| 259 | - } | ||
| 260 | - }else{ | ||
| 261 | - router.back() | ||
| 262 | - } | 300 | + router.back() |
| 263 | }) | 301 | }) |
| 264 | } | 302 | } |
| 265 | .height('85lpx') | 303 | .height('85lpx') |
| @@ -289,9 +327,19 @@ export struct SearchComponent { | @@ -289,9 +327,19 @@ export struct SearchComponent { | ||
| 289 | } | 327 | } |
| 290 | } | 328 | } |
| 291 | this.isGetRequest = true | 329 | this.isGetRequest = true |
| 330 | + this.resetSearch() | ||
| 292 | }).catch((err: Error) => { | 331 | }).catch((err: Error) => { |
| 293 | console.log(TAG, JSON.stringify(err)) | 332 | console.log(TAG, JSON.stringify(err)) |
| 294 | this.isGetRequest = true | 333 | this.isGetRequest = true |
| 334 | + this.resetSearch() | ||
| 295 | }) | 335 | }) |
| 296 | } | 336 | } |
| 337 | + | ||
| 338 | + resetSearch(){ | ||
| 339 | + this.isClickedHistorySearch = false | ||
| 340 | + this.isClickedHotSearch = false | ||
| 341 | + this.isClickedRelatedSearch = false | ||
| 342 | + this.isClickedInputSearch = false | ||
| 343 | + this.isClickedHintSearch = false | ||
| 344 | + } | ||
| 297 | } | 345 | } |
| @@ -135,6 +135,6 @@ export struct SearchHistoryComponent{ | @@ -135,6 +135,6 @@ export struct SearchHistoryComponent{ | ||
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | getCategoryViewHeight() { | 137 | getCategoryViewHeight() { |
| 138 | - return `${46 * this.getCategoryRowCount()}lpx`; | 138 | + return `${50 * this.getCategoryRowCount()}lpx`; |
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| @@ -80,7 +80,7 @@ export struct SearchHotsComponent{ | @@ -80,7 +80,7 @@ export struct SearchHotsComponent{ | ||
| 80 | .fontWeight('400lpx') | 80 | .fontWeight('400lpx') |
| 81 | .lineHeight('42lpx') | 81 | .lineHeight('42lpx') |
| 82 | }.layoutWeight(1) | 82 | }.layoutWeight(1) |
| 83 | - if(item.mark!=0){ | 83 | + if(item.mark===1 || item.mark===2){ |
| 84 | Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2')) | 84 | Image(item.mark===1?$r('app.media.search_hots_mark1'):$r('app.media.search_hots_mark2')) |
| 85 | .width('42lpx') | 85 | .width('42lpx') |
| 86 | .height('31lpx') | 86 | .height('31lpx') |
| @@ -194,6 +194,7 @@ export struct SearchResultContentComponent{ | @@ -194,6 +194,7 @@ export struct SearchResultContentComponent{ | ||
| 194 | isSearch: true, | 194 | isSearch: true, |
| 195 | publishTimestamp:"", | 195 | publishTimestamp:"", |
| 196 | bottomNavId:'', | 196 | bottomNavId:'', |
| 197 | + openType:'' | ||
| 197 | } | 198 | } |
| 198 | 199 | ||
| 199 | this.data.push(contentDTO) | 200 | this.data.push(contentDTO) |
| 1 | import { Params } from 'wdBean'; | 1 | import { Params } from 'wdBean'; |
| 2 | import { AppUtils, StringUtils } from 'wdKit/Index'; | 2 | import { AppUtils, StringUtils } from 'wdKit/Index'; |
| 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 3 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 4 | +import { CustomTitleUI } from '../reusable/CustomTitleUI'; | ||
| 4 | import { EnvironmentCustomDialog } from './EnvironmentCustomDialog'; | 5 | import { EnvironmentCustomDialog } from './EnvironmentCustomDialog'; |
| 5 | 6 | ||
| 6 | const TAG = 'AboutPageUI'; | 7 | const TAG = 'AboutPageUI'; |
| @@ -23,11 +24,11 @@ export struct AboutPageUI { | @@ -23,11 +24,11 @@ export struct AboutPageUI { | ||
| 23 | }) | 24 | }) |
| 24 | 25 | ||
| 25 | build() { | 26 | build() { |
| 26 | - Navigation() { | 27 | + // Navigation() { |
| 27 | //滑动区域 | 28 | //滑动区域 |
| 28 | this.aboutUi() | 29 | this.aboutUi() |
| 29 | - }.titleMode(NavigationTitleMode.Mini) | ||
| 30 | - .title('关于') | 30 | + // }.titleMode(NavigationTitleMode.Mini) |
| 31 | + // .title('关于') | ||
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | aboutToAppear() { | 34 | aboutToAppear() { |
| @@ -42,6 +43,8 @@ export struct AboutPageUI { | @@ -42,6 +43,8 @@ export struct AboutPageUI { | ||
| 42 | @Builder | 43 | @Builder |
| 43 | aboutUi() { | 44 | aboutUi() { |
| 44 | Column() { | 45 | Column() { |
| 46 | + CustomTitleUI({titleName:'关于'}) | ||
| 47 | + | ||
| 45 | Image($r('app.media.setting_about_logo')) | 48 | Image($r('app.media.setting_about_logo')) |
| 46 | .width('278lpx') | 49 | .width('278lpx') |
| 47 | .height('154lpx') | 50 | .height('154lpx') |
| @@ -76,7 +76,7 @@ export struct AccountAndSecurityLayout { | @@ -76,7 +76,7 @@ export struct AccountAndSecurityLayout { | ||
| 76 | addEmitEvent(){ | 76 | addEmitEvent(){ |
| 77 | // 定义一个eventId为1的事件 | 77 | // 定义一个eventId为1的事件 |
| 78 | let event: emitter.InnerEvent = { | 78 | let event: emitter.InnerEvent = { |
| 79 | - eventId: 10010 | 79 | + eventId: EmitterEventId.PHONE_CHANGE_SUCCESS |
| 80 | }; | 80 | }; |
| 81 | 81 | ||
| 82 | // 收到eventId为1的事件后执行该回调 | 82 | // 收到eventId为1的事件后执行该回调 |
| @@ -197,7 +197,7 @@ export struct EmptyComponent { | @@ -197,7 +197,7 @@ export struct EmptyComponent { | ||
| 197 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { | 197 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoNetwork) { |
| 198 | contentString = '网络出小差了,请检查网络后重试' | 198 | contentString = '网络出小差了,请检查网络后重试' |
| 199 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { | 199 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { |
| 200 | - contentString = '获取内容失败请重试' | 200 | + contentString = '获取内容失败,请重试' |
| 201 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { | 201 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { |
| 202 | contentString = '暂无作品' | 202 | contentString = '暂无作品' |
| 203 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) { | 203 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) { |
| @@ -235,7 +235,7 @@ export struct EmptyComponent { | @@ -235,7 +235,7 @@ export struct EmptyComponent { | ||
| 235 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { | 235 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_ContentFailed) { |
| 236 | imageString = $r('app.media.icon_no_content') | 236 | imageString = $r('app.media.icon_no_content') |
| 237 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { | 237 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoCreation) { |
| 238 | - imageString = $r('app.media.icon_no_appointmentMade') | 238 | + imageString = $r('app.media.icon_no_works1') |
| 239 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) { | 239 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NoBooking) { |
| 240 | imageString = $r('app.media.icon_no_appointmentMade') | 240 | imageString = $r('app.media.icon_no_appointmentMade') |
| 241 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NetworkFailed) { | 241 | } else if (this.emptyType === WDViewDefaultType.WDViewDefaultType_NetworkFailed) { |
| 1 | +@CustomDialog | ||
| 2 | +export struct MergeRecordDialog { | ||
| 3 | + controller: CustomDialogController | ||
| 4 | + cancel: () => void = () => { | ||
| 5 | + } | ||
| 6 | + confirm: () => void = () => { | ||
| 7 | + } | ||
| 8 | + | ||
| 9 | + build() { | ||
| 10 | + Column() { | ||
| 11 | + Text("合并游客记录到当前账号,可避免信息丢失") | ||
| 12 | + .fontColor("#222222") | ||
| 13 | + .fontSize(18) | ||
| 14 | + .width("100%") | ||
| 15 | + .fontWeight(FontWeight.Bold) | ||
| 16 | + .textAlign(TextAlign.Center) | ||
| 17 | + .margin({ top: 20 }) | ||
| 18 | + | ||
| 19 | + Divider().color("#999999").width("100%").margin({ top: 20 }).height('1vp') | ||
| 20 | + Row() { | ||
| 21 | + Text('取消') | ||
| 22 | + .fontSize(16) | ||
| 23 | + .fontColor("#648DF2") | ||
| 24 | + .layoutWeight(1) | ||
| 25 | + .fontWeight(FontWeight.Medium) | ||
| 26 | + .textAlign(TextAlign.Center) | ||
| 27 | + .onClick(() => { | ||
| 28 | + this.controller.close() | ||
| 29 | + if (this.cancel) { | ||
| 30 | + this.cancel() | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + }) | ||
| 34 | + .height('100%') | ||
| 35 | + // Divider().color("#999999").height('100%').width('0.5vp') | ||
| 36 | + Text('一键合并') | ||
| 37 | + .fontSize(16) | ||
| 38 | + .fontColor("#648DF2") | ||
| 39 | + .layoutWeight(1) | ||
| 40 | + .fontWeight(FontWeight.Medium) | ||
| 41 | + .textAlign(TextAlign.Center) | ||
| 42 | + .border({ | ||
| 43 | + width: { left: 1 }, | ||
| 44 | + color: "#999999", | ||
| 45 | + style: { left: BorderStyle.Solid } | ||
| 46 | + | ||
| 47 | + }) | ||
| 48 | + .onClick(() => { | ||
| 49 | + this.controller.close() | ||
| 50 | + if (this.confirm) { | ||
| 51 | + this.confirm() | ||
| 52 | + } | ||
| 53 | + }) | ||
| 54 | + .height('100%') | ||
| 55 | + }.layoutWeight(1).justifyContent(FlexAlign.Center) | ||
| 56 | + }.height(140).backgroundColor(Color.White).borderRadius(10).width('74%') | ||
| 57 | + } | ||
| 58 | +} |
| @@ -4,7 +4,7 @@ import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsI | @@ -4,7 +4,7 @@ import MinePageCreatorFunctionsItem from '../viewmodel/MinePageCreatorFunctionsI | ||
| 4 | import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; | 4 | import MinePageMoreFunctionModel from '../viewmodel/MinePageMoreFunctionModel'; |
| 5 | import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | 5 | import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 6 | import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem'; | 6 | import { MineAppointmentListItem } from '../viewmodel/MineAppointmentListItem'; |
| 7 | -import { Logger, StringUtils, EmitterUtils, EmitterEventId } from 'wdKit'; | 7 | +import { Logger, StringUtils, EmitterUtils, EmitterEventId, SPHelper } from 'wdKit'; |
| 8 | import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem'; | 8 | import { MineFollowListDetailItem } from '../viewmodel/MineFollowListDetailItem'; |
| 9 | import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem'; | 9 | import { FollowListDetailRequestItem } from '../viewmodel/FollowListDetailRequestItem'; |
| 10 | import { FollowListItem } from '../viewmodel/FollowListItem'; | 10 | import { FollowListItem } from '../viewmodel/FollowListItem'; |
| @@ -22,6 +22,7 @@ import { UserFollowListRequestItem } from '../viewmodel/UserFollowListRequestIte | @@ -22,6 +22,7 @@ import { UserFollowListRequestItem } from '../viewmodel/UserFollowListRequestIte | ||
| 22 | import { AppointmentOperationRequestItem } from '../viewmodel/AppointmentOperationRequestItem'; | 22 | import { AppointmentOperationRequestItem } from '../viewmodel/AppointmentOperationRequestItem'; |
| 23 | import { CommentLikeOperationRequestItem } from '../viewmodel/CommentLikeOperationRequestItem'; | 23 | import { CommentLikeOperationRequestItem } from '../viewmodel/CommentLikeOperationRequestItem'; |
| 24 | import { FollowOperationRequestItem } from '../viewmodel/FollowOperationRequestItem'; | 24 | import { FollowOperationRequestItem } from '../viewmodel/FollowOperationRequestItem'; |
| 25 | +import { SpConstants } from 'wdConstant/Index'; | ||
| 25 | 26 | ||
| 26 | const TAG = "MinePageDatasModel" | 27 | const TAG = "MinePageDatasModel" |
| 27 | 28 | ||
| @@ -559,7 +560,26 @@ class MinePageDatasModel{ | @@ -559,7 +560,26 @@ class MinePageDatasModel{ | ||
| 559 | return WDHttp.post<ResponseDTO>(url,object) | 560 | return WDHttp.post<ResponseDTO>(url,object) |
| 560 | }; | 561 | }; |
| 561 | 562 | ||
| 562 | - | 563 | + visitorMergeComment() { |
| 564 | + let bean: Record<string, string> = {}; | ||
| 565 | + bean['time'] = SPHelper.default.getSync(SpConstants.FIRSTCOMMENTTIME, "") as string | ||
| 566 | + bean['deviceId'] = HttpUtils.getDeviceId(); | ||
| 567 | + return new Promise<object>((success, error) => { | ||
| 568 | + // Logger.info(TAG, `visitorMergeComment`); | ||
| 569 | + HttpBizUtil.post<ResponseDTO<object>>(HttpUrlUtils.visitorMergeComment(), bean).then((data: ResponseDTO<object>) => { | ||
| 570 | + if (!data) { | ||
| 571 | + error() | ||
| 572 | + } | ||
| 573 | + if (data.code != 0) { | ||
| 574 | + error() | ||
| 575 | + } | ||
| 576 | + SPHelper.default.save(SpConstants.FIRSTCOMMENTTIME, "") | ||
| 577 | + success(data) | ||
| 578 | + }).catch(() => { | ||
| 579 | + error() | ||
| 580 | + }) | ||
| 581 | + }) | ||
| 582 | + } | ||
| 563 | } | 583 | } |
| 564 | 584 | ||
| 565 | const minePageDatasModel = MinePageDatasModel.getInstance() | 585 | const minePageDatasModel = MinePageDatasModel.getInstance() |
| 1 | 1 | ||
| 2 | -import { Logger, SPHelper, UserDataLocal } from 'wdKit'; | 2 | +import { Logger, SPHelper, StringUtils, UserDataLocal } from 'wdKit'; |
| 3 | import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; | 3 | import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; |
| 4 | import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem'; | 4 | import { SearchHistoryItem } from '../viewmodel/SearchHistoryItem'; |
| 5 | import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem'; | 5 | import { SearchHotContentItem } from '../viewmodel/SearchHotContentItem'; |
| @@ -18,7 +18,7 @@ const TAG = "SearcherAboutDataModel" | @@ -18,7 +18,7 @@ const TAG = "SearcherAboutDataModel" | ||
| 18 | class SearcherAboutDataModel{ | 18 | class SearcherAboutDataModel{ |
| 19 | private static instance: SearcherAboutDataModel; | 19 | private static instance: SearcherAboutDataModel; |
| 20 | public searchHistoryData:SearchHistoryItem[] = [] | 20 | public searchHistoryData:SearchHistoryItem[] = [] |
| 21 | - public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY" + UserDataLocal.getUserId() | 21 | + public SEARCH_HISTORY_KEY:string = "SEARCH_HISTORY_KEY" |
| 22 | 22 | ||
| 23 | private constructor() { } | 23 | private constructor() { } |
| 24 | 24 | ||
| @@ -37,7 +37,7 @@ class SearcherAboutDataModel{ | @@ -37,7 +37,7 @@ class SearcherAboutDataModel{ | ||
| 37 | * 插入搜索记录(单个) | 37 | * 插入搜索记录(单个) |
| 38 | */ | 38 | */ |
| 39 | public async putSearchHistoryData(content:string){ | 39 | public async putSearchHistoryData(content:string){ |
| 40 | - let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string | 40 | + let history = SPHelper.default.getSync(this.generationSearchKey(),"[]") as string |
| 41 | this.searchHistoryData = JSON.parse(history) | 41 | this.searchHistoryData = JSON.parse(history) |
| 42 | this.searchHistoryData.forEach((element,index) => { | 42 | this.searchHistoryData.forEach((element,index) => { |
| 43 | if (element.searchContent == content) { | 43 | if (element.searchContent == content) { |
| @@ -45,14 +45,14 @@ class SearcherAboutDataModel{ | @@ -45,14 +45,14 @@ class SearcherAboutDataModel{ | ||
| 45 | } | 45 | } |
| 46 | }); | 46 | }); |
| 47 | this.searchHistoryData.splice(0,0,new SearchHistoryItem(content)) | 47 | this.searchHistoryData.splice(0,0,new SearchHistoryItem(content)) |
| 48 | - await SPHelper.default.saveSync(this.SEARCH_HISTORY_KEY, JSON.stringify(this.searchHistoryData)); | 48 | + await SPHelper.default.saveSync(this.generationSearchKey(), JSON.stringify(this.searchHistoryData)); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | /** | 51 | /** |
| 52 | * 删除搜索记录(所有) | 52 | * 删除搜索记录(所有) |
| 53 | */ | 53 | */ |
| 54 | public async delSearchHistoryData(){ | 54 | public async delSearchHistoryData(){ |
| 55 | - SPHelper.default.deleteSync(this.SEARCH_HISTORY_KEY) | 55 | + SPHelper.default.deleteSync(this.generationSearchKey()) |
| 56 | this.searchHistoryData = [] | 56 | this.searchHistoryData = [] |
| 57 | } | 57 | } |
| 58 | /** | 58 | /** |
| @@ -62,11 +62,11 @@ class SearcherAboutDataModel{ | @@ -62,11 +62,11 @@ class SearcherAboutDataModel{ | ||
| 62 | if(this.searchHistoryData!=null && this.searchHistoryData.length>0){ | 62 | if(this.searchHistoryData!=null && this.searchHistoryData.length>0){ |
| 63 | this.searchHistoryData.splice(index,1) | 63 | this.searchHistoryData.splice(index,1) |
| 64 | }else{ | 64 | }else{ |
| 65 | - let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string | 65 | + let history = SPHelper.default.getSync(this.generationSearchKey(),"[]") as string |
| 66 | this.searchHistoryData = JSON.parse(history) | 66 | this.searchHistoryData = JSON.parse(history) |
| 67 | this.searchHistoryData.splice(index,1) | 67 | this.searchHistoryData.splice(index,1) |
| 68 | } | 68 | } |
| 69 | - SPHelper.default.saveSync(this.SEARCH_HISTORY_KEY, JSON.stringify(this.searchHistoryData)) | 69 | + SPHelper.default.saveSync(this.generationSearchKey(), JSON.stringify(this.searchHistoryData)) |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | /** | 72 | /** |
| @@ -79,7 +79,7 @@ class SearcherAboutDataModel{ | @@ -79,7 +79,7 @@ class SearcherAboutDataModel{ | ||
| 79 | } | 79 | } |
| 80 | return this.searchHistoryData | 80 | return this.searchHistoryData |
| 81 | } | 81 | } |
| 82 | - let history = SPHelper.default.getSync(this.SEARCH_HISTORY_KEY,"[]") as string | 82 | + let history = SPHelper.default.getSync(this.generationSearchKey(),"[]") as string |
| 83 | 83 | ||
| 84 | this.searchHistoryData = JSON.parse(history) | 84 | this.searchHistoryData = JSON.parse(history) |
| 85 | if(this.searchHistoryData.length>10){ | 85 | if(this.searchHistoryData.length>10){ |
| @@ -91,6 +91,15 @@ class SearcherAboutDataModel{ | @@ -91,6 +91,15 @@ class SearcherAboutDataModel{ | ||
| 91 | return this.searchHistoryData | 91 | return this.searchHistoryData |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | + public generationSearchKey():string{ | ||
| 95 | + let userId = UserDataLocal.getUserId() | ||
| 96 | + if(StringUtils.isEmpty(userId)){ | ||
| 97 | + return this.SEARCH_HISTORY_KEY + "_" + "0000111122223333" | ||
| 98 | + }else{ | ||
| 99 | + return this.SEARCH_HISTORY_KEY + "_" + userId | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + | ||
| 94 | /** | 103 | /** |
| 95 | * 首页 搜索提示滚动内容 | 104 | * 首页 搜索提示滚动内容 |
| 96 | */ | 105 | */ |
| @@ -4,16 +4,18 @@ import { router } from '@kit.ArkUI'; | @@ -4,16 +4,18 @@ import { router } from '@kit.ArkUI'; | ||
| 4 | @Component | 4 | @Component |
| 5 | struct ShowUserHeaderPage { | 5 | struct ShowUserHeaderPage { |
| 6 | @State headPhotoUrl: string = ''; | 6 | @State headPhotoUrl: string = ''; |
| 7 | + @State headType: string = '' | ||
| 7 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 8 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 8 | 9 | ||
| 9 | onPageShow() { | 10 | onPageShow() { |
| 10 | this.headPhotoUrl = this.params?.['headPhotoUrl']; | 11 | this.headPhotoUrl = this.params?.['headPhotoUrl']; |
| 12 | + this.headType = this.params?.['headType'] ?? ''; | ||
| 11 | } | 13 | } |
| 12 | 14 | ||
| 13 | build() { | 15 | build() { |
| 14 | Row() { | 16 | Row() { |
| 15 | Image(this.headPhotoUrl) | 17 | Image(this.headPhotoUrl) |
| 16 | - .alt($r('app.media.default_head')) | 18 | + .alt(this.headType.length > 0 ? $r('app.media.WDAccountOwnerHedaerDefaultIcon') : $r('app.media.default_head')) |
| 17 | .width('720lpx') | 19 | .width('720lpx') |
| 18 | .height('720lpx') | 20 | .height('720lpx') |
| 19 | .objectFit(ImageFit.Auto) | 21 | .objectFit(ImageFit.Auto) |
| @@ -34,7 +34,7 @@ export class RefreshConstants { | @@ -34,7 +34,7 @@ export class RefreshConstants { | ||
| 34 | /** | 34 | /** |
| 35 | * The refresh and load height. | 35 | * The refresh and load height. |
| 36 | */ | 36 | */ |
| 37 | - static readonly CUSTOM_LAYOUT_HEIGHT: number = 90; | 37 | + static readonly CUSTOM_LAYOUT_HEIGHT: number = 80; |
| 38 | /** | 38 | /** |
| 39 | * Full the width. | 39 | * Full the width. |
| 40 | */ | 40 | */ |
| 1 | import { CompDTO, ContentDTO, PageDTO, PageInfoDTO } from 'wdBean'; | 1 | import { CompDTO, ContentDTO, PageDTO, PageInfoDTO } from 'wdBean'; |
| 2 | import { CompStyle, ViewType } from 'wdConstant/Index'; | 2 | import { CompStyle, ViewType } from 'wdConstant/Index'; |
| 3 | -import { CollectionUtils, DateTimeUtils, Logger, NetworkUtil } from 'wdKit'; | 3 | +import { CollectionUtils, DateTimeUtils, Logger, NetworkUtil, StringUtils } from 'wdKit'; |
| 4 | import { closeRefresh } from '../utils/PullDownRefresh'; | 4 | import { closeRefresh } from '../utils/PullDownRefresh'; |
| 5 | import PageModel from './PageModel'; | 5 | import PageModel from './PageModel'; |
| 6 | import PageViewModel from './PageViewModel'; | 6 | import PageViewModel from './PageViewModel'; |
| @@ -9,6 +9,7 @@ import { CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; | @@ -9,6 +9,7 @@ import { CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; | ||
| 9 | import PageAdModel from './PageAdvModel'; | 9 | import PageAdModel from './PageAdvModel'; |
| 10 | import { ArrayList } from '@kit.ArkTS'; | 10 | import { ArrayList } from '@kit.ArkTS'; |
| 11 | import { WDViewDefaultType } from '../components/view/EmptyComponent'; | 11 | import { WDViewDefaultType } from '../components/view/EmptyComponent'; |
| 12 | +import { CompAdvMatInfoBean } from 'wdBean/src/main/ets/bean/adv/CompAdvInfoBean'; | ||
| 12 | 13 | ||
| 13 | const TAG = 'PageHelper'; | 14 | const TAG = 'PageHelper'; |
| 14 | 15 | ||
| @@ -21,6 +22,7 @@ export class PageHelper { | @@ -21,6 +22,7 @@ export class PageHelper { | ||
| 21 | */ | 22 | */ |
| 22 | async refreshUI(pageModel: PageModel, pageAdvModel: PageAdModel) { | 23 | async refreshUI(pageModel: PageModel, pageAdvModel: PageAdModel) { |
| 23 | pageModel.loadStrategy = 2 | 24 | pageModel.loadStrategy = 2 |
| 25 | + pageModel.pageTotalCompSize = 0; | ||
| 24 | this.getPageInfo(pageModel, pageAdvModel) | 26 | this.getPageInfo(pageModel, pageAdvModel) |
| 25 | } | 27 | } |
| 26 | 28 | ||
| @@ -52,7 +54,7 @@ export class PageHelper { | @@ -52,7 +54,7 @@ export class PageHelper { | ||
| 52 | PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { | 54 | PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { |
| 53 | if (pageInfo == null) { | 55 | if (pageInfo == null) { |
| 54 | pageModel.viewType = ViewType.EMPTY; | 56 | pageModel.viewType = ViewType.EMPTY; |
| 55 | - pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent; | 57 | + pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; |
| 56 | return; | 58 | return; |
| 57 | } | 59 | } |
| 58 | pageModel.pageInfo = pageInfo; | 60 | pageModel.pageInfo = pageInfo; |
| @@ -94,7 +96,7 @@ export class PageHelper { | @@ -94,7 +96,7 @@ export class PageHelper { | ||
| 94 | // 没数据,展示空页面 | 96 | // 没数据,展示空页面 |
| 95 | Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.'); | 97 | Logger.debug(TAG, 'aboutToAppear, data response page ' + pageModel.pageId + ', comp list is empty.'); |
| 96 | pageModel.viewType = ViewType.EMPTY; | 98 | pageModel.viewType = ViewType.EMPTY; |
| 97 | - pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoListContent; | 99 | + pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; |
| 98 | 100 | ||
| 99 | } | 101 | } |
| 100 | } | 102 | } |
| @@ -147,7 +149,7 @@ export class PageHelper { | @@ -147,7 +149,7 @@ export class PageHelper { | ||
| 147 | * 处理页面中的广告组件信息 | 149 | * 处理页面中的广告组件信息 |
| 148 | * @param pageDto | 150 | * @param pageDto |
| 149 | */ | 151 | */ |
| 150 | - private handlePageCompAdvPostion(pageCompList: ArrayList<CompDTO>, pageDto: PageDTO) { | 152 | + private handlePageCompAdvPostion(pageCompList: ArrayList<CompDTO>, pageModel: PageModel, pageDto: PageDTO) { |
| 151 | 153 | ||
| 152 | let compAdvList = pageDto.compAdList | 154 | let compAdvList = pageDto.compAdList |
| 153 | 155 | ||
| @@ -159,17 +161,20 @@ export class PageHelper { | @@ -159,17 +161,20 @@ export class PageHelper { | ||
| 159 | flag = false | 161 | flag = false |
| 160 | } | 162 | } |
| 161 | 163 | ||
| 164 | + | ||
| 162 | let pageCompSize = pageCompList.length // 信息流组件业务数量 | 165 | let pageCompSize = pageCompList.length // 信息流组件业务数量 |
| 163 | - console.error("ZZZXXXXX", " start--->" + pageCompSize); | 166 | + // console.error("ZZZXXXXX", " start--->" + pageCompSize); |
| 164 | 167 | ||
| 165 | if (pageCompSize == 0) { | 168 | if (pageCompSize == 0) { |
| 166 | flag = false | 169 | flag = false |
| 167 | } | 170 | } |
| 168 | 171 | ||
| 169 | if (flag) { | 172 | if (flag) { |
| 173 | + let bannerAdvIndex = 0; // banner组件展示数据投放 | ||
| 174 | + let layoutAdvIndex = 0; //稿件投放统计 | ||
| 170 | // 升序排序 | 175 | // 升序排序 |
| 171 | compAdvList.sort((a: CompAdvBean, b: CompAdvBean) => a.slotInfo.position - b.slotInfo.position) | 176 | compAdvList.sort((a: CompAdvBean, b: CompAdvBean) => a.slotInfo.position - b.slotInfo.position) |
| 172 | - console.error("ZZZXXXXX", " 排序后的广告--->" + JSON.stringify(compAdvList)); | 177 | + // console.error("ZZZXXXXX", " 排序后的广告--->" + JSON.stringify(compAdvList)); |
| 173 | //当前日期 | 178 | //当前日期 |
| 174 | let serverTimeLong: number = DateTimeUtils.getTimeStamp(); | 179 | let serverTimeLong: number = DateTimeUtils.getTimeStamp(); |
| 175 | for (let advBean of compAdvList) { | 180 | for (let advBean of compAdvList) { |
| @@ -192,14 +197,91 @@ export class PageHelper { | @@ -192,14 +197,91 @@ export class PageHelper { | ||
| 192 | // 插入轮播组件的广告 | 197 | // 插入轮播组件的广告 |
| 193 | if (4 == advSubType) { | 198 | if (4 == advSubType) { |
| 194 | 199 | ||
| 200 | + let position = slotInfo.position - 1; | ||
| 201 | + // 检测newCompList 集合中是否有轮播组件资源 | ||
| 202 | + let adCompId = slotInfo.compId; | ||
| 203 | + if (!StringUtils.isEmpty(adCompId)) { | ||
| 204 | + for (let compBean of pageCompList) { | ||
| 205 | + if (StringUtils.isEmpty(compBean.id)) { | ||
| 206 | + continue | ||
| 207 | + } | ||
| 208 | + let compId = compBean.id.toString(); | ||
| 209 | + //匹配组件 | ||
| 210 | + if (adCompId == compId) { | ||
| 211 | + // 运营位数据 | ||
| 212 | + let dataList = compBean.operDataList; | ||
| 213 | + if (dataList != null) { | ||
| 214 | + | ||
| 215 | + // 数组转成 ArrayList | ||
| 216 | + let changeArrayList = (dataList: ContentDTO[]) => { | ||
| 217 | + let compOperData: ArrayList<ContentDTO> = new ArrayList() | ||
| 218 | + for (let dataListBean of dataList) { | ||
| 219 | + compOperData.add(dataListBean) | ||
| 220 | + } | ||
| 221 | + return compOperData | ||
| 222 | + } | ||
| 223 | + | ||
| 224 | + let compOperData = changeArrayList(dataList) | ||
| 225 | + | ||
| 226 | + // 轮播组件广告数据转 业务信息 | ||
| 227 | + let changeContentDTO = (matInfo: CompAdvMatInfoBean) => { | ||
| 228 | + let advContentBean: ContentDTO = {} as ContentDTO; | ||
| 229 | + advContentBean.newsTitle = matInfo.advTitle | ||
| 230 | + advContentBean.objectType = matInfo.advType == "0" ? matInfo.advType : "4" | ||
| 231 | + advContentBean.coverUrl = matInfo.matImageUrl[0] | ||
| 232 | + advContentBean.linkUrl = matInfo.linkUrl | ||
| 233 | + advContentBean.openType = matInfo.linkType | ||
| 234 | + advContentBean.corner = '' | ||
| 235 | + return advContentBean | ||
| 236 | + } | ||
| 237 | + let advContentBean = changeContentDTO(matInfo) | ||
| 238 | + | ||
| 239 | + let dataListSize = dataList.length; | ||
| 240 | + if (position < dataListSize) { | ||
| 241 | + //dataList.add(position + bannerAdvIndex, advContentBean); | ||
| 242 | + compOperData.insert(advContentBean, position + bannerAdvIndex) | ||
| 243 | + } else { | ||
| 244 | + compOperData.add(advContentBean); | ||
| 245 | + } | ||
| 246 | + bannerAdvIndex = bannerAdvIndex + 1; | ||
| 247 | + | ||
| 248 | + // ArrayList转成 数组 | ||
| 249 | + compBean.operDataList = compOperData.convertToArray() | ||
| 250 | + } | ||
| 251 | + } | ||
| 252 | + } | ||
| 253 | + } | ||
| 254 | + | ||
| 195 | } else { | 255 | } else { |
| 256 | + | ||
| 257 | + | ||
| 196 | let advPosition = slotInfo.position //广告位置,从1开始 | 258 | let advPosition = slotInfo.position //广告位置,从1开始 |
| 259 | + // 页面的comp总数 - 这次请求的comp总数 = 剩余comp总数 | ||
| 197 | advPosition = advPosition - 1 | 260 | advPosition = advPosition - 1 |
| 198 | - let advComp: CompDTO = { | ||
| 199 | - compStyle: CompStyle.Card_Comp_Adv, | ||
| 200 | - matInfo: matInfo | ||
| 201 | - } as CompDTO; | ||
| 202 | - pageCompList.insert(advComp, 0) | 261 | + |
| 262 | + let a = pageModel.pageTotalCompSize - pageCompSize | ||
| 263 | + if (advPosition <= pageModel.pageTotalCompSize && advPosition >= a) { | ||
| 264 | + | ||
| 265 | + let b = advPosition - a; | ||
| 266 | + console.error('ZZZXXXXX', matInfo.advSubType + '-------------' + matInfo.advTitle + " " + advPosition + " " + a + " " + b) | ||
| 267 | + if (b <= pageCompSize && b >= 0) { | ||
| 268 | + | ||
| 269 | + let advComp: CompDTO = { | ||
| 270 | + compStyle: CompStyle.Card_Comp_Adv, | ||
| 271 | + matInfo: matInfo | ||
| 272 | + } as CompDTO; | ||
| 273 | + | ||
| 274 | + if (pageCompSize == slotInfo.position) { | ||
| 275 | + pageCompList.add(advComp) | ||
| 276 | + } else { | ||
| 277 | + pageCompList.insert(advComp, b + layoutAdvIndex) | ||
| 278 | + } | ||
| 279 | + | ||
| 280 | + layoutAdvIndex = layoutAdvIndex + 1; | ||
| 281 | + | ||
| 282 | + } | ||
| 283 | + } | ||
| 284 | + | ||
| 203 | } | 285 | } |
| 204 | } | 286 | } |
| 205 | } | 287 | } |
| @@ -207,7 +289,7 @@ export class PageHelper { | @@ -207,7 +289,7 @@ export class PageHelper { | ||
| 207 | } | 289 | } |
| 208 | 290 | ||
| 209 | } | 291 | } |
| 210 | - console.error("ZZZXXXXX", " end--->" + pageCompList.length); | 292 | + // console.error("ZZZXXXXX", " end--->" + pageCompList.length); |
| 211 | } | 293 | } |
| 212 | 294 | ||
| 213 | 295 | ||
| @@ -228,19 +310,21 @@ export class PageHelper { | @@ -228,19 +310,21 @@ export class PageHelper { | ||
| 228 | 310 | ||
| 229 | //移除音频 和 活动 | 311 | //移除音频 和 活动 |
| 230 | this.collectPageComp(pageModel, data) | 312 | this.collectPageComp(pageModel, data) |
| 231 | - // | 313 | + |
| 232 | // pageModel.compList.push(...data.compList) | 314 | // pageModel.compList.push(...data.compList) |
| 233 | - PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => { | ||
| 234 | - // 刷新,替换所有数据 | ||
| 235 | - pageModel.compList.updateItems(sizeBefore, data) | ||
| 236 | - pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 237 | - }) | 315 | + // TODO 暂时屏蔽,此处代码会造成 广告逻辑错乱,只有第一页有广告数据,随着加载更多,第二页也会出现广告数据 |
| 316 | + // PageViewModel.getInteractData(data.compList).then((data: CompDTO[]) => { | ||
| 317 | + // // 刷新,替换所有数据 | ||
| 318 | + // pageModel.compList.updateItems(sizeBefore, data) | ||
| 319 | + // pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | ||
| 320 | + // }) | ||
| 238 | } | 321 | } |
| 239 | }).catch((err: string | Resource) => { | 322 | }).catch((err: string | Resource) => { |
| 240 | promptAction.showToast({ message: err }); | 323 | promptAction.showToast({ message: err }); |
| 241 | }) | 324 | }) |
| 242 | } | 325 | } |
| 243 | 326 | ||
| 327 | + | ||
| 244 | /** | 328 | /** |
| 245 | * 移除comp | 329 | * 移除comp |
| 246 | */ | 330 | */ |
| @@ -256,11 +340,22 @@ export class PageHelper { | @@ -256,11 +340,22 @@ export class PageHelper { | ||
| 256 | if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { | 340 | if (contentInfo && (contentInfo.objectType === '13' || contentInfo.objectType === '3')) { |
| 257 | Logger.debug(TAG, 'getGroupData 移除音频 和 活动'); | 341 | Logger.debug(TAG, 'getGroupData 移除音频 和 活动'); |
| 258 | } else { | 342 | } else { |
| 259 | - pageCompList.add(element) | 343 | + // 暂时屏蔽活动和音频详情入口 |
| 344 | + if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') { | ||
| 345 | + } else { | ||
| 346 | + pageCompList.add(element) | ||
| 347 | + } | ||
| 348 | + | ||
| 260 | } | 349 | } |
| 261 | } | 350 | } |
| 351 | + | ||
| 352 | + // 记录 | ||
| 353 | + pageModel.pageTotalCompSize = pageCompList.length + pageModel.pageTotalCompSize | ||
| 354 | + // console.error("ZZZXXXXX", " collectPageComp--->" + pageModel.pageTotalCompSize); | ||
| 355 | + | ||
| 262 | // 处理页面广告数据,投放到页面的位置 | 356 | // 处理页面广告数据,投放到页面的位置 |
| 263 | - //this.handlePageCompAdvPostion(pageCompList, pageDto); | 357 | + this.handlePageCompAdvPostion(pageCompList, pageModel, pageDto); |
| 358 | + | ||
| 264 | 359 | ||
| 265 | //遍历所有组件和稿件数据 push到页面 | 360 | //遍历所有组件和稿件数据 push到页面 |
| 266 | for (let element of pageCompList) { | 361 | for (let element of pageCompList) { |
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="9" height="6" viewBox="0 0 9 6"><g><g><path d="M2.63066,0.5L7.79156,0.5C8.13703,0.5,8.3784,0.8420000000000001,8.26266,1.167505L6.84044,5.1675C6.76957,5.36684,6.5809,5.5,6.36934,5.5L1.208442,5.5C0.862974,5.5,0.6216,5.158,0.737335,4.8325L2.15956,0.832495C2.23043,0.633155,2.4191000000000003,0.5,2.63066,0.5" fill-rule="evenodd" fill="#ED2800" fill-opacity="1"/></g></g></svg> |
| @@ -58,10 +58,10 @@ export struct TabLiveComponent { | @@ -58,10 +58,10 @@ export struct TabLiveComponent { | ||
| 58 | // 加载更多 | 58 | // 加载更多 |
| 59 | ListItem() { | 59 | ListItem() { |
| 60 | if (this.pageModel.hasMore) { | 60 | if (this.pageModel.hasMore) { |
| 61 | - LoadMoreLayout({ | ||
| 62 | - refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, | ||
| 63 | - this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) | ||
| 64 | - }) | 61 | + // LoadMoreLayout({ |
| 62 | + // refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, | ||
| 63 | + // this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) | ||
| 64 | + // }) | ||
| 65 | } else { | 65 | } else { |
| 66 | ListHasNoMoreDataUI() | 66 | ListHasNoMoreDataUI() |
| 67 | } | 67 | } |
| @@ -89,7 +89,7 @@ export struct TabLiveComponent { | @@ -89,7 +89,7 @@ export struct TabLiveComponent { | ||
| 89 | if (data.barrageResponses && data.barrageResponses.length > 0) { | 89 | if (data.barrageResponses && data.barrageResponses.length > 0) { |
| 90 | /** | 90 | /** |
| 91 | * 在直播聊天添加一条新内容逻辑: | 91 | * 在直播聊天添加一条新内容逻辑: |
| 92 | - 判断 oldNewsId:迁移id非空 且 直播状态不是预约:"wait" | 92 | + 判断 oldNewsId:迁移id为空 且 直播状态不是预约:"wait" |
| 93 | 消息内容: | 93 | 消息内容: |
| 94 | 1.头像固定:APP默认头像 | 94 | 1.头像固定:APP默认头像 |
| 95 | 2.名称固定:人民日报主持人 | 95 | 2.名称固定:人民日报主持人 |
| @@ -105,22 +105,17 @@ export struct TabLiveComponent { | @@ -105,22 +105,17 @@ export struct TabLiveComponent { | ||
| 105 | if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId) | 105 | if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId) |
| 106 | && this.liveDetailsBean | 106 | && this.liveDetailsBean |
| 107 | && this.liveDetailsBean.liveInfo.liveState != 'wait') { | 107 | && this.liveDetailsBean.liveInfo.liveState != 'wait') { |
| 108 | - let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean | ||
| 109 | - liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction | ||
| 110 | - liveRoomItemBeanTemp.senderUserName = '人民日报主持人' | ||
| 111 | - liveRoomItemBeanTemp.pictureUrls = [] | ||
| 112 | - liveRoomItemBeanTemp.pictureUrls.push(this.liveDetailsBean?.fullColumnImgUrls[0]?.url) | ||
| 113 | - liveRoomItemBeanTemp.dataType = 'ZH_TEXT_AND_IMAGE_MSG' | ||
| 114 | - let temp = this.liveDetailsBean?.fullColumnImgUrls[0] | ||
| 115 | - if (temp) { | ||
| 116 | - liveRoomItemBeanTemp.pictureResolutions = [] | ||
| 117 | - liveRoomItemBeanTemp.pictureResolutions.push(`${temp.height}*${temp.weight}`) | ||
| 118 | - } | ||
| 119 | - this.liveList.push(liveRoomItemBeanTemp) | 108 | + this.updateLiveListData() |
| 120 | } | 109 | } |
| 121 | } | 110 | } |
| 122 | } else { | 111 | } else { |
| 123 | - this.pageModel.viewType = ViewType.EMPTY; | 112 | + if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId) |
| 113 | + && this.liveDetailsBean | ||
| 114 | + && this.liveDetailsBean.liveInfo.liveState != 'wait') { | ||
| 115 | + this.updateLiveListData() | ||
| 116 | + } else { | ||
| 117 | + this.pageModel.viewType = ViewType.EMPTY; | ||
| 118 | + } | ||
| 124 | } | 119 | } |
| 125 | }, | 120 | }, |
| 126 | () => { | 121 | () => { |
| @@ -128,6 +123,21 @@ export struct TabLiveComponent { | @@ -128,6 +123,21 @@ export struct TabLiveComponent { | ||
| 128 | }) | 123 | }) |
| 129 | } | 124 | } |
| 130 | 125 | ||
| 126 | + updateLiveListData() { | ||
| 127 | + let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean | ||
| 128 | + liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction | ||
| 129 | + liveRoomItemBeanTemp.senderUserName = '人民日报主持人' | ||
| 130 | + liveRoomItemBeanTemp.pictureUrls = [] | ||
| 131 | + liveRoomItemBeanTemp.pictureUrls.push(this.liveDetailsBean?.fullColumnImgUrls[0]?.url) | ||
| 132 | + liveRoomItemBeanTemp.dataType = 'ZH_TEXT_AND_IMAGE_MSG' | ||
| 133 | + let temp = this.liveDetailsBean?.fullColumnImgUrls[0] | ||
| 134 | + if (temp) { | ||
| 135 | + liveRoomItemBeanTemp.pictureResolutions = [] | ||
| 136 | + liveRoomItemBeanTemp.pictureResolutions.push(`${temp.height}*${temp.weight}`) | ||
| 137 | + } | ||
| 138 | + this.liveList.push(liveRoomItemBeanTemp) | ||
| 139 | + } | ||
| 140 | + | ||
| 131 | aboutToDisappear(): void { | 141 | aboutToDisappear(): void { |
| 132 | } | 142 | } |
| 133 | } | 143 | } |
| @@ -7,7 +7,7 @@ import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/ | @@ -7,7 +7,7 @@ import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/ | ||
| 7 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; | 7 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; |
| 8 | import { SettingPasswordParams } from './SettingPasswordLayout' | 8 | import { SettingPasswordParams } from './SettingPasswordLayout' |
| 9 | import { Router } from '@ohos.arkui.UIContext' | 9 | import { Router } from '@ohos.arkui.UIContext' |
| 10 | -import { SPHelper, ToastUtils } from 'wdKit/Index' | 10 | +import { EmitterEventId, EmitterUtils, SPHelper, ToastUtils } from 'wdKit/Index' |
| 11 | import { SpConstants } from 'wdConstant/Index' | 11 | import { SpConstants } from 'wdConstant/Index' |
| 12 | import { emitter } from '@kit.BasicServicesKit' | 12 | import { emitter } from '@kit.BasicServicesKit' |
| 13 | 13 | ||
| @@ -189,7 +189,7 @@ struct ForgetPasswordPage { | @@ -189,7 +189,7 @@ struct ForgetPasswordPage { | ||
| 189 | sendEmitEvent(){ | 189 | sendEmitEvent(){ |
| 190 | // 定义一个eventId为1的事件,事件优先级为Low | 190 | // 定义一个eventId为1的事件,事件优先级为Low |
| 191 | let event: emitter.InnerEvent = { | 191 | let event: emitter.InnerEvent = { |
| 192 | - eventId: 10010, | 192 | + eventId: EmitterEventId.PHONE_CHANGE_SUCCESS, |
| 193 | priority: emitter.EventPriority.LOW | 193 | priority: emitter.EventPriority.LOW |
| 194 | }; | 194 | }; |
| 195 | 195 |
| @@ -60,7 +60,7 @@ export class LoginModel { | @@ -60,7 +60,7 @@ export class LoginModel { | ||
| 60 | let bean: Record<string, Object> = {}; | 60 | let bean: Record<string, Object> = {}; |
| 61 | bean['phone'] = phone | 61 | bean['phone'] = phone |
| 62 | bean['loginType'] = loginType | 62 | bean['loginType'] = loginType |
| 63 | - bean['deviceId'] = '60da5af6-9c59-3566-8622-8c6c00710994' | 63 | + bean['deviceId'] = HttpUtils.getDeviceId() |
| 64 | bean['verificationCode'] = verificationCode | 64 | bean['verificationCode'] = verificationCode |
| 65 | return new Promise<LoginBean>((success, fail) => { | 65 | return new Promise<LoginBean>((success, fail) => { |
| 66 | HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean).then((data: ResponseDTO<LoginBean>) => { | 66 | HttpRequest.post<ResponseDTO<LoginBean>>(HttpUrlUtils.getAppLoginUrl(), bean).then((data: ResponseDTO<LoginBean>) => { |
| @@ -90,7 +90,7 @@ export class LoginModel { | @@ -90,7 +90,7 @@ export class LoginModel { | ||
| 90 | bean['userName'] = phone | 90 | bean['userName'] = phone |
| 91 | } | 91 | } |
| 92 | bean['loginType'] = loginType | 92 | bean['loginType'] = loginType |
| 93 | - bean['deviceId'] = '60da5af6-9c59-3566-8622-8c6c00710994' | 93 | + bean['deviceId'] = HttpUtils.getDeviceId() |
| 94 | bean['password'] = password | 94 | bean['password'] = password |
| 95 | bean['oldPassword'] = oldPassword | 95 | bean['oldPassword'] = oldPassword |
| 96 | return new Promise<LoginBean>((success, fail) => { | 96 | return new Promise<LoginBean>((success, fail) => { |
| 1 | import { Logger } from 'wdKit/src/main/ets/utils/Logger' | 1 | import { Logger } from 'wdKit/src/main/ets/utils/Logger' |
| 2 | import { LoginModel } from './LoginModel' | 2 | import { LoginModel } from './LoginModel' |
| 3 | import { LoginBean } from './LoginBean' | 3 | import { LoginBean } from './LoginBean' |
| 4 | -import { SPHelper, StringUtils } from 'wdKit' | 4 | +import { EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit' |
| 5 | import { CheckVerifyBean } from './CheckVerifyBean' | 5 | import { CheckVerifyBean } from './CheckVerifyBean' |
| 6 | import cryptoFramework from '@ohos.security.cryptoFramework' | 6 | import cryptoFramework from '@ohos.security.cryptoFramework' |
| 7 | import buffer from '@ohos.buffer' | 7 | import buffer from '@ohos.buffer' |
| @@ -55,6 +55,7 @@ export class LoginViewModel { | @@ -55,6 +55,7 @@ export class LoginViewModel { | ||
| 55 | SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status) | 55 | SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status) |
| 56 | SPHelper.default.saveSync(SpConstants.USER_Type, data.userType) | 56 | SPHelper.default.saveSync(SpConstants.USER_Type, data.userType) |
| 57 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName) | 57 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName) |
| 58 | + EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS) | ||
| 58 | success(data) | 59 | success(data) |
| 59 | }).catch((error:string) => { | 60 | }).catch((error:string) => { |
| 60 | fail(error) | 61 | fail(error) |
| @@ -82,6 +83,7 @@ export class LoginViewModel { | @@ -82,6 +83,7 @@ export class LoginViewModel { | ||
| 82 | SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status) | 83 | SPHelper.default.saveSync(SpConstants.USER_STATUS, data.status) |
| 83 | SPHelper.default.saveSync(SpConstants.USER_Type, data.userType) | 84 | SPHelper.default.saveSync(SpConstants.USER_Type, data.userType) |
| 84 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName) | 85 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName) |
| 86 | + EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS) | ||
| 85 | success(data) | 87 | success(data) |
| 86 | }).catch((value: string) => { | 88 | }).catch((value: string) => { |
| 87 | fail(value) | 89 | fail(value) |
| @@ -157,6 +159,7 @@ export class LoginViewModel { | @@ -157,6 +159,7 @@ export class LoginViewModel { | ||
| 157 | SPHelper.default.saveSync(SpConstants.USER_STATUS, '') | 159 | SPHelper.default.saveSync(SpConstants.USER_STATUS, '') |
| 158 | SPHelper.default.saveSync(SpConstants.USER_Type, '') | 160 | SPHelper.default.saveSync(SpConstants.USER_Type, '') |
| 159 | SPHelper.default.saveSync(SpConstants.USER_NAME, '') | 161 | SPHelper.default.saveSync(SpConstants.USER_NAME, '') |
| 162 | + UserDataLocal.clearUserData() | ||
| 160 | success(data) | 163 | success(data) |
| 161 | }).catch((message: string) => { | 164 | }).catch((message: string) => { |
| 162 | fail(message) | 165 | fail(message) |
| 1 | import { Action } from 'wdBean'; | 1 | import { Action } from 'wdBean'; |
| 2 | import { SpacialTopicPageComponent } from 'wdComponent' | 2 | import { SpacialTopicPageComponent } from 'wdComponent' |
| 3 | import { CommonConstants } from 'wdConstant' | 3 | import { CommonConstants } from 'wdConstant' |
| 4 | -import { Logger } from 'wdKit' | 4 | +import { Logger, WindowModel } from 'wdKit' |
| 5 | import router from '@ohos.router'; | 5 | import router from '@ohos.router'; |
| 6 | 6 | ||
| 7 | const TAG = 'SpacialTopicPage'; | 7 | const TAG = 'SpacialTopicPage'; |
| @@ -27,6 +27,7 @@ struct SpacialTopicPage { | @@ -27,6 +27,7 @@ struct SpacialTopicPage { | ||
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | aboutToAppear() { | 29 | aboutToAppear() { |
| 30 | + WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 30 | Logger.info(TAG, 'aboutToAppear'); | 31 | Logger.info(TAG, 'aboutToAppear'); |
| 31 | let action: Action = router.getParams() as Action | 32 | let action: Action = router.getParams() as Action |
| 32 | this.action = action | 33 | this.action = action |
| @@ -34,6 +35,7 @@ struct SpacialTopicPage { | @@ -34,6 +35,7 @@ struct SpacialTopicPage { | ||
| 34 | 35 | ||
| 35 | aboutToDisappear() { | 36 | aboutToDisappear() { |
| 36 | Logger.info(TAG, 'aboutToDisappear'); | 37 | Logger.info(TAG, 'aboutToDisappear'); |
| 38 | + WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 37 | } | 39 | } |
| 38 | 40 | ||
| 39 | onPageShow() { | 41 | onPageShow() { |
| @@ -181,12 +181,12 @@ struct LaunchAdvertisingPage { | @@ -181,12 +181,12 @@ struct LaunchAdvertisingPage { | ||
| 181 | //端外打开 | 181 | //端外打开 |
| 182 | 182 | ||
| 183 | ProcessUtils.jumpExternalWebPage(this.model.launchAdInfo[0].matInfo.linkUrl) | 183 | ProcessUtils.jumpExternalWebPage(this.model.launchAdInfo[0].matInfo.linkUrl) |
| 184 | - clearInterval(this.timer) | 184 | + //clearInterval(this.timer) |
| 185 | 185 | ||
| 186 | }else { | 186 | }else { |
| 187 | //端内打开 | 187 | //端内打开 |
| 188 | ProcessUtils.gotoDefaultWebPage(this.model.launchAdInfo[0].matInfo.linkUrl) | 188 | ProcessUtils.gotoDefaultWebPage(this.model.launchAdInfo[0].matInfo.linkUrl) |
| 189 | - clearInterval(this.timer) | 189 | + //clearInterval(this.timer) |
| 190 | 190 | ||
| 191 | } | 191 | } |
| 192 | } | 192 | } |
| @@ -35,7 +35,7 @@ struct LaunchPage { | @@ -35,7 +35,7 @@ struct LaunchPage { | ||
| 35 | alignment: DialogAlignment.Center, | 35 | alignment: DialogAlignment.Center, |
| 36 | offset: { dx: 0, dy: '-24' }, | 36 | offset: { dx: 0, dy: '-24' }, |
| 37 | customStyle: true, | 37 | customStyle: true, |
| 38 | - autoCancel: false | 38 | + autoCancel: false, |
| 39 | }); | 39 | }); |
| 40 | 40 | ||
| 41 | onCancel() { | 41 | onCancel() { |
| @@ -110,6 +110,9 @@ struct LaunchPage { | @@ -110,6 +110,9 @@ struct LaunchPage { | ||
| 110 | if (dataModel.launchAdInfo.length) { | 110 | if (dataModel.launchAdInfo.length) { |
| 111 | //跳转广告页 | 111 | //跳转广告页 |
| 112 | this.jumpToAdvertisingPage(); | 112 | this.jumpToAdvertisingPage(); |
| 113 | + | ||
| 114 | + //WDRouterRule.jumpWithReplacePage(WDRouterPage.privacyPage) | ||
| 115 | + | ||
| 113 | }else { | 116 | }else { |
| 114 | //直接跳转首页 | 117 | //直接跳转首页 |
| 115 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) | 118 | WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) |
| @@ -156,7 +159,7 @@ struct LaunchPage { | @@ -156,7 +159,7 @@ struct LaunchPage { | ||
| 156 | build(){ | 159 | build(){ |
| 157 | 160 | ||
| 158 | Stack({alignContent:Alignment.Bottom}){ | 161 | Stack({alignContent:Alignment.Bottom}){ |
| 159 | - Image($r('app.media.app_icon')) | 162 | + Image($r('app.media.LaunchPage_logo')) |
| 160 | .width('278lpx') | 163 | .width('278lpx') |
| 161 | .height('154lpx') | 164 | .height('154lpx') |
| 162 | .margin({ | 165 | .margin({ |
| @@ -3,59 +3,35 @@ import webview from '@ohos.web.webview'; | @@ -3,59 +3,35 @@ import webview from '@ohos.web.webview'; | ||
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | import { GlobalContext } from '../../utils/GlobalContext' | 4 | import { GlobalContext } from '../../utils/GlobalContext' |
| 5 | import { WDRouterRule } from 'wdRouter'; | 5 | import { WDRouterRule } from 'wdRouter'; |
| 6 | +import { LikeComponent } from 'wdComponent' | ||
| 6 | 7 | ||
| 7 | @Entry | 8 | @Entry |
| 8 | @Component | 9 | @Component |
| 9 | struct PrivacyPage { | 10 | struct PrivacyPage { |
| 10 | @State message: string = 'Hello World' | 11 | @State message: string = 'Hello World' |
| 11 | - webController: webview.WebviewController = new webview.WebviewController(); | ||
| 12 | - //@State params: object = router.getParams(); | 12 | + model: Record<string, string> = {} |
| 13 | + | ||
| 14 | + aboutToAppear(): void { | ||
| 15 | + | ||
| 16 | + this.model['contentId'] = '30044572938' //必须 | ||
| 17 | + this.model['userName'] = '人民日报网友5MbdHk' | ||
| 18 | + this.model['contentType'] = '8' //必须 | ||
| 19 | + this.model['title'] = '“神器”还是“安慰剂”?中学生“体考神器”调查' | ||
| 20 | + this.model['userHeaderUrl'] = "" | ||
| 21 | + this.model['channelId'] = "2002" //必须 | ||
| 22 | + //this.model['status'] = "1" //必须 | ||
| 23 | + | ||
| 24 | + | ||
| 25 | + | ||
| 26 | + } | ||
| 27 | + | ||
| 13 | 28 | ||
| 14 | build() { | 29 | build() { |
| 15 | Row() { | 30 | Row() { |
| 16 | Column() { | 31 | Column() { |
| 17 | - // Web component loading H5. | ||
| 18 | - Web({ src: 'https://www.baidu.com', controller: this.webController }) | ||
| 19 | - .zoomAccess(false) | ||
| 20 | - .width('100%') | ||
| 21 | - .height('100%') | ||
| 22 | - .aspectRatio(1) | ||
| 23 | - // .onConfirm((event) => { | ||
| 24 | - // AlertDialog.show({ | ||
| 25 | - // message: Const.WEB_ALERT_DIALOG_TEXT_VALUE + event?.message, | ||
| 26 | - // confirm: { | ||
| 27 | - // value: $r('app.string.web_alert_dialog_button_value'), | ||
| 28 | - // action: () => { | ||
| 29 | - // event?.result.handleConfirm(); | ||
| 30 | - // } | ||
| 31 | - // }, | ||
| 32 | - // cancel: () => { | ||
| 33 | - // event?.result.handleCancel(); | ||
| 34 | - // } | ||
| 35 | - // }); | ||
| 36 | - // return true; | ||
| 37 | - // }) | ||
| 38 | - // .onErrorReceive((event) => { | ||
| 39 | - // if (event?.error.getErrorInfo() === 'ERR_INTERNET_DISCONNECTED') { | ||
| 40 | - // prompt.showToast({ | ||
| 41 | - // message: $r('app.string.internet_err'), | ||
| 42 | - // duration: Const.WebConstant_DURATION | ||
| 43 | - // }) | ||
| 44 | - // } | ||
| 45 | - // if (event?.error.getErrorInfo() === 'ERR_CONNECTION_TIMED_OUT') { | ||
| 46 | - // prompt.showToast({ | ||
| 47 | - // message: $r('app.string.internet_err'), | ||
| 48 | - // duration: Const.WebConstant_DURATION | ||
| 49 | - // }) | ||
| 50 | - // } | ||
| 51 | - // }) | ||
| 52 | - // .onProgressChange((event) => { | ||
| 53 | - // if (event?.newProgress === Const.WebConstant_PROGRESS_MAX) { | ||
| 54 | - // this.isLoading = false; | ||
| 55 | - // clearInterval(this.intervalLoading); | ||
| 56 | - // this.intervalLoading = -1; | ||
| 57 | - // } | ||
| 58 | - // }) | 32 | + |
| 33 | + LikeComponent({data: this.model,componentType:1}) | ||
| 34 | + | ||
| 59 | } | 35 | } |
| 60 | .width('100%') | 36 | .width('100%') |
| 61 | } | 37 | } |
| @@ -134,7 +134,7 @@ export default struct CustomDialogComponent { | @@ -134,7 +134,7 @@ export default struct CustomDialogComponent { | ||
| 134 | Text($r('app.string.dialog_text_privacy_statement')) | 134 | Text($r('app.string.dialog_text_privacy_statement')) |
| 135 | .width('90%') | 135 | .width('90%') |
| 136 | .fontColor($r('app.color.dialog_text_color')) | 136 | .fontColor($r('app.color.dialog_text_color')) |
| 137 | - .fontSize(13).margin({top:20}) | 137 | + .fontSize(14).margin({top:20}) |
| 138 | Row() { | 138 | Row() { |
| 139 | Text($r('app.string.dialog_button_disagree')) | 139 | Text($r('app.string.dialog_button_disagree')) |
| 140 | .fancy() | 140 | .fancy() |
| @@ -3,8 +3,9 @@ import { WdWebComponent } from 'wdWebComponent'; | @@ -3,8 +3,9 @@ import { WdWebComponent } from 'wdWebComponent'; | ||
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | import { CommonConstants } from 'wdConstant' | 4 | import { CommonConstants } from 'wdConstant' |
| 5 | import { BridgeWebViewControl } from 'wdJsBridge'; | 5 | import { BridgeWebViewControl } from 'wdJsBridge'; |
| 6 | -import { detailedSkeleton } from 'wdComponent/src/main/ets/components/skeleton/detailSkeleton' | 6 | + |
| 7 | const TAG = 'DefaultWebPage' | 7 | const TAG = 'DefaultWebPage' |
| 8 | + | ||
| 8 | @Entry | 9 | @Entry |
| 9 | @Component | 10 | @Component |
| 10 | struct DefaultWebPage { | 11 | struct DefaultWebPage { |
| @@ -16,9 +17,6 @@ struct DefaultWebPage { | @@ -16,9 +17,6 @@ struct DefaultWebPage { | ||
| 16 | 17 | ||
| 17 | build() { | 18 | build() { |
| 18 | Column() { | 19 | Column() { |
| 19 | - if (!this.isPageEnd) { | ||
| 20 | - detailedSkeleton() | ||
| 21 | - } | ||
| 22 | Stack({ alignContent: Alignment.Bottom }) { | 20 | Stack({ alignContent: Alignment.Bottom }) { |
| 23 | Column() { | 21 | Column() { |
| 24 | WdWebComponent({ | 22 | WdWebComponent({ |
-
Please register or login to post a comment