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
wangyong_wd
2024-04-22 09:57:08 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4e991cc57e98d14681aca496f52abddf98996e33
4e991cc5
1 parent
af3e02d4
style:本地精选卡样式优化
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
56 deletions
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/AttentionListComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow04.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/local_content_icon.png
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
View file @
4e991cc
import { CompDTO } from 'wdBean';
import { CommonConstants, CompStyle } from 'wdConstant';
import { BannerComponent } from './view/BannerComponent';
import { LabelComponent } from './view/LabelComponent';
import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent';
import {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/AttentionListComponent.ets
View file @
4e991cc
...
...
@@ -71,6 +71,7 @@ export struct AttentionListComponent {
})
}
.listDirection(Axis.Horizontal)
.scrollBar(BarState.Off)
.height(74)
}
.padding({
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
View file @
4e991cc
import { ContentDTO, FullColumnImgUrlDTO } from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { ProcessUtils } from '../../utils/ProcessUtils';
import { CommonConstants } from 'wdConstant/Index';
const TAG = 'Card19Component';
/**
...
...
@@ -83,9 +85,16 @@ export struct Card19Component {
.fontColor($r('app.color.color_222222'))
.textOverflowStyle(2)
.margin({ bottom: 8 })
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
}
// 图片-从无图到9图展示
createImg({ fullColumnImgUrls: this.contentDTO.fullColumnImgUrls })
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
...
...
@@ -94,9 +103,6 @@ export struct Card19Component {
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhSingleRow04.ets
View file @
4e991cc
import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { DateTimeUtils } from 'wdKit';
import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { DateTimeUtils } from 'wdKit';
import { ProcessUtils } from '../../utils/ProcessUtils';
/**
...
...
@@ -12,12 +12,10 @@ import { ProcessUtils } from '../../utils/ProcessUtils';
export struct ZhSingleRow04 {
@State compDTO: CompDTO = {} as CompDTO
aboutToAppear() {}
build() {
Column(){
Column()
{
//顶部
Row(){
Row()
{
Row() {
Image($r("app.media.local_selection"))
.width(24)
...
...
@@ -28,6 +26,7 @@ export struct ZhSingleRow04 {
.fontColor($r("app.color.color_222222"))
.fontWeight(600)
}
Row() {
Text("更多")
.fontSize($r("app.float.font_size_14"))
...
...
@@ -41,64 +40,93 @@ export struct ZhSingleRow04 {
.justifyContent(FlexAlign.SpaceBetween)
.margin({ top: 8, bottom: 8 })
.width('100%')
// 列表内容
List({ space: 12 }) {
ForEach(this.compDTO.operDataList, (item: ContentDTO) => {
ForEach(this.compDTO.operDataList, (item: ContentDTO
, index: number
) => {
ListItem() {
Row(){
if(item.coverUrl) {
Image(item.coverUrl)
.width(84)
.height(56)
.borderRadius(3)
.objectFit(ImageFit.Cover)
.padding({right: 6})
}
Column(){
Text(item.newsTitle)
.fontSize($r("app.float.font_size_16"))
.fontColor($r("app.color.color_212228"))
.fontWeight(400)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.margin({ top: 8 })
Row(){
Text(item.source)
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_B0B0B0'))
.textOverflow({overflow: TextOverflow.Ellipsis})
.maxLines(1)
.width(item.source.length > 10 ? '60%' : '')
Image($r("app.media.point"))
.width(16)
.height(16)
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.compDTO.operDataList[0].publishTime)))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
}
.width('100%')
localCard(
{
operDataListItem: item
}
.width(200)
}
// .margin({right: 18})
.onClick(() =>{
ProcessUtils.processPage(item)
})
)
.margin({right: index === this.compDTO.operDataList.length - 1 ? $r('app.float.card_comp_pagePadding_lf') : 0})
.onClick(() => {
ProcessUtils.processPage(item)
})
}
})
}
.listDirection(Axis.Horizontal)
.width('100%')
.scrollBar(BarState.Off)
.width(CommonConstants.FULL_PARENT)
}
.width(CommonConstants.FULL_WIDTH)
.padding({
top: 14,
left: 16,
right: 16,
bottom: 14
left: $r('app.float.card_comp_pagePadding_lf'),
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
}
}
@Component
struct localCard {
@Prop operDataListItem: ContentDTO
build() {
Flex({ direction: FlexDirection.Column }) {
Text(this.operDataListItem.source)
.fontSize($r('app.float.font_size_12'))
.fontColor($r('app.color.color_B0B0B0'))
.width('100%')
.margin({ bottom: 6 })
.flexShrink(0)
Text(this.operDataListItem.newsTitle)
.width(CommonConstants.FULL_PARENT)
.height(CommonConstants.FULL_PARENT)
.fontSize($r('app.float.font_size_16'))
.fontColor('#000000')
.align(Alignment.TopStart)
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
Row() {
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.operDataListItem.publishTime)))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.margin({ right: 5 })
// 这里需要外部查询评论接口后,写入字段
if(this.operDataListItem.interactData?.commentNum) {
Text(`${this.operDataListItem.interactData?.commentNum}评`)
.fontSize(12)
}
Blank()
Image($r('app.media.local_content_icon'))
.width(20)
.height(20)
.margin({
right: -4
})
}
.width('100%')
.padding({
top: 17
})
.flexShrink(0)
}
.width(182)
.height(146)
.padding(12)
.border({
radius: 2,
})
.shadow({ radius: 5, color: '#1A000000', offsetX: 0, offsetY: 2 })
.margin({
right: 10
})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/local_content_icon.png
0 → 100644
View file @
4e991cc
2.04 KB
Please
register
or
login
to post a comment