王士厅

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool

# Conflicts:
#	sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
Showing 86 changed files with 915 additions and 599 deletions
... ... @@ -203,6 +203,7 @@ export class ProcessUtils {
relType: content?.relType,
relId: content?.relId,
channelId: content?.channelId,
pageId: content?.pageId
} as ExtraDTO
} as Params,
};
... ...
... ... @@ -10,6 +10,7 @@ export interface ExtraDTO extends ItemDTO {
topicId: string;
channelId: string;
compId: string;
pageId: string;
sourcePage: string;
relId: string;
relType: string;
... ...
... ... @@ -100,6 +100,8 @@ export class ContentDTO implements BaseDTO {
本地辅助字段
*/
liveRoomDataBean : LiveRoomDataBean = {} as LiveRoomDataBean// 批查获取到的直播观看人数
//本地字段:时间轴专题页节点组件时间;【如果开启模糊则显示时间->左右;0:否,1:是】
timeBlurred:number = 0
static clone(old: ContentDTO): ContentDTO {
let content = new ContentDTO();
... ...
... ... @@ -25,5 +25,6 @@ export interface Params {
creatorId?: string; //号主id
videoUrl?: string;
videoCoverUrl?: string;
pageId?: string;
backVisibility?: boolean; //展示顶部返回栏
}
... ...
... ... @@ -6,11 +6,12 @@ import { VideoInfoDTO } from './VideoInfoDTO';
import { RmhInfoDTO } from './RmhInfoDTO'
import { UserInfoDTO } from './UserInfoDTO'
/**
* 接口定义:
* http://192.168.1.3:3300/project/3802/interface/api/200915
*/
export interface ContentDetailDTO {
export class ContentDetailDTO {
newsId: number;
newsTitle: string;
newsShortTitle: string;
... ... @@ -40,7 +41,7 @@ export interface ContentDetailDTO {
shareInfo: ShareInfoDTO;
photoList: any[];
videoInfo: VideoInfoDTO[];
liveInfo?: any;
liveInfo?: any ;
voteInfo?: any;
rmhInfo?: RmhInfoDTO | null;
userInfo?: UserInfoDTO | null;
... ... @@ -71,4 +72,8 @@ export interface ContentDetailDTO {
isNewspaper: boolean;
oldNewsId: string;
serials: any;
// 本地字段
showTime:boolean = false;
}
\ No newline at end of file
... ...
import { ArrayList } from '@kit.ArkTS';
import { SharePosterItemBean } from './SharePosterItemBean';
export interface ShareInfoDTO {
shareCoverUrl: string;
shareOpen: number;
//海报图片地址
sharePosterCoverUrl: string;
//海报报分享开关 0:关闭,1:开启
sharePosterOpen: number;
shareSummary: string;
//标题
shareTitle: string;
//分享链接
shareUrl: string;
//首发时间
publishTime:string;
//图片
imageUrl:string;
//直播和内容的举报,仅针对人民号发布的才能举报,cms创建的没有举报按钮
showReport:boolean;
//点赞按钮显示 -1:不展示 0:未点赞 1:已点赞
showLike:number;
//0 分享海报关闭,1 分享海报开启
posterShareControl:string;
//是否展示海报 -1-不展示图标
showPoster:number;
//海报展示类型 1:专题、文章、图文、视频、直播 2:人民号 3:评论 4:电子报海报 5:音频专题海报 6:早晚报专题海报 7:榜单H5 8:H5普通文章专题,包含时间链
showPosterType:number;
//接口返回: 内容id、内容类型
contentId:string;
//内容类型,分享的类型 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频
contentType:string;
//关系id
targetRelId:string;
//关系类型,1.频道关系;2.专题关系
targetRelType:string;
//21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题
topicType:string;
//早晚报;1-早报;2-午报;3-晚报
topicPattern:number;
//是否有头版
isFrontDaily:boolean;
//分享海报简介
posterSummary:string;
sharePosterItemList: SharePosterItemBean[]
//分享海报标题
posterTitle:string;
}
... ...
export interface SharePosterItemBean {
title: string;
duration:number;
imageUrl:string;
timeNode:string;
/**
* 是否显示时间左右
*/
timeBlurred:number;
}
... ...
import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO'
import { ReLInfoDTO } from '../detail/ReLInfoDTO'
import { RmhInfoDTO } from '../detail/RmhInfoDTO'
export interface LiveDetailsBean {
/**
* {
"code": "0",
"data": [
{
"activityInfos": [],
"appstyle": 2,
"audioList": [],
"authorList": [
{
"authorName": "雷崔捷"
}
],
"bestNoticer": null,
"commentDisplay": 0,
"editorName": "",
"firstFrameImageUri": "",
"fullColumnImgUrls": [
{
"format": null,
"height": null,
"landscape": null,
"size": null,
"url": "https://rmrbcmsonline.peopleapp.com/upload/image/202404/rmrb_71671711971849.png",
"weight": null
}
],
"hasPopUp": null,
"isNewspaper": false,
"itemId": "",
"itemTypeCode": "",
"keyArticle": 0,
"likesStyle": null,
"liveInfo": {
"background": {
"imageUrl": "",
"name": ""
},
"backgroundStyle": null,
"cornerFlag": 0,
"cornerImgUrl": "",
"cornerLinkUrl": "",
"createUserId": "",
"createUserName": "",
"endTime": "2024-04-03 11:08:00",
"handAngleImageUri": "",
"handAngleLink": "",
"handAngleSwitch": false,
"likeEnable": 1,
"likesStyle": "thumb",
"liveExperience": 1,
"liveExperienceTime": 3,
"liveLandScape": "news",
"liveState": "end",
"liveStyle": 0,
"liveWay": 0,
"mlive": {
"barrageShowEnable": false,
"giftEnable": false,
"mliveId": 20000016257,
"roomId": "5381b934-cea8-4338-bd12-5bf70af43e0c"
},
"notice": "",
"openComment": 1,
"padImageUri": "",
"planStartTime": "2024-04-03 05:00:00",
"playbackSwitch": true,
"preCommentFlag": 1,
"previewType": 1,
"previewUrl": "",
"shareSwitch": "",
"startTime": "2024-04-03 05:03:23",
"tplId": 5,
"vlive": [
{
"coverImageUrl": "",
"definition": [],
"liveStreamManagerId": null,
"liveStreamType": 1,
"liveUrl": "https://plwbthird.live.weibo.com/alicdn/5018938748437049.m3u8",
"name": "线路1",
"replayUri": "http://mlive3.video.weibocdn.com/record/alicdn/5018726527666338/index.m3u8",
"serialNum": null,
"shiftEnable": false,
"showPad": false,
"type": "play",
"vliveId": 186728
}
],
"vrType": 0
},
"menuShow": 1,
"newIntroduction": "眼前有山河,心中有家国!每年清明节前夕,宁夏固原市第二中学和固原市弘文中学会组织入学新生,一天之内徒步54公里从学校往返任山河烈士陵园,用这种方式缅怀烈士们,这份坚定与执着已经延续了29年。",
"newLinkObject": null,
"newsBodyTitle": "",
"newsContent": "",
"newsContentBak": "",
"newsDownTitle": "",
"newsId": 20000016229,
"newsLinkUrl": "",
"newsShortTitle": "",
"newsSource": "41",
"newsSourceName": "",
"newsSummary": "",
"newsTags": "",
"newsTitle": "徒步54公里的思政课,坚守29年的薪火传承",
"newsType": 2,
"oldNewsId": "7218507",
"openAudio": 0,
"openComment": null,
"openLikes": null,
"photoList": [],
"popUps": [],
"preCommentFlag": null,
"publishTime": "2024-04-01 19:44:00",
"reLInfo": {
"channelId": 2061,
"relId": "500005272745",
"relObjectId": 2061,
"relType": "1"
},
"readFlag": 0,
"recommendShow": null,
"rmhInfo": null,
"rmhPlatform": 0,
"sceneId": "",
"serials": null,
"shareInfo": {
"shareCoverUrl": "https://rmrbcmsonline.peopleapp.com/upload/image/202404/202404011944259539.png?x-oss-process=image/resize,w_400",
"shareOpen": 1,
"sharePosterCoverUrl": "https://rmrbcmsonline.peopleapp.com/upload/image/202404/rmrb_71671711971849.png?x-oss-process=image/resize,m_fill,h_450,w_800,limit_0/quality,q_90",
"sharePosterOpen": 1,
"shareSummary": "人民日报,有品质的新闻",
"shareTitle": "徒步54公里的思政课,坚守29年的薪火传承",
"shareUrl": "https://people.pdnews.cn/column/20000016229-500005272745"
},
"specialColumnId": null,
"specialColumnName": "",
"subSceneId": "",
"timeline": null,
"topicInfo": null,
"traceId": "",
"traceInfo": "",
"userInfo": null,
"videoInfo": [],
"viewCount": 0,
"visitorComment": 1,
"voteInfo": null
}
],
"message": "Success",
"meta": null,
"requestId": "",
"success": true,
"timestamp": 1712807514322
}
*/
visitorComment: number
newsType: number;
keyArticle: number
liveInfo: LiveInfo
fullColumnImgUrls: Array<FullColumnImgUrlBean>
fullColumnImgUrls: Array<FullColumnImgUrlDTO>
newsTitle: string
newsId: string
newIntroduction: string
//迁移id
oldNewsId: string
reLInfo: ReLInfo
reLInfo: ReLInfoDTO
rmhInfo: RmhInfoDTO
}
... ... @@ -188,13 +38,6 @@ export interface MLive {
mliveId: string
}
export interface FullColumnImgUrlBean {
url: string
height: string
landscape: number
size: string
weight: string
}
export interface Vlive {
//拉流直播 url
... ... @@ -205,9 +48,7 @@ export interface Vlive {
liveStreamType: number | null
}
export interface ReLInfo {
relId: string
}
export interface joinPeopleNum {
barrageNum: number,
... ...
import { FullColumnImgUrlBean } from './LiveDetailsBean'
import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO'
export interface LiveRoomBean {
pageNum: number
pageSize: number
... ... @@ -32,6 +31,6 @@ export interface LiveRoomItemBean {
//音频地址
audioUrl: string
//详情页面插入数据bean
fullColumnImgUrlDto: FullColumnImgUrlBean
fullColumnImgUrlDto: FullColumnImgUrlDTO
}
\ No newline at end of file
... ...
import { FrontLinkObject } from '../component/FrontLinkObject';
import { ArrayList } from '@kit.ArkTS';
import { ContentDTO } from '../content/ContentDTO';
export interface TopicInfo {
axisColor: string;
... ... @@ -28,8 +30,17 @@ export interface TopicInfo {
topicId: string;
topicPattern: number;
// topicTemplate?: any;
//21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链
topicType: number;
transluceImgUrl: string;
visitorComment: number;
// voteInfo?: any;
//频道、专题页关系id;
relId:string;
//关系类型:1.频道关系;2.专题关系;
relType:string;
//本地字段 --》分享页面需要展示的数据
shareContentList: ContentDTO[]
//专题背景图
backgroundImgUrl: string
}
\ No newline at end of file
... ...
export interface NewspaperShareBean {
shareUrl:string;
sharePosterOpen:number;
sharePosterCoverUrl:string;
}
\ No newline at end of file
... ...
... ... @@ -32,12 +32,6 @@ export struct CardParser {
pageShowTime:number = 0;
pageHideTime:number = 0;
aboutToAppear(): void {
console.log('CardParser-contentDTO', JSON.stringify(this.contentDTO))
console.log('CardParser-compDTO', JSON.stringify(this.compDTO))
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
... ...
... ... @@ -42,6 +42,9 @@ export struct CompParser {
@State noneAudioItems: ContentDTO[] = [];
aboutToAppear(): void {
console.log('CompParser-compDTO', JSON.stringify(this.compDTO))
// 轮播图屏蔽音频类型稿件
if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
this.audioItems = this.compDTO.operDataList.filter(item => {
... ...
import { NewspaperListBean, NewspaperListItemBean } from 'wdBean';
import { ContentDetailDTO, NewspaperListBean, NewspaperListItemBean } from 'wdBean';
import { NewspaperViewModel } from '../viewmodel/NewspaperViewModel';
import router from '@ohos.router';
import { ENewspaperItemComponent } from './ENewspaperItemComponent';
... ... @@ -11,7 +11,8 @@ import { RMCalendarBean } from './calendar/RMCalendarBean';
import { newsSkeleton } from './skeleton/newsSkeleton';
import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index';
import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index';
import { WDShare } from 'wdShare/Index';
//电子报UI
@Component
export struct ENewspaperPageComponent {
private displayTool = display.getDefaultDisplaySync()
... ... @@ -179,7 +180,7 @@ export struct ENewspaperPageComponent {
})
.id('e_newspaper_share')
.onClick(() => {
ToastUtils.showToast('分享为公共方法,待开发', 1000);
this.share()
})
}
}
... ... @@ -392,4 +393,24 @@ export struct ENewspaperPageComponent {
}
}
share() {
let contentDetailData: ContentDetailDTO = {
shareInfo:{
shareTitle:this.newspaperListBean?.list[this.swiperIndex].pageName,
publishTime:this.newspaperListBean?.list[this.swiperIndex].periodNum,
imageUrl:this.newspaperListBean?.list[this.swiperIndex].pagePic,
shareUrl:this.newspaperListBean?.list[this.swiperIndex].sharePagePic.shareUrl,
sharePosterCoverUrl:this.newspaperListBean?.list[this.swiperIndex].sharePagePic.sharePosterCoverUrl,
showReport:false,
showLike:-1,
shareOpen:1,
sharePosterOpen:1,
posterShareControl:'-1',
showPoster:-1,
showPosterType:4,
}
} as ContentDetailDTO
WDShare.shareContent(contentDetailData,TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage)
}
}
\ No newline at end of file
... ...
... ... @@ -15,7 +15,7 @@ export struct InteractMComponent {
build() {
Row(){
Image(this.messageModel.InteractMsubM.headUrl)
.alt($r('app.media.default_head'))
.alt(this.messageModel.InteractMsubM.userType === '1'?$r('app.media.default_head'):$r('app.media.AccountOwner_DefaultIcon'))
.width(36)
.height(36)
.borderRadius(18)
... ...
... ... @@ -294,7 +294,7 @@ export struct MorningEveningPaperComponent {
@Builder
topPaperTitle(){
Column(){
PaperTitleComponent().margin({top:this.topSafeHeight})
PaperTitleComponent({topicInfo:this.pageInfoBean?.topicInfo}).margin({top:this.topSafeHeight})
}.height(44+this.topSafeHeight).backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor)
}
... ...
import router from '@ohos.router';
import { ContentDetailDTO, TopicInfo } from 'wdBean/Index';
import { ToastUtils } from 'wdKit';
import { WDShare } from 'wdShare/Index';
import { TrackConstants } from 'wdTracking/Index';
/**
* 早晚报页面标题bar
... ... @@ -9,7 +12,7 @@ import { ToastUtils } from 'wdKit';
export struct PaperTitleComponent {
@Consume title?: string
@Consume subTitle?: string
topicInfo: TopicInfo = {} as TopicInfo
aboutToAppear() {
}
... ... @@ -105,7 +108,7 @@ export struct PaperTitleComponent {
.id('img_share')
.margin({ right: 16 })
.onClick(() => {
ToastUtils.showToast('分享为公共方法,待开发', 1000)
this.share()
})
}
// .margin({ left: 14, right: 14 })
... ... @@ -149,4 +152,28 @@ export struct PaperTitleComponent {
// }
// .margin({ left: 6 })
}
share() {
let contentDetailData: ContentDetailDTO = {
newsId:Number.parseInt(this.topicInfo.topicId),
shareInfo:{
contentId:this.topicInfo.topicId,
contentType:this.topicInfo.topicType+'',
shareTitle:this.topicInfo.shareTitle,
shareSummary:this.topicInfo.shareSummary,
imageUrl:this.topicInfo.shareCoverUrl,
sharePosterCoverUrl:this.topicInfo.sharePosterCoverUrl,
shareUrl:this.topicInfo.shareUrl,
targetRelId:this.topicInfo.relId,
targetRelType:this.topicInfo.relType,
showReport:false,
showLike:-1,
shareOpen:1,
sharePosterOpen:this.topicInfo.posterFlag,
showPoster:this.topicInfo.posterFlag>0?1:-1,
}
} as ContentDetailDTO
WDShare.setTopicBeanToShareBean(contentDetailData.shareInfo,this.topicInfo)
WDShare.shareContent(contentDetailData,TrackConstants.PageName.Eletronic_Paper,TrackConstants.PageName.Eletronic_Paper)
}
}
\ No newline at end of file
... ...
... ... @@ -3,7 +3,7 @@ import { CompList, ContentDTO, InteractDataDTO} from 'wdBean';
import { BreakpointConstants } from 'wdConstant';
import { Logger } from 'wdKit';
import { PaperSingleColumn999CardView } from '../page/CardView';
import { EmptyComponent } from '../view/EmptyComponent';
import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent';
const TAG = 'SingleColumn999Component';
... ... @@ -153,9 +153,8 @@ export struct SingleColumn999Component {
})
} else {
if (this.compListItem && this.compListItem?.operDataList) {
EmptyComponent({ emptyHeight: 200 })
EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent})
}
}
}
... ... @@ -170,9 +169,13 @@ export struct SingleColumn999Component {
*/
@Builder
buildPaperItem(item: ContentDTO, index: number) {
///屏蔽早晚报 音频
if (item.objectType != '13'){
PaperSingleColumn999CardView({
item: item,
index: index,
})
}
}
}
\ No newline at end of file
... ...
... ... @@ -12,6 +12,7 @@ import { EmptyComponent } from '../components/view/EmptyComponent';
import { NetworkUtil, WindowModel } from 'wdKit';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { PageRepository } from '../repository/PageRepository';
const TAG: string = 'SpacialTopicPageComponent'
... ... @@ -59,7 +60,6 @@ export struct SpacialTopicPageComponent {
private async getDetail() {
this.isNetConnected = NetworkUtil.isNetConnected()
let contentId: string = ''
let relId: string = ''
let relType: string = ''
... ... @@ -74,11 +74,14 @@ export struct SpacialTopicPageComponent {
if (this.action.params.extra.relType) {
relType = this.action.params.extra.relType
}
}
let pageId = this.action.params.extra?.pageId
console.log('pageIdpageId',pageId)
if(pageId){
let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId)
let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
if (detailBeans && detailBeans.length > 0) {
this.contentDetailData = detailBeans[0];
if (detailBeans?.length > 0) {
this.contentDetailData = JSON.parse(JSON.stringify(detailBeans[0]));
this.viewBlogInsightIntentShare()
// if (this.contentDetailData[0]?.openComment) {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
... ... @@ -92,6 +95,11 @@ export struct SpacialTopicPageComponent {
// }
this.trySendData2H5()
}
if(pageInfoMsg && pageInfoMsg.data){
this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo.commentFlag)
this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo.commentShowFlag)
}
}
}
}
... ...
... ... @@ -14,6 +14,8 @@ import font from '@ohos.font';
export struct CardMediaInfo {
@State livePeopleNum :boolean = true
//@ObjectLink compDTO: CompDTO
@State beused: string = ''; // 2024-05-28 给CardMediaInfo组件添加beused的字段让其知道被哪个组件使用,不传默认为空
@State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中
@State joinPeopleNum: number = 0;
// objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,
... ... @@ -154,12 +156,17 @@ export struct CardMediaInfo {
}
}
// 备注直播间观看人数在轮播图卡不显示
if(this.beused !== 'Zh_Carousel_Layout_01'){
if (!!this.joinPeopleNum) {
Text(' | ')
.mediaText()
Text(`${this.handlerNum(this.joinPeopleNum.toString())}人参加`)
.mediaText()
}
}
// } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo
// ?.replayUri) {
// // Image($r('app.media.card_live'))
... ...
... ... @@ -5,7 +5,7 @@ import {
ContentDetailRequest,
postInteractAccentionOperateParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { RmhInfoDTO } from 'wdBean'
import { RmhInfoDTO, CompDTO, ContentDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant/Index';
import { DateTimeUtils, SPHelper, Logger, ToastUtils } from 'wdKit';
import { SpConstants } from 'wdConstant/Index'
... ... @@ -14,9 +14,14 @@ import router from '@ohos.router'
import { postBatchAttentionStatusParams } from 'wdBean/Index';
import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
@Component
export struct RmhTitle {
@State compDTO: CompDTO = new CompDTO()
@State contentDTO: ContentDTO = new ContentDTO();
@State pageId: string = '';
@State pageName: string = '';
@Prop rmhInfo: RmhInfoDTO
@Prop publishTime: string | undefined
@State loadImg: boolean = false;
... ... @@ -48,6 +53,16 @@ export struct RmhTitle {
}
ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
console.log('rmhTitle-data', JSON.stringify(res.data))
InfomationCardClick.track(
this.compDTO,
this.contentDTO,
this.pageId,
this.pageName,
'follow', // like, commentClick, follow
this.followStatus == '0' ? true : false,
)
if (this.followStatus == '1') {
this.followStatus = '0'
} else {
... ...
... ... @@ -77,15 +77,8 @@ export struct Card10Component {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
ProcessUtils.processPage(this.contentDTO)
})
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center).margin({ left: 5, bottom: 5 })
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center)
}
if (this.contentDTO.objectType == '5') {
Notes({ objectType: 5 }).margin({ left: 5, bottom: 5 })
}
}.alignContent(Alignment.BottomStart)
... ... @@ -135,15 +128,8 @@ export struct Card10Component {
Row() {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center)
}
if (item.objectType == '5') {
Notes({ objectType: 5 })
}
Text(item.newsTitle)
.fontSize($r('app.float.font_size_17'))
... ... @@ -151,12 +137,10 @@ export struct Card10Component {
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 &&
(this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 :
((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 :
0 )
.textIndent(item.objectType == '5' ? 38 : 0)
}.alignContent(Alignment.TopStart)
Blank()
//bottom 评论等信息
CardSourceInfo(
{
... ... @@ -166,6 +150,7 @@ export struct Card10Component {
)
}
.layoutWeight(1)
.height(78)
.alignItems(HorizontalAlign.Start)
// 右侧图片
... ... @@ -183,6 +168,7 @@ export struct Card10Component {
})
}
.alignContent(Alignment.BottomEnd)
.height(78)
}
}
.padding({ top: 10, bottom: 10 })
... ...
... ... @@ -39,13 +39,13 @@ export struct Card11Component {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center)
Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center)
Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center)
}
}
Text() {
... ...
... ... @@ -38,7 +38,16 @@ export struct Card12Component {
Column() {
// rmh信息
if (this.contentDTO.rmhInfo) {
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
RmhTitle(
{
rmhInfo: this.contentDTO.rmhInfo,
publishTime: this.contentDTO.publishTime,
contentDTO: this.contentDTO,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
}
)
}
// 标题
if (this.contentDTO.newsTitle) {
... ...
... ... @@ -41,7 +41,16 @@ export struct Card14Component {
Column() {
// rmh信息
if (this.contentDTO.rmhInfo) {
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
RmhTitle(
{
rmhInfo: this.contentDTO.rmhInfo,
publishTime: this.contentDTO.publishTime,
contentDTO: this.contentDTO,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
}
)
}
// 左标题,右图
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) {
... ...
... ... @@ -44,8 +44,16 @@ export struct Card15Component {
build() {
Column() {
// rmh信息
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
//新闻标题
RmhTitle(
{
rmhInfo: this.contentDTO.rmhInfo,
publishTime: this.contentDTO.publishTime,
contentDTO: this.contentDTO,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
}
) //新闻标题
if (this.contentDTO.newsTitle) {
Text() {
if (this.titleMarked) {
... ...
... ... @@ -46,7 +46,16 @@ export struct Card16Component {
Column() {
// rmh信息
if (this.contentDTO.rmhInfo) {
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
RmhTitle(
{
rmhInfo: this.contentDTO.rmhInfo,
publishTime: this.contentDTO.publishTime,
contentDTO: this.contentDTO,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
}
)
}
// 标题
if (this.contentDTO.newsTitle) {
... ...
... ... @@ -38,8 +38,16 @@ export struct Card19Component {
build() {
Column() {
// rmh信息
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
// 标题
RmhTitle(
{
rmhInfo: this.contentDTO.rmhInfo,
publishTime: this.contentDTO.publishTime,
contentDTO: this.contentDTO,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
}
) // 标题
if (this.contentDTO.newsTitle) {
Text() {
if (this.titleMarked) {
... ...
... ... @@ -38,8 +38,16 @@ export struct Card20Component {
build() {
Column() {
// rmh信息
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
// 标题
RmhTitle(
{
rmhInfo: this.contentDTO.rmhInfo,
publishTime: this.contentDTO.publishTime,
contentDTO: this.contentDTO,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
}
) // 标题
if (this.contentDTO.newsTitle) {
Text() {
... ...
... ... @@ -40,8 +40,16 @@ export struct Card21Component {
build() {
Column() {
// 顶部 rmh信息
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime })
// 中间内容
RmhTitle(
{
rmhInfo: this.contentDTO.rmhInfo,
publishTime: this.contentDTO.publishTime,
contentDTO: this.contentDTO,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
}
) // 中间内容
Grid() {
GridItem() {
Text() {
... ...
... ... @@ -61,13 +61,13 @@ export struct Card2Component {
// }
// }
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center)
Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center)
Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center)
}
}
//新闻标题
... ...
... ... @@ -42,13 +42,13 @@ export struct Card3Component {
// Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center)
// }
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center)
Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center)
Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center)
}
}
Text() {
... ...
... ... @@ -44,10 +44,25 @@ export struct Card5Component {
Image(this.loadImg ? this.contentDTO.coverUrl : '')
.backgroundColor(0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.borderRadius($r('app.float.image_border_radius'))
.borderRadius(
{
topLeft: $r('app.float.image_border_radius'),
topRight: $r('app.float.image_border_radius'),
bottomLeft: $r('app.float.image_border_radius'),
bottomRight: $r('app.float.image_border_radius')
}
)
.aspectRatio(343 / 225)
if (this.titleShowPolicy === 1 || this.titleShowPolicy === null || this.titleShowPolicy === '') {
Row()
.borderRadius(
{
topLeft: $r('app.float.image_border_radius'),
topRight: $r('app.float.image_border_radius'),
bottomLeft: $r('app.float.image_border_radius'),
bottomRight: $r('app.float.image_border_radius')
}
)
.width(CommonConstants.FULL_WIDTH)
.height(59)
.linearGradient({
... ... @@ -55,16 +70,17 @@ export struct Card5Component {
['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]
]
})
Row() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center)
Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center)
Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center)
}
}
... ...
... ... @@ -53,17 +53,16 @@ export struct Card6Component {
// }
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType }).height(28).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center)
Notes({ newTags: this.contentDTO.seoTags }).height(28).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center)
Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center)
}
}
Text() {
if (this.titleMarked) {
ForEach(this.textArr, (textItem: textItem) => {
... ...
... ... @@ -89,14 +89,14 @@ export struct Card9Component {
topRight: $r('app.float.image_border_radius')
})
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center)
.margin({ left: 5, bottom: 5 })
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center)
Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center)
}
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center)
Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center)
}
}
... ...
... ... @@ -7,6 +7,7 @@ import MinePageDatasModel from '../../model/MinePageDatasModel';
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel';
import { SearchDescription } from '../../viewmodel/SearchResultContentItem';
import { CardParser } from '../CardParser'
import { Card9Component } from './Card9Component';
const TAG: string = 'More_Comp';
... ... @@ -23,7 +24,11 @@ export struct MoreComponent {
build() {
if (this.showDetail) {
ForEach(this.contentDTO.sameContentList, (item: ContentDTO, index: number) => {
if (item.appStyle !== "9") {
CardParser({compDTO:new CompDTO, contentDTO: item })
} else {
Card9Component({ compDTO: new CompDTO, contentDTO:item, pageId: "", pageName: "" })
}
})
} else {
Column() {
... ...
... ... @@ -256,12 +256,14 @@ export struct CommentComponent {
//获取数据
async getData() {
commentViewModel.fetchContentCommentList(this.currentPage + '', this.publishCommentModel.targetId,
let pageIndex = this.currentPage
commentViewModel.fetchContentCommentList(pageIndex + '', this.publishCommentModel.targetId,
this.publishCommentModel.targetType)
.then(commentListModel => {
console.log('评论:', JSON.stringify(commentListModel.list))
this.currentPage++
// 这里需要先赋值,否则下次UI刷新可能重复进入第1页两次
this.currentPage = pageIndex + 1
if (Number.parseInt(commentListModel.totalCommentNum) >
Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + ''
... ... @@ -279,7 +281,9 @@ export struct CommentComponent {
if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
if (pageIndex == 1) {
this.allDatas.clearAllData() // 防止数据重复问题
}
commentListModel.list.forEach(element => {
element.hasMore = Number.parseInt(element.childCommentNum) ? true : false
let newModel = commentViewModel.deepCopyCommentItemModel(element)
... ... @@ -289,7 +293,6 @@ export struct CommentComponent {
this.allDatas.push(newModel)
});
} else {
this.hasMore = false
}
... ... @@ -327,7 +330,7 @@ struct ChildCommentItem {
}
}
.maxLines(1)
.layoutWeight(1)
.flexShrink(1)
.fontSize(14)
.fontColor($r('app.color.color_222222'))
.fontWeight(FontWeight.Medium)
... ... @@ -338,7 +341,7 @@ struct ChildCommentItem {
/// 人民号>置顶>作者
//人民号
if (this.item.fromUserType !== 1) {
if (this.item.fromUserType == 2) {
Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 });
}
//置顶
... ... @@ -541,6 +544,8 @@ struct commentHeaderView {
//昵称
Text(this.item.fromUserName)
.fontSize(14)
.maxLines(1)
.flexShrink(1)
.fontColor($r('app.color.color_222222'))
.fontWeight(FontWeight.Medium)
.margin({ left: 5 })
... ... @@ -550,7 +555,7 @@ struct commentHeaderView {
/// 人民号>置顶>作者
//人民号
if (this.item.fromUserType !== 1) {
if (this.item.fromUserType == 2) {
Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 });
}
//置顶
... ...
... ... @@ -11,6 +11,7 @@ export struct CommentListDialogView {
@Link @Watch('showCommentListChange') showCommentList: boolean
@Link contentDetailData: ContentDetailDTO // 详情页传
@Link pageInfo: PageInfoDTO // 专题页传
@Link publishCommentModel: publishCommentModel
onClose?: () => void
// @Consume pageId: TrackConstants.PageName
... ... @@ -19,6 +20,7 @@ export struct CommentListDialogView {
private dialogController: CustomDialogController = new CustomDialogController({
builder: CommentListDialog({
contentDetailData: this.contentDetailData,
publishCommentModel:this.publishCommentModel,
pageInfo: this.pageInfo,
onClose: this.onClose
}),
... ... @@ -47,7 +49,7 @@ export struct CommentListDialogView {
struct CommentListDialog {
/// 内部使用
@State private publishCommentModel: publishCommentModel = new publishCommentModel()
@Link publishCommentModel: publishCommentModel
@State private operationButtonList: string[] = []
controller?: CustomDialogController
@State windowWidth: number = AppStorage.get<number>('windowWidth') || 0
... ...
... ... @@ -204,7 +204,8 @@ struct CarouselLayout01CardView {
Column() {
// 这里用于展示轮播图右上角信息,这里只对直播类型的展示
if (this.item.objectType === '2' || this.item.objectType === '4') {
CardMediaInfo({ contentDTO: this.item,livePeopleNum:false })
// 2024-05-28 给CardMediaInfo组件添加beused的字段让其知道被哪个组件使用,不传默认为空
CardMediaInfo({ contentDTO: this.item,livePeopleNum:false ,beused:'Zh_Carousel_Layout_01'})
.width(CommonConstants.FULL_PARENT)
}
Blank()
... ... @@ -223,7 +224,8 @@ struct CarouselLayout01CardView {
// if (this.item.objectType == '5' || this.item.objectType == '6') {
// Notes({ objectType: this.item.objectType })
// }
Text(`${this.item.corner}${this.item.newsTitle}`)
//Text(`${this.item.corner}${this.item.newsTitle}`)
Text(`${this.item.newsTitle}`)
.width(CommonConstants.FULL_PARENT)
.fontColor(Color.White)
.fontSize($r('app.float.font_size_18'))
... ...
... ... @@ -16,7 +16,7 @@ export default struct MinePagePersonFunctionUI {
Grid(){
ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{
GridItem(){
PagePersonFunction({ item: item, noDivider : (index % 4 < 3 && index != this.personalData.length-1) ? false : true})
PagePersonFunction({ item: item, noDivider : (index % 5 < 4 && index != this.personalData.length-1) ? false : true})
}.onClick(()=>{
console.log(index+"")
switch (item.msg){
... ... @@ -77,14 +77,14 @@ export default struct MinePagePersonFunctionUI {
break;
}
}
}).width('169lpx')
}).width('142lpx')
.height('117lpx')
})
}
.rowsTemplate('1fr 1fr')
.columnsTemplate('1fr 1fr 1fr 1fr')
.height('234lpx')
.margin({top:'31lpx',left:'23lpx',right:'23lpx' })
.rowsTemplate('1fr')
.columnsTemplate('1fr 1fr 1fr 1fr 1fr')
.height('117lpx')
.margin({top:'31lpx'})
}
messageClick(){
... ...
... ... @@ -86,7 +86,7 @@ export struct FollowFirstTabsComponent{
if(!this.isConnectNetwork){
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.reloadNetWork()
},})
}})
.layoutWeight(1)
.width('100%')
}else{
... ...
... ... @@ -102,7 +102,8 @@ export struct FollowListDetailUI {
}
}
}
.cachedCount(10)
.edgeEffect(EdgeEffect.None)
.cachedCount(5)
.padding({ left: '31lpx', right: '31lpx' })
.layoutWeight(1)
.scrollBar(BarState.Off)
... ...
... ... @@ -109,7 +109,7 @@ export struct HomePageBottomCommentComponent {
}
}
}
.cachedCount(15)
.cachedCount(5)
.layoutWeight(1)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
... ...
... ... @@ -177,7 +177,7 @@ export struct HomePageBottomFollowComponent {
}
}
}
.cachedCount(15)
.cachedCount(5)
.padding({ left: '31lpx', right: '31lpx' })
.layoutWeight(1)
.scrollBar(BarState.Off)
... ...
... ... @@ -109,7 +109,7 @@ export struct OtherHomePageBottomCommentComponent {
}
}
}
.cachedCount(15)
.cachedCount(5)
.layoutWeight(1)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
... ...
... ... @@ -138,7 +138,7 @@ export struct OtherHomePageBottomFollowComponent{
ListHasNoMoreDataUI()
}
}
}.cachedCount(15)
}.cachedCount(5)
.padding({left:'31lpx',right:'31lpx'})
.layoutWeight(1)
.scrollBar(BarState.Off)
... ...
... ... @@ -542,11 +542,19 @@ export struct PaperSingleColumn999CardView {
if (this.item) {
Row() {
Row() {
if (this.item.corner.length > 0){
Text(this.item.corner)
.fontSize(12)
.fontColor('#ED2800')
.margin({ left: 16 })
}
if (this.buildSourceString().length > 0) {
Text(this.buildSourceString())
.fontSize(12)
.fontColor('#B0B0B0')
.margin({ left: 16 })
.margin({ left: this.item.corner.length > 0?10:16 })
///不显示时间或者不显示评论
if (this.getPublishTime().length > 0 || this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.commentNum) > 0) {
... ...
... ... @@ -4,10 +4,13 @@ import { EditListInfo, editModel, editModelParams, WDEditDataModelType } from '.
import EditInfoViewModel from '../../viewmodel/EditInfoViewModel';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog'
import {EditUserInfoCustomDialog} from '../view/areaPickerDialog/EditUserInfoCustomDialog'
import {EditUserSexCustomDialog} from '../view/areaPickerDialog/EditUserSexCustomDialog'
import { AreaListModel } from '../../model/AreaListModel';
import router from '@ohos.router';
import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils'
import { TrackConstants } from 'wdTracking/Index';
import { window } from '@kit.ArkUI';
@Entry
@Component
... ... @@ -16,6 +19,7 @@ struct EditUserInfoPage {
@State headerImg: string = ''
@State dataSource: AreaListModel[] = []
@State currentUserInfo: editModel = new editModel()
@State bottomSafeHeight: number = 0;
dialogController: CustomDialogController = new CustomDialogController({
builder: AreaPickerDialog({dataSource:this.dataSource,
... ... @@ -29,10 +33,51 @@ struct EditUserInfoPage {
}
}),
alignment: DialogAlignment.Bottom,
offset:{dx:0,dy:0},
customStyle: true,
offset: {
dx: 0,
dy: -this.bottomSafeHeight
},
})
aboutToAppear() {
dateDialogController: CustomDialogController = new CustomDialogController({
builder: EditUserInfoCustomDialog({
confirmCallback:(selectDate:Date)=>{
let mon = selectDate.getUTCMonth() as number + 1
let monStr = mon < 10? '0'+mon.toString():mon.toString();
let dayStr = selectDate.getUTCDate() as number < 10? '0'+selectDate.getUTCDate():selectDate.getUTCDate();
this.currentUserInfo.userExtend.birthday = selectDate.getUTCFullYear()+'-'+monStr+'-'+dayStr;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday
this.updateEditModel()
}
}),
alignment: DialogAlignment.Bottom,
customStyle: true,
offset: {
dx: 0,
dy: -this.bottomSafeHeight
},
})
sexDialogController: CustomDialogController = new CustomDialogController({
builder: EditUserSexCustomDialog({
confirmCallback:(index)=>{
this.currentUserInfo.userExtend.sex = index;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex
this.updateEditModel()
}
}),
alignment: DialogAlignment.Bottom,
customStyle: true,
offset: {
dx: 0,
dy: -this.bottomSafeHeight
},
})
async aboutToAppear() {
let windowHight: window.Window = await window.getLastWindow(getContext(this));
this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height)
this.getAccountOwnerInfo()
this.getAreaList()
}
... ... @@ -145,31 +190,9 @@ struct EditUserInfoPage {
}else if (i === 3){
this.dialogController.open()
} else if (i === 4) {
DatePickerDialog.show({
start:new Date('1900-1-1'),
end:new Date(),
selected:new Date,
lunar:false,
onAccept:(value:DatePickerResult) => {
let mon = value.month as number + 1
let monStr = mon < 10? '0'+mon.toString():mon.toString();
let dayStr = value.day as number < 10? '0'+value.day:value.day;
this.currentUserInfo.userExtend.birthday = value.year+'-'+monStr+'-'+dayStr;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday
this.updateEditModel()
}
})
this.dateDialogController.open()
}else if(i === 5){
TextPickerDialog.show({
range:['男','女'],
canLoop:false,
selected:this.currentUserInfo.userExtend.sex === 0?1:0,
onAccept:(value:TextPickerResult) => {
this.currentUserInfo.userExtend.sex = value.index == 0?1:0;
this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex
this.updateEditModel()
}
})
this.sexDialogController.open()
}
})
}
... ...
... ... @@ -114,6 +114,7 @@ struct MyCollectionListPage {
.height(CommonConstants.FULL_HEIGHT)
}
}
.backgroundColor('#FFFFFF')
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
}
... ...
import router from '@ohos.router'
import { PeopleShipHomePageNavComponent } from '../peopleShipHomePage/PeopleShipHomeNavComponent'
import { PeopleShipHomePageTopComponent } from '../peopleShipHomePage/PeopleShipHomePageTopComponent'
import { Logger, WindowModel } from 'wdKit'
import { Logger, NetworkUtil, WindowModel } from 'wdKit'
import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel'
import { PeopleShipHomeListComponent } from '../peopleShipHomePage/PeopleShipHomeListComponent'
import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem'
... ... @@ -14,6 +14,7 @@ import {
ArticleCountData
} from 'wdBean'
import { EmptyComponent } from '../view/EmptyComponent'
import { CustomTitleUI } from '../reusable/CustomTitleUI'
@Entry
@Component
... ... @@ -39,8 +40,10 @@ struct PeopleShipHomePage {
@Provide topHeight: number = 214
@State isLoading: boolean = true
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
build() {
if(this.isConnectNetwork){
Stack({ alignContent: Alignment.TopStart }) {
Stack({ alignContent: Alignment.Top }){
// 顶部图片
... ... @@ -61,8 +64,6 @@ struct PeopleShipHomePage {
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
Column(){
// 头部返回
PeopleShipHomePageNavComponent({
... ... @@ -122,7 +123,6 @@ struct PeopleShipHomePage {
})
}
}
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
.alignItems(HorizontalAlign.Start)
... ... @@ -130,7 +130,21 @@ struct PeopleShipHomePage {
.width('100%')
}
.width('100%')
}else{
Column(){
CustomTitleUI({ titleName: "" })
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.isConnectNetwork = NetworkUtil.isNetConnected()
if(this.isConnectNetwork){
this.detailModel = {} as PeopleShipUserDetailData
this.getData()
}
}})
.height('calc(100% - 84lpx)')
.width('100%')
}.width("100%")
.height("100%")
}
}
aboutToAppear() {
... ...
... ... @@ -43,7 +43,8 @@ export struct SearchComponent {
this.getSearchHistoryData()
let intervalID = setInterval(() => {
sendEventByKey("searchId", 10, "")
// sendEventByKey("searchId", 10, "") //这个报错 暂时替换下面这个
focusControl.requestFocus('searchId')
clearInterval(intervalID);
}, 1000);
}
... ... @@ -180,6 +181,11 @@ export struct SearchComponent {
trackSearchClick(this.fromTabName,content)
//赋值
this.searchText = content
if(StringUtils.isNotEmpty(this.searchText)){
this.hasInputContent = true
}
//保存搜索记录
SearcherAboutDataModel.putSearchHistoryData(this.searchText)
//获取搜索记录
... ...
... ... @@ -10,7 +10,7 @@ import {
} from 'wdBean/Index'
import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO'
import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO'
import { LazyDataSource, Logger, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'
import { LazyDataSource, StringUtils, UserDataLocal } from 'wdKit/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import MinePageDatasModel from '../../model/MinePageDatasModel'
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
... ... @@ -21,7 +21,6 @@ import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusReq
import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem'
import { SearchResultContentData } from '../../viewmodel/SearchResultContentData'
import {
SearchDescription,
SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem'
import { CardParser } from '../CardParser'
import { FollowChildComponent } from '../mine/follow/FollowChildComponent'
... ... @@ -30,6 +29,7 @@ import { ActivityItemComponent } from './ActivityItemComponent'
import { SearchCreatorComponent } from './SearchCreatorComponent'
import { JSON } from '@kit.ArkTS'
import { MoreComponent } from '../cardview/MoreComponent'
import { Card9Component } from '../cardview/Card9Component'
const TAG = "SearchResultContentComponent"
... ... @@ -264,6 +264,11 @@ export struct SearchResultContentComponent {
ActivityItemComponent({ contentDTO: item })
}else if(item.sameContentListSize > 0){
MoreComponent({ contentDTO: item })
}else if(item.appStyle == "9"){
Column(){
Card9Component({ compDTO: new CompDTO, contentDTO:item, pageId: "", pageName: "" })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
}
} else {
CardParser({compDTO:new CompDTO, contentDTO: item })
}
... ... @@ -284,7 +289,7 @@ export struct SearchResultContentComponent {
ListHasNoMoreDataUI()
}
}
}.cachedCount(10)
}.cachedCount(5)
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.onReachEnd(() => {
... ... @@ -300,57 +305,6 @@ export struct SearchResultContentComponent {
}
@Builder
multiCreatorUI() {
Column() {
List() {
ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {
ListItem() {
SearchCreatorComponent({ item: item })
}
.width('150lpx')
.height('100%')
})
ListItem() {
Column() {
Text("查看更多")
.width('19lpx')
.fontSize('19lpx')
.fontWeight('400lpx')
.lineHeight('27lpx')
.fontColor($r('app.color.color_9E9E9E'))
}
.borderRadius({ topLeft: '4lpx', bottomLeft: '4lpx' })
.height('180lpx')
.width('77lpx')
.backgroundColor($r('app.color.color_EDEDED'))
.justifyContent(FlexAlign.Center)
}.height('100%')
.margin({ left: '23lpx' })
.onClick(() => {
let params: Params = {
pageID: this.keywords
}
WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage, params)
})
}
.cachedCount(6)
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.listDirection(Axis.Horizontal)
.width('100%')
.height('219lpx')
Divider()
.width('100%')
.height('12lpx')
.color($r('app.color.color_F5F5F5'))
.strokeWidth('12lpx')
}
}
@Builder
SearchListUI() {
List({space:'8lpx'}) {
ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => {
... ... @@ -459,7 +413,7 @@ export struct SearchResultContentComponent {
contentDTO.tagWord = -1
contentDTO.isSelect = true
contentDTO.rmhInfo = {} as RmhInfoDTO
contentDTO.photoNum = -1
contentDTO.photoNum = StringUtils.isEmpty(value.data.picCount) ? 0 : Number(value.data.picCount)
contentDTO.liveInfo = {} as LiveInfoDTO;
contentDTO.videoInfo = {
videoDuration: Number.parseInt(value.data.duration)
... ... @@ -482,7 +436,7 @@ export struct SearchResultContentComponent {
contentDTO.bottomNavId = '';
contentDTO.openType = '';
contentDTO.extra = '';
contentDTO.titleShow = value.data.type == "5" ? 1 : 0;
contentDTO.titleShow = value.data.titleShow == "1" ? 0 : 1
contentDTO.rmhInfo = rmhInfo
contentDTO.shareFlag = value.data.shareFlag
contentDTO.contentText = value.data.contentText
... ...
... ... @@ -49,7 +49,7 @@ export struct LikeComponent {
// 2:竖屏直播页 3:图集 4:横屏直播页
if(this.pageComponentType == 2 || this.pageComponentType == 4) {
// 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
this.likesStyle = this.contentDetailData?.liveInfo?.likesStyle
this.likesStyle = String(this.contentDetailData?.liveInfo?.likesStyle)
this.openLikes = this.contentDetailData?.liveInfo?.likeEnable == 1 ? true : false
} else {
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
... ...
import { ToastUtils, Logger, NumberFormatterUtils, SPHelper } from 'wdKit';
import { NumberFormatterUtils, SPHelper } from 'wdKit';
import promptAction from '@ohos.promptAction';
import {
InputMethodProperty,
batchLikeAndCollectResult,
batchLikeAndCollectParams,
batchLikeAndCollectResult,
ContentDetailDTO,
postExecuteLikeParams,
contentListParams,
InteractDataDTO,
postExecuteCollectRecordParams
... ... @@ -13,16 +11,15 @@ import {
import router from '@ohos.router';
import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
import { LikeComponent } from './LikeComponent';
import { CommentTabComponent, CommentIconComponent, } from '../comment/view/CommentTabComponent';
import { publishCommentModel } from '../comment/model/PublishCommentModel'
import { HttpUrlUtils } from 'wdNetwork/Index';
import { CommentIconComponent, CommentTabComponent, } from '../comment/view/CommentTabComponent';
import { publishCommentModel } from '../comment/model/PublishCommentModel';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { PageRepository } from '../../repository/PageRepository';
import { SpConstants } from 'wdConstant/Index';
import { WDShare } from 'wdShare/Index';
import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel'
import { EmitterEventId, EmitterUtils } from 'wdKit/Index'
import { PlayerConstants } from 'wdPlayer'
import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel';
import { EmitterEventId, EmitterUtils } from 'wdKit/Index';
import { PlayerConstants } from 'wdPlayer';
import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
const TAG = 'OperRowListView';
... ... @@ -508,7 +505,7 @@ export struct OperRowListView {
// 评论组件需要数据
if (Number.parseInt(this.interactData.commentNum) >
Number.parseInt(this.publishCommentModel.totalCommentNumer)) {
this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0'
this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + ''
}
}
// console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res))
... ...
... ... @@ -13,6 +13,7 @@ export struct AreaPickerDialog {
@Provide dataSource: AreaListModel[] = []
result: JSON[] = [];
confirmCallback: (province:string,city:string,county:string,address:string) => void = () => {
}
build() {
... ... @@ -22,27 +23,33 @@ export struct AreaPickerDialog {
.onClick(()=> {
this.controller.close()
})
.width(60)
.backgroundColor(0xffffff)
.fontColor(Color.Black)
.layoutWeight(1)
Blank()
Blank().width(80)
Text(this.title)
.fontSize(18).textAlign(TextAlign.Center).margin({top:10,bottom:10})
Blank()
Blank().width(80)
Button('提交',{type:ButtonType.Normal})
.onClick(()=> {
this.controller.close()
this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label);
})
.width(60)
.backgroundColor(0xffffff)
.fontColor('#ED2800')
.layoutWeight(1)
}
.margin({top:0,bottom:10})
}.backgroundColor(0xffffff)
Divider()
.color('#f5f5f5')
.width('100%')
.strokeWidth(1)
Row(){
FirstLevelComponent().width('33%')
... ... @@ -50,7 +57,8 @@ export struct AreaPickerDialog {
ThirdLevelComponent().width('33%')
}
}
.height('40%')
.backgroundColor(0xffffff)
.height('35%')
.width('100%')
}
}
\ No newline at end of file
... ...
@Component
export struct DateCustomComponent {
@Consume selectDate: Date
build() {
Column(){
Column(){
DatePicker({
start:new Date('1900-1-1'),
end:new Date(),
selected:new Date,
}).selectedTextStyle({color:'#666666'})
.textStyle({color:'#999999'})
.onDateChange((value) => {
this.selectDate = value as Date
})
}.justifyContent(FlexAlign.Center)
}.height('100%')
}
}
\ No newline at end of file
... ...
import { DateCustomComponent } from './DateCustomComponent'
@CustomDialog
export struct EditUserInfoCustomDialog{
@Provide selectDate: Date = new Date
controller: CustomDialogController
confirmCallback: (selectDate:Date) => void = () => {
}
build() {
Column(){
Row(){
Button('取消',{type:ButtonType.Normal})
.onClick(()=> {
this.controller.close()
})
.width(60)
.backgroundColor(0xffffff)
.fontColor(Color.Black)
.layoutWeight(1)
Blank().width(80)
Text('修改生日')
.fontSize(18).textAlign(TextAlign.Center).margin({top:10,bottom:10})
Blank().width(80)
Button('提交',{type:ButtonType.Normal})
.onClick(()=> {
this.controller.close()
this.confirmCallback(this.selectDate);
})
.width(60)
.backgroundColor(0xffffff)
.fontColor('#ED2800')
.layoutWeight(1)
}.backgroundColor(0xffffff)
Divider()
.color('#f5f5f5')
.width('100%')
.strokeWidth(1)
DateCustomComponent().width('70%')
}
.backgroundColor(0xffffff)
.height('35%')
.width('100%')
}
}
\ No newline at end of file
... ...
@CustomDialog
export struct EditUserSexCustomDialog {
controller: CustomDialogController
confirmCallback: (selectIndex:number) => void = () => {
}
build() {
Column(){
Button('男',{type:ButtonType.Normal}).height(45).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff)
.onClick(()=>{
this.confirmCallback(1)
this.controller.close()
})
Divider()
.color('#f5f5f5')
.width('100%')
.strokeWidth(1)
Button('女',{type:ButtonType.Normal}).height(45).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff)
.onClick(()=>{
this.confirmCallback(0)
this.controller.close()
})
Divider()
.color('#f5f5f5')
.width('100%')
.strokeWidth(5)
Button('取消',{type:ButtonType.Normal}).height(80).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff)
.onClick(()=>{
this.controller.close()
})
}.height(176).width('100%').backgroundColor(Color.White)
}
}
\ No newline at end of file
... ...
... ... @@ -28,7 +28,6 @@ export struct FirstLevelComponent {
this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number])
})
.backgroundColor(Color.White)
// .border({color:'#e2e2e2',width:{right:0.5}})
.width('100%')
.layoutWeight(1)
.selectedTextStyle({color:'#666666'})
... ... @@ -38,6 +37,5 @@ export struct FirstLevelComponent {
.justifyContent(FlexAlign.Center)
}
.height('100%')
}
}
\ No newline at end of file
... ...
... ... @@ -830,7 +830,7 @@ class MinePageDatasModel{
contentDTO.tagWord = -1
contentDTO.isSelect = true
contentDTO.rmhInfo = {} as RmhInfoDTO
contentDTO.photoNum = -1
contentDTO.photoNum = StringUtils.isEmpty(value.picCount) ? 0 : Number(value.picCount)
contentDTO.liveInfo = {} as LiveInfoDTO;
contentDTO.videoInfo = {
videoDuration: Number.parseInt(value.duration)
... ... @@ -853,7 +853,7 @@ class MinePageDatasModel{
contentDTO.bottomNavId = '';
contentDTO.openType = '';
contentDTO.extra = '';
contentDTO.titleShow = value.type == "5" ? 1 : 0;
contentDTO.titleShow = value.titleShow == "1" ? 0 : 1
contentDTO.rmhInfo = rmhInfo
contentDTO.shareFlag = value.shareFlag
contentDTO.contentText = value.contentText
... ...
... ... @@ -182,7 +182,7 @@ struct SearchCreatorPage {
ListHasNoMoreDataUI()
}
}
}.cachedCount(10)
}.cachedCount(5)
.padding({left:'31lpx',right:'31lpx'})
.layoutWeight(1)
.scrollBar(BarState.Off)
... ...
... ... @@ -62,8 +62,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
commentCount: _item?.interactData?.commentNum || 0,
favorites: _item?.interactData?.collectNum || 0,
viewCount: _item?.interactData?.readNum || 0,
rankingHint: 99,
isPublicData: true
rankingHint: 99
}
}
insightIntentArray.push(viewBlogInsightIntentItem)
... ... @@ -113,8 +112,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext,
forwardCount: interactData?.shareNum || 0,
commentCount: interactData?.commentNum || 0,
favorites: interactData?.collectNum || 0,
rankingHint: 99,
isPublicData: true
rankingHint: 99
}
}
... ... @@ -147,8 +145,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en
activityType: ['RecentViews'],
columnTitle: pageInfoBean?.topicInfo?.title,
columnSubTitle: pageInfoBean?.shareSummary,
rankingHint: 99,
isPublicData: true
rankingHint: 99
}
}
console.log('yzl viewColumInsightIntentShare', JSON.stringify(viewColumInsightIntentItem))
... ...
... ... @@ -43,10 +43,19 @@ export class InfomationCardClick {
return summaryType;
}
public static track(compDTO: CompDTO, contentDTO: ContentDTO, pageId: string, pageName: string): void {
public static track(
compDTO: CompDTO,
contentDTO: ContentDTO,
pageId: string,
pageName: string,
action = 'detailPageShow', // like, commentClick, follow
bl = false,
followUserId = '',
followUserName = ''
): void {
try {
const extParams: ParamType = {
'action': 'detailPageShow',
'action': action,
'shareChannel': '',
'duration': 0,
'contentName': contentDTO.newsTitle,
... ... @@ -87,7 +96,15 @@ export class InfomationCardClick {
extParams['saAuthorName'] = contentDTO.source;
}
console.log('InfomationCardClick-params:', JSON.stringify(extParams))
TrackingContent.common(TrackConstants.EventType.Click, pageId, pageName, extParams)
if (action === 'detailPageShow') {
TrackingContent.common(TrackConstants.EventType.Click, pageId, pageName, extParams);
} else if (action === 'like') {
TrackingContent.like(bl, pageId, pageName, extParams);
} else if (action === 'commentClick') {
TrackingContent.commentClick(pageId, pageName, extParams);
} else if (action === 'follow') {
TrackingContent.follow(bl, followUserId, followUserName, pageId, pageName, extParams)
}
} catch (err) {
console.log('InfomationCardClick-err', JSON.stringify(err))
}
... ...
import { Action, ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index';
import { Action, ContentDetailDTO } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import router from '@ohos.router';
... ... @@ -31,9 +31,10 @@ export struct DetailPlayLiveCommon {
@Provide pageShow: number = -1
@Provide pageHide: number = -1
@Provide pageBackPress: number = -1
@Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@Provide publishCommentModel: publishCommentModel = new publishCommentModel()
// 横屏或竖屏 general-竖屏,news-横屏
@State liveLandscape: string = ''
async aboutToAppear(): Promise<void> {
const par: Action = router.getParams() as Action;
... ... @@ -48,11 +49,11 @@ export struct DetailPlayLiveCommon {
build() {
Column() {
// 直播预约或横屏直播统一进横屏直播
if (this.liveState === 'wait' || this.liveStyle === 0) {
// 非沉浸式
if (this.liveState === 'wait' || this.liveLandscape === 'news') {
// 非沉浸式直播
DetailPlayLivePage({ contentId: this.contentId, relId: this.relId, relType: this.relType })
} else if (this.liveStyle === 1) {
// 沉浸式
} else if (this.liveLandscape === 'general') {
// 沉浸式直播
DetailPlayVLivePage()
}
}
... ... @@ -70,60 +71,64 @@ export struct DetailPlayLiveCommon {
.then((data: Array<ContentDetailDTO>) => {
console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data))
if (data) {
this.contentDetailData = data[0];
// if (this.contentDetailData.openComment === 1) {
console.log(TAG, '查询视频详情用于评论展示 openComment:', this.contentDetailData.openComment)
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
this.publishCommentModel.commentContent = ''
this.getLiveDetails()
// }
}
})
}
let detailData = data[0]
this.liveLandscape =
detailData?.liveInfo?.liveLandScape //String(this.contentDetailData?.liveInfo?.liveLandScape || '')
/**
* 获取直播信息,可区分横竖屏直播
*/
getLiveDetails() {
this.liveState = detailData.liveInfo?.liveState
this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType)
.then(
(data) => {
if (data.length > 0) {
if (this.liveState === 'wait' || this.liveLandscape === 'news') {
this.contentDetailData = data[0]
} else if (this.liveLandscape === 'general') {
//todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行
setTimeout(() => {
this.liveDetailsBean = data[0]
this.contentDetailData = data[0]
}, 10)
}
this.liveState = data[0].liveInfo?.liveState
this.liveStyle = data[0].liveInfo.liveStyle
console.log(TAG, '查询视频详情用于评论展示 openComment:', detailData.openComment)
this.publishCommentModel.targetId = String(detailData?.newsId || '')
this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = detailData?.newsTitle
this.publishCommentModel.targetRelType = String(detailData?.reLInfo?.relType || '')
this.publishCommentModel.targetRelObjectId = String(detailData?.reLInfo?.relObjectId || '')
this.publishCommentModel.keyArticle = String(detailData?.keyArticle || '')
this.publishCommentModel.targetType = String(detailData?.newsType || '')
this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '')
this.publishCommentModel.commentContent = ''
this.liveStyle = detailData.liveInfo?.liveStyle
if (data[0].fullColumnImgUrls && data[0].fullColumnImgUrls.length > 0) {
this.imgUrl = data[0].fullColumnImgUrls[0].url
if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) {
this.imgUrl = detailData.fullColumnImgUrls[0].url
}
if (data[0].liveInfo.liveState == 'end') {
this.playUrl = data[0].liveInfo.vlive[0].replayUri
if (detailData.liveInfo.liveState == 'end') {
this.playUrl = detailData.liveInfo.vlive[0].replayUri
}
// console.log(TAG, 'getLiveDetails:', JSON.stringify((this.liveDetailsBean)))
//console.error('XXXXZZZZ', "liveLandscape =" + this.liveLandscape + ' this.liveState =' + this.liveState)
}
},
() => {
})
}
// /**
// *
// * @returns true : 沉浸式;false : 非沉浸式
// */
// isImmersionLive(): boolean {
//
// let flag = false
//
// if (this.liveState === 'wait' || this.liveLandscape === 'news') {
// flag = false
// } else if (this.liveLandscape === 'general') {
// flag = true
// }
//
// return flag
// }
onPageShow() {
this.pageShow = Math.random()
Logger.info(TAG, 'onPageShow')
... ...
... ... @@ -7,8 +7,9 @@ import mediaquery from '@ohos.mediaquery';
import { Logger, WindowModel } from 'wdKit/Index';
import { router, window } from '@kit.ArkUI';
import { devicePLSensorManager } from 'wdDetailPlayApi/Index';
import { LiveCommentComponent, LiveOperRowListView } from 'wdComponent/Index';
import { LiveCommentComponent } from 'wdComponent/Index';
import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index';
import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { ResponseDTO } from 'wdNetwork/Index';
... ... @@ -69,8 +70,8 @@ export struct DetailPlayLivePage {
TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab })
.layoutWeight(1)
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
LiveOperRowListView({
pageComponentType: 4, // 4:横屏直播页
OperRowListView({
componentType: 4,
operationButtonList: ['comment', 'collect', 'share', 'like'],
styleType: 1,
contentDetailData: this.contentDetailData,
... ...
import { Action, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index';
import { LiveRoomDataBean } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import router from '@ohos.router';
import { WindowModel } from 'wdKit/Index';
import { PlayerComponent } from '../widgets/vertical/PlayerComponent';
import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent';
import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index';
import { WDAliPlayerController } from 'wdPlayer/Index';
import { DisplayDirection } from 'wdConstant/Index';
import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index';
import { PlayerEndView } from '../widgets/vertical/PlayerEndView';
... ... @@ -33,7 +32,6 @@ export struct DetailPlayVLivePage {
@Consume @Watch('openFullScreen') pageShow: number
@Consume @Watch('closeFullScreen') pageHide: number
@Consume contentId: string
@Consume liveDetailsBean: LiveDetailsBean
@State swiperIndex: number = 1
aboutToAppear(): void {
... ... @@ -117,5 +115,7 @@ export struct DetailPlayVLivePage {
console.error(TAG, 'getLiveDetails catch', message)
})
}
}
... ...
import font from '@ohos.font'
import { LiveDetailsBean } from 'wdBean/Index'
import { ContentDetailDTO } from 'wdBean/Index'
import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { HttpUtils } from 'wdNetwork/Index'
... ... @@ -7,7 +7,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
@Component
export struct LiveCountdownComponent {
@State liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean
@State liveDetailsBean: ContentDetailDTO = {} as ContentDetailDTO
textTimerController: TextTimerController = new TextTimerController()
@State format: string = 'HH:mm:ss'
@State month: string = ''
... ... @@ -141,7 +141,7 @@ export struct LiveCountdownComponent {
}
//2024-04-01 19:44:00-trim->2024-04-0119:44:00
if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) {
let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime?.trim()
let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime+''
this.month = Number(playStartTimeTmp.substring(5, 7)).toString()
this.day = playStartTimeTmp.substring(8, 10)
this.hour = playStartTimeTmp.substring(11, 13)
... ... @@ -152,7 +152,7 @@ export struct LiveCountdownComponent {
getLiveAppointmentStatus() {
this.liveViewModel.getLiveAppointmentStatus(
this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '',
this.liveDetailsBean.newsId
this.liveDetailsBean.newsId+''
).then(
(data) => {
this.isAppointmentLive = data
... ... @@ -165,7 +165,7 @@ export struct LiveCountdownComponent {
liveAppointment() {
this.liveViewModel.liveAppointment(
this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '',
this.liveDetailsBean.newsId,
this.liveDetailsBean.newsId+'',
!this.isAppointmentLive).then(
(data) => {
if (data.success) {
... ...
import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, WDViewDefaultType } from 'wdComponent/Index'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout'
... ... @@ -17,7 +17,7 @@ export struct TabChatComponent {
@State private pageModel: PageModel = new PageModel()
liveViewModel: LiveViewModel = new LiveViewModel()
@State liveChatList: Array<LiveRoomItemBean> = []
@Consume liveDetailsBean: LiveDetailsBean
@Consume contentDetailData: ContentDetailDTO
@Consume publishCommentModel: publishCommentModel
aboutToAppear(): void {
... ... @@ -102,8 +102,8 @@ export struct TabChatComponent {
this.pageModel.currentPage = 1
this.liveViewModel.getLiveChatList(
this.pageModel.currentPage,
this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
this.liveDetailsBean?.newsId,
this.contentDetailData?.liveInfo?.mlive?.mliveId,
String( this.contentDetailData.newsId),
20,)
.then(
(data) => {
... ...
import { LiveDetailsBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index'
import { LiveCountdownComponent } from './LiveCountdownComponent'
@Component
export struct TabInfoComponent {
@Consume liveDetailsBean: LiveDetailsBean
@Consume contentDetailData: ContentDetailDTO
aboutToAppear(): void {
}
... ... @@ -12,7 +11,7 @@ export struct TabInfoComponent {
Column() {
this.showLiveTitle()
this.showLiveDetails()
LiveCountdownComponent({liveDetailsBean:this.liveDetailsBean})
LiveCountdownComponent({liveDetailsBean:this.contentDetailData})
}.margin({
top: 13,
left: 16,
... ... @@ -27,7 +26,7 @@ export struct TabInfoComponent {
@Builder
showLiveTitle() {
Text(this.liveDetailsBean.newsTitle)
Text(this.contentDetailData.newsTitle)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('18vp')
... ... @@ -38,7 +37,7 @@ export struct TabInfoComponent {
@Builder
showLiveDetails() {
Text(this.liveDetailsBean.newIntroduction)
Text(this.contentDetailData.newIntroduction)
.maxLines(5)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontSize('14vp')
... ...
import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index'
import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI, WDViewDefaultType } from 'wdComponent/Index'
import { TabLiveItemComponent } from './TabLiveItemComponent'
import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout'
... ... @@ -12,12 +12,14 @@ import { Logger } from 'wdKit'
const TAG: string = 'TabLiveComponent';
/**
* 非沉浸式直播间组件
*/
@Component
export struct TabLiveComponent {
liveViewModel: LiveViewModel = new LiveViewModel()
@State liveList: Array<LiveRoomItemBean> = []
@Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
@Consume @Watch('updateData') contentDetailData: ContentDetailDTO
@State private pageModel: PageModel = new PageModel()
aboutToAppear(): void {
... ... @@ -81,15 +83,15 @@ export struct TabLiveComponent {
}
getLiveList() {
if (!this.liveDetailsBean || !this.liveDetailsBean.newsId) {
if (!this.contentDetailData || !this.contentDetailData.newsId) {
// 参数不够,直接拦截接口
return
}
this.pageModel.currentPage = 1
this.liveViewModel.getLiveList(
this.pageModel.currentPage,
this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
this.liveDetailsBean?.newsId,
this.contentDetailData?.liveInfo?.mlive?.mliveId,
this.contentDetailData?.newsId+'',
20)
.then(
(data) => {
... ... @@ -110,16 +112,16 @@ export struct TabLiveComponent {
this.pageModel.hasMore = true;
} else {
this.pageModel.hasMore = false;
if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId)
&& this.liveDetailsBean
&& this.liveDetailsBean.liveInfo.liveState != 'wait') {
if (StringUtils.isEmpty(this.contentDetailData.oldNewsId)
&& this.contentDetailData
&& this.contentDetailData.liveInfo.liveState != 'wait') {
this.updateLiveListData()
}
}
} else {
if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId)
&& this.liveDetailsBean
&& this.liveDetailsBean.liveInfo.liveState != 'wait') {
if (StringUtils.isEmpty(this.contentDetailData.oldNewsId)
&& this.contentDetailData
&& this.contentDetailData.liveInfo.liveState != 'wait') {
this.pageModel.viewType = ViewType.LOADED;
this.updateLiveListData()
} else {
... ... @@ -136,12 +138,12 @@ export struct TabLiveComponent {
updateLiveListData() {
let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean
liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction
liveRoomItemBeanTemp.text = this.contentDetailData.newIntroduction
liveRoomItemBeanTemp.senderUserName = '人民日报主持人'
liveRoomItemBeanTemp.pictureUrls = []
liveRoomItemBeanTemp.pictureUrls.push(this.liveDetailsBean?.fullColumnImgUrls[0]?.url)
liveRoomItemBeanTemp.pictureUrls.push(this.contentDetailData?.fullColumnImgUrls[0]?.url)
liveRoomItemBeanTemp.dataType = 'ZH_TEXT_AND_IMAGE_MSG'
let temp = this.liveDetailsBean?.fullColumnImgUrls[0]
let temp = this.contentDetailData?.fullColumnImgUrls[0]
if (temp) {
liveRoomItemBeanTemp.pictureResolutions = []
liveRoomItemBeanTemp.pictureResolutions.push(`${temp.height}*${temp.weight}`)
... ...
import { window } from '@kit.ArkUI'
import { window } from '@kit.ArkUI';
import lottie from '@ohos/lottie';
import { NumberFormatterUtils, StringUtils, WindowModel } from 'wdKit/Index'
import { DateFormatUtil, WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { DisplayDirection } from 'wdConstant/Index'
import { LiveFollowComponent, LottieView } from 'wdComponent/Index'
import { NumberFormatterUtils, StringUtils, WindowModel } from 'wdKit/Index';
import { DateFormatUtil, PlayerConstants, WDAliPlayerController } from 'wdPlayer/Index';
import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index';
import { DisplayDirection } from 'wdConstant/Index';
import { LiveFollowComponent, LottieView } from 'wdComponent/Index';
@Component
export struct PlayUIComponent {
playerController?: WDAliPlayerController;
//菜单键是否可见
@State @Watch('onChangeMenuVisible') isMenuVisible: boolean = true
@Consume liveDetailsBean: LiveDetailsBean
@Consume contentDetailData: ContentDetailDTO
@Consume liveRoomDataBean: LiveRoomDataBean
@State currentTime: string = ''
@State totalTime: string = ''
... ... @@ -20,12 +20,15 @@ export struct PlayUIComponent {
//是否处于播放状态中
@State isPlayStatus: boolean = true
@Consume displayDirection: DisplayDirection
@Prop isShowBottom: boolean
// 播放地址 (视频或者 直播地址)
@Prop liveUrl: string
// 当前播放资源的状态
@Consume playSourceState: number
onChangeMenuVisible() {
if (!this.liveDetailsBean || !this.liveDetailsBean.liveInfo ||
this.liveDetailsBean?.liveInfo?.liveState === 'wait') {
if (!this.contentDetailData || !this.contentDetailData.liveInfo ||
this.contentDetailData?.liveInfo?.liveState === 'wait') {
return
}
let time: number = 0
... ... @@ -40,6 +43,21 @@ export struct PlayUIComponent {
aboutToAppear(): void {
this.onChangeMenuVisible()
this.initPlayerSet()
}
aboutToDisappear(): void {
if (this.contentDetailData.liveInfo?.liveState == 'running') {
lottie.destroy('live_status_wait')
}
}
/*
初始话播放器设置
*/
initPlayerSet(){
//播放进度监听
if (this.playerController) {
this.playerController.onTimeUpdate = (position: number, duration: number) => {
... ... @@ -48,20 +66,15 @@ export struct PlayUIComponent {
this.progressVal = Math.floor(position * 100 / duration);
}
}
}
aboutToDisappear(): void {
if (this.liveDetailsBean.liveInfo?.liveState == 'running') {
lottie.destroy('live_status_wait')
}
}
build() {
Column() {
if (this.liveDetailsBean && this.liveDetailsBean.liveInfo) {
if (this.contentDetailData && this.contentDetailData.liveInfo) {
this.getTopUIComponent()
this.getMiddleUIComponent()
if(this.isShowBottom){
if (this.isShowBottom) {
this.getBottomUIComponent()
}
... ... @@ -92,8 +105,8 @@ export struct PlayUIComponent {
// window.Orientation.PORTRAIT :
// window.Orientation.LANDSCAPE);
})
if (this.liveDetailsBean.liveInfo?.liveState != 'wait') {
Text(this.liveDetailsBean.newsTitle)
if (this.contentDetailData.liveInfo?.liveState != 'wait') {
Text(this.contentDetailData.newsTitle)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.MARQUEE })
.fontSize(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '18vp' : '16vp')
... ... @@ -116,9 +129,9 @@ export struct PlayUIComponent {
})
Row() {
if (this.liveDetailsBean?.rmhInfo) {
if (this.contentDetailData?.rmhInfo) {
LiveFollowComponent({
rmhInfo: this.liveDetailsBean.rmhInfo
rmhInfo: this.contentDetailData.rmhInfo
})
.margin({
right: 10
... ... @@ -144,7 +157,7 @@ export struct PlayUIComponent {
getLiveStatusView() {
// 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
// 预约
if (this.liveDetailsBean.liveInfo?.liveState == 'wait') {
if (this.contentDetailData.liveInfo?.liveState == 'wait') {
Row() {
Image($r('app.media.icon_live_status_wait'))
... ... @@ -163,7 +176,7 @@ export struct PlayUIComponent {
})
}
// 直播中
else if (this.liveDetailsBean.liveInfo?.liveState == 'running') {
else if (this.contentDetailData.liveInfo?.liveState == 'running') {
Row() {
Stack() {
Image($r('app.media.icon_live_status_running_back'))
... ... @@ -204,7 +217,7 @@ export struct PlayUIComponent {
})
}
//回看
else if (this.liveDetailsBean.liveInfo?.liveState == 'end') {
else if (this.contentDetailData.liveInfo?.liveState == 'end') {
Row() {
Text('回看')
.fontSize('11vp')
... ... @@ -240,7 +253,7 @@ export struct PlayUIComponent {
.layoutWeight(1)
.width('100%')
.onClick(() => {
if (this.liveDetailsBean?.liveInfo?.liveState === 'wait') {
if (this.contentDetailData?.liveInfo?.liveState === 'wait') {
return
}
this.isMenuVisible = !this.isMenuVisible
... ... @@ -250,16 +263,13 @@ export struct PlayUIComponent {
@Builder
getBottomUIComponent() {
Row() {
if (this.liveDetailsBean?.liveInfo?.liveState == 'wait') {
Blank()
} else if (this.liveDetailsBean?.liveInfo?.liveState == 'running') {
this.playOrPauseBtn()
Blank()
} else if (this.liveDetailsBean?.liveInfo?.liveState == 'end') {
if (StringUtils.isEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri)) {
Blank()
} else {
// 视频资源
if (!StringUtils.isEmpty(this.liveUrl)) {
// 暂定和播放按钮
this.playOrPauseBtn()
// 开始时间
if (this.contentDetailData?.liveInfo?.liveState != 'running' || this.contentDetailData.showTime) {
Text(this.currentTime)
.fontColor(Color.White)
.fontWeight(600)
... ... @@ -267,7 +277,12 @@ export struct PlayUIComponent {
.margin({
left: 16
})
}
// 进度条
this.playProgressView()
// 总的播放时间
if (this.contentDetailData?.liveInfo?.liveState != 'running' || this.contentDetailData.showTime) {
Text(this.totalTime)
.fontColor(Color.White)
.fontWeight(600)
... ... @@ -276,11 +291,13 @@ export struct PlayUIComponent {
right: 16
})
}
} else {
Blank()
}
if (this.liveDetailsBean?.liveInfo?.liveState == 'running'
|| (this.liveDetailsBean?.liveInfo?.liveState == 'end' &&
StringUtils.isNotEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri))
) {
// 全屏按钮
if (!StringUtils.isEmpty(this.liveUrl)) {
Image($r('app.media.icon_live_player_full_screen'))
.width(24)
.height(24)
... ... @@ -297,6 +314,7 @@ export struct PlayUIComponent {
})
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}
}
.alignItems(VerticalAlign.Center)
.linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] })
... ... @@ -312,6 +330,19 @@ export struct PlayUIComponent {
@Builder
playOrPauseBtn() {
if (this.playSourceState === PlayerConstants.STATUS_COMPLETION) {
//资源播放完成
Image($r('app.media.player_play_ic'))
.width(24)
.height(24)
.onClick(() => {
this.isPlayStatus = true
this.initPlayerSet()
this.playerController?.firstPlay(this.liveUrl)
this.playerController?.play()
})
} else {
//暂停、播放
Image(this.isPlayStatus ? $r('app.media.icon_live_player_pause') : $r('app.media.player_play_ic'))
.width(24)
... ... @@ -327,6 +358,8 @@ export struct PlayUIComponent {
})
}
}
@Builder
playProgressView() {
Slider({
... ...
import { LiveDetailsBean } from 'wdBean/Index';
import { ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index';
import { Logger, StringUtils } from 'wdKit/Index';
import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
import { PlayUIComponent } from './PlayUIComponent';
... ... @@ -6,12 +6,16 @@ import { PictureLoading } from '../../vertical/PictureLoading';
const TAG: string = 'TopPlayComponent'
/**
* 非沉浸式直播 --- 顶部播放器组件
*/
@Component
export struct TopPlayComponent {
@Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
@Consume @Watch('updateData') contentDetailData: ContentDetailDTO
playerController?: WDAliPlayerController
@State imgUrl: string = ''
// 预告片图片/视频url
@State previewUrl: string = ''
@State isVideoSource: boolean = false
//未开始
@State isWait: boolean = false
//已结束直播
... ... @@ -22,14 +26,15 @@ export struct TopPlayComponent {
@State isLoading: boolean = false
// 获取播放资源能播放了
@State isCanPlay: boolean = false
// 当前播放资源的状态
@Provide playSourceState: number = 0
private playUrl: string = ""
private xComponentIsLoaded: boolean = false
aboutToAppear(): void {
if (this.playerController) {
this.playerController.onCanplay = () => {
Logger.debug(TAG, 'onCanplay==>')
this.isCanPlay = true
this.isLoading = true
this.playerController?.play()
... ... @@ -38,51 +43,78 @@ export struct TopPlayComponent {
this.playerController.onStatusChange = (status: number) => {
this.playSourceState = status
Logger.debug(TAG, 'status==>' + status)
if (status === PlayerConstants.STATUS_ERROR) {
this.isError = true
this.isLoading = true
this.isCanPlay = false
} else if (status === PlayerConstants.STATUS_COMPLETION) {
// 播放完成
} else {
this.isError = false
}
}
}
this.updateData()
}
updateData() {
// 检测等待中的直播预告是否视频资源
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1
&& this.contentDetailData.liveInfo.previewUrl &&
this.contentDetailData.liveInfo.previewUrl.length > 0) {
// 预告资源是视频
this.isVideoSource = true
this.contentDetailData.showTime = true
}
//直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.previewUrl &&
this.liveDetailsBean.liveInfo.previewUrl.length > 0) {
this.imgUrl = this.liveDetailsBean.liveInfo.previewUrl
Logger.debug(TAG, 'ok+' + `${this.imgUrl}`)
} else if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
Logger.debug(TAG, 'ok-' + `${this.imgUrl}`)
}
this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait'
if(this.isWait ){
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl &&
this.contentDetailData.liveInfo.previewUrl.length > 0) {
this.previewUrl = this.contentDetailData.liveInfo.previewUrl
} else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
this.previewUrl = this.contentDetailData.fullColumnImgUrls[0].url
}
Logger.debug(TAG, 'ok+' + `${this.previewUrl}`)
if (this.isVideoSource) {
this.isWait = false
this.isLoading = false
} else {
this.isWait = this.contentDetailData?.liveInfo?.liveState == 'wait'
if (this.isWait) {
this.isLoading = true
}
this.isEnd = this.liveDetailsBean?.liveInfo?.liveState === 'end' &&
StringUtils.isEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri)
if (!this.isWait && this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) {
}
this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' &&
StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri)
if (!this.isWait && this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) {
let playUrl = ''
if (this.liveDetailsBean.liveInfo.liveState == 'running') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl
} else if (this.liveDetailsBean.liveInfo.liveState == 'end') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
if (this.contentDetailData.liveInfo.liveState == 'running') {
playUrl = this.contentDetailData.liveInfo.vlive[0].liveUrl
} else if (this.contentDetailData.liveInfo.liveState == 'end') {
playUrl = this.contentDetailData.liveInfo.vlive[0].replayUri
}
// this.playerController?.firstPlay('https://rmrbcmsonline.peopleapp.com/upload/rmh/video/mp4/202404/1713752415708fb81d0b8f137b.mp4');
if (this.isVideoSource) {
this.playUrl = this.previewUrl
this.tryToPlay()
} else {
if (StringUtils.isNotEmpty(playUrl)) {
Logger.debug(TAG, `${playUrl}`)
this.playUrl = playUrl
this.tryToPlay()
}
}
}
}
tryToPlay() {
... ... @@ -113,18 +145,22 @@ export struct TopPlayComponent {
.width('100%')
.visibility(this.isWait ? Visibility.None : Visibility.Visible)
if (this.isVideoSource) {
} else {
// 直播房间图
Image(this.imgUrl)
Image(this.previewUrl)
.objectFit(ImageFit.Cover)
.visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None)
.contrast(this.isEnd ? 0.2 : 1)
.width('100%')
}
// loading
PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible)
// 视频播放器上的控制面板和信息
PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay })
PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay, liveUrl: this.playUrl })
// 直播结束
Text('直播已结束')
... ...
import { LiveDetailsBean } from 'wdBean/Index'
import { ContentDetailDTO } from 'wdBean/Index'
@Component
export struct ChartItemCompereComponent {
@Consume liveDetailsBean: LiveDetailsBean
// @Consume liveDetailsBean: LiveDetailsBean
@Consume contentDetailData: ContentDetailDTO
aboutToAppear(): void {
}
... ... @@ -32,7 +32,7 @@ export struct ChartItemCompereComponent {
.margin({ bottom: 8 })
.justifyContent(FlexAlign.Start)
Text(this.liveDetailsBean.newIntroduction).lineHeight(22).fontColor('#FFFFFFFF').fontSize(14)
Text(this.contentDetailData.newIntroduction).lineHeight(22).fontColor('#FFFFFFFF').fontSize(14)
}
.backgroundColor('#4D000000')
.borderRadius(3)
... ...
... ... @@ -17,12 +17,11 @@ const TAG = "PlayerCommentComponent"
@Component
export struct PlayerCommentComponent {
liveViewModel: LiveViewModel = new LiveViewModel()
@Consume @Watch('liveDetailsBeanChange') liveDetailsBean: LiveDetailsBean
@Consume liveRoomDataBean: LiveRoomDataBean
@Consume displayDirection: DisplayDirection
@State private pageModel: PageModel = new PageModel()
@State liveChatList: Array<LiveRoomItemBean> = []
@Consume contentDetailData: ContentDetailDTO
@Consume @Watch('liveDetailsBeanChange') contentDetailData: ContentDetailDTO
@Consume publishCommentModel: publishCommentModel
scroller: Scroller = new Scroller()
... ... @@ -65,8 +64,8 @@ export struct PlayerCommentComponent {
this.pageModel.currentPage = 1
this.liveViewModel.getLiveChatList(
1,
this.liveDetailsBean?.liveInfo?.mlive?.mliveId,
this.liveDetailsBean?.newsId,
this.contentDetailData?.liveInfo?.mlive?.mliveId,
this.contentDetailData?.newsId+'',
20,)
.then(
(data) => {
... ... @@ -98,7 +97,7 @@ export struct PlayerCommentComponent {
Column() {
List({ scroller: this.scroller }) {
// 主持人
if (this.liveDetailsBean.oldNewsId) {
if (this.contentDetailData.oldNewsId) {
ChartItemCompereComponent()
}
ForEach(this.liveChatList, (item: LiveRoomItemBean) => {
... ...
import { LiveDetailsBean } from 'wdBean/Index';
import { WDPlayerController, WDPlayerRenderVLiveView, WDPlayerRenderView, WDAliPlayerController,
AliPlayerRenderView } from 'wdPlayer/Index';
import { ContentDetailDTO } from 'wdBean/Index';
import { AliPlayerRenderView, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index';
import { PictureLoading } from './PictureLoading';
const TAG = 'PlayerComponent'
... ... @@ -8,7 +7,7 @@ const TAG = 'PlayerComponent'
@Component
export struct PlayerComponent {
@Prop playerController: WDAliPlayerController;
@Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean
@Consume @Watch('updateData') contentDetailData: ContentDetailDTO
@Consume @Watch('pageShowChange') pageShow: number
@Consume @Watch('pageHideChange') pageHide: number
@Consume isShowControl: boolean
... ... @@ -21,7 +20,6 @@ export struct PlayerComponent {
@State playUrl: string = ''
@State isCanplay: boolean = false
pageShowChange() {
this.playerController?.play()
}
... ... @@ -42,19 +40,19 @@ export struct PlayerComponent {
updateData() {
//直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
this.imgUrl = this.contentDetailData.fullColumnImgUrls[0].url
}
this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait'
if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) {
this.isWait = this.contentDetailData?.liveInfo?.liveState == 'wait'
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) {
let playUrl = ''
let liveStreamType: number | null = null
if (this.liveDetailsBean.liveInfo.liveState == 'running') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl
liveStreamType = this.liveDetailsBean.liveInfo.vlive[0].liveStreamType
} else if (this.liveDetailsBean.liveInfo.liveState == 'end') {
playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
liveStreamType = this.liveDetailsBean.liveInfo.vlive[0].liveStreamType
if (this.contentDetailData.liveInfo.liveState == 'running') {
playUrl = this.contentDetailData.liveInfo.vlive[0].liveUrl
liveStreamType = this.contentDetailData.liveInfo.vlive[0].liveStreamType
} else if (this.contentDetailData.liveInfo.liveState == 'end') {
playUrl = this.contentDetailData.liveInfo.vlive[0].replayUri
liveStreamType = this.contentDetailData.liveInfo.vlive[0].liveStreamType
}
this.liveStreamType = liveStreamType
... ... @@ -79,7 +77,7 @@ export struct PlayerComponent {
playerController: this.playerController,
onLoad: () => {
this.isCanplay = true
console.error('WDAliPlayerController','------1------------')
console.error('WDAliPlayerController', '------1------------')
this.playerController?.firstPlay(this.playUrl);
}
}).margin({ top: 195 }).height(211)
... ... @@ -102,6 +100,4 @@ export struct PlayerComponent {
.height('100%')
.width('100%')
}
}
\ No newline at end of file
... ...
import { LiveDetailsBean, LiveRoomDataBean, postBatchAttentionStatusParams, } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean, postBatchAttentionStatusParams, } from 'wdBean/Index'
import { MultiPictureDetailViewModel } from 'wdComponent/src/main/ets/viewmodel/MultiPictureDetailViewModel'
import { SpConstants } from 'wdConstant/Index'
import { ContentDetailRequest, postInteractAccentionOperateParams } from 'wdDetailPlayApi/Index'
... ... @@ -10,14 +10,15 @@ const TAG = 'PlayerEndView'
@Preview
@Component
export struct PlayerEndView {
@Consume liveDetailsBean: LiveDetailsBean
// @Consume liveDetailsBean: LiveDetailsBean
@Consume contentDetailData: ContentDetailDTO
@Consume liveRoomDataBean: LiveRoomDataBean
@State duration: string = ''
@State followStatus: String = '0';
aboutToAppear(): void {
const sn = DateTimeUtils.parseDate(this.liveDetailsBean.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
const en = DateTimeUtils.parseDate(this.liveDetailsBean.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
const sn = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
const en = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN)
const sd = DateTimeUtils.getDuration(sn, en)
this.duration = DateTimeUtils.secondToTime(sd / 1000)
this.getBatchAttentionStatus()
... ... @@ -29,7 +30,7 @@ export struct PlayerEndView {
async getBatchAttentionStatus() {
try {
const params: postBatchAttentionStatusParams = {
creatorIds: [{ creatorId: this.liveDetailsBean?.rmhInfo?.rmhId ?? '' }]
creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }]
}
let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)
this.followStatus = data[0]?.status;
... ... @@ -51,9 +52,9 @@ export struct PlayerEndView {
}
// TODO:直播间没有携带人民号信息
const params2: postInteractAccentionOperateParams = {
attentionUserType: this.liveDetailsBean?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
attentionUserId: this.liveDetailsBean?.rmhInfo?.userId || '', // 被关注用户号主id
attentionCreatorId: this.liveDetailsBean?.rmhInfo?.rmhId || '', // 被关注用户号主id
attentionUserType: this.contentDetailData?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号)
attentionUserId: this.contentDetailData?.rmhInfo?.userId || '', // 被关注用户号主id
attentionCreatorId: this.contentDetailData?.rmhInfo?.rmhId || '', // 被关注用户号主id
status: this.followStatus == '0' ? 1 : 0,
}
... ... @@ -79,12 +80,12 @@ export struct PlayerEndView {
Stack() {
Column() {
Text(this.liveDetailsBean?.rmhInfo?.rmhName)
Text(this.contentDetailData?.rmhInfo?.rmhName)
.fontWeight(400)
.fontSize(18)
.fontColor(Color.White)
.padding({ top: 52 })
Text(this.liveDetailsBean?.rmhInfo?.rmhDesc || '')
Text(this.contentDetailData?.rmhInfo?.rmhDesc || '')
.fontWeight(400)
.fontSize(13)
.fontColor('#B2FFFFFF')
... ... @@ -127,7 +128,7 @@ export struct PlayerEndView {
.backgroundColor('#999999')
.borderRadius(4)
Image(this.liveDetailsBean?.fullColumnImgUrls[0]?.url)
Image(this.contentDetailData?.fullColumnImgUrls[0]?.url)
.width(80)
.height(80)
.borderRadius(40)
... ...
import lottie from '@ohos/lottie'
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { LiveFollowComponent, LottieView } from 'wdComponent/Index'
import { NumberFormatterUtils } from 'wdKit/Index'
@Preview
@Component
export struct PlayerTitleComponent {
@Consume liveDetailsBean: LiveDetailsBean
// @Consume liveDetailsBean: LiveDetailsBean
@Consume liveRoomDataBean: LiveRoomDataBean
@Consume liveState: string
@Consume contentDetailData: ContentDetailDTO
aboutToDisappear(): void {
if (this.liveDetailsBean.liveInfo?.liveState == 'running') {
if (this.contentDetailData.liveInfo?.liveState == 'running') {
lottie.destroy('live_status_wait')
}
}
... ... @@ -19,7 +19,7 @@ export struct PlayerTitleComponent {
build() {
Column() {
Row() {
Text(this.liveDetailsBean.newsTitle || '')
Text(this.contentDetailData.newsTitle || '')
.maxLines(2)
.fontSize(16)
.fontWeight(500)
... ... @@ -42,9 +42,9 @@ export struct PlayerTitleComponent {
@Builder
getLiveStatusView() {
if (this.liveDetailsBean.rmhInfo?.rmhName) {
if (this.contentDetailData.rmhInfo?.rmhName) {
LiveFollowComponent({
rmhInfo: this.liveDetailsBean.rmhInfo
rmhInfo: this.contentDetailData.rmhInfo
}).margin({
right: 10
})
... ...
import { window } from '@kit.ArkUI'
import { NumberFormatterUtils, WindowModel } from 'wdKit/Index'
import { devicePLSensorManager } from 'wdDetailPlayApi/Index'
import { DateFormatUtil, WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'
import { DateFormatUtil, WDAliPlayerController } from 'wdPlayer/Index'
import { LiveRoomDataBean } from 'wdBean/Index'
@Component
export struct PlayerVideoControlComponent {
private playerController?: WDAliPlayerController
@Consume liveDetailsBean: LiveDetailsBean
@Consume liveRoomDataBean: LiveRoomDataBean
@State currentTime: string = ''
@State totalTime: string = ''
... ...
... ... @@ -182,7 +182,7 @@ export struct DetailPlayShortVideoPage {
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
// publishCommentModel: $publishCommentModel
publishCommentModel: $publishCommentModel
})
this.playerViewBuilder()
... ...
import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index'
import { CommentListDialogView } from 'wdComponent/Index'
import { CommentListDialogView, publishCommentModel } from 'wdComponent/Index'
@Component
export struct CommentDialogView {
@Link @Watch('showCommentListChange') showCommentList: boolean
@Link index: number
@Link currentIndex: number
@Link publishCommentModel: publishCommentModel
@Consume contentDetailData: ContentDetailDTO
@State fakePageInfo: PageInfoDTO = {} as PageInfoDTO
@State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
... ... @@ -29,6 +30,7 @@ export struct CommentDialogView {
CommentListDialogView({
showCommentList: this.innerShowComment,
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
pageInfo: this.fakePageInfo,
onClose: () => {
this.showCommentList = false
... ...
... ... @@ -50,8 +50,6 @@ export struct WDPlayerRenderLiveView {
aboutToAppear() {
MGPlayRenderViewIns.add();
console.log('playerController', this.playerController)
insIndex++;
if (!this.playerController) {
return
... ... @@ -59,7 +57,6 @@ export struct WDPlayerRenderLiveView {
this.playerController.onVideoSizeChange = (width: number, height: number) => {
// console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`)
Logger.info(TAG, ` onVideoSizeChange width:${width} videoTop:${height}`)
this.videoWidth = width;
this.videoHeight = height;
this.updateLayout()
... ... @@ -83,8 +80,6 @@ export struct WDPlayerRenderLiveView {
.onLoad(async (event) => {
Logger.info(TAG, 'onLoad')
let surfaceId = this.xComponentController.getXComponentSurfaceId()
console.log('surfaceId===', surfaceId)
console.log('insId===', this.insId)
this.xComponentController.setXComponentSurfaceSize({
surfaceWidth: 1920,
surfaceHeight: 720
... ...
import { ContentDetailDTO, ContentDTO, PageInfoDTO } from 'wdBean/Index';
import { ContentDetailDTO, ContentDTO, PageInfoDTO, ShareInfoDTO, TopicInfo } from 'wdBean/Index';
import { SharePosterItemBean } from 'wdBean/src/main/ets/bean/detail/SharePosterItemBean';
import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index';
import { ShareContentType } from 'wdShareBase/src/main/ets/Constant';
... ... @@ -29,4 +30,58 @@ export class WDShare {
}
//专题分享数据转换
static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean: TopicInfo){
shareBean.topicType = topicInfoBean.topicType+''
//21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链
if(25 == topicInfoBean.topicType){
shareBean.showPosterType = 6
shareBean.topicPattern = topicInfoBean.topicPattern
shareBean.publishTime = topicInfoBean.topicDate
if(topicInfoBean.frontLinkObject == null){
shareBean.isFrontDaily = false
if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){
shareBean.sharePosterItemList = [] as SharePosterItemBean[]
shareBean.sharePosterItemList.length = topicInfoBean.shareContentList.length
for (let index = 0; index < topicInfoBean.shareContentList.length; index++) {
let element = topicInfoBean.shareContentList[index]
if(element != null){
shareBean.sharePosterItemList[index] = {
title:topicInfoBean.shareContentList[index].newsTitle,
imageUrl:topicInfoBean.shareContentList[index].coverUrl,
} as SharePosterItemBean
}
}
}
}else{
shareBean.isFrontDaily = true
shareBean.sharePosterCoverUrl = topicInfoBean.frontLinkObject.coverUrl
shareBean.posterSummary = topicInfoBean.frontLinkObject.summary
}
}else{
//文章/直播/话题专题(H5普通文章专题,包含时间链)
shareBean.showPosterType = 8
//海报的头图
shareBean.sharePosterCoverUrl = topicInfoBean.backgroundImgUrl
shareBean.isFrontDaily = false
shareBean.posterTitle = topicInfoBean.title
shareBean.posterSummary = topicInfoBean.summary
if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){
shareBean.sharePosterItemList = [] as SharePosterItemBean[]
shareBean.sharePosterItemList.length = topicInfoBean.shareContentList.length
for (let index = 0; index < topicInfoBean.shareContentList.length; index++) {
let element = topicInfoBean.shareContentList[index]
if(element != null){
shareBean.sharePosterItemList[index] = {
title:topicInfoBean.shareContentList[index].newsTitle,
imageUrl:topicInfoBean.shareContentList[index].coverUrl,
timeNode:topicInfoBean.shareContentList[index].publishTime,
timeBlurred:topicInfoBean.shareContentList[index].timeBlurred
} as SharePosterItemBean
}
}
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -17,7 +17,7 @@ export class TrackingUtils {
static fillPositionWith(attr: ParamType) {
let pageName = attr["pageName"] as string
let action = attr["action"] as string
if (action.length > 0) {
if (action != null && action.length > 0) {
attr["saPosition"] = pageName + "_" + action
return
}
... ...
... ... @@ -5,7 +5,7 @@ import window from '@ohos.window';
import { TrackingPageBrowse ,TrackConstants} from 'wdTracking/Index';
const TAG = 'ENewspaper';
//电子报主页面
@Entry
@Component
struct ENewspaper {
... ...
... ... @@ -116,7 +116,7 @@ export struct MultiPictureDetailPageComponent {
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
// publishCommentModel: $publishCommentModel
publishCommentModel: $publishCommentModel
})
}
... ...