Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
陈剑华
2024-05-24 16:28:58 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
bc1012d17373260c4f08af7d24d74610ff622d67
bc1012d1
2 parents
049d2945
be7b05e1
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
22 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardMediaInfo.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardMediaInfo.ets
View file @
bc1012d
...
...
@@ -174,6 +174,7 @@ export struct CardMediaInfo {
.mediaLogo()
Text(`${this.contentDTO.photoNum}`)
.mediaTextImgtype()
.fontFamily('BebasNeue')
}
.margin({ left: 80,top: 55})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card2Component.ets
View file @
bc1012d
...
...
@@ -36,18 +36,7 @@ export struct Card2Component {
this.titleInit();
this.loadImg = await onlyWifiLoadImg();
}
calculateTextIndent() {
if (this.contentDTO?.newTags?.length < 5 && this.contentDTO?.newTags?.length > 2) {
return 58;
} else if ((this.contentDTO.newTags?.length !== 0) || (this.contentDTO.seoTags?.length !== 0)) {
// 当newTags或seoTags存在时,应用相同的缩进
return 35;
} else if (this.contentDTO.objectType == '5') {
return 35;
} else {
return 0;
}
}
titleInit() {
if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) {
this.titleMarked = true;
...
...
@@ -63,13 +52,27 @@ export struct Card2Component {
Stack() {
if(this.contentDTO.objectType == '5'){
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
} else {
if (this.contentDTO.seoTags) {
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
} else if (this.contentDTO.newTags) {
}else if(this.contentDTO.objectType == '2'){
if(this.contentDTO.seoTags){
Notes({ newTags: this.contentDTO.seoTags }).height(30).align(Alignment.Center)
}else if(this.contentDTO.newTags){
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}else {
if(this.contentDTO.newTags){
Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center)
}
}
//新闻标题
// if (this.contentDTO.newTags) {
//
// //Notes({ newTags: this.contentDTO.newTags })
// } else if (this.contentDTO.objectType == '5') {
//
// //Notes({ objectType: this.contentDTO.objectType })
// }
Text() {
if (this.titleMarked) {
Span(this.str01)
...
...
@@ -86,7 +89,9 @@ export struct Card2Component {
.lineHeight(27)
.textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
.align(Alignment.Start)
.textIndent(this.calculateTextIndent())
.textIndent( (this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5) ? 58 :
(this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 0 || this.contentDTO.objectType === '5') ? 35 :
0 )
}.alignContent(Alignment.TopStart)
//.textIndent(this.contentDTO.objectType == '5' ? 35 : 0)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
View file @
bc1012d
...
...
@@ -22,7 +22,7 @@ interface ILikeStyleResp {
export struct LikeComponent {
@Consume contentDetailData: ContentDetailDTO
@Prop pageComponentType: number
@State likesStyle: number
= this.contentDetailData.likesStyle
// 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State likesStyle: number
| string = 1
// 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State likeStatus: boolean = false
viewModel: LikeViewModel = new LikeViewModel()
@Prop @Watch('onDataUpdated') data: Record<string, string>
...
...
@@ -41,6 +41,14 @@ export struct LikeComponent {
// this.data['status'] = "1"
aboutToAppear() {
// 2:竖屏直播页 3:图集 4:横屏直播页
if(this.pageComponentType == 2 || this.pageComponentType == 4) {
// 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
this.likesStyle = this.contentDetailData?.liveInfo?.likesStyle
} else {
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
this.likesStyle = this.contentDetailData.likesStyle
}
this.onDataUpdated()
}
...
...
@@ -80,7 +88,7 @@ export struct LikeComponent {
* 将点赞样式转换为icon
*/
transLikeStyle(): ILikeStyleResp {
if (this.likesStyle === 1) {
if (this.likesStyle === 1
|| this.likesStyle === 'love' || this.likesStyle === 'thumb'
) {
return {
url: this.likeStatus ? $r(`app.media.ic_like_check`) :
this.styleType == 1 ?
...
...
@@ -88,12 +96,12 @@ export struct LikeComponent {
$r(`app.media.ic_like_uncheck`),
name: '赞'
}
} else if (this.likesStyle === 2) {
} else if (this.likesStyle === 2
|| this.likesStyle === 'pray'
) {
return {
url: this.likeStatus ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`),
name: '祈祷'
}
} else if (this.likesStyle === 3) {
} else if (this.likesStyle === 3
|| this.likesStyle === 'mourning'
) {
return {
url: this.likeStatus ? $r(`app.media.ic_candle_check`) :
$r(`app.media.ic_candle_uncheck`),
...
...
@@ -143,6 +151,7 @@ export struct LikeComponent {
}
.width(154)
.height(40)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
}
@Builder
...
...
@@ -160,6 +169,7 @@ export struct LikeComponent {
.onClick(() => {
this.clickButtonEvent()
})
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
}
@Builder
...
...
@@ -173,7 +183,10 @@ export struct LikeComponent {
.onClick(() => {
this.clickButtonEvent()
})
}.width(24).height(24)
}
.width(24)
.height(24)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
}
@Builder
...
...
@@ -248,6 +261,7 @@ export struct LikeComponent {
}.width(24).height(24).onClick(() => {
this.clickButtonEvent()
})
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
}
@Builder
...
...
@@ -284,6 +298,7 @@ export struct LikeComponent {
}
.width(36)
.height(42)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
}
...
...
Please
register
or
login
to post a comment