douaojie

fix: 专题设置成图片

... ... @@ -9,6 +9,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
*/
const TAG: string = 'Card10Component';
@Preview
@Component
export struct Card10Component {
@State contentDTO: ContentDTO = {} as ContentDTO;
... ... @@ -39,12 +40,18 @@ export struct Card10Component {
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.contentDTO)
})
Text('专题')
.fontSize($r('app.float.font_size_12'))
.padding({ left: 8, right: 8, top: 3, bottom: 3 })
.backgroundColor(Color.Red)
.fontColor(Color.White)
.borderRadius($r('app.float.button_border_radius'))
// Text('专题')
// .fontSize($r('app.float.font_size_12'))
// .padding({ left: 8, right: 8, top: 3, bottom: 3 })
// .backgroundColor(Color.Red)
// .fontColor(Color.White)
// .borderRadius($r('app.float.button_border_radius'))
// .margin({ left: 5, bottom: 5 })
ImageSpan($r('app.media.special'))
.width($r('app.float.font_size_36'))
.objectFit(ImageFit.Fill)
.verticalAlign(ImageSpanAlignment.CENTER)
.margin({ left: 5, bottom: 5 })
}.alignContent(Alignment.BottomStart)
... ... @@ -92,12 +99,32 @@ export struct Card10Component {
timelineItem(item: slideShows, index: number) {
Row() {
Column() {
Text(item.newsTitle)
.fontSize($r('app.float.font_size_17'))
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
Text(item.newsTitle) {
if (item.objectType == '5') {
// Text('专题')
// .fontSize($r('app.float.font_size_12'))
// .padding({ left: 8, right: 8, top: 3, bottom: 3 })
// .backgroundColor(Color.Red)
// .fontColor(Color.White)
// .borderRadius($r('app.float.button_border_radius'))
// .margin({ right: 5 })
ImageSpan($r('app.media.special'))
.width($r('app.float.font_size_36'))
.objectFit(ImageFit.Fill)
.verticalAlign(ImageSpanAlignment.CENTER)
.margin({ right: 5 })
}
Span(item.newsTitle)
}
.fontSize($r('app.float.font_size_17'))
.fontWeight(400)
.fontColor($r('app.color.color_222222'))
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
CardSourceInfo(
{
contentDTO: {
... ...
<?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>
\ No newline at end of file
... ...