douaojie

fix: 问题修复

... ... @@ -8,7 +8,7 @@ export struct CardSourceInfo {
@ObjectLink compDTO: CompDTO
build() {
Flex() {
Flex({ alignItems: ItemAlign.Center }) {
if (this.contentDTO.corner) {
Text(this.contentDTO.corner)
.fontSize($r("app.float.font_size_11"))
... ... @@ -28,31 +28,39 @@ export struct CardSourceInfo {
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName && this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) && (this.getContentDtoBean()?.interactData?.commentNum || DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '')) {
if (((this.contentDTO.rmhPlatform === 1 && this.contentDTO.rmhInfo?.rmhName &&
this.contentDTO.rmhInfo?.rmhName != '') || (this.contentDTO.source && this.contentDTO.source != '')) &&
(this.getContentDtoBean()?.interactData?.commentNum ||
DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)) != '')) {
Image($r("app.media.point"))
.width(16)
.height(16)
}
// 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间
if (this.contentDTO.isSearch || this.contentDTO.isCollection ||
!this.contentDTO.isSearch && DateTimeUtils.getCommentTime
(Number
.parseFloat(this
.contentDTO.publishTime))
.indexOf
('-') === -1) {
// if (this.contentDTO.isSearch || this.contentDTO.isCollection ||
// (!this.contentDTO.isSearch &&
// DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)).indexOf('-') === -1)) {
//
// Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
// .fontSize($r("app.float.font_size_11"))
// .fontColor($r("app.color.color_B0B0B0"))
// .flexShrink(0);
// }
if (this.contentDTO.source) {
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.flexShrink(0)
.flexShrink(0);
}
if (this.getContentDtoBean()?.interactData?.commentNum) {
if (this.getContentDtoBean()?.interactData?.commentNum && this.contentDTO.source) {
Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`)
.fontSize($r("app.float.font_size_11"))
.fontColor($r("app.color.color_B0B0B0"))
.flexShrink(0)
.margin({ left: 6 })
.visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None : Visibility.Visible)
.visibility(Number(this.getContentDtoBean()?.interactData?.commentNum) === 0 ? Visibility.None :
Visibility.Visible)
}
}
.width(CommonConstants.FULL_WIDTH)
... ... @@ -67,7 +75,7 @@ export struct CardSourceInfo {
if (this.compDTO == undefined) {
return this.contentDTO
}
if(this.compDTO.operDataList.length == 0){
if (this.compDTO.operDataList.length == 0) {
return this.contentDTO
}
return this.compDTO.operDataList[0]
... ...
... ... @@ -87,12 +87,12 @@ export struct Card5Component {
}
.alignContent(Alignment.Bottom)
.width(CommonConstants.FULL_WIDTH)
// .padding({
// left: $r('app.float.card_comp_pagePadding_lf'),
// right: $r('app.float.card_comp_pagePadding_lf'),
// top: $r('app.float.card_comp_pagePadding_tb'),
// bottom: $r('app.float.card_comp_pagePadding_tb')
// })
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
right: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
this.clicked = true;
ProcessUtils.processPage(this.contentDTO)
... ...
... ... @@ -54,9 +54,9 @@ export struct Card6Component {
// }
Stack() {
if (this.contentDTO.newTags) {
Notes({ newTags: this.contentDTO.newTags })
Notes({ newTags: this.contentDTO.newTags }).height(27).align(Alignment.Center)
} else if (this.contentDTO.objectType == '5') {
Notes({ objectType: this.contentDTO.objectType })
Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center)
}
Text() {
... ... @@ -114,7 +114,7 @@ export struct Card6Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.width(CommonConstants.FULL_WIDTH)
.height(this.contentDTO.appStyle === CompStyle.Card_13 ? 107 : 217)
// .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 107 : 217)
.justifyContent(FlexAlign.SpaceBetween)
}
}
\ No newline at end of file
... ...
... ... @@ -21,8 +21,9 @@ export struct Notes {
bottom: 3
})
.linearGradient({ angle: 90, colors: [['#FFFF2B00', 0.0], ['#FFFE6A00', 1.0]] })
.fontColor(Color.White)
.borderRadius($r('app.float.button_border_radius'))
.fontColor(Color.White)// .borderRadius($r('app.float.button_border_radius'))
.borderRadius(2)
.margin({ top: 1 })
}
}
... ...
... ... @@ -36,7 +36,8 @@ export struct ZhSingleRow04 {
.width(14)
.height(14)
}
.visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None : Visibility.Visible)
.visibility(this.compDTO?.objectType === '0' || this.compDTO?.objectType === '' ? Visibility.None :
Visibility.Visible)
.onClick(() => {
if (this.compDTO?.objectType === '11') {
ProcessUtils.jumpChannelTab(this.compDTO.objectId, this.compDTO.pageId as string, this.compDTO.objectTitle)
... ... @@ -64,9 +65,11 @@ export struct ZhSingleRow04 {
operDataListItem: item
}
)
.margin({right: index === this.compDTO.operDataList.length - 1 ? 26 : 0, left:
.margin({
right: index === this.compDTO.operDataList.length - 1 ? 26 : 0, left:
index === 0 ? $r('app.float.card_comp_pagePadding_lf') : 0,
top: 6})
top: 6
})
.onClick(() => {
ProcessUtils.processPage(item)
})
... ... @@ -106,8 +109,7 @@ struct localCard {
.align(Alignment.TopStart)
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.lineHeight(20)
.margin({bottom: 17})
.lineHeight(25)
.fontWeight(500)
Row() {
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.operDataListItem.publishTime)))
... ... @@ -115,7 +117,7 @@ struct localCard {
.fontColor($r("app.color.color_B0B0B0"))
.margin({ right: 5 })
// 这里需要外部查询评论接口后,写入字段
if(this.operDataListItem.interactData?.commentNum) {
if (this.operDataListItem.interactData?.commentNum) {
Text(`${this.operDataListItem.interactData?.commentNum}评`)
.fontSize(12)
}
... ... @@ -139,7 +141,12 @@ struct localCard {
.border({
radius: 2,
})
.shadow({ radius: 6, color: '#1A000000', offsetX: 3, offsetY: 0 })
.shadow({
radius: 6,
color: '#1A000000',
offsetX: 0,
offsetY: 3
}) // 设置下方阴影
.margin({
right: 10
})
... ...