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-12 18:09:08 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9db55a430ffa63604e5b1d393a5efe3fbec47688
9db55a43
1 parent
ed9a3372
新增:人民号动态图文卡
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
278 additions
and
1 deletions
sight_harmony/features/wdBean/Index.ets
sight_harmony/features/wdBean/src/main/ets/bean/component/ArticleListDTO.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/appStyleImagesDTO.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/rmhTitle.ets
sight_harmony/features/wdComponent/src/main/resources/base/media/rmh_follow.png
sight_harmony/features/wdBean/Index.ets
View file @
9db55a4
...
...
@@ -108,4 +108,8 @@ export { ShareInfo } from './src/main/ets/bean/morningevening/ShareInfo';
export { slideShows } from './src/main/ets/bean/morningevening/slideShows';
export { LiveDetailsBean } from './src/main/ets/bean/live/LiveDetailsBean';
\ No newline at end of file
export { LiveDetailsBean } from './src/main/ets/bean/live/LiveDetailsBean';
export { ArticleListDTO } from './src/main/ets/bean/component/ArticleListDTO';
export { appStyleImagesDTO } from './src/main/ets/bean/content/appStyleImagesDTO';
...
...
sight_harmony/features/wdBean/src/main/ets/bean/component/ArticleListDTO.ets
0 → 100644
View file @
9db55a4
/**
* http://192.168.1.3:3300/project/3856/interface/api/190567
* 接口名称:客户端 客态主页页面-获取作品-从发布库获取该创作者下 稿件列表
* 接口路径:GET/zh/c/article/articleList
* 人民号-动态tab下列表数据
*/
import { appStyleImagesDTO } from '../content/appStyleImagesDTO'
export interface ArticleListDTO {
listTitle: string;
mainPicCount: string;
videosCount: string;
voicesCount: string;
landscape: number;
sourceName: string;
finalStatus: string;
score: string;
shareUrl: string;
sortPosId: string;
id: string;
serialsId: string;
oldContentId: string;
type: string;
tenancy: string;
clientPubFlag: string;
grayScale: string;
title: string
publishType: string;
publishTime: string;
firstPublishTime: string;
onlineStatus: string;
auditingStatus: string;
zhOnlineStatus: string;
zhAuditingStatus: string;
selectedStatus: string;
qualityScore: string;
levelScore: number;
isOrg: string;
articlePayment: number;
appStyle: number;
appStyleImages: appStyleImagesDTO[];
description: string;
introduction: string;
deleted: string;
keyArticle: string;
updateTime: string;
createTime: string;
createUserId: string;
createUserName: string;
creatorId: number;
creatorName: string;
articleExistVote: string;
rmhPlatform: string;
objectPos: string;
objectPosPictures: string;
shareFlag: string;
firstPublish: string;
readNum: string;
readFlag: string;
creatorLevel: string;
creatorTag: string;
joinActivity: string;
userType: string;
content: object;
contentShare: [];
contentLinkData: string;
contentExt: [];
contentVideos: string;
contentPictures: [];
contentPayments: string;
contentPaymentStaffs: string;
contentTxt: [];
contentSource: object;
contentTags: string;
contentVoices: string;
contentAuthorLocals: string;
contentEpaperArticle: string;
contentStatistics: string;
topicExistHeadImage: string;
topicComps: string;
live: string;
statusInfo: string;
askInfo: string;
askAttachmentList: string;
askAnswerList: string;
askFeedbackList: string;
ttopicInteracts: string;
ttopic: string;
mlive: string;
vlives: string
}
\ No newline at end of file
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/appStyleImagesDTO.ets
0 → 100644
View file @
9db55a4
export interface appStyleImagesDTO {
url: string;
bucket: string;
landscape: number;
sort: number;
height: number;
weight: number;
size: number;
format: number;
fullUrl: string
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
0 → 100644
View file @
9db55a4
import { ArticleListDTO, appStyleImagesDTO } from 'wdBean';
import { rmhTitle } from './rmhTitle'
const TAG = 'Card19Component';
/**
* 人民号-动态---19:动态图文卡人民号; 从无图--9图
*/
@Entry
@Component
export struct Card19Component {
@State articleListItem: ArticleListDTO = {} as ArticleListDTO
aboutToAppear(): void {
}
build() {
Column() {
// rmh信息
rmhTitle()
// 标题
if (this.articleListItem.title) {
Text(this.articleListItem.title)
.fontSize($r('app.float.font_size_17'))
.fontColor($r('app.color.color_222222'))
.textOverflowStyle(2)
.margin({ bottom: 8 })
}
// 图片-从无图到9图展示
createArticleListItem({ appStyleImages: this.articleListItem.appStyleImages })
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.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')
})
}
}
@Component
struct createArticleListItem {
@Prop appStyleImages: appStyleImagesDTO[]
build() {
if (this.appStyleImages.length === 1) {
Image(this.appStyleImages[0].fullUrl)
.width('66%')
.alignSelf(ItemAlign.Start)
} else if (this.appStyleImages.length > 4 || this.appStyleImages.length === 2 || this
.appStyleImages.length === 3) {
Flex({ wrap: FlexWrap.Wrap }) {
ForEach(this.appStyleImages, (item: appStyleImagesDTO, index: number) => {
Image(item.fullUrl)
.width('32%')
.aspectRatio(1)
.margin({ right: (index + 1) % 3 === 0 ? 0 : 2, bottom: 2 })
})
}
} else if (this.appStyleImages.length === 4) {
Flex({ wrap: FlexWrap.Wrap }) {
ForEach(this.appStyleImages.slice(0, 2), (item: appStyleImagesDTO, index: number) => {
Image(item.fullUrl)
.width('32%')
.aspectRatio(1)
.margin({ right: (index + 1) % 3 === 0 ? 0 : 2, bottom: 2 })
})
Rect()
.width('32%')
.aspectRatio(1)
.fill($r('app.color.color_transparent'))
ForEach(this.appStyleImages.slice(2, 4), (item: appStyleImagesDTO, index: number) => {
Image(item.fullUrl)
.width('32%')
.aspectRatio(1)
.margin({ right: (index + 1) % 3 === 0 ? 0 : 2, bottom: 2 })
})
}
}
}
}
@Extend(Text)
function textOverflowStyle(maxLine: number) {
.maxLines(maxLine)
.textOverflow({ overflow: TextOverflow.Ellipsis })
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/rmhTitle.ets
0 → 100644
View file @
9db55a4
/**
* 这里是人民号动态中的顶部信息:人民号logo,名字,描述,关注等
*/
import { RmhInfoDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant/Index';
import { DateTimeUtils } from 'wdKit/Index';
interface RmhInfo extends RmhInfoDTO {
isSelected: boolean;
headPhotoUrl: string;
introduction: string;
userName: string;
publishTime: string;
}
@Entry
@Component
export struct rmhTitle {
// TODO 这里需要传入rmh信息及是否显示关注,是否已关注
@State isAttentionShow: Boolean = false
@State rmhInfo: RmhInfo = {
authIcon: "https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/blue.png",
authTitle: "四川农业大学",
headPhotoUrl: "https://cdnjdphoto.aikan.pdnews.cn//upload/ueditor/image/20221208/a_785146000057561088.png?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg",
introduction: "四川农业四川",
userId: "554708665557894",
userName: "四川农业大学",
userType: "2",
publishTime: '1712912775606'
} as RmhInfo
build() {
Row() {
Stack() {
Image(this.rmhInfo.headPhotoUrl)
.width(36)
.height(36).borderRadius(50)
Image(this.rmhInfo.authIcon)
.width(14)
.height(14)
.borderRadius(50)
}
.margin({ right: 8 })
.alignContent(Alignment.BottomEnd)
Column() {
Text(this.rmhInfo.userName)
.fontSize($r('app.float.font_size_13'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.alignSelf(ItemAlign.Start)
Row() {
Text(DateTimeUtils.formatDate(Number.parseFloat(this.rmhInfo.publishTime)))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
Image($r("app.media.point"))
.width(16)
.height(16)
Text(this.rmhInfo.introduction)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.margin({ left: 6 })
.maxLines(1)
.textOverflow({overflow: TextOverflow.Ellipsis})
}
}
.align(Alignment.Start)
Blank()
if(this.isAttentionShow) {
Row(){
Image($r('app.media.rmh_follow'))
.width(16)
.height(16)
Text('关注')
.fontSize($r('app.float.font_size_13'))
.fontColor($r('app.color.color_ED2800'))
}
}
}
.width(CommonConstants.FULL_WIDTH)
.margin({bottom: 10})
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/resources/base/media/rmh_follow.png
0 → 100644
View file @
9db55a4
1.53 KB
Please
register
or
login
to post a comment