王士厅
... ... @@ -69,9 +69,9 @@ export class ContentDTO implements BaseDTO {
vImageUrl: string = '';
screenType: string = '';
source: string = '';
objectType: string = '';
objectType: string = '';//0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频
objectId: string = '';
objectLevel: string = '';
objectLevel: string = '';// 对象分类;频道(1:一级频道,2:二级频道),专题(21:文章专题,22:音频专题,23:直播专题,24:话题专题)
channelId: string = '';
relId: string = '';
relType: string = '';
... ...
... ... @@ -122,7 +122,7 @@ export struct Card10Component {
ProcessUtils.processPage(this.contentDTO)
})
if (this.contentDTO.objectType == '5') {
Notes({ objectType: 5 }).margin({ left: 5, bottom: 5 })
Notes({ objectType: 5,objectLevel:this.contentDTO.objectLevel }).margin({ left: 5, bottom: 5 })
}
}.alignContent(Alignment.BottomStart)
... ... @@ -212,7 +212,7 @@ export struct Card10ComponentTimelineItem {
Column() {
Stack() {
if (this.slideItem.objectType == '5') {
Notes({ objectType: 5 })
Notes({ objectType: 5,objectLevel:this.slideItem.objectLevel })
}
Text(this.slideItem.newsTitle)
.fontSize($r('app.float.font_size_17'))
... ... @@ -255,7 +255,7 @@ export struct Card10ComponentTimelineItem {
Column() {
Stack() {
if (this.slideItem.objectType == '5') {
Notes({ objectType: 5 })
Notes({ objectType: 5,objectLevel:this.slideItem.objectLevel })
}
Text(this.slideItem.newsTitle)
.fontSize($r('app.float.font_size_17'))
... ...
... ... @@ -41,7 +41,7 @@ export struct Card11Component {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType, }).height(28).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(28).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(28).align(Alignment.Center)
... ...
... ... @@ -56,7 +56,7 @@ export struct Card20Component {
if (this.contentDTO.newsTitle) {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(29).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(29).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(29).align(Alignment.Center)
... ...
... ... @@ -49,7 +49,7 @@ export struct Card2Component {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(29).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(29).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(29).align(Alignment.Center)
... ...
... ... @@ -39,7 +39,7 @@ export struct Card3Component {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(29).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(29).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(29).align(Alignment.Center)
... ...
... ... @@ -49,7 +49,7 @@ export struct Card4Component {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(19).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(19).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(19).align(Alignment.Center)
... ...
... ... @@ -77,7 +77,7 @@ export struct Card5Component {
Row() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(20).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center)
... ...
... ... @@ -46,7 +46,7 @@ export struct Card6Component {
Column() {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(28).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(28).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(28).align(Alignment.Center)
... ...
... ... @@ -108,7 +108,7 @@ export struct Card9Component {
topRight: $r('app.float.image_border_radius')
})
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center)
Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(20).align(Alignment.Center)
.margin({ left: 5, bottom: 5 })
} else {
if (this.contentDTO.seoTags) {
... ...
... ... @@ -2,12 +2,14 @@
* 表示
* objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,
14动态图文,15动态视频16问政;100人民号,101标签
* objectLevel: 对象分类;频道(1:一级频道,2:二级频道),专题(21:文章专题,22:音频专题,23:直播专题,24:话题专题)
*/
@Preview
@Component
export struct Notes {
@State objectType: number | string = 5
@State objectLevel: number | string = -1
@State newTags: string = ''
@State seoTags: string = ''
build() {
... ... @@ -30,16 +32,19 @@ export struct Notes {
returnTypeTitleFn(): string {
if (this.newTags) {
return this.newTags
} else {
if (this.objectType == 5) {
return '专题'
} else if (this.objectType == 10) {
return 'H5'
} else if (this.objectType == 8) {
return '文章'
}
if (this.objectType == 5) {
if (this.objectLevel == 24) {
return '调查'
}
return '专题'
}
if (this.objectType == 10) {
return 'H5'
}
if (this.objectType == 8) {
return '文章'
}
return ''
}
}
\ No newline at end of file
... ...
... ... @@ -219,7 +219,7 @@ struct CarouselLayout01CardView {
// 文本信息
Stack() {
if(this.item.objectType == '5'){
Notes({ objectType: this.item.objectType })
Notes({ objectType: this.item.objectType,objectLevel:this.item.objectLevel })
} else {
if (this.item.seoTags) {
Notes({ newTags: this.item.seoTags })
... ...
... ... @@ -209,6 +209,10 @@ export struct DetailPlayShortVideoPage {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetTitle = String(this.contentDetailData?.newsTitle || '')
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
///解决初始化竖屏视频时 this.ratio未更新导致显示错误
this.calculatePlayerRect()
}
contentTrackingDict() {
... ...