wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix: 20218 搜索-猛犸新闻,搜索结果中动态图文的长图比例展示不正确
  noncode: 更新版本号
... ... @@ -2,8 +2,8 @@
"app": {
"bundleName": "com.peopledailychina.hosactivity",
"vendor": "$string:app_vendor",
"versionCode": 7396,
"versionName": "7.3.9.6",
"versionCode": 7397,
"versionName": "7.3.9.7",
"icon": "$media:app_icon",
"label": "$string:app_name"
}
... ...
... ... @@ -185,6 +185,34 @@ struct createImg {
}
}
@Builder
longPicTip(weight: number, height: number) {
Flex({ direction: FlexDirection.Row }) {
Image($r('app.media.icon_long_pic'))
.width(12)
.height(12)
.margin({ right: 4 })
Text('长图')
.fontSize(10)
.fontWeight(400)
.textShadow({
radius: 1,
color: `rgba(0,0,0,0.5)`,
offsetY:1,
offsetX:1
})
.fontColor(0xffffff)
.fontFamily('PingFang SC')
.visibility(
weight / height > 2 || height / weight > 2
? Visibility.Visible : Visibility.None
)
}
.width(48)
.align(Alignment.BottomEnd)
.padding({ bottom: 8 })
}
build() {
GridRow({
gutter: { x: 2, y: 2 }
... ... @@ -212,29 +240,7 @@ struct createImg {
.autoResize(true)
.borderRadius(this.caclImageRadius(index))
}
Flex({ direction: FlexDirection.Row }) {
Image($r('app.media.icon_long_pic'))
.width(12)
.height(12)
.margin({right: 4})
Text('长图')
.fontSize(10)
.fontWeight(400)
.textShadow({
radius: 1,
color: '#777',
offsetX:1,
offsetY:1
})
.fontColor(0xffffff)
.fontFamily('PingFang SC')
.visibility(
item.weight / item.height > 2 / 1 || item.weight / item.height < 1 / 2
? Visibility.Visible : Visibility.None
)
}
.width(48)
.padding({bottom: 9})
this.longPicTip(item.weight, item.height)
}
}
... ... @@ -261,20 +267,25 @@ struct createImg {
GridCol({
span: this.onePicW > this.onePicH ? 12 : 8
}) {
Stack({alignContent: Alignment.BottomEnd}) {
Image(this.loadImg ? item.url || item.fullUrl : '')
.backgroundColor(0xf5f5f5)
// .aspectRatio(this.onePicW > this.onePicH ? 343 / 198 : 228 / 305)
.width('100%')
.constraintSize({
maxHeight: this.onePicW > this.onePicH ? 198 : 305
})
.autoResize(true)
// .objectFit(ImageFit.Cover)
.autoResize(true)
// .aspectRatio(3/4)
.borderRadius(this.caclImageRadius(index))
.opacity(!item.weight && !item.height ? 0 : 1)
.onComplete((event?) => {
this.onePicW = event?.width || 0;
this.onePicH = event?.height || 0;
})
if (this.onePicW && this.onePicH) {
this.longPicTip(this.onePicW, this.onePicH)
}
}
}
}
} else if (this.fullColumnImgUrls.length === 5) {
... ... @@ -290,30 +301,7 @@ struct createImg {
.height('226lvp')
.borderRadius(this.caclImageRadius(index))
if(this.getPicType(item.weight, item.height) !== 3){
Flex({ direction: FlexDirection.Row }) {
Image($r('app.media.icon_long_pic'))
.width(12)
.height(12)
.margin({ right: 4 })
Text('长图')
.fontSize(10)
.fontWeight(400)
.textShadow({
radius: 1,
color: `rgba(0,0,0,0.5)`,
offsetY:1,
offsetX:1
})
.fontColor(0xffffff)
.fontFamily('PingFang SC')
.visibility(
item.weight / item.height > 2 / 1 || item.weight / item.height < 1 / 2
? Visibility.Visible : Visibility.None
)
}
.width(48)
.align(Alignment.BottomEnd)
.padding({ bottom: 3 })
this.longPicTip(item.weight, item.height)
}
}
}
... ... @@ -329,30 +317,7 @@ struct createImg {
.width('100%')
.autoResize(true)
if (this.getPicType(item.weight, item.height) !== 3) {
Flex({ direction: FlexDirection.Row }) {
Image($r('app.media.icon_long_pic'))
.width(12)
.height(12)
.margin({ right: 4 })
Text('长图')
.fontSize(10)
.fontWeight(400)
.textShadow({
radius: 1,
color: `rgba(0,0,0,0.5)`,
offsetY: 1,
offsetX: 1
})
.fontColor(0xffffff)
.fontFamily('PingFang SC')
.visibility(
item.weight / item.height > 2 / 1 || item.weight / item.height < 1 / 2
? Visibility.Visible : Visibility.None
)
}
.width(48)
.align(Alignment.BottomEnd)
.padding({ bottom: 3 })
this.longPicTip(item.weight, item.height)
}
}
.onClick(() => {
... ...