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-04-18 17:42:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
04e10de3368eec7a5de66c45611be156080ff23c
04e10de3
1 parent
77cd00aa
开篇12 14 16联调
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
148 deletions
sight_harmony/commons/wdConstant/src/main/ets/enum/CompStyle.ts
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card12Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card14Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card16Component.ets
sight_harmony/commons/wdConstant/src/main/ets/enum/CompStyle.ts
View file @
04e10de
...
...
@@ -16,7 +16,7 @@ export const enum CompStyle {
Single_Column_05
=
'Single_Column-05'
,
// 海报图卡:/
Single_Column_06
=
'Single_Column-06'
,
// 留言板卡:/
Grid_Layout_01
=
'Grid_Layout-01'
,
// 横屏宫格卡:视频、直播
Grid_Layout_02
=
'Grid_Layout-02'
,
// 竖屏宫格卡:视频、直播、榜单
Grid_Layout_02
=
'Grid_Layout-02'
,
// 竖屏宫格卡
:视频、直播、榜单
Masonry_Layout_01
=
'Masonry_Layout-01'
,
// 双列瀑布流/瀑布流卡:视频、直播、专题、活动
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
View file @
04e10de
...
...
@@ -8,8 +8,11 @@ import { Card6Component } from './cardview/Card6Component';
import { Card9Component } from './cardview/Card9Component';
import { Card10Component } from './cardview/Card10Component';
import { Card11Component } from './cardview/Card11Component';
import { Card17Component } from './cardview/Card17Component';
import { Card12Component } from './cardview/Card12Component';
import { Card14Component } from './cardview/Card14Component';
import { Card15Component } from './cardview/Card15Component';
import { Card16Component } from './cardview/Card16Component';
import { Card17Component } from './cardview/Card17Component';
import { Card19Component } from './cardview/Card19Component';
import { Card20Component } from './cardview/Card20Component';
import { Card21Component } from './cardview/Card21Component';
...
...
@@ -45,8 +48,14 @@ export struct CardParser {
Card10Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_11) {
Card11Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_12) {
Card12Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_14) {
Card14Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_15) {
Card15Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_16) {
Card16Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_17) {
Card17Component({ contentDTO })
} else if (contentDTO.appStyle === CompStyle.Card_19) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
View file @
04e10de
...
...
@@ -9,6 +9,7 @@ import {
import {
HorizontalStrokeCardThreeTwoRadioForOneComponent
} from './view/HorizontalStrokeCardThreeTwoRadioForOneComponent';
import { ZhSingleRow02 } from './compview/ZhSingleRow02';
import { ZhSingleRow04 } from './compview/ZhSingleRow04';
import { ZhSingleColumn04 } from './compview/ZhSingleColumn04';
import { ZhSingleColumn05 } from './compview/ZhSingleColumn05';
...
...
@@ -46,6 +47,8 @@ export struct CompParser {
} else {
HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: compDTO })
}
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_02) {
ZhSingleRow02({ compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
LiveHorizontalReservationComponent({ compDTO: compDTO })
} else if (compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card12Component.ets
View file @
04e10de
...
...
@@ -2,6 +2,7 @@ import { ContentDTO } from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from '../../utils/ProcessUtils';
const TAG = 'Card12Component';
...
...
@@ -10,39 +11,7 @@ const TAG = 'Card12Component';
*/
@Component
export struct Card12Component {
@State contentDTO: ContentDTO = {
appStyle: '20',
coverType: 1,
coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',
fullColumnImgUrls: [
{
landscape: 1,
size: 1,
url: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',
weight: 1600
}
],
newsTitle: '好玩!》10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',
rmhInfo: {
authIcon:
'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/yellow.png',
authTitle: '10后音乐人王烁然个人人民号',
authTitle2: '10后音乐人王烁然个人人民号',
banControl: 0,
cnIsAttention: 1,
rmhDesc: '10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',
rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221031/3d3419e86a.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',
rmhName: '王烁然',
userId: '522435359667845',
userType: '2'
},
objectType: '1',
videoInfo: {
firstFrameImageUri: '',
videoDuration: 37,
videoUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/mp4/202105/rmrb_GSNARt6P1622451310.mp4'
}
} as ContentDTO;
@State contentDTO: ContentDTO = {} as ContentDTO;
aboutToAppear(): void {
}
...
...
@@ -50,7 +19,9 @@ export struct Card12Component {
build() {
Column() {
// rmh信息
if (this.contentDTO.rmhInfo) {
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo })
}
// 标题
if (this.contentDTO.newsTitle) {
Text(this.contentDTO.newsTitle)
...
...
@@ -64,9 +35,6 @@ export struct Card12Component {
.fontFamily('PingFang SC-Regular')
}
// if (this.contentDTO.fullColumnImgUrls?.[0]) {
// createImg({ contentDTO: this.contentDTO })
// }
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.padding({
...
...
@@ -75,6 +43,9 @@ export struct Card12Component {
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
}
}
...
...
@@ -85,45 +56,6 @@ interface radiusType {
bottomRight: number | Resource;
}
@Component
struct createImg {
@Prop contentDTO: ContentDTO
build() {
GridRow() {
if (this.contentDTO.fullColumnImgUrls[0].landscape === 1) {
// 横屏
GridCol({
span: { xs: 12 }
}) {
Stack() {
Image(this.contentDTO.coverUrl)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.borderRadius($r('app.float.image_border_radius'))
CardMediaInfo({ contentDTO: this.contentDTO })
}
.align(Alignment.BottomEnd)
}
} else {
// 竖图显示,宽度占50%,高度自适应
GridCol({
span: { xs: 6 }
}) {
Stack() {
Image(this.contentDTO.coverUrl)
.width(CommonConstants.FULL_WIDTH)
.borderRadius($r('app.float.image_border_radius'))
CardMediaInfo({ contentDTO: this.contentDTO })
}
.align(Alignment.BottomEnd)
}
}
}
}
}
@Extend(Text)
function textOverflowStyle(maxLine: number) {
.maxLines(maxLine)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card14Component.ets
View file @
04e10de
...
...
@@ -2,6 +2,7 @@ import { ContentDTO } from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from '../../utils/ProcessUtils';
const TAG = 'Card14Component';
...
...
@@ -11,37 +12,37 @@ const TAG = 'Card14Component';
@Component
export struct Card14Component {
@State contentDTO: ContentDTO = {
// appStyle: '20',
// coverType: 1,
// coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',
// fullColumnImgUrls: [
// {
// landscape: 1,
// size: 1,
// url: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',
// weight: 1600
// }
// ],
// newsTitle: '好玩!》10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',
// rmhInfo: {
// authIcon:
// 'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/yellow.png',
// authTitle: '10后音乐人王烁然个人人民号',
// authTitle2: '10后音乐人王烁然个人人民号',
// banControl: 0,
// cnIsAttention: 1,
// rmhDesc: '10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',
// rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221031/3d3419e86a.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',
// rmhName: '王烁然',
// userId: '522435359667845',
// userType: '2'
// },
// objectType: '1',
// videoInfo: {
// firstFrameImageUri: '',
// videoDuration: 37,
// videoUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/mp4/202105/rmrb_GSNARt6P1622451310.mp4'
// }
appStyle: '20',
coverType: 1,
coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',
fullColumnImgUrls: [
{
landscape: 1,
size: 1,
url: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',
weight: 1600
}
],
newsTitle: '好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》好玩!》',
rmhInfo: {
authIcon:
'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/yellow.png',
authTitle: '10后音乐人王烁然个人人民号',
authTitle2: '10后音乐人王烁然个人人民号',
banControl: 0,
cnIsAttention: 1,
rmhDesc: '10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',
rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221031/3d3419e86a.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',
rmhName: '王烁然',
userId: '522435359667845',
userType: '2'
},
objectType: '1',
videoInfo: {
firstFrameImageUri: '',
videoDuration: 37,
videoUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/mp4/202105/rmrb_GSNARt6P1622451310.mp4'
}
} as ContentDTO;
aboutToAppear(): void {
...
...
@@ -50,9 +51,11 @@ export struct Card14Component {
build() {
Column() {
// rmh信息
if (this.contentDTO.rmhInfo) {
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo })
}
// 左标题,右图
Flex({ direction: FlexDirection.Row }) {
Flex({ direction: FlexDirection.Row
, justifyContent: FlexAlign.SpaceBetween
}) {
Text(this.contentDTO.newsTitle)
.fontSize($r('app.float.font_size_17'))
...
...
@@ -61,12 +64,13 @@ export struct Card14Component {
.lineHeight(25)
.fontFamily('PingFang SC-Regular')
.textAlign(TextAlign.Start)
.flexBasis('auto')
//
.flexBasis('auto')
.margin({right: 12})
.flexBasis(214)
Image(this.contentDTO.coverUrl)
.flexBasis(174)
.height(75)
.flexBasis(117)
.height(78)
.borderRadius($r('app.float.image_border_radius'))
// .flexBasis(160)
.backgroundImageSize(ImageSize.Auto)
...
...
@@ -85,6 +89,9 @@ export struct Card14Component {
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/cardview/Card16Component.ets
View file @
04e10de
...
...
@@ -2,47 +2,21 @@ import { ContentDTO } from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from '../../utils/ProcessUtils';
const TAG = 'Card16Component';
interface fullColumnImgUrlItem {
url: string
}
/**
* 人民号-动态---16:人民号三图卡;
*/
@Component
export struct Card16Component {
@State contentDTO: ContentDTO = {
appStyle: '20',
coverType: 1,
coverUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90;https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90;https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',
fullColumnImgUrls: [
{
landscape: 1,
size: 1,
url: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/default_image/202105/rmrb_default_image_4GdWrgSw1622451312.jpg?x-oss-process=image/resize,m_fill,h_480,w_360/quality,q_90',
weight: 1600
}
],
newsTitle: '好玩!》10后音乐人王烁然个人人民号10后音乐人王烁然个人人民号10后音乐人王烁然个人人民号10后音乐人王烁然个人人民号10后音乐人王烁然个人人民号10后音乐人王烁然个人人民号',
rmhInfo: {
authIcon:
'https://cdnjdphoto.aikan.pdnews.cn/creator-category/icon/auth/yellow.png',
authTitle: '10后音乐人王烁然个人人民号',
authTitle2: '10后音乐人王烁然个人人民号',
banControl: 0,
cnIsAttention: 1,
rmhDesc: '10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人10后少年音乐人',
rmhHeadUrl: 'https://cdnjdphoto.aikan.pdnews.cn/image/creator/rmh/20221031/3d3419e86a.jpeg?x-oss-process=image/resize,l_100/auto-orient,1/quality,q_90/format,jpg',
rmhName: '王烁然',
userId: '522435359667845',
userType: '2'
},
objectType: '1',
videoInfo: {
firstFrameImageUri: '',
videoDuration: 37,
videoUrl: 'https://rmrbcmsonline.peopleapp.com/upload/user_app/gov_dynamic/video/mp4/202105/rmrb_GSNARt6P1622451310.mp4'
}
} as ContentDTO;
@State contentDTO: ContentDTO = {} as ContentDTO;
aboutToAppear(): void {
}
...
...
@@ -50,7 +24,9 @@ export struct Card16Component {
build() {
Column() {
// rmh信息
if (this.contentDTO.rmhInfo) {
RmhTitle({ rmhInfo: this.contentDTO.rmhInfo })
}
// 标题
if (this.contentDTO.newsTitle) {
Text(this.contentDTO.newsTitle)
...
...
@@ -61,10 +37,10 @@ export struct Card16Component {
.margin({ bottom: 8 })
.lineHeight(25)
}
if (this.contentDTO.
coverUrl
) {
if (this.contentDTO.
fullColumnImgUrls?.length > 0
) {
Flex() {
ForEach(this.contentDTO.coverUrl?.split(';'), (item: string) => {
Image(item).flexBasis(113).height(75).margin({right: 2})
ForEach(this.contentDTO.fullColumnImgUrls.slice(0, 3), (item: fullColumnImgUrlItem, index: number) => {
Image(item.url).flexBasis(113).height(75).margin({ right: index > 1 ? 0 : 2 })
})
}
}
...
...
@@ -76,6 +52,9 @@ export struct Card16Component {
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
}
}
...
...
Please
register
or
login
to post a comment