zhangfengjin

fix: 7015功能缺陷-【uat】-人民号主页以及详情页长图标识展示逻辑调整

... ... @@ -294,6 +294,7 @@ export struct DynamicDetailComponent {
.padding({ bottom: 9 })
}
}
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
... ... @@ -328,9 +329,33 @@ export struct DynamicDetailComponent {
GridCol({
span: { xs: 4 }
}) {
Image(item.picPath)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
Stack({alignContent: Alignment.BottomEnd}) {
Image(item.picPath)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
if(this.getPicType(item) !== 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')
}
.width(48)
.align(Alignment.BottomEnd)
.padding({ bottom: 3 })
}
}
}
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
... ... @@ -343,9 +368,33 @@ export struct DynamicDetailComponent {
GridCol({
span: { sm: 4, lg: 3 }
}) {
Image(item.picPath)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
Stack({alignContent: Alignment.BottomEnd}) {
Image(item.picPath)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
if(this.getPicType(item) !== 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')
}
.width(48)
.align(Alignment.BottomEnd)
.padding({ bottom: 3})
}
}
}
.onClick(async (event: ClickEvent) => {
let retvalue = await FastClickUtil.isMinDelayTime()
... ... @@ -644,10 +693,10 @@ export struct DynamicDetailComponent {
}
getPicType(item: PhotoListBean) {
if (item.width && item.width) {
if (item.width / item.height > 343 / 172) {
if (item.width && item.height) {
if (item.width / item.height > 2/1) {
return 1; //横长图
} else if (item.height / item.width > 305 / 228) {
} else if (item.width / item.height < 1/2) {
return 2; //竖长图
} else {
return 3
... ... @@ -656,7 +705,6 @@ export struct DynamicDetailComponent {
return 3; //普通图
}
}
/**
* 关注号主
*/
... ...
... ... @@ -110,10 +110,10 @@ struct createImg {
}
getPicType(){
if (this.picWidth && this.picWidth) {
if (this.picWidth / this.picHeight > 343/172) {
if (this.picWidth && this.picHeight) {
if (this.picWidth / this.picHeight > 2/1) {
return 1; //横长图
} else if (this.picHeight / this.picWidth > 305/228) {
} else if ( this.picWidth/this.picHeight < 1/2) {
return 2; //竖长图
} else {
return 3
... ... @@ -193,19 +193,75 @@ struct createImg {
GridCol({
span: { xs: 4 }
}) {
Image(this.loadImg ? item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
Stack({alignContent: Alignment.BottomEnd}) {
Image(this.loadImg ? item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
.onComplete(callback => {
this.picWidth = callback?.width || 0;
this.picHeight = callback?.height || 0;
})
if(this.getPicType() !== 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')
}
.width(48)
.align(Alignment.BottomEnd)
.padding({ bottom: 3 })
}
}
}
} else {
GridCol({
span: { sm: 4, lg: 3 }
}) {
Image(this.loadImg ? item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.loadImg ? item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.aspectRatio(1)
.borderRadius(this.caclImageRadius(index))
.onComplete(callback => {
this.picWidth = callback?.width || 0;
this.picHeight = callback?.height || 0;
})
if (this.getPicType() !== 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')
}
.width(48)
.align(Alignment.BottomEnd)
.padding({ bottom: 3 })
}
}
}
}
})
... ...