douaojie

fix: 专题设置成图片

@@ -9,6 +9,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; @@ -9,6 +9,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
9 */ 9 */
10 const TAG: string = 'Card10Component'; 10 const TAG: string = 'Card10Component';
11 11
  12 +@Preview
12 @Component 13 @Component
13 export struct Card10Component { 14 export struct Card10Component {
14 @State contentDTO: ContentDTO = {} as ContentDTO; 15 @State contentDTO: ContentDTO = {} as ContentDTO;
@@ -39,12 +40,18 @@ export struct Card10Component { @@ -39,12 +40,18 @@ export struct Card10Component {
39 .onClick((event: ClickEvent) => { 40 .onClick((event: ClickEvent) => {
40 ProcessUtils.processPage(this.contentDTO) 41 ProcessUtils.processPage(this.contentDTO)
41 }) 42 })
42 - Text('专题')  
43 - .fontSize($r('app.float.font_size_12'))  
44 - .padding({ left: 8, right: 8, top: 3, bottom: 3 })  
45 - .backgroundColor(Color.Red)  
46 - .fontColor(Color.White)  
47 - .borderRadius($r('app.float.button_border_radius')) 43 + // Text('专题')
  44 + // .fontSize($r('app.float.font_size_12'))
  45 + // .padding({ left: 8, right: 8, top: 3, bottom: 3 })
  46 + // .backgroundColor(Color.Red)
  47 + // .fontColor(Color.White)
  48 + // .borderRadius($r('app.float.button_border_radius'))
  49 + // .margin({ left: 5, bottom: 5 })
  50 +
  51 + ImageSpan($r('app.media.special'))
  52 + .width($r('app.float.font_size_36'))
  53 + .objectFit(ImageFit.Fill)
  54 + .verticalAlign(ImageSpanAlignment.CENTER)
48 .margin({ left: 5, bottom: 5 }) 55 .margin({ left: 5, bottom: 5 })
49 }.alignContent(Alignment.BottomStart) 56 }.alignContent(Alignment.BottomStart)
50 57
@@ -92,12 +99,32 @@ export struct Card10Component { @@ -92,12 +99,32 @@ export struct Card10Component {
92 timelineItem(item: slideShows, index: number) { 99 timelineItem(item: slideShows, index: number) {
93 Row() { 100 Row() {
94 Column() { 101 Column() {
95 - Text(item.newsTitle) 102 +
  103 + Text(item.newsTitle) {
  104 + if (item.objectType == '5') {
  105 + // Text('专题')
  106 + // .fontSize($r('app.float.font_size_12'))
  107 + // .padding({ left: 8, right: 8, top: 3, bottom: 3 })
  108 + // .backgroundColor(Color.Red)
  109 + // .fontColor(Color.White)
  110 + // .borderRadius($r('app.float.button_border_radius'))
  111 + // .margin({ right: 5 })
  112 + ImageSpan($r('app.media.special'))
  113 + .width($r('app.float.font_size_36'))
  114 + .objectFit(ImageFit.Fill)
  115 + .verticalAlign(ImageSpanAlignment.CENTER)
  116 + .margin({ right: 5 })
  117 + }
  118 +
  119 + Span(item.newsTitle)
  120 + }
96 .fontSize($r('app.float.font_size_17')) 121 .fontSize($r('app.float.font_size_17'))
97 .fontWeight(400) 122 .fontWeight(400)
98 .fontColor($r('app.color.color_222222')) 123 .fontColor($r('app.color.color_222222'))
99 .maxLines(2) 124 .maxLines(2)
100 .textOverflow({ overflow: TextOverflow.Ellipsis }) 125 .textOverflow({ overflow: TextOverflow.Ellipsis })
  126 +
  127 +
101 CardSourceInfo( 128 CardSourceInfo(
102 { 129 {
103 contentDTO: { 130 contentDTO: {
  1 +<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1715075661006" class="icon" viewBox="0 0 2048 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7815" width="64" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M1920 0a128 128 0 0 1 128 128v768a128 128 0 0 1-128 128H128a128 128 0 0 1-128-128V128a128 128 0 0 1 128-128h1792zM569.344 135.168c-6.144 30.72-12.288 61.44-19.2 92.928H347.392v51.456h191.232c-7.68 32.256-15.36 63.744-23.808 95.232H295.168v53.76h204.288c-16.128 52.992-33.792 103.68-52.224 152.832h379.392c-40.704 50.688-96.768 99.84-167.424 145.92a2339.2 2339.2 0 0 0-165.888-51.456l-29.184 43.008a1960.896 1960.896 0 0 1 356.352 134.4l30.72-48.384a1604.032 1604.032 0 0 0-132.864-56.064c79.104-56.832 136.704-114.432 173.568-171.264V529.92H526.336c10.752-31.488 22.272-65.28 33.024-101.376h425.472v-53.76h-410.88c7.68-29.952 15.36-61.44 23.04-95.232h342.528v-51.456H608.512c6.144-27.648 11.52-57.6 17.664-88.32l-56.832-4.608z m829.44 354.816h-325.632v50.688h152.064v186.624c-23.808-17.664-46.08-42.24-66.048-73.728 3.84-23.04 6.144-46.848 7.68-72.96l-49.152-6.144c-3.84 87.552-26.112 165.888-67.584 235.776l39.936 35.328a565.696 565.696 0 0 0 57.6-135.936c31.488 44.544 67.584 76.032 108.288 92.928 44.16 19.136 151.04 29.12 322.176 29.888l173.952 0.064 9.216-55.296c-34.88 1.408-85.696 2.816-152.32 3.008l-20.48 0.064c-157.44 0-258.048-6.912-302.592-20.736a89.408 89.408 0 0 0-11.52-4.608v-83.712h105.216V622.08h-105.216V540.672h124.416v-50.688z m201.984-122.88h-50.688v108.288c-1.536 57.6-13.056 104.448-33.024 140.544-22.272 34.56-60.672 62.208-115.968 82.176l29.952 47.616c58.368-23.04 101.376-54.528 127.488-95.232 26.112-43.776 40.704-102.144 42.24-175.104V367.104z m29.952 228.864l-36.864 35.328c49.92 39.936 89.088 78.336 117.504 113.664l39.168-38.4a850.24 850.24 0 0 0-119.808-110.592z m110.592-424.704h-331.776v50.688h143.616a539.136 539.136 0 0 1-9.984 61.44h-109.824v310.272h49.152V331.008h185.856v262.656h51.456V283.392h-126.72c4.608-19.968 7.68-39.936 9.984-61.44h138.24v-50.688zM1369.6 170.496h-261.888v268.032H1369.6V170.496z m-53.76 156.672v65.28h-154.368v-65.28h154.368z m0-110.592V284.16h-154.368V216.576h154.368z" fill="#ff0000" p-id="7816"></path></svg>