wangliang_wd

feat:优化动态详情页图片展示

@@ -1115,9 +1115,8 @@ struct createImg { @@ -1115,9 +1115,8 @@ struct createImg {
1115 getPicHeight(picWidth: number, picHeight: number) { 1115 getPicHeight(picWidth: number, picHeight: number) {
1116 //console.info(`cj2024 getPicType picWidth = ${picWidth} picHeight = ${picHeight} picWidth / picHeight = ${picWidth / picHeight}`) 1116 //console.info(`cj2024 getPicType picWidth = ${picWidth} picHeight = ${picHeight} picWidth / picHeight = ${picWidth / picHeight}`)
1117 if (picWidth && picHeight) { 1117 if (picWidth && picHeight) {
1118 - let imageH = 305  
1119 let sizeH = this.compWidth * picHeight / picWidth 1118 let sizeH = this.compWidth * picHeight / picWidth
1120 - return Math.max(sizeH,imageH) 1119 + return picWidth/picHeight === 1 ? 228:Math.min(sizeH,305)
1121 } else { 1120 } else {
1122 return 305; //普通图 1121 return 305; //普通图
1123 } 1122 }
@@ -1231,7 +1230,7 @@ struct createImg { @@ -1231,7 +1230,7 @@ struct createImg {
1231 // .aspectRatio(this.onePicW > this.onePicH ? 343 / 198 : 228 / 305) 1230 // .aspectRatio(this.onePicW > this.onePicH ? 343 / 198 : 228 / 305)
1232 .width('100%') 1231 .width('100%')
1233 .constraintSize({ 1232 .constraintSize({
1234 - maxHeight: this.getPicHeight(this.onePicW,this.onePicH) 1233 + maxHeight: this.getPicHeight(item.width,item.height)
1235 }) 1234 })
1236 .autoResize(true) 1235 .autoResize(true)
1237 .borderRadius(this.caclImageRadius(index)) 1236 .borderRadius(this.caclImageRadius(index))