shishuangxi

新增标题缩略comp样式

@@ -6,6 +6,8 @@ import { EmptyComponent } from './EmptyComponent'; @@ -6,6 +6,8 @@ import { EmptyComponent } from './EmptyComponent';
6 import { ErrorComponent } from './ErrorComponent'; 6 import { ErrorComponent } from './ErrorComponent';
7 import { LabelComponent } from './LabelComponent'; 7 import { LabelComponent } from './LabelComponent';
8 import { LoadingComponent } from './LoadingComponent'; 8 import { LoadingComponent } from './LoadingComponent';
  9 +import { TitleAbbrComponent } from './TitleAbbrComponent';
  10 +import { TitleAllComponent } from './TitleAllComponent';
9 11
10 const TAG = 'PageComponent'; 12 const TAG = 'PageComponent';
11 13
@@ -42,6 +44,10 @@ export struct PageComponent { @@ -42,6 +44,10 @@ export struct PageComponent {
42 componentBuilder(compDTO: CompDTO, compIndex: number) { 44 componentBuilder(compDTO: CompDTO, compIndex: number) {
43 if (compDTO.compStyle === CompStyle.Label_03) { 45 if (compDTO.compStyle === CompStyle.Label_03) {
44 LabelComponent({ compDTO: compDTO }) 46 LabelComponent({ compDTO: compDTO })
  47 + } else if (compDTO.compStyle === CompStyle.Title_Abbr_01) {
  48 + TitleAbbrComponent({ compDTO: compDTO })
  49 + } else if (compDTO.compStyle === CompStyle.Title_All_01) {
  50 + TitleAllComponent({ compDTO: compDTO })
45 } else { 51 } else {
46 // todo:组件未实现 / Component Not Implemented 52 // todo:组件未实现 / Component Not Implemented
47 Text(compDTO.compStyle) 53 Text(compDTO.compStyle)
  1 +//缩略标题
  2 +import { CommonConstants } from 'wdConstant'
  3 +import { CompDTO } from '../repository/bean/CompDTO'
  4 +
  5 +@Component
  6 +export struct TitleAbbrComponent {
  7 + @State compDTO: CompDTO = {} as CompDTO
  8 +
  9 + build() {
  10 + Column() {
  11 + Text(this.compDTO.operDataList[0].title)
  12 + .fontSize($r("app.float.font_size_16"))
  13 + .fontColor($r("app.color.color_222222"))
  14 + .maxLines(3)
  15 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  16 + .width(CommonConstants.FULL_WIDTH)
  17 + Row() {
  18 + Text("锐评")
  19 + .fontSize($r("app.float.font_size_12"))
  20 + .fontColor($r("app.color.color_ED2800"))
  21 + Text(this.compDTO.operDataList[0].source)
  22 + .fontSize($r("app.float.font_size_12"))
  23 + .fontColor($r("app.color.color_B0B0B0"))
  24 + .margin({ left: 6 })
  25 + Image($r("app.media.point"))
  26 + .width(16)
  27 + .height(16)
  28 +
  29 + Text("46分钟前")
  30 + .fontSize($r("app.float.font_size_12"))
  31 + .fontColor($r("app.color.color_B0B0B0"))
  32 +
  33 + }.width(CommonConstants.FULL_WIDTH)
  34 + .justifyContent(FlexAlign.Start)
  35 + .margin({ top: 8 })
  36 +
  37 + }.width(CommonConstants.FULL_WIDTH)
  38 + .padding({
  39 + top: 14,
  40 + left: 16,
  41 + right: 16,
  42 + bottom: 14
  43 + })
  44 + .backgroundColor($r("app.color.white"))
  45 + .margin({ bottom: 8 })
  46 + }
  47 +}
  1 +//全标题 "compStyle":"3",
  2 +import { CommonConstants } from 'wdConstant'
  3 +import { CompDTO } from '../repository/bean/CompDTO'
  4 +
  5 +@Component
  6 +export struct TitleAllComponent {
  7 + @State compDTO: CompDTO = {} as CompDTO
  8 +
  9 + build() {
  10 + Column() {
  11 + Text(this.compDTO.operDataList[0].title)
  12 + .fontSize($r("app.float.font_size_16"))
  13 + .fontColor($r("app.color.color_222222"))
  14 + .width(CommonConstants.FULL_WIDTH)
  15 + Row() {
  16 + Text("锐评")
  17 + .fontSize($r("app.float.font_size_12"))
  18 + .fontColor($r("app.color.color_ED2800"))
  19 + Text(this.compDTO.operDataList[0].source)
  20 + .fontSize($r("app.float.font_size_12"))
  21 + .fontColor($r("app.color.color_B0B0B0"))
  22 + .margin({ left: 6 })
  23 + Image($r("app.media.point"))
  24 + .width(16)
  25 + .height(16)
  26 +
  27 + Text("46分钟前")
  28 + .fontSize($r("app.float.font_size_12"))
  29 + .fontColor($r("app.color.color_B0B0B0"))
  30 +
  31 + }.width(CommonConstants.FULL_WIDTH)
  32 + .justifyContent(FlexAlign.Start)
  33 + .margin({ top: 8 })
  34 +
  35 + }.width("100%")
  36 + .padding({
  37 + top: 14,
  38 + left: 16,
  39 + right: 16,
  40 + bottom: 14
  41 + })
  42 + .backgroundColor($r("app.color.white"))
  43 + .margin({ bottom: 8 })
  44 + }
  45 +}
@@ -33,4 +33,5 @@ export interface ContentDTO { @@ -33,4 +33,5 @@ export interface ContentDTO {
33 title: string; 33 title: string;
34 vImageUrl: string; 34 vImageUrl: string;
35 screenType: string; 35 screenType: string;
  36 + source:string;
36 } 37 }
@@ -19,6 +19,18 @@ @@ -19,6 +19,18 @@
19 { 19 {
20 "name": "color_FE4B05", 20 "name": "color_FE4B05",
21 "value": "#FE4B05" 21 "value": "#FE4B05"
  22 + },
  23 + {
  24 + "name": "color_222222",
  25 + "value": "#222222"
  26 + },
  27 + {
  28 + "name": "color_ED2800",
  29 + "value": "#ED2800"
  30 + },
  31 + {
  32 + "name": "color_B0B0B0",
  33 + "value": "#B0B0B0"
22 } 34 }
23 ] 35 ]
24 } 36 }
@@ -19,4 +19,6 @@ export const enum CompStyle { @@ -19,4 +19,6 @@ export const enum CompStyle {
19 Grid_Layout_01 = 'Grid_Layout-01', // 横屏宫格卡:视频、直播 19 Grid_Layout_01 = 'Grid_Layout-01', // 横屏宫格卡:视频、直播
20 Grid_Layout_02 = 'Grid_Layout-02', // 竖屏宫格卡:视频、直播、榜单 20 Grid_Layout_02 = 'Grid_Layout-02', // 竖屏宫格卡:视频、直播、榜单
21 Masonry_Layout_01 = 'Masonry_Layout-01', // 双列瀑布流/瀑布流卡:视频、直播、专题、活动 21 Masonry_Layout_01 = 'Masonry_Layout-01', // 双列瀑布流/瀑布流卡:视频、直播、专题、活动
  22 + Title_Abbr_01 = 'Title_Abbr_01', // 标题缩略
  23 + Title_All_01 = 'Title_All_01', // 全标题
22 } 24 }