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
wangliang_wd
2024-05-27 17:59:19 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
02fd1aecbac804eac70936007f5e7b89e8bcc7f2
02fd1aec
1 parent
f8a716e7
feat:优化早晚报组件UI
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
11 deletions
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/SingleColumn999Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/topicInfoView.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/SingleColumn999Component.ets
View file @
02fd1ae
...
...
@@ -127,18 +127,20 @@ export struct SingleColumn999Component {
ListItem() {
Text("已显示全部内容")
.fontSize(14)
.width("100%")// .height(100)
.height(50)
.padding(9)
.fontColor(Color.White)
.fontSize($r('app.float.font_size_14'))
.fontWeight(400)
.textAlign(TextAlign.Center)
.align(Alignment.
Bottom
)
.align(Alignment.
Top
)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
}
.height("100%") // 必须设置height
//
.height("100%") // 必须设置height
// .margin({ left: 14, right: 14 })
// .listDirection(Axis.Vertical) // 默认值:Axis.Vertical
// .lanes(this.buildLanes()) // 行/列数,一列 // 默认值:1
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/topicInfoView.ets
View file @
02fd1ae
...
...
@@ -34,7 +34,7 @@ export struct topicInfoView {
if (this.frontLinkObject) {
Row() {
Text(
"查看详情"
)
Text(
this.frontLinkObject.linkUrl.length > 0?"查看详情":''
)
.fontSize(14)
.fontColor($r('app.color.white'))
.maxLines(1)
...
...
@@ -50,6 +50,7 @@ export struct topicInfoView {
.margin({ top: 8, left: 16, right: 16, bottom: 16 })
.borderRadius(2)
.onClick(()=>{
if (this.frontLinkObject.linkUrl.length === 0) return
let contentDTO :ContentDTO = new ContentDTO();
contentDTO.objectType = this.frontLinkObject?.newsType.toString()
contentDTO.objectId = this.frontLinkObject?.newsId
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/CardView.ets
View file @
02fd1ae
...
...
@@ -440,6 +440,7 @@ export struct PaperSingleColumn999CardView {
.borderRadius(5)
.aspectRatio(319 / 179) ///图片设计比例
.padding({ top: 10 })
//视频
if (this.item?.videoInfo) {
Row() {
Image($r('app.media.card_play'))
...
...
@@ -468,6 +469,64 @@ export struct PaperSingleColumn999CardView {
.width(CommonConstants.FULL_PARENT)
.justifyContent(FlexAlign.End)
}
//直播
if (this.item?.objectType === '2') {
Row() {
Image(this.buildLiveStateImage())
.width(14)
.height(14)
.objectFit(ImageFit.Contain)
Text(this.buildLiveStateString())
.fontColor(Color.White)
.fontSize($r('app.float.vp_12'))
.fontWeight(500)
.textAlign(TextAlign.End)
.lineHeight(18)
.textShadow({
radius: 2,
color: 'rgba(0,0,0,0.3)',
offsetY: 2
})
.margin({
right: 10,
left: 3
})
}
.margin({
bottom: 3
})
.width(CommonConstants.FULL_PARENT)
.justifyContent(FlexAlign.End)
}
//组图
if (this.item?.objectType === '9') {
Row() {
Image($r('app.media.card_image'))
.width(14)
.height(14)
.objectFit(ImageFit.Contain)
Text(this.item?.photoNum.toString())
.fontColor(Color.White)
.fontSize($r('app.float.vp_12'))
.fontWeight(500)
.textAlign(TextAlign.End)
.lineHeight(18)
.textShadow({
radius: 2,
color: 'rgba(0,0,0,0.3)',
offsetY: 2
})
.margin({
right: 10,
left: 3
})
}
.margin({
bottom: 3
})
.width(CommonConstants.FULL_PARENT)
.justifyContent(FlexAlign.End)
}
}.margin({ left: 16, right: 16 })
}
if (this.item?.newsSummary) {
...
...
@@ -483,14 +542,14 @@ export struct PaperSingleColumn999CardView {
if (this.item) {
Row() {
Row() {
if (this.item?.source.length > 0) {
Text(this.item?.source)
if (this.buildSourceString().length > 0) {
Text(this.buildSourceString())
.fontSize(12)
.fontColor('#B0B0B0')
.margin({ left: 16 })
///不显示时间或者不显示评论
if (this.getPublishTime().length > 0 || this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.co
llec
tNum) > 0) {
if (this.getPublishTime().length > 0 || this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.co
mmen
tNum) > 0) {
Image($r('app.media.point'))
.width(16)
.height(16)
...
...
@@ -502,7 +561,7 @@ export struct PaperSingleColumn999CardView {
.fontSize(12)
.fontColor('#B0B0B0')
.margin({ left: this.item?.source.length > 0?0:16 })
if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.co
llec
tNum) > 0) {
if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.co
mmen
tNum) > 0) {
Text(this.interactData.commentNum + "评")
.fontSize(12)
.fontColor('#B0B0B0')
...
...
@@ -555,5 +614,39 @@ export struct PaperSingleColumn999CardView {
}
}
buildLiveStateString(): string {
let contentString: string = ''
if (this.item.liveInfo.liveState === 'wait') {
contentString = '预约'
}else if(this.item.liveInfo.liveState === 'running'){
contentString = '直播中'
}else if(this.item.liveInfo.liveState === 'end'){
contentString = '回看'
}
return contentString;
}
buildLiveStateImage(): Resource | string {
let imageString: Resource | string = ''
if (this.item.liveInfo.liveState === 'wait') {
imageString = $r('app.media.card_wait')
}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')
}
return imageString;
}
buildSourceString(): string {
let contentString: string = ''
if (this.item?.rmhInfo?.rmhName.length > 0) {
contentString = this.item?.rmhInfo?.rmhName
}else if(this.item?.source.length > 0){
contentString = this.item?.source
}
return contentString;
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/MyCollectionListPage.ets
View file @
02fd1ae
...
...
@@ -40,12 +40,13 @@ struct MyCollectionListPage {
TrackingButton.click('morning_evening_news_click',TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect)
}
},
titleShow:false,
tipValue: this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏'
title:this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏',
tipShow: false ,
leftTextColor:$r('app.color.color_648DF2'),
}),
autoCancel: true,
alignment: DialogAlignment.Center,
customStyle: true
customStyle: true
,
})
aboutToAppear(){
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
02fd1ae
...
...
@@ -627,7 +627,9 @@ export struct TopNavigationComponentNew {
}else {
ToastUtils.showToast('暂无早晚报信息', 1000)
}
}).catch()
}).catch((err:string) =>{
ToastUtils.showToast('暂无早晚报信息', 1000)
})
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
...
...
Please
register
or
login
to post a comment