陈剑华

Merge remote-tracking branch 'origin/main'

... ... @@ -29,6 +29,14 @@
"value": "14fp"
},
{
"name": "font_size_14_5",
"value": "14.5fp"
},
{
"name": "font_size_15",
"value": "15fp"
},
{
"name": "font_size_16",
"value": "16fp"
},
... ...
... ... @@ -59,6 +59,7 @@ export class ContentDTO implements BaseDTO {
source: string = '';
objectId: string = '';
objectType: string = '';
objectLevel: string = '';
channelId: string = '';
relId: string = '';
relType: string = '';
... ...
... ... @@ -49,10 +49,15 @@ export struct FeedBackActivity {
Column() {
Text($r('app.string.feedback_opinion_type'))
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Bold)
.fontSize($r('app.float.font_size_14_5'))
.fontWeight(600)
.width('100%')
.margin({ left: 24, top: $r('app.float.vp_14') })
Blank()
.height(0.5)
.width('94%')
.margin({ top: $r('app.float.vp_12') })
.backgroundColor($r('app.color.color_EDEDED'))
GridRow({
columns:3,
}) {
... ... @@ -82,15 +87,15 @@ export struct FeedBackActivity {
}
})
}
.width('94%')
.width('90%')
.margin({top:$r('app.float.vp_16')})
Blank()
.height($r('app.float.margin_5'))
.backgroundColor($r('app.color.color_F5F5F5'))
Text($r('app.string.feedback_opinion_tv'))
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_16'))
.fontWeight(FontWeight.Bold)
.fontSize($r('app.float.font_size_14_5'))
.fontWeight(600)
.width(CommonConstants.FULL_WIDTH)
.margin({ left: 24, top: $r('app.float.vp_12') })
Stack({ alignContent: Alignment.BottomEnd }) {
... ... @@ -191,26 +196,46 @@ export struct FeedBackActivity {
.fontSize($r('app.float.font_size_13_2'))
.width('94%')
.margin({ top: $r('app.float.margin_24') })
Row() {
Blank().width('3%')
Text($r('app.string.feedback_mail'))
.height(CommonConstants.FULL_HEIGHT)
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_14'))
.fontWeight(FontWeight.Bold)
.fontSize($r('app.float.font_size_13_2'))
.fontWeight(600)
.padding({left: $r('app.float.margin_12') })
.backgroundColor($r('app.color.color_F5F5F5'))
.borderRadius({
topLeft: 4,
topRight: 0,
bottomLeft: 4,
bottomRight: 0,
})
TextInput({ placeholder: $r('app.string.feedback_hideemail') })
.width(CommonConstants.FULL_WIDTH)
.width(0)
.layoutWeight(1)
.height(CommonConstants.FULL_HEIGHT)
// .margin({left:15})
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.font_size_13_2'))
.placeholderColor($r('app.color.color_CCCCCC'))
.placeholderFont({size:$r('app.float.font_size_13_2')})
.backgroundColor($r('app.color.color_F5F5F5'))
.borderRadius({
topLeft: 0,
topRight: 4,
bottomLeft: 0,
bottomRight: 4,
})
.onChange((value) => {
// Logger.debug(TAG, "onChange" + value + "/" + this.passwordContent)
this.email = value
})
Blank().width('3%')
}
.height(44)
.width('94%')
.backgroundColor($r('app.color.color_F5F5F5'))
.margin({top: $r('app.float.margin_16') })
.borderRadius(4)
.height(42)
.width(CommonConstants.FULL_WIDTH)
.margin({top: $r('app.float.margin_16')})
Blank().layoutWeight(1)
}
}
... ... @@ -222,8 +247,8 @@ export struct FeedBackActivity {
Column(){
Text($r('app.string.submit'))
.textAlign(TextAlign.Center)
.height(44)
.width('90%')
.height(42)
.width('94%')
.fontColor(this.canSubmit ? $r('app.color.color_fff') : $r('app.color.color_FFFFFF_40'))
.fontSize($r('app.float.font_size_18'))
.backgroundColor(this.canSubmit ? $r('app.color.color_ED2800') : $r('app.color.color_ED2800_99'))
... ...
... ... @@ -169,8 +169,8 @@ export struct SingleColumn999Component {
*/
@Builder
buildPaperItem(item: ContentDTO, index: number) {
///屏蔽早晚报 音频
if (item.objectType != '13'){
///屏蔽早晚报 音频 和 音频专题
if (item.objectType != '13'&&!(item.objectType == '5' && item.objectLevel === '22')){
PaperSingleColumn999CardView({
item: item,
index: index,
... ...
... ... @@ -438,7 +438,8 @@ export struct PaperSingleColumn999CardView {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.item?.coverUrl)
.borderRadius(5)
.aspectRatio(319 / 179) ///图片设计比例
.objectFit(ImageFit.Fill)
.aspectRatio(16 / 10) ///图片设计比例
.padding({ top: 10 })
//视频
if (this.item?.videoInfo) {
... ... @@ -629,7 +630,11 @@ export struct PaperSingleColumn999CardView {
}else if(this.item.liveInfo.liveState === 'running'){
contentString = '直播中'
}else if(this.item.liveInfo.liveState === 'end'){
contentString = '回看'
if (this.item.liveInfo.replayUri.length > 0) {
contentString = '回看'
}else {
contentString = '已结束'
}
}
return contentString;
}
... ... @@ -643,7 +648,10 @@ export struct PaperSingleColumn999CardView {
}else if(this.item.liveInfo.liveState === 'running'){
imageString = $r('app.media.card_live')
}else if(this.item.liveInfo.liveState === 'end'){
imageString = $r('app.media.card_play')
if (this.item.liveInfo.replayUri.length > 0) {
imageString = $r('app.media.card_play')
}else {
}
}
return imageString;
}
... ...
... ... @@ -28,10 +28,10 @@ export struct CustomTitleUI {
Text(this.titleName)
.maxLines(1)
.id("title")
.fontSize('35lpx')
.fontSize('30lpx')
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.lineHeight('42lpx')
.lineHeight('43lpx')
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
middle: {anchor: "__container__", align: HorizontalAlign.Center}
... ...
... ... @@ -29,6 +29,14 @@
"value": "14fp"
},
{
"name": "font_size_14_5",
"value": "14.5fp"
},
{
"name": "font_size_15",
"value": "15fp"
},
{
"name": "font_size_16",
"value": "16fp"
},
... ...
... ... @@ -68,19 +68,35 @@ export struct DetailPlayLiveCommon {
*/
getContentDetail() {
this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType)
.then((data: Array<ContentDetailDTO>) => {
.then(async (data: Array<ContentDetailDTO>) => {
console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data))
if (data) {
let detailData = data[0]
//人民号类型单独获取直播地址
if (detailData.rmhPlatform === 1) {
let vliveId = detailData.liveInfo.vlive[0].vliveId as string
console.error(TAG, 'vliveId==' + vliveId)
let pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean
if (pullStreamAddressData) {
console.log(TAG, ' GetPullAddressBean:', JSON.stringify(pullStreamAddressData))
let m3u8uUrl = pullStreamAddressData.transCode[0].m3u8Url
detailData.liveInfo.vlive[0].liveUrl = m3u8uUrl
this.playUrl = m3u8uUrl
console.log(TAG, ' GetPullAddressBean:', m3u8uUrl)
}
}
this.liveLandscape =
detailData?.liveInfo?.liveLandScape //String(this.contentDetailData?.liveInfo?.liveLandScape || '')
detailData?.liveInfo?.liveLandScape
this.liveState = detailData.liveInfo?.liveState
this.contentDetailData = data[0]
console.log(TAG, '查询视频详情用于评论展示 openComment:', detailData.openComment)
this.publishCommentModel.targetId = String(detailData?.newsId || '')
this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = detailData?.newsTitle
... ... @@ -100,18 +116,6 @@ export struct DetailPlayLiveCommon {
this.playUrl = detailData.liveInfo.vlive[0].replayUri
}
//人民号类型单独获取直播地址
if (detailData.rmhPlatform === 1) {
let vliveId = detailData.liveInfo.vlive[0].vliveId as string
console.error(TAG, 'vliveId==' + vliveId)
this.liveViewModel.getLiveRoomPullAddress(vliveId)
.then((data: GetPullAddressBean) => {
console.log(TAG, ' GetPullAddressBean:', JSON.stringify(data))
})
}
}
})
... ...
... ... @@ -30,14 +30,7 @@ export class LiveViewModel {
}
getLiveRoomPullAddress(vliveId:string){
// return new Promise<GetPullAddressBean>((success, fail) => {
// this.liveModel.getContentDetail(contentId, relId, relType).then((data) => {
// success(data)
// }).catch((message: string) => {
// fail(message)
// })
// })
async getLiveRoomPullAddress(vliveId:string) : Promise<GetPullAddressBean>{
return new Promise<GetPullAddressBean>((success, fail) => {
ContentDetailRequest.getLiveRoomPullStream(vliveId).then(async (resDTO: ResponseDTO<GetPullAddressBean>) => {
... ...
... ... @@ -15,6 +15,7 @@ export struct TopPlayComponent {
playerController?: WDAliPlayerController
// 预告片图片/视频url
@State previewUrl: string = ''
// 预告资源是否是视频资源
@State isVideoSource: boolean = false
//未开始
@State isWait: boolean = false
... ... @@ -61,6 +62,9 @@ export struct TopPlayComponent {
this.updateData()
}
/**
* 更新直播播放数据
*/
updateData() {
// 检测等待中的直播预告是否视频资源
if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1
... ... @@ -91,8 +95,11 @@ export struct TopPlayComponent {
}
}
this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' &&
StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri)
Logger.debug(TAG, `---0------>` + this.isWait + ' ->' + this.isLoading + ' ->' + this.isEnd)
if (!this.isWait && this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) {
let playUrl = ''
if (this.contentDetailData.liveInfo.liveState == 'running') {
... ... @@ -105,17 +112,29 @@ export struct TopPlayComponent {
this.playUrl = this.previewUrl
this.tryToPlay()
} else {
Logger.debug(TAG, `---0------>${playUrl}`)
if (StringUtils.isNotEmpty(playUrl)) {
Logger.debug(TAG, `${playUrl}`)
this.playUrl = playUrl
this.tryToPlay()
}
}
}
// 文字直播 running 状态
if (this.contentDetailData?.liveInfo?.liveWay === 1 && this.contentDetailData?.liveInfo?.liveState === 'running') {
this.isWait = true
this.isLoading = true
if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) {
this.previewUrl = this.contentDetailData.fullColumnImgUrls[0].url
} else {
this.previewUrl = ''
}
}
}
tryToPlay() {
Logger.debug(TAG, `---1------>`)
if (!this.xComponentIsLoaded) {
Logger.debug(TAG, "需要xComponent加载完成")
return
... ... @@ -136,6 +155,7 @@ export struct TopPlayComponent {
this.isLoading = false
this.isError = false
this.xComponentIsLoaded = true
Logger.debug(TAG, `---onLoad------>`)
this.tryToPlay()
}
})
... ... @@ -149,6 +169,7 @@ export struct TopPlayComponent {
// 直播房间图
Image(this.previewUrl)
.objectFit(ImageFit.Cover)
.alt($r('app.media.live_room_image_fail'))
.visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None)
.contrast(this.isEnd ? 0.2 : 1)
.width('100%')
... ...
... ... @@ -16,6 +16,7 @@ export struct PlayerComponent {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State imgUrl: string = ''
@State isWait: boolean = false
// 0-横屏流画面,1-竖屏幕流画面
@State liveStreamType: number | null = -1
@State playUrl: string = ''
@State isCanplay: boolean = false
... ...
... ... @@ -95,6 +95,22 @@ struct LaunchAdvertisingPage {
.width('100%')
.height('100%')
if (this.defaultModel.isAd === '1'){
Stack({alignContent:Alignment.TopStart}){
Text('广告')
.fontColor(Color.White)
.textAlign(TextAlign.Center)
.fontSize('24lpx')
.width('72lpx')
.height('36lpx')
.borderRadius(5)
.margin({top:'10lpx',left:'19lpx'})
.backgroundColor('#80000000')
}
.width('100%')
.height('100%')
}
if(this.defaultModel.screenType != '2'){
//底部logo样式 按钮加载在背景展示图上
Button(){
... ...