Showing
38 changed files
with
436 additions
and
134 deletions
| @@ -100,6 +100,8 @@ export class ContentDTO implements BaseDTO { | @@ -100,6 +100,8 @@ export class ContentDTO implements BaseDTO { | ||
| 100 | 本地辅助字段 | 100 | 本地辅助字段 |
| 101 | */ | 101 | */ |
| 102 | liveRoomDataBean : LiveRoomDataBean = {} as LiveRoomDataBean// 批查获取到的直播观看人数 | 102 | liveRoomDataBean : LiveRoomDataBean = {} as LiveRoomDataBean// 批查获取到的直播观看人数 |
| 103 | + //本地字段:时间轴专题页节点组件时间;【如果开启模糊则显示时间->左右;0:否,1:是】 | ||
| 104 | + timeBlurred:number = 0 | ||
| 103 | 105 | ||
| 104 | static clone(old: ContentDTO): ContentDTO { | 106 | static clone(old: ContentDTO): ContentDTO { |
| 105 | let content = new ContentDTO(); | 107 | let content = new ContentDTO(); |
| 1 | +import { ArrayList } from '@kit.ArkTS'; | ||
| 2 | +import { SharePosterItemBean } from './SharePosterItemBean'; | ||
| 3 | + | ||
| 1 | export interface ShareInfoDTO { | 4 | export interface ShareInfoDTO { |
| 2 | shareCoverUrl: string; | 5 | shareCoverUrl: string; |
| 3 | shareOpen: number; | 6 | shareOpen: number; |
| 7 | + //海报图片地址 | ||
| 4 | sharePosterCoverUrl: string; | 8 | sharePosterCoverUrl: string; |
| 9 | + //海报报分享开关 0:关闭,1:开启 | ||
| 5 | sharePosterOpen: number; | 10 | sharePosterOpen: number; |
| 6 | shareSummary: string; | 11 | shareSummary: string; |
| 12 | + //标题 | ||
| 7 | shareTitle: string; | 13 | shareTitle: string; |
| 14 | + //分享链接 | ||
| 8 | shareUrl: string; | 15 | shareUrl: string; |
| 16 | + //首发时间 | ||
| 17 | + publishTime:string; | ||
| 18 | + //图片 | ||
| 19 | + imageUrl:string; | ||
| 20 | + //直播和内容的举报,仅针对人民号发布的才能举报,cms创建的没有举报按钮 | ||
| 21 | + showReport:boolean; | ||
| 22 | + //点赞按钮显示 -1:不展示 0:未点赞 1:已点赞 | ||
| 23 | + showLike:number; | ||
| 24 | + //0 分享海报关闭,1 分享海报开启 | ||
| 25 | + posterShareControl:string; | ||
| 26 | + //是否展示海报 -1-不展示图标 | ||
| 27 | + showPoster:number; | ||
| 28 | + //海报展示类型 1:专题、文章、图文、视频、直播 2:人民号 3:评论 4:电子报海报 5:音频专题海报 6:早晚报专题海报 7:榜单H5 8:H5普通文章专题,包含时间链 | ||
| 29 | + showPosterType:number; | ||
| 30 | + //接口返回: 内容id、内容类型 | ||
| 31 | + contentId:string; | ||
| 32 | + //内容类型,分享的类型 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频 | ||
| 33 | + contentType:string; | ||
| 34 | + //关系id | ||
| 35 | + targetRelId:string; | ||
| 36 | + //关系类型,1.频道关系;2.专题关系 | ||
| 37 | + targetRelType:string; | ||
| 38 | + //21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题 | ||
| 39 | + topicType:string; | ||
| 40 | + //早晚报;1-早报;2-午报;3-晚报 | ||
| 41 | + topicPattern:number; | ||
| 42 | + //是否有头版 | ||
| 43 | + isFrontDaily:boolean; | ||
| 44 | + //分享海报简介 | ||
| 45 | + posterSummary:string; | ||
| 46 | + sharePosterItemList: SharePosterItemBean[] | ||
| 47 | + //分享海报标题 | ||
| 48 | + posterTitle:string; | ||
| 49 | + | ||
| 9 | } | 50 | } |
| 1 | import { FrontLinkObject } from '../component/FrontLinkObject'; | 1 | import { FrontLinkObject } from '../component/FrontLinkObject'; |
| 2 | +import { ArrayList } from '@kit.ArkTS'; | ||
| 3 | +import { ContentDTO } from '../content/ContentDTO'; | ||
| 2 | 4 | ||
| 3 | export interface TopicInfo { | 5 | export interface TopicInfo { |
| 4 | axisColor: string; | 6 | axisColor: string; |
| @@ -28,8 +30,17 @@ export interface TopicInfo { | @@ -28,8 +30,17 @@ export interface TopicInfo { | ||
| 28 | topicId: string; | 30 | topicId: string; |
| 29 | topicPattern: number; | 31 | topicPattern: number; |
| 30 | // topicTemplate?: any; | 32 | // topicTemplate?: any; |
| 33 | + //21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链 | ||
| 31 | topicType: number; | 34 | topicType: number; |
| 32 | transluceImgUrl: string; | 35 | transluceImgUrl: string; |
| 33 | visitorComment: number; | 36 | visitorComment: number; |
| 34 | // voteInfo?: any; | 37 | // voteInfo?: any; |
| 38 | + //频道、专题页关系id; | ||
| 39 | + relId:string; | ||
| 40 | + //关系类型:1.频道关系;2.专题关系; | ||
| 41 | + relType:string; | ||
| 42 | + //本地字段 --》分享页面需要展示的数据 | ||
| 43 | + shareContentList: ContentDTO[] | ||
| 44 | + //专题背景图 | ||
| 45 | + backgroundImgUrl: string | ||
| 35 | } | 46 | } |
| 1 | -import { NewspaperListBean, NewspaperListItemBean } from 'wdBean'; | 1 | +import { ContentDetailDTO, NewspaperListBean, NewspaperListItemBean } from 'wdBean'; |
| 2 | import { NewspaperViewModel } from '../viewmodel/NewspaperViewModel'; | 2 | import { NewspaperViewModel } from '../viewmodel/NewspaperViewModel'; |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | import { ENewspaperItemComponent } from './ENewspaperItemComponent'; | 4 | import { ENewspaperItemComponent } from './ENewspaperItemComponent'; |
| @@ -11,7 +11,8 @@ import { RMCalendarBean } from './calendar/RMCalendarBean'; | @@ -11,7 +11,8 @@ import { RMCalendarBean } from './calendar/RMCalendarBean'; | ||
| 11 | import { newsSkeleton } from './skeleton/newsSkeleton'; | 11 | import { newsSkeleton } from './skeleton/newsSkeleton'; |
| 12 | import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index'; | 12 | import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index'; |
| 13 | import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index'; | 13 | import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index'; |
| 14 | - | 14 | +import { WDShare } from 'wdShare/Index'; |
| 15 | +//电子报UI | ||
| 15 | @Component | 16 | @Component |
| 16 | export struct ENewspaperPageComponent { | 17 | export struct ENewspaperPageComponent { |
| 17 | private displayTool = display.getDefaultDisplaySync() | 18 | private displayTool = display.getDefaultDisplaySync() |
| @@ -179,7 +180,7 @@ export struct ENewspaperPageComponent { | @@ -179,7 +180,7 @@ export struct ENewspaperPageComponent { | ||
| 179 | }) | 180 | }) |
| 180 | .id('e_newspaper_share') | 181 | .id('e_newspaper_share') |
| 181 | .onClick(() => { | 182 | .onClick(() => { |
| 182 | - ToastUtils.showToast('分享为公共方法,待开发', 1000); | 183 | + this.share() |
| 183 | }) | 184 | }) |
| 184 | } | 185 | } |
| 185 | } | 186 | } |
| @@ -392,4 +393,24 @@ export struct ENewspaperPageComponent { | @@ -392,4 +393,24 @@ export struct ENewspaperPageComponent { | ||
| 392 | 393 | ||
| 393 | } | 394 | } |
| 394 | } | 395 | } |
| 396 | + | ||
| 397 | + share() { | ||
| 398 | + let contentDetailData: ContentDetailDTO = { | ||
| 399 | + shareInfo:{ | ||
| 400 | + shareTitle:this.newspaperListBean?.list[this.swiperIndex].pageName, | ||
| 401 | + publishTime:this.newspaperListBean?.list[this.swiperIndex].periodNum, | ||
| 402 | + imageUrl:this.newspaperListBean?.list[this.swiperIndex].pagePic, | ||
| 403 | + shareUrl:this.newspaperListBean?.list[this.swiperIndex].sharePagePic.shareUrl, | ||
| 404 | + sharePosterCoverUrl:this.newspaperListBean?.list[this.swiperIndex].sharePagePic.sharePosterCoverUrl, | ||
| 405 | + showReport:false, | ||
| 406 | + showLike:-1, | ||
| 407 | + shareOpen:1, | ||
| 408 | + sharePosterOpen:1, | ||
| 409 | + posterShareControl:'-1', | ||
| 410 | + showPoster:-1, | ||
| 411 | + showPosterType:4, | ||
| 412 | + } | ||
| 413 | + } as ContentDetailDTO | ||
| 414 | + WDShare.shareContent(contentDetailData,TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage) | ||
| 415 | + } | ||
| 395 | } | 416 | } |
| @@ -294,7 +294,7 @@ export struct MorningEveningPaperComponent { | @@ -294,7 +294,7 @@ export struct MorningEveningPaperComponent { | ||
| 294 | @Builder | 294 | @Builder |
| 295 | topPaperTitle(){ | 295 | topPaperTitle(){ |
| 296 | Column(){ | 296 | Column(){ |
| 297 | - PaperTitleComponent().margin({top:this.topSafeHeight}) | 297 | + PaperTitleComponent({topicInfo:this.pageInfoBean?.topicInfo}).margin({top:this.topSafeHeight}) |
| 298 | }.height(44+this.topSafeHeight).backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor) | 298 | }.height(44+this.topSafeHeight).backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor) |
| 299 | } | 299 | } |
| 300 | 300 |
| 1 | import router from '@ohos.router'; | 1 | import router from '@ohos.router'; |
| 2 | +import { ContentDetailDTO, TopicInfo } from 'wdBean/Index'; | ||
| 2 | import { ToastUtils } from 'wdKit'; | 3 | import { ToastUtils } from 'wdKit'; |
| 4 | +import { WDShare } from 'wdShare/Index'; | ||
| 5 | +import { TrackConstants } from 'wdTracking/Index'; | ||
| 3 | 6 | ||
| 4 | /** | 7 | /** |
| 5 | * 早晚报页面标题bar | 8 | * 早晚报页面标题bar |
| @@ -9,7 +12,7 @@ import { ToastUtils } from 'wdKit'; | @@ -9,7 +12,7 @@ import { ToastUtils } from 'wdKit'; | ||
| 9 | export struct PaperTitleComponent { | 12 | export struct PaperTitleComponent { |
| 10 | @Consume title?: string | 13 | @Consume title?: string |
| 11 | @Consume subTitle?: string | 14 | @Consume subTitle?: string |
| 12 | - | 15 | + topicInfo: TopicInfo = {} as TopicInfo |
| 13 | aboutToAppear() { | 16 | aboutToAppear() { |
| 14 | } | 17 | } |
| 15 | 18 | ||
| @@ -105,7 +108,7 @@ export struct PaperTitleComponent { | @@ -105,7 +108,7 @@ export struct PaperTitleComponent { | ||
| 105 | .id('img_share') | 108 | .id('img_share') |
| 106 | .margin({ right: 16 }) | 109 | .margin({ right: 16 }) |
| 107 | .onClick(() => { | 110 | .onClick(() => { |
| 108 | - ToastUtils.showToast('分享为公共方法,待开发', 1000) | 111 | + this.share() |
| 109 | }) | 112 | }) |
| 110 | } | 113 | } |
| 111 | // .margin({ left: 14, right: 14 }) | 114 | // .margin({ left: 14, right: 14 }) |
| @@ -149,4 +152,28 @@ export struct PaperTitleComponent { | @@ -149,4 +152,28 @@ export struct PaperTitleComponent { | ||
| 149 | // } | 152 | // } |
| 150 | // .margin({ left: 6 }) | 153 | // .margin({ left: 6 }) |
| 151 | } | 154 | } |
| 155 | + | ||
| 156 | + share() { | ||
| 157 | + let contentDetailData: ContentDetailDTO = { | ||
| 158 | + newsId:Number.parseInt(this.topicInfo.topicId), | ||
| 159 | + shareInfo:{ | ||
| 160 | + contentId:this.topicInfo.topicId, | ||
| 161 | + contentType:this.topicInfo.topicType+'', | ||
| 162 | + shareTitle:this.topicInfo.shareTitle, | ||
| 163 | + shareSummary:this.topicInfo.shareSummary, | ||
| 164 | + imageUrl:this.topicInfo.shareCoverUrl, | ||
| 165 | + sharePosterCoverUrl:this.topicInfo.sharePosterCoverUrl, | ||
| 166 | + shareUrl:this.topicInfo.shareUrl, | ||
| 167 | + targetRelId:this.topicInfo.relId, | ||
| 168 | + targetRelType:this.topicInfo.relType, | ||
| 169 | + showReport:false, | ||
| 170 | + showLike:-1, | ||
| 171 | + shareOpen:1, | ||
| 172 | + sharePosterOpen:this.topicInfo.posterFlag, | ||
| 173 | + showPoster:this.topicInfo.posterFlag>0?1:-1, | ||
| 174 | + } | ||
| 175 | + } as ContentDetailDTO | ||
| 176 | + WDShare.setTopicBeanToShareBean(contentDetailData.shareInfo,this.topicInfo) | ||
| 177 | + WDShare.shareContent(contentDetailData,TrackConstants.PageName.Eletronic_Paper,TrackConstants.PageName.Eletronic_Paper) | ||
| 178 | + } | ||
| 152 | } | 179 | } |
| @@ -14,6 +14,8 @@ import font from '@ohos.font'; | @@ -14,6 +14,8 @@ import font from '@ohos.font'; | ||
| 14 | export struct CardMediaInfo { | 14 | export struct CardMediaInfo { |
| 15 | 15 | ||
| 16 | @State livePeopleNum :boolean = true | 16 | @State livePeopleNum :boolean = true |
| 17 | + //@ObjectLink compDTO: CompDTO | ||
| 18 | + @State beused: string = ''; // 2024-05-28 给CardMediaInfo组件添加beused的字段让其知道被哪个组件使用,不传默认为空 | ||
| 17 | @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 | 19 | @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 |
| 18 | @State joinPeopleNum: number = 0; | 20 | @State joinPeopleNum: number = 0; |
| 19 | // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, | 21 | // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, |
| @@ -154,12 +156,17 @@ export struct CardMediaInfo { | @@ -154,12 +156,17 @@ export struct CardMediaInfo { | ||
| 154 | } | 156 | } |
| 155 | 157 | ||
| 156 | } | 158 | } |
| 157 | - if (!!this.joinPeopleNum) { | ||
| 158 | - Text(' | ') | ||
| 159 | - .mediaText() | ||
| 160 | - Text(`${this.handlerNum(this.joinPeopleNum.toString())}人参加`) | ||
| 161 | - .mediaText() | ||
| 162 | - } | 159 | + // 备注直播间观看人数在轮播图卡不显示 |
| 160 | + if(this.beused !== 'Zh_Carousel_Layout_01'){ | ||
| 161 | + if (!!this.joinPeopleNum) { | ||
| 162 | + Text(' | ') | ||
| 163 | + .mediaText() | ||
| 164 | + Text(`${this.handlerNum(this.joinPeopleNum.toString())}人参加`) | ||
| 165 | + .mediaText() | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + | ||
| 163 | // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo | 170 | // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo |
| 164 | // ?.replayUri) { | 171 | // ?.replayUri) { |
| 165 | // // Image($r('app.media.card_live')) | 172 | // // Image($r('app.media.card_live')) |
| @@ -44,10 +44,25 @@ export struct Card5Component { | @@ -44,10 +44,25 @@ export struct Card5Component { | ||
| 44 | Image(this.loadImg ? this.contentDTO.coverUrl : '') | 44 | Image(this.loadImg ? this.contentDTO.coverUrl : '') |
| 45 | .backgroundColor(0xf5f5f5) | 45 | .backgroundColor(0xf5f5f5) |
| 46 | .width(CommonConstants.FULL_WIDTH) | 46 | .width(CommonConstants.FULL_WIDTH) |
| 47 | - .borderRadius($r('app.float.image_border_radius')) | 47 | + .borderRadius( |
| 48 | + { | ||
| 49 | + topLeft: $r('app.float.image_border_radius'), | ||
| 50 | + topRight: $r('app.float.image_border_radius'), | ||
| 51 | + bottomLeft: $r('app.float.image_border_radius'), | ||
| 52 | + bottomRight: $r('app.float.image_border_radius') | ||
| 53 | + } | ||
| 54 | + ) | ||
| 48 | .aspectRatio(343 / 225) | 55 | .aspectRatio(343 / 225) |
| 49 | if (this.titleShowPolicy === 1 || this.titleShowPolicy === null || this.titleShowPolicy === '') { | 56 | if (this.titleShowPolicy === 1 || this.titleShowPolicy === null || this.titleShowPolicy === '') { |
| 50 | Row() | 57 | Row() |
| 58 | + .borderRadius( | ||
| 59 | + { | ||
| 60 | + topLeft: $r('app.float.image_border_radius'), | ||
| 61 | + topRight: $r('app.float.image_border_radius'), | ||
| 62 | + bottomLeft: $r('app.float.image_border_radius'), | ||
| 63 | + bottomRight: $r('app.float.image_border_radius') | ||
| 64 | + } | ||
| 65 | + ) | ||
| 51 | .width(CommonConstants.FULL_WIDTH) | 66 | .width(CommonConstants.FULL_WIDTH) |
| 52 | .height(59) | 67 | .height(59) |
| 53 | .linearGradient({ | 68 | .linearGradient({ |
| @@ -55,6 +70,7 @@ export struct Card5Component { | @@ -55,6 +70,7 @@ export struct Card5Component { | ||
| 55 | ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0] | 70 | ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0] |
| 56 | ] | 71 | ] |
| 57 | }) | 72 | }) |
| 73 | + | ||
| 58 | Row() { | 74 | Row() { |
| 59 | Stack() { | 75 | Stack() { |
| 60 | if(this.contentDTO.objectType == '5'){ | 76 | if(this.contentDTO.objectType == '5'){ |
| @@ -69,7 +85,7 @@ export struct Card5Component { | @@ -69,7 +85,7 @@ export struct Card5Component { | ||
| 69 | } | 85 | } |
| 70 | 86 | ||
| 71 | Text() { | 87 | Text() { |
| 72 | - if (this.titleMarked) { | 88 | + if (this.titleMarked) { |
| 73 | ForEach(this.textArr, (textItem: textItem) => { | 89 | ForEach(this.textArr, (textItem: textItem) => { |
| 74 | if (textItem.isRed) { | 90 | if (textItem.isRed) { |
| 75 | Span(textItem.content) | 91 | Span(textItem.content) |
| @@ -256,12 +256,14 @@ export struct CommentComponent { | @@ -256,12 +256,14 @@ export struct CommentComponent { | ||
| 256 | 256 | ||
| 257 | //获取数据 | 257 | //获取数据 |
| 258 | async getData() { | 258 | async getData() { |
| 259 | - commentViewModel.fetchContentCommentList(this.currentPage + '', this.publishCommentModel.targetId, | 259 | + let pageIndex = this.currentPage |
| 260 | + commentViewModel.fetchContentCommentList(pageIndex + '', this.publishCommentModel.targetId, | ||
| 260 | this.publishCommentModel.targetType) | 261 | this.publishCommentModel.targetType) |
| 261 | .then(commentListModel => { | 262 | .then(commentListModel => { |
| 262 | console.log('评论:', JSON.stringify(commentListModel.list)) | 263 | console.log('评论:', JSON.stringify(commentListModel.list)) |
| 263 | - this.currentPage++ | ||
| 264 | 264 | ||
| 265 | + // 这里需要先赋值,否则下次UI刷新可能重复进入第1页两次 | ||
| 266 | + this.currentPage = pageIndex + 1 | ||
| 265 | if (Number.parseInt(commentListModel.totalCommentNum) > | 267 | if (Number.parseInt(commentListModel.totalCommentNum) > |
| 266 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | 268 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { |
| 267 | this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + '' | 269 | this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + '' |
| @@ -279,7 +281,9 @@ export struct CommentComponent { | @@ -279,7 +281,9 @@ export struct CommentComponent { | ||
| 279 | 281 | ||
| 280 | if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { | 282 | if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { |
| 281 | 283 | ||
| 282 | - this.allDatas.clearAllData() // 防止数据重复问题 | 284 | + if (pageIndex == 1) { |
| 285 | + this.allDatas.clearAllData() // 防止数据重复问题 | ||
| 286 | + } | ||
| 283 | commentListModel.list.forEach(element => { | 287 | commentListModel.list.forEach(element => { |
| 284 | element.hasMore = Number.parseInt(element.childCommentNum) ? true : false | 288 | element.hasMore = Number.parseInt(element.childCommentNum) ? true : false |
| 285 | let newModel = commentViewModel.deepCopyCommentItemModel(element) | 289 | let newModel = commentViewModel.deepCopyCommentItemModel(element) |
| @@ -289,7 +293,6 @@ export struct CommentComponent { | @@ -289,7 +293,6 @@ export struct CommentComponent { | ||
| 289 | this.allDatas.push(newModel) | 293 | this.allDatas.push(newModel) |
| 290 | }); | 294 | }); |
| 291 | 295 | ||
| 292 | - | ||
| 293 | } else { | 296 | } else { |
| 294 | this.hasMore = false | 297 | this.hasMore = false |
| 295 | } | 298 | } |
| @@ -327,7 +330,7 @@ struct ChildCommentItem { | @@ -327,7 +330,7 @@ struct ChildCommentItem { | ||
| 327 | } | 330 | } |
| 328 | } | 331 | } |
| 329 | .maxLines(1) | 332 | .maxLines(1) |
| 330 | - .layoutWeight(1) | 333 | + .flexShrink(1) |
| 331 | .fontSize(14) | 334 | .fontSize(14) |
| 332 | .fontColor($r('app.color.color_222222')) | 335 | .fontColor($r('app.color.color_222222')) |
| 333 | .fontWeight(FontWeight.Medium) | 336 | .fontWeight(FontWeight.Medium) |
| @@ -338,7 +341,7 @@ struct ChildCommentItem { | @@ -338,7 +341,7 @@ struct ChildCommentItem { | ||
| 338 | /// 人民号>置顶>作者 | 341 | /// 人民号>置顶>作者 |
| 339 | 342 | ||
| 340 | //人民号 | 343 | //人民号 |
| 341 | - if (this.item.fromUserType !== 1) { | 344 | + if (this.item.fromUserType == 2) { |
| 342 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); | 345 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); |
| 343 | } | 346 | } |
| 344 | //置顶 | 347 | //置顶 |
| @@ -541,6 +544,8 @@ struct commentHeaderView { | @@ -541,6 +544,8 @@ struct commentHeaderView { | ||
| 541 | //昵称 | 544 | //昵称 |
| 542 | Text(this.item.fromUserName) | 545 | Text(this.item.fromUserName) |
| 543 | .fontSize(14) | 546 | .fontSize(14) |
| 547 | + .maxLines(1) | ||
| 548 | + .flexShrink(1) | ||
| 544 | .fontColor($r('app.color.color_222222')) | 549 | .fontColor($r('app.color.color_222222')) |
| 545 | .fontWeight(FontWeight.Medium) | 550 | .fontWeight(FontWeight.Medium) |
| 546 | .margin({ left: 5 }) | 551 | .margin({ left: 5 }) |
| @@ -550,7 +555,7 @@ struct commentHeaderView { | @@ -550,7 +555,7 @@ struct commentHeaderView { | ||
| 550 | /// 人民号>置顶>作者 | 555 | /// 人民号>置顶>作者 |
| 551 | 556 | ||
| 552 | //人民号 | 557 | //人民号 |
| 553 | - if (this.item.fromUserType !== 1) { | 558 | + if (this.item.fromUserType == 2) { |
| 554 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); | 559 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); |
| 555 | } | 560 | } |
| 556 | //置顶 | 561 | //置顶 |
| @@ -11,6 +11,7 @@ export struct CommentListDialogView { | @@ -11,6 +11,7 @@ export struct CommentListDialogView { | ||
| 11 | @Link @Watch('showCommentListChange') showCommentList: boolean | 11 | @Link @Watch('showCommentListChange') showCommentList: boolean |
| 12 | @Link contentDetailData: ContentDetailDTO // 详情页传 | 12 | @Link contentDetailData: ContentDetailDTO // 详情页传 |
| 13 | @Link pageInfo: PageInfoDTO // 专题页传 | 13 | @Link pageInfo: PageInfoDTO // 专题页传 |
| 14 | + @Link publishCommentModel: publishCommentModel | ||
| 14 | onClose?: () => void | 15 | onClose?: () => void |
| 15 | 16 | ||
| 16 | // @Consume pageId: TrackConstants.PageName | 17 | // @Consume pageId: TrackConstants.PageName |
| @@ -19,6 +20,7 @@ export struct CommentListDialogView { | @@ -19,6 +20,7 @@ export struct CommentListDialogView { | ||
| 19 | private dialogController: CustomDialogController = new CustomDialogController({ | 20 | private dialogController: CustomDialogController = new CustomDialogController({ |
| 20 | builder: CommentListDialog({ | 21 | builder: CommentListDialog({ |
| 21 | contentDetailData: this.contentDetailData, | 22 | contentDetailData: this.contentDetailData, |
| 23 | + publishCommentModel:this.publishCommentModel, | ||
| 22 | pageInfo: this.pageInfo, | 24 | pageInfo: this.pageInfo, |
| 23 | onClose: this.onClose | 25 | onClose: this.onClose |
| 24 | }), | 26 | }), |
| @@ -47,7 +49,7 @@ export struct CommentListDialogView { | @@ -47,7 +49,7 @@ export struct CommentListDialogView { | ||
| 47 | struct CommentListDialog { | 49 | struct CommentListDialog { |
| 48 | 50 | ||
| 49 | /// 内部使用 | 51 | /// 内部使用 |
| 50 | - @State private publishCommentModel: publishCommentModel = new publishCommentModel() | 52 | + @Link publishCommentModel: publishCommentModel |
| 51 | @State private operationButtonList: string[] = [] | 53 | @State private operationButtonList: string[] = [] |
| 52 | controller?: CustomDialogController | 54 | controller?: CustomDialogController |
| 53 | @State windowWidth: number = AppStorage.get<number>('windowWidth') || 0 | 55 | @State windowWidth: number = AppStorage.get<number>('windowWidth') || 0 |
| @@ -204,7 +204,8 @@ struct CarouselLayout01CardView { | @@ -204,7 +204,8 @@ struct CarouselLayout01CardView { | ||
| 204 | Column() { | 204 | Column() { |
| 205 | // 这里用于展示轮播图右上角信息,这里只对直播类型的展示 | 205 | // 这里用于展示轮播图右上角信息,这里只对直播类型的展示 |
| 206 | if (this.item.objectType === '2' || this.item.objectType === '4') { | 206 | if (this.item.objectType === '2' || this.item.objectType === '4') { |
| 207 | - CardMediaInfo({ contentDTO: this.item,livePeopleNum:false }) | 207 | + // 2024-05-28 给CardMediaInfo组件添加beused的字段让其知道被哪个组件使用,不传默认为空 |
| 208 | + CardMediaInfo({ contentDTO: this.item,livePeopleNum:false ,beused:'Zh_Carousel_Layout_01'}) | ||
| 208 | .width(CommonConstants.FULL_PARENT) | 209 | .width(CommonConstants.FULL_PARENT) |
| 209 | } | 210 | } |
| 210 | Blank() | 211 | Blank() |
| @@ -223,7 +224,8 @@ struct CarouselLayout01CardView { | @@ -223,7 +224,8 @@ struct CarouselLayout01CardView { | ||
| 223 | // if (this.item.objectType == '5' || this.item.objectType == '6') { | 224 | // if (this.item.objectType == '5' || this.item.objectType == '6') { |
| 224 | // Notes({ objectType: this.item.objectType }) | 225 | // Notes({ objectType: this.item.objectType }) |
| 225 | // } | 226 | // } |
| 226 | - Text(`${this.item.corner}${this.item.newsTitle}`) | 227 | + //Text(`${this.item.corner}${this.item.newsTitle}`) |
| 228 | + Text(`${this.item.newsTitle}`) | ||
| 227 | .width(CommonConstants.FULL_PARENT) | 229 | .width(CommonConstants.FULL_PARENT) |
| 228 | .fontColor(Color.White) | 230 | .fontColor(Color.White) |
| 229 | .fontSize($r('app.float.font_size_18')) | 231 | .fontSize($r('app.float.font_size_18')) |
| @@ -86,7 +86,7 @@ export struct FollowFirstTabsComponent{ | @@ -86,7 +86,7 @@ export struct FollowFirstTabsComponent{ | ||
| 86 | if(!this.isConnectNetwork){ | 86 | if(!this.isConnectNetwork){ |
| 87 | EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { | 87 | EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { |
| 88 | this.reloadNetWork() | 88 | this.reloadNetWork() |
| 89 | - },}) | 89 | + }}) |
| 90 | .layoutWeight(1) | 90 | .layoutWeight(1) |
| 91 | .width('100%') | 91 | .width('100%') |
| 92 | }else{ | 92 | }else{ |
| @@ -102,7 +102,8 @@ export struct FollowListDetailUI { | @@ -102,7 +102,8 @@ export struct FollowListDetailUI { | ||
| 102 | } | 102 | } |
| 103 | } | 103 | } |
| 104 | } | 104 | } |
| 105 | - .cachedCount(10) | 105 | + .edgeEffect(EdgeEffect.None) |
| 106 | + .cachedCount(5) | ||
| 106 | .padding({ left: '31lpx', right: '31lpx' }) | 107 | .padding({ left: '31lpx', right: '31lpx' }) |
| 107 | .layoutWeight(1) | 108 | .layoutWeight(1) |
| 108 | .scrollBar(BarState.Off) | 109 | .scrollBar(BarState.Off) |
| @@ -109,7 +109,7 @@ export struct HomePageBottomCommentComponent { | @@ -109,7 +109,7 @@ export struct HomePageBottomCommentComponent { | ||
| 109 | } | 109 | } |
| 110 | } | 110 | } |
| 111 | } | 111 | } |
| 112 | - .cachedCount(15) | 112 | + .cachedCount(5) |
| 113 | .layoutWeight(1) | 113 | .layoutWeight(1) |
| 114 | .scrollBar(BarState.Off) | 114 | .scrollBar(BarState.Off) |
| 115 | .edgeEffect(EdgeEffect.None) | 115 | .edgeEffect(EdgeEffect.None) |
| @@ -177,7 +177,7 @@ export struct HomePageBottomFollowComponent { | @@ -177,7 +177,7 @@ export struct HomePageBottomFollowComponent { | ||
| 177 | } | 177 | } |
| 178 | } | 178 | } |
| 179 | } | 179 | } |
| 180 | - .cachedCount(15) | 180 | + .cachedCount(5) |
| 181 | .padding({ left: '31lpx', right: '31lpx' }) | 181 | .padding({ left: '31lpx', right: '31lpx' }) |
| 182 | .layoutWeight(1) | 182 | .layoutWeight(1) |
| 183 | .scrollBar(BarState.Off) | 183 | .scrollBar(BarState.Off) |
| @@ -109,7 +109,7 @@ export struct OtherHomePageBottomCommentComponent { | @@ -109,7 +109,7 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 109 | } | 109 | } |
| 110 | } | 110 | } |
| 111 | } | 111 | } |
| 112 | - .cachedCount(15) | 112 | + .cachedCount(5) |
| 113 | .layoutWeight(1) | 113 | .layoutWeight(1) |
| 114 | .scrollBar(BarState.Off) | 114 | .scrollBar(BarState.Off) |
| 115 | .edgeEffect(EdgeEffect.None) | 115 | .edgeEffect(EdgeEffect.None) |
| @@ -138,7 +138,7 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -138,7 +138,7 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 138 | ListHasNoMoreDataUI() | 138 | ListHasNoMoreDataUI() |
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| 141 | - }.cachedCount(15) | 141 | + }.cachedCount(5) |
| 142 | .padding({left:'31lpx',right:'31lpx'}) | 142 | .padding({left:'31lpx',right:'31lpx'}) |
| 143 | .layoutWeight(1) | 143 | .layoutWeight(1) |
| 144 | .scrollBar(BarState.Off) | 144 | .scrollBar(BarState.Off) |
| @@ -4,10 +4,12 @@ import { EditListInfo, editModel, editModelParams, WDEditDataModelType } from '. | @@ -4,10 +4,12 @@ import { EditListInfo, editModel, editModelParams, WDEditDataModelType } from '. | ||
| 4 | import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; | 4 | import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; |
| 5 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 5 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 6 | import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' | 6 | import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' |
| 7 | +import {EditUserInfoCustomDialog} from '../view/areaPickerDialog/EditUserInfoCustomDialog' | ||
| 7 | import { AreaListModel } from '../../model/AreaListModel'; | 8 | import { AreaListModel } from '../../model/AreaListModel'; |
| 8 | import router from '@ohos.router'; | 9 | import router from '@ohos.router'; |
| 9 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' | 10 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' |
| 10 | import { TrackConstants } from 'wdTracking/Index'; | 11 | import { TrackConstants } from 'wdTracking/Index'; |
| 12 | +import { window } from '@kit.ArkUI'; | ||
| 11 | 13 | ||
| 12 | @Entry | 14 | @Entry |
| 13 | @Component | 15 | @Component |
| @@ -16,6 +18,7 @@ struct EditUserInfoPage { | @@ -16,6 +18,7 @@ struct EditUserInfoPage { | ||
| 16 | @State headerImg: string = '' | 18 | @State headerImg: string = '' |
| 17 | @State dataSource: AreaListModel[] = [] | 19 | @State dataSource: AreaListModel[] = [] |
| 18 | @State currentUserInfo: editModel = new editModel() | 20 | @State currentUserInfo: editModel = new editModel() |
| 21 | + @State bottomSafeHeight: number = 0; | ||
| 19 | 22 | ||
| 20 | dialogController: CustomDialogController = new CustomDialogController({ | 23 | dialogController: CustomDialogController = new CustomDialogController({ |
| 21 | builder: AreaPickerDialog({dataSource:this.dataSource, | 24 | builder: AreaPickerDialog({dataSource:this.dataSource, |
| @@ -29,10 +32,35 @@ struct EditUserInfoPage { | @@ -29,10 +32,35 @@ struct EditUserInfoPage { | ||
| 29 | } | 32 | } |
| 30 | }), | 33 | }), |
| 31 | alignment: DialogAlignment.Bottom, | 34 | alignment: DialogAlignment.Bottom, |
| 32 | - offset:{dx:0,dy:0}, | 35 | + customStyle: true, |
| 36 | + offset: { | ||
| 37 | + dx: 0, | ||
| 38 | + dy: -this.bottomSafeHeight | ||
| 39 | + }, | ||
| 33 | }) | 40 | }) |
| 34 | 41 | ||
| 35 | - aboutToAppear() { | 42 | + dateDialogController: CustomDialogController = new CustomDialogController({ |
| 43 | + builder: EditUserInfoCustomDialog({ | ||
| 44 | + confirmCallback:(selectDate:Date)=>{ | ||
| 45 | + let mon = selectDate.getUTCMonth() as number + 1 | ||
| 46 | + let monStr = mon < 10? '0'+mon.toString():mon.toString(); | ||
| 47 | + let dayStr = selectDate.getUTCDate() as number < 10? '0'+selectDate.getUTCDate():selectDate.getUTCDate(); | ||
| 48 | + this.currentUserInfo.userExtend.birthday = selectDate.getUTCFullYear()+'-'+monStr+'-'+dayStr; | ||
| 49 | + this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday | ||
| 50 | + this.updateEditModel() | ||
| 51 | + } | ||
| 52 | + }), | ||
| 53 | + alignment: DialogAlignment.Bottom, | ||
| 54 | + customStyle: true, | ||
| 55 | + offset: { | ||
| 56 | + dx: 0, | ||
| 57 | + dy: -this.bottomSafeHeight | ||
| 58 | + }, | ||
| 59 | + }) | ||
| 60 | + | ||
| 61 | + async aboutToAppear() { | ||
| 62 | + let windowHight: window.Window = await window.getLastWindow(getContext(this)); | ||
| 63 | + this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) | ||
| 36 | this.getAccountOwnerInfo() | 64 | this.getAccountOwnerInfo() |
| 37 | this.getAreaList() | 65 | this.getAreaList() |
| 38 | } | 66 | } |
| @@ -145,20 +173,22 @@ struct EditUserInfoPage { | @@ -145,20 +173,22 @@ struct EditUserInfoPage { | ||
| 145 | }else if (i === 3){ | 173 | }else if (i === 3){ |
| 146 | this.dialogController.open() | 174 | this.dialogController.open() |
| 147 | } else if (i === 4) { | 175 | } else if (i === 4) { |
| 148 | - DatePickerDialog.show({ | ||
| 149 | - start:new Date('1900-1-1'), | ||
| 150 | - end:new Date(), | ||
| 151 | - selected:new Date, | ||
| 152 | - lunar:false, | ||
| 153 | - onAccept:(value:DatePickerResult) => { | ||
| 154 | - let mon = value.month as number + 1 | ||
| 155 | - let monStr = mon < 10? '0'+mon.toString():mon.toString(); | ||
| 156 | - let dayStr = value.day as number < 10? '0'+value.day:value.day; | ||
| 157 | - this.currentUserInfo.userExtend.birthday = value.year+'-'+monStr+'-'+dayStr; | ||
| 158 | - this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday | ||
| 159 | - this.updateEditModel() | ||
| 160 | - } | ||
| 161 | - }) | 176 | + this.dateDialogController.open() |
| 177 | + | ||
| 178 | + // DatePickerDialog.show({ | ||
| 179 | + // start:new Date('1900-1-1'), | ||
| 180 | + // end:new Date(), | ||
| 181 | + // selected:new Date, | ||
| 182 | + // lunar:false, | ||
| 183 | + // onAccept:(value:DatePickerResult) => { | ||
| 184 | + // let mon = value.month as number + 1 | ||
| 185 | + // let monStr = mon < 10? '0'+mon.toString():mon.toString(); | ||
| 186 | + // let dayStr = value.day as number < 10? '0'+value.day:value.day; | ||
| 187 | + // this.currentUserInfo.userExtend.birthday = value.year+'-'+monStr+'-'+dayStr; | ||
| 188 | + // this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday | ||
| 189 | + // this.updateEditModel() | ||
| 190 | + // } | ||
| 191 | + // }) | ||
| 162 | }else if(i === 5){ | 192 | }else if(i === 5){ |
| 163 | TextPickerDialog.show({ | 193 | TextPickerDialog.show({ |
| 164 | range:['男','女'], | 194 | range:['男','女'], |
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | import { PeopleShipHomePageNavComponent } from '../peopleShipHomePage/PeopleShipHomeNavComponent' | 2 | import { PeopleShipHomePageNavComponent } from '../peopleShipHomePage/PeopleShipHomeNavComponent' |
| 3 | import { PeopleShipHomePageTopComponent } from '../peopleShipHomePage/PeopleShipHomePageTopComponent' | 3 | import { PeopleShipHomePageTopComponent } from '../peopleShipHomePage/PeopleShipHomePageTopComponent' |
| 4 | -import { Logger, WindowModel } from 'wdKit' | 4 | +import { Logger, NetworkUtil, WindowModel } from 'wdKit' |
| 5 | import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' | 5 | import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' |
| 6 | import { PeopleShipHomeListComponent } from '../peopleShipHomePage/PeopleShipHomeListComponent' | 6 | import { PeopleShipHomeListComponent } from '../peopleShipHomePage/PeopleShipHomeListComponent' |
| 7 | import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' | 7 | import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' |
| @@ -14,6 +14,7 @@ import { | @@ -14,6 +14,7 @@ import { | ||
| 14 | ArticleCountData | 14 | ArticleCountData |
| 15 | } from 'wdBean' | 15 | } from 'wdBean' |
| 16 | import { EmptyComponent } from '../view/EmptyComponent' | 16 | import { EmptyComponent } from '../view/EmptyComponent' |
| 17 | +import { CustomTitleUI } from '../reusable/CustomTitleUI' | ||
| 17 | 18 | ||
| 18 | @Entry | 19 | @Entry |
| 19 | @Component | 20 | @Component |
| @@ -39,8 +40,10 @@ struct PeopleShipHomePage { | @@ -39,8 +40,10 @@ struct PeopleShipHomePage { | ||
| 39 | @Provide topHeight: number = 214 | 40 | @Provide topHeight: number = 214 |
| 40 | @State isLoading: boolean = true | 41 | @State isLoading: boolean = true |
| 41 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 42 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 43 | + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | ||
| 42 | 44 | ||
| 43 | build() { | 45 | build() { |
| 46 | + if(this.isConnectNetwork){ | ||
| 44 | Stack({ alignContent: Alignment.TopStart }) { | 47 | Stack({ alignContent: Alignment.TopStart }) { |
| 45 | Stack({ alignContent: Alignment.Top }){ | 48 | Stack({ alignContent: Alignment.Top }){ |
| 46 | // 顶部图片 | 49 | // 顶部图片 |
| @@ -61,8 +64,6 @@ struct PeopleShipHomePage { | @@ -61,8 +64,6 @@ struct PeopleShipHomePage { | ||
| 61 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | 64 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) |
| 62 | } | 65 | } |
| 63 | 66 | ||
| 64 | - | ||
| 65 | - | ||
| 66 | Column(){ | 67 | Column(){ |
| 67 | // 头部返回 | 68 | // 头部返回 |
| 68 | PeopleShipHomePageNavComponent({ | 69 | PeopleShipHomePageNavComponent({ |
| @@ -122,7 +123,6 @@ struct PeopleShipHomePage { | @@ -122,7 +123,6 @@ struct PeopleShipHomePage { | ||
| 122 | 123 | ||
| 123 | }) | 124 | }) |
| 124 | } | 125 | } |
| 125 | - | ||
| 126 | } | 126 | } |
| 127 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) | 127 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) |
| 128 | .alignItems(HorizontalAlign.Start) | 128 | .alignItems(HorizontalAlign.Start) |
| @@ -130,7 +130,21 @@ struct PeopleShipHomePage { | @@ -130,7 +130,21 @@ struct PeopleShipHomePage { | ||
| 130 | .width('100%') | 130 | .width('100%') |
| 131 | } | 131 | } |
| 132 | .width('100%') | 132 | .width('100%') |
| 133 | - | 133 | + }else{ |
| 134 | + Column(){ | ||
| 135 | + CustomTitleUI({ titleName: "" }) | ||
| 136 | + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { | ||
| 137 | + this.isConnectNetwork = NetworkUtil.isNetConnected() | ||
| 138 | + if(this.isConnectNetwork){ | ||
| 139 | + this.detailModel = {} as PeopleShipUserDetailData | ||
| 140 | + this.getData() | ||
| 141 | + } | ||
| 142 | + }}) | ||
| 143 | + .height('calc(100% - 84lpx)') | ||
| 144 | + .width('100%') | ||
| 145 | + }.width("100%") | ||
| 146 | + .height("100%") | ||
| 147 | + } | ||
| 134 | } | 148 | } |
| 135 | 149 | ||
| 136 | aboutToAppear() { | 150 | aboutToAppear() { |
| @@ -181,6 +181,11 @@ export struct SearchComponent { | @@ -181,6 +181,11 @@ export struct SearchComponent { | ||
| 181 | trackSearchClick(this.fromTabName,content) | 181 | trackSearchClick(this.fromTabName,content) |
| 182 | //赋值 | 182 | //赋值 |
| 183 | this.searchText = content | 183 | this.searchText = content |
| 184 | + | ||
| 185 | + if(StringUtils.isNotEmpty(this.searchText)){ | ||
| 186 | + this.hasInputContent = true | ||
| 187 | + } | ||
| 188 | + | ||
| 184 | //保存搜索记录 | 189 | //保存搜索记录 |
| 185 | SearcherAboutDataModel.putSearchHistoryData(this.searchText) | 190 | SearcherAboutDataModel.putSearchHistoryData(this.searchText) |
| 186 | //获取搜索记录 | 191 | //获取搜索记录 |
| @@ -289,7 +289,7 @@ export struct SearchResultContentComponent { | @@ -289,7 +289,7 @@ export struct SearchResultContentComponent { | ||
| 289 | ListHasNoMoreDataUI() | 289 | ListHasNoMoreDataUI() |
| 290 | } | 290 | } |
| 291 | } | 291 | } |
| 292 | - }.cachedCount(10) | 292 | + }.cachedCount(5) |
| 293 | .edgeEffect(EdgeEffect.None) | 293 | .edgeEffect(EdgeEffect.None) |
| 294 | .scrollBar(BarState.Off) | 294 | .scrollBar(BarState.Off) |
| 295 | .onReachEnd(() => { | 295 | .onReachEnd(() => { |
| @@ -305,57 +305,6 @@ export struct SearchResultContentComponent { | @@ -305,57 +305,6 @@ export struct SearchResultContentComponent { | ||
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | @Builder | 307 | @Builder |
| 308 | - multiCreatorUI() { | ||
| 309 | - Column() { | ||
| 310 | - List() { | ||
| 311 | - ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => { | ||
| 312 | - ListItem() { | ||
| 313 | - SearchCreatorComponent({ item: item }) | ||
| 314 | - } | ||
| 315 | - .width('150lpx') | ||
| 316 | - .height('100%') | ||
| 317 | - }) | ||
| 318 | - | ||
| 319 | - ListItem() { | ||
| 320 | - Column() { | ||
| 321 | - Text("查看更多") | ||
| 322 | - .width('19lpx') | ||
| 323 | - .fontSize('19lpx') | ||
| 324 | - .fontWeight('400lpx') | ||
| 325 | - .lineHeight('27lpx') | ||
| 326 | - .fontColor($r('app.color.color_9E9E9E')) | ||
| 327 | - } | ||
| 328 | - .borderRadius({ topLeft: '4lpx', bottomLeft: '4lpx' }) | ||
| 329 | - .height('180lpx') | ||
| 330 | - .width('77lpx') | ||
| 331 | - .backgroundColor($r('app.color.color_EDEDED')) | ||
| 332 | - .justifyContent(FlexAlign.Center) | ||
| 333 | - | ||
| 334 | - }.height('100%') | ||
| 335 | - .margin({ left: '23lpx' }) | ||
| 336 | - .onClick(() => { | ||
| 337 | - let params: Params = { | ||
| 338 | - pageID: this.keywords | ||
| 339 | - } | ||
| 340 | - WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage, params) | ||
| 341 | - }) | ||
| 342 | - } | ||
| 343 | - .cachedCount(6) | ||
| 344 | - .edgeEffect(EdgeEffect.None) | ||
| 345 | - .scrollBar(BarState.Off) | ||
| 346 | - .listDirection(Axis.Horizontal) | ||
| 347 | - .width('100%') | ||
| 348 | - .height('219lpx') | ||
| 349 | - | ||
| 350 | - Divider() | ||
| 351 | - .width('100%') | ||
| 352 | - .height('12lpx') | ||
| 353 | - .color($r('app.color.color_F5F5F5')) | ||
| 354 | - .strokeWidth('12lpx') | ||
| 355 | - } | ||
| 356 | - } | ||
| 357 | - | ||
| 358 | - @Builder | ||
| 359 | SearchListUI() { | 308 | SearchListUI() { |
| 360 | List({space:'8lpx'}) { | 309 | List({space:'8lpx'}) { |
| 361 | ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => { | 310 | ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => { |
| @@ -464,7 +413,7 @@ export struct SearchResultContentComponent { | @@ -464,7 +413,7 @@ export struct SearchResultContentComponent { | ||
| 464 | contentDTO.tagWord = -1 | 413 | contentDTO.tagWord = -1 |
| 465 | contentDTO.isSelect = true | 414 | contentDTO.isSelect = true |
| 466 | contentDTO.rmhInfo = {} as RmhInfoDTO | 415 | contentDTO.rmhInfo = {} as RmhInfoDTO |
| 467 | - contentDTO.photoNum = -1 | 416 | + contentDTO.photoNum = StringUtils.isEmpty(value.data.picCount) ? 0 : Number(value.data.picCount) |
| 468 | contentDTO.liveInfo = {} as LiveInfoDTO; | 417 | contentDTO.liveInfo = {} as LiveInfoDTO; |
| 469 | contentDTO.videoInfo = { | 418 | contentDTO.videoInfo = { |
| 470 | videoDuration: Number.parseInt(value.data.duration) | 419 | videoDuration: Number.parseInt(value.data.duration) |
| @@ -505,7 +505,7 @@ export struct OperRowListView { | @@ -505,7 +505,7 @@ export struct OperRowListView { | ||
| 505 | // 评论组件需要数据 | 505 | // 评论组件需要数据 |
| 506 | if (Number.parseInt(this.interactData.commentNum) > | 506 | if (Number.parseInt(this.interactData.commentNum) > |
| 507 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | 507 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { |
| 508 | - this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0' | 508 | + this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' |
| 509 | } | 509 | } |
| 510 | } | 510 | } |
| 511 | // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) | 511 | // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) |
| @@ -13,6 +13,7 @@ export struct AreaPickerDialog { | @@ -13,6 +13,7 @@ export struct AreaPickerDialog { | ||
| 13 | @Provide dataSource: AreaListModel[] = [] | 13 | @Provide dataSource: AreaListModel[] = [] |
| 14 | result: JSON[] = []; | 14 | result: JSON[] = []; |
| 15 | confirmCallback: (province:string,city:string,county:string,address:string) => void = () => { | 15 | confirmCallback: (province:string,city:string,county:string,address:string) => void = () => { |
| 16 | + | ||
| 16 | } | 17 | } |
| 17 | 18 | ||
| 18 | build() { | 19 | build() { |
| @@ -22,27 +23,33 @@ export struct AreaPickerDialog { | @@ -22,27 +23,33 @@ export struct AreaPickerDialog { | ||
| 22 | .onClick(()=> { | 23 | .onClick(()=> { |
| 23 | this.controller.close() | 24 | this.controller.close() |
| 24 | }) | 25 | }) |
| 26 | + .width(60) | ||
| 25 | .backgroundColor(0xffffff) | 27 | .backgroundColor(0xffffff) |
| 26 | .fontColor(Color.Black) | 28 | .fontColor(Color.Black) |
| 27 | .layoutWeight(1) | 29 | .layoutWeight(1) |
| 28 | 30 | ||
| 29 | - Blank() | 31 | + Blank().width(80) |
| 30 | 32 | ||
| 31 | Text(this.title) | 33 | Text(this.title) |
| 32 | .fontSize(18).textAlign(TextAlign.Center).margin({top:10,bottom:10}) | 34 | .fontSize(18).textAlign(TextAlign.Center).margin({top:10,bottom:10}) |
| 33 | 35 | ||
| 34 | - Blank() | 36 | + Blank().width(80) |
| 35 | 37 | ||
| 36 | Button('提交',{type:ButtonType.Normal}) | 38 | Button('提交',{type:ButtonType.Normal}) |
| 37 | .onClick(()=> { | 39 | .onClick(()=> { |
| 38 | this.controller.close() | 40 | this.controller.close() |
| 39 | this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); | 41 | this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); |
| 40 | }) | 42 | }) |
| 43 | + .width(60) | ||
| 41 | .backgroundColor(0xffffff) | 44 | .backgroundColor(0xffffff) |
| 42 | .fontColor('#ED2800') | 45 | .fontColor('#ED2800') |
| 43 | .layoutWeight(1) | 46 | .layoutWeight(1) |
| 44 | - } | ||
| 45 | - .margin({top:0,bottom:10}) | 47 | + }.backgroundColor(0xffffff) |
| 48 | + | ||
| 49 | + Divider() | ||
| 50 | + .color('#f5f5f5') | ||
| 51 | + .width('100%') | ||
| 52 | + .strokeWidth(1) | ||
| 46 | 53 | ||
| 47 | Row(){ | 54 | Row(){ |
| 48 | FirstLevelComponent().width('33%') | 55 | FirstLevelComponent().width('33%') |
| @@ -50,7 +57,8 @@ export struct AreaPickerDialog { | @@ -50,7 +57,8 @@ export struct AreaPickerDialog { | ||
| 50 | ThirdLevelComponent().width('33%') | 57 | ThirdLevelComponent().width('33%') |
| 51 | } | 58 | } |
| 52 | } | 59 | } |
| 53 | - .height('40%') | 60 | + .backgroundColor(0xffffff) |
| 61 | + .height('35%') | ||
| 54 | .width('100%') | 62 | .width('100%') |
| 55 | } | 63 | } |
| 56 | } | 64 | } |
| 1 | + | ||
| 2 | +@Component | ||
| 3 | +export struct DateCustomComponent { | ||
| 4 | + @Consume selectDate: Date | ||
| 5 | + build() { | ||
| 6 | + Column(){ | ||
| 7 | + Column(){ | ||
| 8 | + DatePicker({ | ||
| 9 | + start:new Date('1900-1-1'), | ||
| 10 | + end:new Date(), | ||
| 11 | + selected:new Date, | ||
| 12 | + }).selectedTextStyle({color:'#666666'}) | ||
| 13 | + .textStyle({color:'#999999'}) | ||
| 14 | + .onDateChange((value) => { | ||
| 15 | + this.selectDate = value as Date | ||
| 16 | + }) | ||
| 17 | + // .onDateChange:(value:DatePickerResult) => { | ||
| 18 | + // let mon = value.month as number + 1 | ||
| 19 | + // let monStr = mon < 10? '0'+mon.toString():mon.toString(); | ||
| 20 | + // let dayStr = value.day as number < 10? '0'+value.day:value.day; | ||
| 21 | + // this.currentUserInfo.userExtend.birthday = value.year+'-'+monStr+'-'+dayStr; | ||
| 22 | + // this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday | ||
| 23 | + // this.updateEditModel() | ||
| 24 | + // } | ||
| 25 | + }.justifyContent(FlexAlign.Center) | ||
| 26 | + }.height('100%') | ||
| 27 | + } | ||
| 28 | +} |
| 1 | +import { DateCustomComponent } from './DateCustomComponent' | ||
| 2 | + | ||
| 3 | +@CustomDialog | ||
| 4 | + | ||
| 5 | +export struct EditUserInfoCustomDialog{ | ||
| 6 | + @Provide selectDate: Date = new Date | ||
| 7 | + controller: CustomDialogController | ||
| 8 | + confirmCallback: (selectDate:Date) => void = () => { | ||
| 9 | + | ||
| 10 | + } | ||
| 11 | + build() { | ||
| 12 | + Column(){ | ||
| 13 | + Row(){ | ||
| 14 | + Button('取消',{type:ButtonType.Normal}) | ||
| 15 | + .onClick(()=> { | ||
| 16 | + this.controller.close() | ||
| 17 | + }) | ||
| 18 | + .width(60) | ||
| 19 | + .backgroundColor(0xffffff) | ||
| 20 | + .fontColor(Color.Black) | ||
| 21 | + .layoutWeight(1) | ||
| 22 | + | ||
| 23 | + Blank().width(80) | ||
| 24 | + | ||
| 25 | + Text('修改生日') | ||
| 26 | + .fontSize(18).textAlign(TextAlign.Center).margin({top:10,bottom:10}) | ||
| 27 | + | ||
| 28 | + Blank().width(80) | ||
| 29 | + | ||
| 30 | + Button('提交',{type:ButtonType.Normal}) | ||
| 31 | + .onClick(()=> { | ||
| 32 | + this.controller.close() | ||
| 33 | + this.confirmCallback(this.selectDate); | ||
| 34 | + }) | ||
| 35 | + .width(60) | ||
| 36 | + .backgroundColor(0xffffff) | ||
| 37 | + .fontColor('#ED2800') | ||
| 38 | + .layoutWeight(1) | ||
| 39 | + }.backgroundColor(0xffffff) | ||
| 40 | + | ||
| 41 | + Divider() | ||
| 42 | + .color('#f5f5f5') | ||
| 43 | + .width('100%') | ||
| 44 | + .strokeWidth(1) | ||
| 45 | + | ||
| 46 | + DateCustomComponent().width('70%') | ||
| 47 | + } | ||
| 48 | + .backgroundColor(0xffffff) | ||
| 49 | + .height('35%') | ||
| 50 | + .width('100%') | ||
| 51 | + } | ||
| 52 | +} |
| @@ -28,7 +28,6 @@ export struct FirstLevelComponent { | @@ -28,7 +28,6 @@ export struct FirstLevelComponent { | ||
| 28 | this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number]) | 28 | this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number]) |
| 29 | }) | 29 | }) |
| 30 | .backgroundColor(Color.White) | 30 | .backgroundColor(Color.White) |
| 31 | - // .border({color:'#e2e2e2',width:{right:0.5}}) | ||
| 32 | .width('100%') | 31 | .width('100%') |
| 33 | .layoutWeight(1) | 32 | .layoutWeight(1) |
| 34 | .selectedTextStyle({color:'#666666'}) | 33 | .selectedTextStyle({color:'#666666'}) |
| @@ -38,6 +37,5 @@ export struct FirstLevelComponent { | @@ -38,6 +37,5 @@ export struct FirstLevelComponent { | ||
| 38 | .justifyContent(FlexAlign.Center) | 37 | .justifyContent(FlexAlign.Center) |
| 39 | } | 38 | } |
| 40 | .height('100%') | 39 | .height('100%') |
| 41 | - | ||
| 42 | } | 40 | } |
| 43 | } | 41 | } |
| @@ -830,7 +830,7 @@ class MinePageDatasModel{ | @@ -830,7 +830,7 @@ class MinePageDatasModel{ | ||
| 830 | contentDTO.tagWord = -1 | 830 | contentDTO.tagWord = -1 |
| 831 | contentDTO.isSelect = true | 831 | contentDTO.isSelect = true |
| 832 | contentDTO.rmhInfo = {} as RmhInfoDTO | 832 | contentDTO.rmhInfo = {} as RmhInfoDTO |
| 833 | - contentDTO.photoNum = -1 | 833 | + contentDTO.photoNum = StringUtils.isEmpty(value.picCount) ? 0 : Number(value.picCount) |
| 834 | contentDTO.liveInfo = {} as LiveInfoDTO; | 834 | contentDTO.liveInfo = {} as LiveInfoDTO; |
| 835 | contentDTO.videoInfo = { | 835 | contentDTO.videoInfo = { |
| 836 | videoDuration: Number.parseInt(value.duration) | 836 | videoDuration: Number.parseInt(value.duration) |
| @@ -182,7 +182,7 @@ struct SearchCreatorPage { | @@ -182,7 +182,7 @@ struct SearchCreatorPage { | ||
| 182 | ListHasNoMoreDataUI() | 182 | ListHasNoMoreDataUI() |
| 183 | } | 183 | } |
| 184 | } | 184 | } |
| 185 | - }.cachedCount(10) | 185 | + }.cachedCount(5) |
| 186 | .padding({left:'31lpx',right:'31lpx'}) | 186 | .padding({left:'31lpx',right:'31lpx'}) |
| 187 | .layoutWeight(1) | 187 | .layoutWeight(1) |
| 188 | .scrollBar(BarState.Off) | 188 | .scrollBar(BarState.Off) |
| @@ -71,12 +71,23 @@ export struct DetailPlayLiveCommon { | @@ -71,12 +71,23 @@ export struct DetailPlayLiveCommon { | ||
| 71 | .then((data: Array<ContentDetailDTO>) => { | 71 | .then((data: Array<ContentDetailDTO>) => { |
| 72 | console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data)) | 72 | console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data)) |
| 73 | if (data) { | 73 | if (data) { |
| 74 | - //todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行 | ||
| 75 | - setTimeout(() => { | ||
| 76 | - this.contentDetailData = data[0]; | ||
| 77 | - }, 50) | ||
| 78 | 74 | ||
| 79 | let detailData = data[0] | 75 | let detailData = data[0] |
| 76 | + this.liveLandscape = | ||
| 77 | + detailData?.liveInfo?.liveLandScape //String(this.contentDetailData?.liveInfo?.liveLandScape || '') | ||
| 78 | + | ||
| 79 | + this.liveState = detailData.liveInfo?.liveState | ||
| 80 | + | ||
| 81 | + | ||
| 82 | + if (this.liveState === 'wait' || this.liveLandscape === 'news') { | ||
| 83 | + this.contentDetailData = data[0] | ||
| 84 | + } else if (this.liveLandscape === 'general') { | ||
| 85 | + //todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行 | ||
| 86 | + setTimeout(() => { | ||
| 87 | + this.contentDetailData = data[0] | ||
| 88 | + }, 10) | ||
| 89 | + } | ||
| 90 | + | ||
| 80 | console.log(TAG, '查询视频详情用于评论展示 openComment:', detailData.openComment) | 91 | console.log(TAG, '查询视频详情用于评论展示 openComment:', detailData.openComment) |
| 81 | this.publishCommentModel.targetId = String(detailData?.newsId || '') | 92 | this.publishCommentModel.targetId = String(detailData?.newsId || '') |
| 82 | this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '') | 93 | this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '') |
| @@ -87,12 +98,6 @@ export struct DetailPlayLiveCommon { | @@ -87,12 +98,6 @@ export struct DetailPlayLiveCommon { | ||
| 87 | this.publishCommentModel.targetType = String(detailData?.newsType || '') | 98 | this.publishCommentModel.targetType = String(detailData?.newsType || '') |
| 88 | this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '') | 99 | this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '') |
| 89 | this.publishCommentModel.commentContent = '' | 100 | this.publishCommentModel.commentContent = '' |
| 90 | - | ||
| 91 | - this.liveLandscape = | ||
| 92 | - detailData?.liveInfo?.liveLandScape //String(this.contentDetailData?.liveInfo?.liveLandScape || '') | ||
| 93 | - | ||
| 94 | - | ||
| 95 | - this.liveState = detailData.liveInfo?.liveState | ||
| 96 | this.liveStyle = detailData.liveInfo?.liveStyle | 101 | this.liveStyle = detailData.liveInfo?.liveStyle |
| 97 | 102 | ||
| 98 | if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) { | 103 | if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) { |
| @@ -107,7 +112,6 @@ export struct DetailPlayLiveCommon { | @@ -107,7 +112,6 @@ export struct DetailPlayLiveCommon { | ||
| 107 | }) | 112 | }) |
| 108 | } | 113 | } |
| 109 | 114 | ||
| 110 | - | ||
| 111 | onPageShow() { | 115 | onPageShow() { |
| 112 | this.pageShow = Math.random() | 116 | this.pageShow = Math.random() |
| 113 | Logger.info(TAG, 'onPageShow') | 117 | Logger.info(TAG, 'onPageShow') |
| @@ -63,7 +63,7 @@ export struct DetailPlayLivePage { | @@ -63,7 +63,7 @@ export struct DetailPlayLivePage { | ||
| 63 | Column() { | 63 | Column() { |
| 64 | 64 | ||
| 65 | TopPlayComponent({ playerController: this.playerController }) | 65 | TopPlayComponent({ playerController: this.playerController }) |
| 66 | - .height(this.displayDirection == DisplayDirection.VERTICAL ?211:'100%') | 66 | + .height(this.displayDirection == DisplayDirection.VERTICAL ? 211 : '100%') |
| 67 | 67 | ||
| 68 | TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab }) | 68 | TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab }) |
| 69 | .layoutWeight(1) | 69 | .layoutWeight(1) |
| @@ -80,7 +80,7 @@ export struct DetailPlayLivePage { | @@ -80,7 +80,7 @@ export struct DetailPlayLivePage { | ||
| 80 | // 切换到大家聊 | 80 | // 切换到大家聊 |
| 81 | this.changeToTab = Math.random() | 81 | this.changeToTab = Math.random() |
| 82 | } | 82 | } |
| 83 | - }) .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 83 | + }).visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 84 | 84 | ||
| 85 | // LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) | 85 | // LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) |
| 86 | // .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 86 | // .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| @@ -119,6 +119,8 @@ export struct DetailPlayLivePage { | @@ -119,6 +119,8 @@ export struct DetailPlayLivePage { | ||
| 119 | 119 | ||
| 120 | getLiveDetails() { | 120 | getLiveDetails() { |
| 121 | const data = this.contentDetailData | 121 | const data = this.contentDetailData |
| 122 | + console.error("XXXXZZZZ", 'contentDetailData ----liveState==>' + data.liveInfo?.liveState) | ||
| 123 | + console.error("XXXXZZZZ", 'contentDetailData ----liveStyle==>' + data.liveInfo?.liveStyle) | ||
| 122 | if (data.liveInfo?.liveState == 'wait') { | 124 | if (data.liveInfo?.liveState == 'wait') { |
| 123 | //直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】 | 125 | //直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】 |
| 124 | if (data.liveInfo?.liveStyle == 1) { | 126 | if (data.liveInfo?.liveStyle == 1) { |
| @@ -129,7 +131,13 @@ export struct DetailPlayLivePage { | @@ -129,7 +131,13 @@ export struct DetailPlayLivePage { | ||
| 129 | this.tabs = ['简介', '直播间', '大家聊'] | 131 | this.tabs = ['简介', '直播间', '大家聊'] |
| 130 | } | 132 | } |
| 131 | } else { | 133 | } else { |
| 132 | - this.tabs = ['直播间', '大家聊'] | 134 | + if (data.liveInfo?.liveStyle == 1) { |
| 135 | + this.tabs = ['大家聊'] | ||
| 136 | + } else if (data.liveInfo?.liveStyle == 2) { | ||
| 137 | + this.tabs = ['直播间',] | ||
| 138 | + } else { | ||
| 139 | + this.tabs = ['直播间', '大家聊'] | ||
| 140 | + } | ||
| 133 | } | 141 | } |
| 134 | 142 | ||
| 135 | } | 143 | } |
| @@ -182,7 +182,7 @@ export struct DetailPlayShortVideoPage { | @@ -182,7 +182,7 @@ export struct DetailPlayShortVideoPage { | ||
| 182 | index: $index, | 182 | index: $index, |
| 183 | currentIndex: $currentIndex, | 183 | currentIndex: $currentIndex, |
| 184 | showCommentList: $showCommentList, | 184 | showCommentList: $showCommentList, |
| 185 | - // publishCommentModel: $publishCommentModel | 185 | + publishCommentModel: $publishCommentModel |
| 186 | }) | 186 | }) |
| 187 | this.playerViewBuilder() | 187 | this.playerViewBuilder() |
| 188 | 188 |
| 1 | import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' | 1 | import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' |
| 2 | 2 | ||
| 3 | -import { CommentListDialogView } from 'wdComponent/Index' | 3 | +import { CommentListDialogView, publishCommentModel } from 'wdComponent/Index' |
| 4 | 4 | ||
| 5 | @Component | 5 | @Component |
| 6 | export struct CommentDialogView { | 6 | export struct CommentDialogView { |
| 7 | @Link @Watch('showCommentListChange') showCommentList: boolean | 7 | @Link @Watch('showCommentListChange') showCommentList: boolean |
| 8 | @Link index: number | 8 | @Link index: number |
| 9 | @Link currentIndex: number | 9 | @Link currentIndex: number |
| 10 | + @Link publishCommentModel: publishCommentModel | ||
| 10 | @Consume contentDetailData: ContentDetailDTO | 11 | @Consume contentDetailData: ContentDetailDTO |
| 11 | @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO | 12 | @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO |
| 12 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) | 13 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) |
| @@ -29,6 +30,7 @@ export struct CommentDialogView { | @@ -29,6 +30,7 @@ export struct CommentDialogView { | ||
| 29 | CommentListDialogView({ | 30 | CommentListDialogView({ |
| 30 | showCommentList: this.innerShowComment, | 31 | showCommentList: this.innerShowComment, |
| 31 | contentDetailData: this.contentDetailData, | 32 | contentDetailData: this.contentDetailData, |
| 33 | + publishCommentModel: this.publishCommentModel, | ||
| 32 | pageInfo: this.fakePageInfo, | 34 | pageInfo: this.fakePageInfo, |
| 33 | onClose: () => { | 35 | onClose: () => { |
| 34 | this.showCommentList = false | 36 | this.showCommentList = false |
| 1 | -import { ContentDetailDTO, ContentDTO, PageInfoDTO } from 'wdBean/Index'; | 1 | +import { ContentDetailDTO, ContentDTO, PageInfoDTO, ShareInfoDTO, TopicInfo } from 'wdBean/Index'; |
| 2 | +import { SharePosterItemBean } from 'wdBean/src/main/ets/bean/detail/SharePosterItemBean'; | ||
| 2 | import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index'; | 3 | import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index'; |
| 3 | import { ShareContentType } from 'wdShareBase/src/main/ets/Constant'; | 4 | import { ShareContentType } from 'wdShareBase/src/main/ets/Constant'; |
| 4 | 5 | ||
| @@ -29,4 +30,58 @@ export class WDShare { | @@ -29,4 +30,58 @@ export class WDShare { | ||
| 29 | 30 | ||
| 30 | } | 31 | } |
| 31 | 32 | ||
| 33 | + //专题分享数据转换 | ||
| 34 | + static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean: TopicInfo){ | ||
| 35 | + shareBean.topicType = topicInfoBean.topicType+'' | ||
| 36 | + //21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链 | ||
| 37 | + if(25 == topicInfoBean.topicType){ | ||
| 38 | + shareBean.showPosterType = 6 | ||
| 39 | + shareBean.topicPattern = topicInfoBean.topicPattern | ||
| 40 | + shareBean.publishTime = topicInfoBean.topicDate | ||
| 41 | + if(topicInfoBean.frontLinkObject == null){ | ||
| 42 | + shareBean.isFrontDaily = false | ||
| 43 | + if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){ | ||
| 44 | + shareBean.sharePosterItemList = [] as SharePosterItemBean[] | ||
| 45 | + shareBean.sharePosterItemList.length = topicInfoBean.shareContentList.length | ||
| 46 | + for (let index = 0; index < topicInfoBean.shareContentList.length; index++) { | ||
| 47 | + let element = topicInfoBean.shareContentList[index] | ||
| 48 | + if(element != null){ | ||
| 49 | + shareBean.sharePosterItemList[index] = { | ||
| 50 | + title:topicInfoBean.shareContentList[index].newsTitle, | ||
| 51 | + imageUrl:topicInfoBean.shareContentList[index].coverUrl, | ||
| 52 | + } as SharePosterItemBean | ||
| 53 | + } | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | + }else{ | ||
| 57 | + shareBean.isFrontDaily = true | ||
| 58 | + shareBean.sharePosterCoverUrl = topicInfoBean.frontLinkObject.coverUrl | ||
| 59 | + shareBean.posterSummary = topicInfoBean.frontLinkObject.summary | ||
| 60 | + } | ||
| 61 | + }else{ | ||
| 62 | + //文章/直播/话题专题(H5普通文章专题,包含时间链) | ||
| 63 | + shareBean.showPosterType = 8 | ||
| 64 | + //海报的头图 | ||
| 65 | + shareBean.sharePosterCoverUrl = topicInfoBean.backgroundImgUrl | ||
| 66 | + shareBean.isFrontDaily = false | ||
| 67 | + shareBean.posterTitle = topicInfoBean.title | ||
| 68 | + shareBean.posterSummary = topicInfoBean.summary | ||
| 69 | + if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){ | ||
| 70 | + shareBean.sharePosterItemList = [] as SharePosterItemBean[] | ||
| 71 | + shareBean.sharePosterItemList.length = topicInfoBean.shareContentList.length | ||
| 72 | + for (let index = 0; index < topicInfoBean.shareContentList.length; index++) { | ||
| 73 | + let element = topicInfoBean.shareContentList[index] | ||
| 74 | + if(element != null){ | ||
| 75 | + shareBean.sharePosterItemList[index] = { | ||
| 76 | + title:topicInfoBean.shareContentList[index].newsTitle, | ||
| 77 | + imageUrl:topicInfoBean.shareContentList[index].coverUrl, | ||
| 78 | + timeNode:topicInfoBean.shareContentList[index].publishTime, | ||
| 79 | + timeBlurred:topicInfoBean.shareContentList[index].timeBlurred | ||
| 80 | + } as SharePosterItemBean | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + } | ||
| 86 | + | ||
| 32 | } | 87 | } |
| @@ -17,7 +17,7 @@ export class TrackingUtils { | @@ -17,7 +17,7 @@ export class TrackingUtils { | ||
| 17 | static fillPositionWith(attr: ParamType) { | 17 | static fillPositionWith(attr: ParamType) { |
| 18 | let pageName = attr["pageName"] as string | 18 | let pageName = attr["pageName"] as string |
| 19 | let action = attr["action"] as string | 19 | let action = attr["action"] as string |
| 20 | - if (action.length > 0) { | 20 | + if (action != null && action.length > 0) { |
| 21 | attr["saPosition"] = pageName + "_" + action | 21 | attr["saPosition"] = pageName + "_" + action |
| 22 | return | 22 | return |
| 23 | } | 23 | } |
| @@ -5,7 +5,7 @@ import window from '@ohos.window'; | @@ -5,7 +5,7 @@ import window from '@ohos.window'; | ||
| 5 | import { TrackingPageBrowse ,TrackConstants} from 'wdTracking/Index'; | 5 | import { TrackingPageBrowse ,TrackConstants} from 'wdTracking/Index'; |
| 6 | 6 | ||
| 7 | const TAG = 'ENewspaper'; | 7 | const TAG = 'ENewspaper'; |
| 8 | - | 8 | +//电子报主页面 |
| 9 | @Entry | 9 | @Entry |
| 10 | @Component | 10 | @Component |
| 11 | struct ENewspaper { | 11 | struct ENewspaper { |
| @@ -116,7 +116,7 @@ export struct MultiPictureDetailPageComponent { | @@ -116,7 +116,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 116 | index: $index, | 116 | index: $index, |
| 117 | currentIndex: $currentIndex, | 117 | currentIndex: $currentIndex, |
| 118 | showCommentList: $showCommentList, | 118 | showCommentList: $showCommentList, |
| 119 | - // publishCommentModel: $publishCommentModel | 119 | + publishCommentModel: $publishCommentModel |
| 120 | }) | 120 | }) |
| 121 | 121 | ||
| 122 | } | 122 | } |
-
Please register or login to post a comment