陈剑华

fix: 组件用的是comp上的coverUrl

稿件用的是programInfo上的ullColumnImgUrls里的url
     appstyle有值的是稿件
     compstyle有值是组件
... ... @@ -111,7 +111,7 @@ export struct Card10Component {
}
// 大图
Stack() {
Image(this.loadImg ? this.contentDTO?.coverUrl : '')
Image(this.loadImg ? this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '')
.backgroundColor(0xf5f5f5)
.width('100%')
.borderRadius({
... ...
... ... @@ -80,7 +80,7 @@ export struct Card14Component {
.margin({right: 12})
.width('64%')
Image(this.loadImg ? this.contentDTO.coverUrl : '')
Image(this.loadImg ? this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '')
.backgroundColor(0xf5f5f5)
.aspectRatio(3 / 2)
.height(78)
... ...
... ... @@ -80,7 +80,7 @@ export struct Card15Component {
}
//大图
Stack() {
Image(this.loadImg ? this.contentDTO.coverUrl : '')
Image(this.loadImg ? this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '')
.backgroundColor(0xf5f5f5)
.borderRadius($r('app.float.image_border_radius'))
//播放状态+时长
... ...
... ... @@ -197,14 +197,14 @@ struct createImg {
alignContent: Alignment.BottomEnd
}) {
if (this.getPicType(item.weight, item.height) === 1) {
Image(this.loadImg ? item.fullUrl || item.url : '')
Image(this.loadImg ? item.url || item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.width('100%')
.height(198)
.autoResize(true)
.borderRadius(this.caclImageRadius(index))
} else if (this.getPicType(item.weight, item.height) === 2) {
Image(this.loadImg ? item.fullUrl || item.url : '')
Image(this.loadImg ? item.url || item.fullUrl : '')
.width('100%')
.height(305)
.autoResize(true)
... ...
... ... @@ -153,7 +153,7 @@ struct createImg {
span: { xs: 12 }
}) {
Stack() {
Image(this.loadImg ? this.contentDTO.coverUrl : '')
Image(this.loadImg ? this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '')
.backgroundColor(0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
... ... @@ -176,7 +176,7 @@ struct createImg {
span: { xs: 6 }
}) {
Stack() {
Image(this.loadImg ? this.contentDTO.coverUrl : '')
Image(this.loadImg ? this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '')
.backgroundColor(0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.borderRadius($r('app.float.image_border_radius'))
... ...
... ... @@ -79,7 +79,7 @@ export struct Card21Component {
GridItem() {
Stack() {
Image(this.loadImg ? this.contentDTO.coverUrl : '')
Image(this.loadImg ? this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '')
.backgroundColor(0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.borderRadius($r('app.float.image_border_radius'))
... ...
//全标题 "appStyle":"2",
import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant/Index';
import { CommonConstants, CompStyle } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
... ... @@ -44,6 +44,14 @@ export struct Card2Component {
this.textArr = titleInitRes.textArr;
}
getCover() {
if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
return this.contentDTO.coverUrl
} else if (this.contentDTO.appStyle === CompStyle.Card_02) {
return this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl
}
return ''
}
build() {
Column() {
... ... @@ -96,7 +104,7 @@ export struct Card2Component {
//大图
Stack() {
Image(this.loadImg ? this.contentDTO.coverUrl : '')
Image(this.loadImg ? this.getCover() : '')
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(16 / 9)
.borderRadius($r('app.float.image_border_radius'))
... ...
import { ContentDTO, CompDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from './notes';
... ... @@ -7,7 +6,8 @@ import { getNotesContentWidth } from '../../utils/FuncUtils'
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed';
import router from '@ohos.router'
import router from '@ohos.router';
import { CommonConstants, CompStyle } from 'wdConstant/Index';
const TAG: string = 'Card5Component';
... ... @@ -42,9 +42,18 @@ export struct Card5Component {
this.textArr = titleInitRes.textArr;
}
getCover() {
if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
return this.contentDTO.coverUrl
} else if (this.contentDTO.appStyle === CompStyle.Card_05) {
return this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl
}
return ''
}
build() {
Stack() {
Image(this.loadImg ? this.contentDTO.coverUrl : '')
Image(this.loadImg ? this.getCover() : '')
.backgroundColor(0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.borderRadius(
... ...
... ... @@ -35,12 +35,22 @@ export struct Card6Component {
const curRouter = router.getState().name;
this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
}
titleInit() {
const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title);
this.titleMarked = titleInitRes.titleMarked;
this.textArr = titleInitRes.textArr;
}
getCover() {
if (this.compDTO.compStyle === CompStyle.Card_13) {
return this.contentDTO.coverUrl
} else if (this.contentDTO.appStyle === CompStyle.Card_06) {
return this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl
}
return ''
}
build() {
Row() {
Column() {
... ... @@ -109,7 +119,7 @@ export struct Card6Component {
Stack({alignContent: Alignment.BottomEnd}) {
Image(this.loadImg ? this.contentDTO.coverUrl || this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '')
Image(this.loadImg ? this.getCover() : '')
.backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5)
.borderRadius(5)
.aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4)
... ...