Showing
43 changed files
with
395 additions
and
130 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 | */ |
| @@ -23,6 +23,9 @@ export enum EmitterEventId { | @@ -23,6 +23,9 @@ export enum EmitterEventId { | ||
| 23 | // 登录成功 | 23 | // 登录成功 |
| 24 | LOGIN_SUCCESS = 8, | 24 | LOGIN_SUCCESS = 8, |
| 25 | 25 | ||
| 26 | + // 换绑成功 | ||
| 27 | + PHONE_CHANGE_SUCCESS = 9, | ||
| 28 | + | ||
| 26 | // App回到前台 | 29 | // App回到前台 |
| 27 | APP_ENTER_FOREGROUD = 100, | 30 | APP_ENTER_FOREGROUD = 100, |
| 28 | // App进入后台 | 31 | // App进入后台 |
| @@ -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 }) |
| @@ -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 |
| @@ -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) |
| @@ -300,7 +314,7 @@ export struct DynamicDetailComponent { | @@ -300,7 +314,7 @@ export struct DynamicDetailComponent { | ||
| 300 | } | 314 | } |
| 301 | } | 315 | } |
| 302 | } | 316 | } |
| 303 | - .padding({ left: this.contentDetailData.videoInfo[0].videoLandScape === 1?0: 16,top: $r('app.float.margin_8')}) | 317 | + .padding({ left: this.contentDetailData.videoInfo[0].videoLandScape === 1?0: 25,top: $r('app.float.margin_8')}) |
| 304 | .onClick((event: ClickEvent) => { | 318 | .onClick((event: ClickEvent) => { |
| 305 | ProcessUtils.processPage(this.mJumpInfo) | 319 | ProcessUtils.processPage(this.mJumpInfo) |
| 306 | }) | 320 | }) |
| @@ -312,8 +326,8 @@ export struct DynamicDetailComponent { | @@ -312,8 +326,8 @@ export struct DynamicDetailComponent { | ||
| 312 | .fontSize($r('app.float.font_size_12')) | 326 | .fontSize($r('app.float.font_size_12')) |
| 313 | .lineHeight($r('app.float.margin_16')) | 327 | .lineHeight($r('app.float.margin_16')) |
| 314 | .margin({ top: $r('app.float.margin_16') | 328 | .margin({ top: $r('app.float.margin_16') |
| 315 | - ,left: $r('app.float.margin_16') | ||
| 316 | - ,right: $r('app.float.margin_16') }) | 329 | + ,left: $r('app.float.vp_12') |
| 330 | + ,right: $r('app.float.vp_12') }) | ||
| 317 | //微信/朋友圈/微博 | 331 | //微信/朋友圈/微博 |
| 318 | Row(){ | 332 | Row(){ |
| 319 | Image($r('app.media.xxhdpi_pic_wechat')) | 333 | Image($r('app.media.xxhdpi_pic_wechat')) |
| @@ -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() { |
| @@ -15,7 +15,7 @@ export class publishCommentModel { | @@ -15,7 +15,7 @@ export class publishCommentModel { | ||
| 15 | /*【迭代二新增】关联的频道id/专题id; 页面必传*/ | 15 | /*【迭代二新增】关联的频道id/专题id; 页面必传*/ |
| 16 | targetRelObjectId: string = "" | 16 | targetRelObjectId: string = "" |
| 17 | /*【迭代二新增】是否是重点稿件 1是 0否 页面必传*/ | 17 | /*【迭代二新增】是否是重点稿件 1是 0否 页面必传*/ |
| 18 | - keyArticle: string = '' | 18 | + keyArticle: string = '0' |
| 19 | /*内容类别, 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14:动态(13和14为中文版新增) 页面必传*/ | 19 | /*内容类别, 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14:动态(13和14为中文版新增) 页面必传*/ |
| 20 | targetType: string = '' | 20 | targetType: string = '' |
| 21 | /*评论总数*/ | 21 | /*评论总数*/ |
| @@ -9,8 +9,9 @@ import measure from '@ohos.measure' | @@ -9,8 +9,9 @@ import measure from '@ohos.measure' | ||
| 9 | import { CommentCustomDialog } from './CommentCustomDialog' | 9 | import { CommentCustomDialog } from './CommentCustomDialog' |
| 10 | import { publishCommentModel } from '../model/PublishCommentModel'; | 10 | import { publishCommentModel } from '../model/PublishCommentModel'; |
| 11 | import { ifaa } from '@kit.OnlineAuthenticationKit'; | 11 | import { ifaa } from '@kit.OnlineAuthenticationKit'; |
| 12 | -import { HttpUrlUtils } from 'wdNetwork/Index'; | 12 | +import { HttpUrlUtils, HttpUtils } from 'wdNetwork/Index'; |
| 13 | import NoMoreLayout from '../../page/NoMoreLayout'; | 13 | import NoMoreLayout from '../../page/NoMoreLayout'; |
| 14 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 14 | 15 | ||
| 15 | const TAG = 'CommentComponent'; | 16 | const TAG = 'CommentComponent'; |
| 16 | 17 | ||
| @@ -559,6 +560,12 @@ struct commentFooterView { | @@ -559,6 +560,12 @@ struct commentFooterView { | ||
| 559 | 560 | ||
| 560 | } | 561 | } |
| 561 | .onClick(() => { | 562 | .onClick(() => { |
| 563 | + // 未登录,跳转登录 | ||
| 564 | + const user_id = HttpUtils.getUserId() | ||
| 565 | + if (!user_id) { | ||
| 566 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 567 | + return | ||
| 568 | + } | ||
| 562 | commentLikeChange(this.item) | 569 | commentLikeChange(this.item) |
| 563 | commentViewModel.commentLike(this.item).then(() => { | 570 | commentViewModel.commentLike(this.item).then(() => { |
| 564 | }).catch(() => { | 571 | }).catch(() => { |
| @@ -7,17 +7,17 @@ import commentViewModel from '../viewmodel/CommentViewModel' | @@ -7,17 +7,17 @@ import commentViewModel from '../viewmodel/CommentViewModel' | ||
| 7 | @Preview | 7 | @Preview |
| 8 | @CustomDialog | 8 | @CustomDialog |
| 9 | export struct CommentCustomDialog { | 9 | export struct CommentCustomDialog { |
| 10 | - | ||
| 11 | @ObjectLink publishCommentModel: publishCommentModel | 10 | @ObjectLink publishCommentModel: publishCommentModel |
| 12 | controller?: CustomDialogController | 11 | controller?: CustomDialogController |
| 13 | confirm: (value: Record<string, string>) => void = () => { | 12 | confirm: (value: Record<string, string>) => void = () => { |
| 14 | } | 13 | } |
| 15 | @State private emojiSwitch: boolean = false | 14 | @State private emojiSwitch: boolean = false |
| 16 | textInputController: TextAreaController = new TextAreaController() | 15 | textInputController: TextAreaController = new TextAreaController() |
| 16 | + @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } | ||
| 17 | 17 | ||
| 18 | aboutToAppear(): void { | 18 | aboutToAppear(): void { |
| 19 | 19 | ||
| 20 | - | 20 | + // this.textInputController.caretPosition(0) |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | publishCommentRequest() { | 23 | publishCommentRequest() { |
| @@ -25,7 +25,7 @@ export struct CommentCustomDialog { | @@ -25,7 +25,7 @@ export struct CommentCustomDialog { | ||
| 25 | // this.publishCommentModel.commentContent = this.commentText | 25 | // this.publishCommentModel.commentContent = this.commentText |
| 26 | //TODO 判断类型 | 26 | //TODO 判断类型 |
| 27 | this.publishCommentModel.commentType = '2' | 27 | this.publishCommentModel.commentType = '2' |
| 28 | - commentViewModel.publishComment(this.publishCommentModel).then((model:commentItemModel) => { | 28 | + commentViewModel.publishComment(this.publishCommentModel).then((model: commentItemModel) => { |
| 29 | this.publishCommentModel.commentContent = '' | 29 | this.publishCommentModel.commentContent = '' |
| 30 | // | 30 | // |
| 31 | 31 | ||
| @@ -74,12 +74,13 @@ export struct CommentCustomDialog { | @@ -74,12 +74,13 @@ export struct CommentCustomDialog { | ||
| 74 | .height(30) | 74 | .height(30) |
| 75 | .onClick(() => { | 75 | .onClick(() => { |
| 76 | 76 | ||
| 77 | - // this.commentText = this.commentText + '神鼎' | 77 | + this.positionInfo = this.textInputController.getCaretOffset() |
| 78 | + | ||
| 78 | this.emojiSwitch = !this.emojiSwitch | 79 | this.emojiSwitch = !this.emojiSwitch |
| 79 | if (this.emojiSwitch) { | 80 | if (this.emojiSwitch) { |
| 80 | this.textInputController.stopEditing() | 81 | this.textInputController.stopEditing() |
| 81 | } else { | 82 | } else { |
| 82 | - this.textInputController.caretPosition(this.textInputController.getTextContentRect().x) | 83 | + // this.textInputController.caretPosition(this.textInputController.getTextContentRect().x) |
| 83 | } | 84 | } |
| 84 | 85 | ||
| 85 | }) | 86 | }) |
| @@ -116,7 +117,7 @@ export struct CommentCustomDialog { | @@ -116,7 +117,7 @@ export struct CommentCustomDialog { | ||
| 116 | 117 | ||
| 117 | //表情view | 118 | //表情view |
| 118 | if (this.emojiSwitch) { | 119 | if (this.emojiSwitch) { |
| 119 | - emojiView() | 120 | + emojiView({ publishCommentModel: this.publishCommentModel }).height(150) |
| 120 | } | 121 | } |
| 121 | 122 | ||
| 122 | }.backgroundColor(Color.White) | 123 | }.backgroundColor(Color.White) |
| @@ -129,8 +130,88 @@ export struct CommentCustomDialog { | @@ -129,8 +130,88 @@ export struct CommentCustomDialog { | ||
| 129 | 130 | ||
| 130 | @Component | 131 | @Component |
| 131 | struct emojiView { | 132 | struct emojiView { |
| 133 | + @ObjectLink publishCommentModel: publishCommentModel | ||
| 134 | + /*没找到获取系统emoji的方案*/ | ||
| 135 | + private emojiString = '😀,😁,😂,😃,😄,😅,😆,😇,😈,😉,😊,😋,😌,😍,😎,😏,😐,😑,😒,😓,😔,😕,😖,😗,😘,😙,😚,😛,😜,😝,😞,😟,😠,😡,😢,😣,😤,😥,😦,😧,😨,😩,😪,😫,😬,😭,😮,😯,😰,😱,😲,😳,😴,😵,😶,😷,😸,😹,😺,😻,😼,😽,😾,😿,🙀,🙅,🙆,🙇,🙈,🙉,🙊,🙋,🙌,🙍,🙎,🙏' | ||
| 136 | + private displayArray: string[][] = [] | ||
| 137 | + private swiperController: SwiperController = new SwiperController() | ||
| 138 | + | ||
| 139 | + aboutToAppear(): void { | ||
| 140 | + | ||
| 141 | + | ||
| 142 | + | ||
| 143 | + this.displayArray = chunk(this.emojiString.split(','), 20) | ||
| 144 | + | ||
| 145 | + //补上删除按钮以及空白占位 | ||
| 146 | + let lastElement = this.displayArray.slice(-1)[0]; | ||
| 147 | + if (lastElement.length < 20) { | ||
| 148 | + let needLength = (20 - lastElement.length) | ||
| 149 | + for (let index = 0; index < needLength; index++) { | ||
| 150 | + lastElement.push('') | ||
| 151 | + } | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + this.displayArray.forEach(element => { | ||
| 155 | + element.push('删除') | ||
| 156 | + }); | ||
| 157 | + | ||
| 158 | + } | ||
| 159 | + | ||
| 132 | build() { | 160 | build() { |
| 161 | + | ||
| 162 | + // String.fromCodePoint() | ||
| 163 | + Swiper(this.swiperController) { | ||
| 164 | + | ||
| 165 | + ForEach(this.displayArray, (array: [], index) => { | ||
| 166 | + Column() { | ||
| 167 | + Grid() { | ||
| 168 | + ForEach(array, (emoji: string, subIndex: number) => { | ||
| 169 | + GridItem() { | ||
| 170 | + Text() { | ||
| 171 | + if (emoji == '删除') { | ||
| 172 | + ImageSpan($r('app.media.wdInput_delete')) | ||
| 173 | + } else { | ||
| 174 | + Span(emoji) | ||
| 133 | } | 175 | } |
| 176 | + | ||
| 177 | + }.textAlign(TextAlign.Center).width(30).height(30) | ||
| 178 | + | ||
| 179 | + // .backgroundColor(Color.Orange) | ||
| 180 | + }.onClick(() => { | ||
| 181 | + if (emoji == '删除') { | ||
| 182 | + this.publishCommentModel.commentContent = this.publishCommentModel.commentContent.substring(0, this.publishCommentModel.commentContent.length -1) | ||
| 183 | + } else if (emoji == '') { | ||
| 184 | + | ||
| 185 | + } else { | ||
| 186 | + this.publishCommentModel.commentContent = this.publishCommentModel.commentContent + emoji | ||
| 187 | + } | ||
| 188 | + | ||
| 189 | + }) | ||
| 190 | + }) | ||
| 191 | + } | ||
| 192 | + .maxCount(6) | ||
| 193 | + .columnsTemplate('1fr 1fr 1fr 1fr 1fr 1fr 1fr') | ||
| 194 | + .rowsGap(10) | ||
| 195 | + .layoutDirection(GridDirection.Row) | ||
| 196 | + | ||
| 197 | + Row().height(40) | ||
| 198 | + } | ||
| 199 | + }) | ||
| 200 | + } | ||
| 201 | + .indicator(true) | ||
| 202 | + .vertical(false) | ||
| 203 | + .height(140) | ||
| 204 | + } | ||
| 205 | +} | ||
| 206 | + | ||
| 207 | +function chunk<T>(array: T[], size: number): T[][] { | ||
| 208 | + const result: T[][] = []; | ||
| 209 | + | ||
| 210 | + for (let i = 0; i < array.length; i += size) { | ||
| 211 | + result.push(array.slice(i, i + size)); | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + return result; | ||
| 134 | } | 215 | } |
| 135 | 216 | ||
| 136 | 217 |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| @@ -5,12 +5,16 @@ import commentViewModel from '../viewmodel/CommentViewModel' | @@ -5,12 +5,16 @@ import commentViewModel from '../viewmodel/CommentViewModel' | ||
| 5 | import { router, window } from '@kit.ArkUI' | 5 | import { router, window } from '@kit.ArkUI' |
| 6 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' | 6 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' |
| 7 | import { MyCommentDataSource } from '../model/MyCommentDataSource' | 7 | import { MyCommentDataSource } from '../model/MyCommentDataSource' |
| 8 | -import { HttpUrlUtils } from 'wdNetwork/Index' | 8 | +import { HttpUrlUtils, HttpUtils } from 'wdNetwork/Index' |
| 9 | import PageModel from '../../../viewmodel/PageModel' | 9 | import PageModel from '../../../viewmodel/PageModel' |
| 10 | import { ErrorComponent } from '../../view/ErrorComponent' | 10 | import { ErrorComponent } from '../../view/ErrorComponent' |
| 11 | import { EmptyComponent , WDViewDefaultType} from '../../view/EmptyComponent' | 11 | import { EmptyComponent , WDViewDefaultType} from '../../view/EmptyComponent' |
| 12 | import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh' | 12 | import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh' |
| 13 | import NoMoreLayout from '../../page/NoMoreLayout' | 13 | import NoMoreLayout from '../../page/NoMoreLayout' |
| 14 | +import { CommentCustomDialog } from './CommentCustomDialog' | ||
| 15 | +import { publishCommentModel } from '../model/PublishCommentModel' | ||
| 16 | +import { ifaa } from '@kit.OnlineAuthenticationKit' | ||
| 17 | +import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 14 | 18 | ||
| 15 | const TAG = 'QualityCommentsComponent'; | 19 | const TAG = 'QualityCommentsComponent'; |
| 16 | 20 | ||
| @@ -24,9 +28,6 @@ export struct QualityCommentsComponent { | @@ -24,9 +28,6 @@ export struct QualityCommentsComponent { | ||
| 24 | @State hasMore: boolean = true; | 28 | @State hasMore: boolean = true; |
| 25 | @State currentPage: number = 1; | 29 | @State currentPage: number = 1; |
| 26 | private scroller: Scroller = new Scroller(); | 30 | private scroller: Scroller = new Scroller(); |
| 27 | - | ||
| 28 | - | ||
| 29 | - | ||
| 30 | @State tileOpacity: number = 0; | 31 | @State tileOpacity: number = 0; |
| 31 | firstPositionY: number = 0; | 32 | firstPositionY: number = 0; |
| 32 | bottomSafeHeight: string = AppStorage.get<number>('bottomSafeHeight') + 'px'; | 33 | bottomSafeHeight: string = AppStorage.get<number>('bottomSafeHeight') + 'px'; |
| @@ -34,6 +35,11 @@ export struct QualityCommentsComponent { | @@ -34,6 +35,11 @@ export struct QualityCommentsComponent { | ||
| 34 | lastWindowColor: string = '#ffffff' | 35 | lastWindowColor: string = '#ffffff' |
| 35 | currentWindowColor: string = '#FF4202' | 36 | currentWindowColor: string = '#FF4202' |
| 36 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); | 37 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); |
| 38 | + @State dialogController: CustomDialogController | null = null; | ||
| 39 | + | ||
| 40 | + /*必传*/ | ||
| 41 | + @State publishCommentModel: publishCommentModel = new publishCommentModel() | ||
| 42 | + | ||
| 37 | 43 | ||
| 38 | aboutToDisappear(): void { | 44 | aboutToDisappear(): void { |
| 39 | 45 | ||
| @@ -43,13 +49,33 @@ export struct QualityCommentsComponent { | @@ -43,13 +49,33 @@ export struct QualityCommentsComponent { | ||
| 43 | windowClass.setWindowLayoutFullScreen(false) | 49 | windowClass.setWindowLayoutFullScreen(false) |
| 44 | // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) | 50 | // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) |
| 45 | 51 | ||
| 52 | + this.dialogController = null // 将dialogController置空 | ||
| 53 | + | ||
| 46 | } | 54 | } |
| 47 | 55 | ||
| 48 | aboutToAppear(): void { | 56 | aboutToAppear(): void { |
| 49 | 57 | ||
| 50 | this.fullScreen(); | 58 | this.fullScreen(); |
| 51 | this.getData(); | 59 | this.getData(); |
| 52 | - | 60 | + this.showAlert() |
| 61 | + } | ||
| 62 | + | ||
| 63 | + showAlert(){ | ||
| 64 | + this.dialogController = new CustomDialogController({ | ||
| 65 | + builder: CommentCustomDialog({ | ||
| 66 | + confirm: (value: Record<string, string>) => { | ||
| 67 | + | ||
| 68 | + }, | ||
| 69 | + publishCommentModel: this.publishCommentModel | ||
| 70 | + }), | ||
| 71 | + autoCancel: true, | ||
| 72 | + alignment: DialogAlignment.Bottom, | ||
| 73 | + customStyle: true, | ||
| 74 | + offset: { | ||
| 75 | + dx: 0, | ||
| 76 | + dy: -20 | ||
| 77 | + }, | ||
| 78 | + }) | ||
| 53 | } | 79 | } |
| 54 | 80 | ||
| 55 | getData(resolve?: (value: string | PromiseLike<string>) => void){ | 81 | getData(resolve?: (value: string | PromiseLike<string>) => void){ |
| @@ -217,7 +243,7 @@ export struct QualityCommentsComponent { | @@ -217,7 +243,7 @@ export struct QualityCommentsComponent { | ||
| 217 | // ListItemGroup({ header: this.titleHeader() }) | 243 | // ListItemGroup({ header: this.titleHeader() }) |
| 218 | LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { | 244 | LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { |
| 219 | ListItem() { | 245 | ListItem() { |
| 220 | - QualityCommentItem({ item: item, index: index }).margin({ left: 12, right: 12 }) | 246 | + QualityCommentItem({ item: item, index: index , dialogController:this.dialogController, publishCommentModel:this.publishCommentModel}).margin({ left: 12, right: 12 }) |
| 221 | } | 247 | } |
| 222 | }) | 248 | }) |
| 223 | // 加载更多 | 249 | // 加载更多 |
| @@ -243,16 +269,6 @@ export struct QualityCommentsComponent { | @@ -243,16 +269,6 @@ export struct QualityCommentsComponent { | ||
| 243 | } | 269 | } |
| 244 | 270 | ||
| 245 | 271 | ||
| 246 | - @Builder | ||
| 247 | - testLayout(){ | ||
| 248 | - List({ space: 12, scroller:this.scroller }){ | ||
| 249 | - LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { | ||
| 250 | - ListItem() { | ||
| 251 | - QualityCommentItem({ item: item, index: index }).margin({ left: 12, right: 12 }) | ||
| 252 | - } | ||
| 253 | - }) | ||
| 254 | - } | ||
| 255 | - } | ||
| 256 | 272 | ||
| 257 | } | 273 | } |
| 258 | 274 | ||
| @@ -261,6 +277,8 @@ export struct QualityCommentsComponent { | @@ -261,6 +277,8 @@ export struct QualityCommentsComponent { | ||
| 261 | 277 | ||
| 262 | @Component | 278 | @Component |
| 263 | struct QualityCommentItem { | 279 | struct QualityCommentItem { |
| 280 | + @ObjectLink publishCommentModel: publishCommentModel | ||
| 281 | + dialogController: CustomDialogController | null = null; | ||
| 264 | @ObjectLink item: commentItemModel | 282 | @ObjectLink item: commentItemModel |
| 265 | index: number = 0 | 283 | index: number = 0 |
| 266 | 284 | ||
| @@ -360,7 +378,20 @@ struct QualityCommentItem { | @@ -360,7 +378,20 @@ struct QualityCommentItem { | ||
| 360 | Row({ space: 16 }) { | 378 | Row({ space: 16 }) { |
| 361 | Row() { | 379 | Row() { |
| 362 | Image($r('app.media.comment_icon_pinglun')).width(16).height(16) | 380 | Image($r('app.media.comment_icon_pinglun')).width(16).height(16) |
| 363 | - } | 381 | + }.onClick(()=>{ |
| 382 | + this.publishCommentModel.targetId = this.item.targetId | ||
| 383 | + this.publishCommentModel.targetRelId = this.item.targetRelId | ||
| 384 | + this.publishCommentModel.targetTitle = this.item.targetTitle | ||
| 385 | + this.publishCommentModel.targetRelType = this.item.targetRelType | ||
| 386 | + this.publishCommentModel.targetRelObjectId = this.item.targetRelObjectId | ||
| 387 | + this.publishCommentModel.targetType = this.item.targetType | ||
| 388 | + // this.publishCommentModel.keyArticle = this.item.keyArticle | ||
| 389 | + | ||
| 390 | + this.publishCommentModel.rootCommentId = this.item.rootCommentId | ||
| 391 | + this.publishCommentModel.parentId = this.item.id | ||
| 392 | + | ||
| 393 | + this.dialogController?.open() | ||
| 394 | + }) | ||
| 364 | 395 | ||
| 365 | Row() { | 396 | Row() { |
| 366 | Image($r(this.item.api_status ? 'app.media.comment_like_select' : 'app.media.comment_like_normal')) | 397 | Image($r(this.item.api_status ? 'app.media.comment_like_select' : 'app.media.comment_like_normal')) |
| @@ -373,6 +404,12 @@ struct QualityCommentItem { | @@ -373,6 +404,12 @@ struct QualityCommentItem { | ||
| 373 | .margin({ left: 3 }) | 404 | .margin({ left: 3 }) |
| 374 | } | 405 | } |
| 375 | }.onClick(() => { | 406 | }.onClick(() => { |
| 407 | + // 未登录,跳转登录 | ||
| 408 | + const user_id = HttpUtils.getUserId() | ||
| 409 | + if (!user_id) { | ||
| 410 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 411 | + return | ||
| 412 | + } | ||
| 376 | commentLikeChange(this.item) | 413 | commentLikeChange(this.item) |
| 377 | commentViewModel.commentLike(this.item).then(() => { | 414 | commentViewModel.commentLike(this.item).then(() => { |
| 378 | }).catch(() => { | 415 | }).catch(() => { |
| @@ -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 | } |
| @@ -12,6 +12,7 @@ export default struct NoMoreLayout { | @@ -12,6 +12,7 @@ export default struct NoMoreLayout { | ||
| 12 | Text($r('app.string.footer_text')) | 12 | Text($r('app.string.footer_text')) |
| 13 | .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT) | 13 | .fontSize(RefreshConstants.NoMoreLayoutConstant_TITLE_FONT) |
| 14 | .textAlign(TextAlign.Center) | 14 | .textAlign(TextAlign.Center) |
| 15 | + .fontColor('#CCCCCC') | ||
| 15 | .margin({bottom:40}) | 16 | .margin({bottom:40}) |
| 16 | } | 17 | } |
| 17 | .width(RefreshConstants.FULL_WIDTH) | 18 | .width(RefreshConstants.FULL_WIDTH) |
| @@ -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 | }) |
| @@ -339,8 +339,8 @@ export struct TopNavigationComponent { | @@ -339,8 +339,8 @@ export struct TopNavigationComponent { | ||
| 339 | }else { | 339 | }else { |
| 340 | Row() { | 340 | Row() { |
| 341 | Image($r('app.media.icon_search')) | 341 | Image($r('app.media.icon_search')) |
| 342 | - .width(18) | ||
| 343 | - .height(18) | 342 | + .width('24vp') |
| 343 | + .height('24vp') | ||
| 344 | } | 344 | } |
| 345 | .height('40vp') | 345 | .height('40vp') |
| 346 | .width('40vp') | 346 | .width('40vp') |
| @@ -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 |
| @@ -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 | + Row() { | ||
| 28 | Text(this.rmhInfo.userName) | 29 | Text(this.rmhInfo.userName) |
| 29 | .fontColor($r('app.color.color_222222')) | 30 | .fontColor($r('app.color.color_222222')) |
| 30 | .fontSize($r('app.float.vp_14')) | 31 | .fontSize($r('app.float.vp_14')) |
| 31 | .fontWeight(600) | 32 | .fontWeight(600) |
| 32 | .maxLines(1) | 33 | .maxLines(1) |
| 33 | .textOverflow({overflow: TextOverflow.Ellipsis}) | 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')) |
| @@ -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)) |
| @@ -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 |
| @@ -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) |
| @@ -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的事件后执行该回调 |
| @@ -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) { |
| @@ -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) |
| 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 | ||
| @@ -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) | ||
| 195 | } else { | 243 | } else { |
| 244 | + compOperData.add(advContentBean); | ||
| 245 | + } | ||
| 246 | + bannerAdvIndex = bannerAdvIndex + 1; | ||
| 247 | + | ||
| 248 | + // ArrayList转成 数组 | ||
| 249 | + compBean.operDataList = compOperData.convertToArray() | ||
| 250 | + } | ||
| 251 | + } | ||
| 252 | + } | ||
| 253 | + } | ||
| 254 | + | ||
| 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 |
| 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 | + | ||
| 198 | let advComp: CompDTO = { | 269 | let advComp: CompDTO = { |
| 199 | compStyle: CompStyle.Card_Comp_Adv, | 270 | compStyle: CompStyle.Card_Comp_Adv, |
| 200 | matInfo: matInfo | 271 | matInfo: matInfo |
| 201 | } as CompDTO; | 272 | } as CompDTO; |
| 202 | - pageCompList.insert(advComp, 0) | 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 { |
| 343 | + // 暂时屏蔽活动和音频详情入口 | ||
| 344 | + if (element.operDataList[0]?.objectType === '3' || element.operDataList[0]?.objectType === '13') { | ||
| 345 | + } else { | ||
| 259 | pageCompList.add(element) | 346 | pageCompList.add(element) |
| 260 | } | 347 | } |
| 348 | + | ||
| 261 | } | 349 | } |
| 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) { |
| @@ -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 |
| 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() |
-
Please register or login to post a comment