wangliang_wd

feat:优化人民号动态卡长图标识展示

@@ -1042,6 +1042,7 @@ struct createImg { @@ -1042,6 +1042,7 @@ struct createImg {
1042 1042
1043 @Builder 1043 @Builder
1044 longPicTip(weight: number, height: number) { 1044 longPicTip(weight: number, height: number) {
  1045 + if (weight / height > 2 || height / weight > 2){
1045 Flex({ direction: FlexDirection.Row }) { 1046 Flex({ direction: FlexDirection.Row }) {
1046 Image($r('app.media.icon_long_pic')) 1047 Image($r('app.media.icon_long_pic'))
1047 .width(12) 1048 .width(12)
@@ -1067,6 +1068,7 @@ struct createImg { @@ -1067,6 +1068,7 @@ struct createImg {
1067 .align(Alignment.BottomEnd) 1068 .align(Alignment.BottomEnd)
1068 .padding({ bottom: 8 }) 1069 .padding({ bottom: 8 })
1069 } 1070 }
  1071 + }
1070 1072
1071 build() { 1073 build() {
1072 GridRow({ 1074 GridRow({
@@ -187,30 +187,32 @@ struct createImg { @@ -187,30 +187,32 @@ struct createImg {
187 187
188 @Builder 188 @Builder
189 longPicTip(weight: number, height: number) { 189 longPicTip(weight: number, height: number) {
190 - // Flex({ direction: FlexDirection.Row }) {  
191 - // Image($r('app.media.icon_long_pic'))  
192 - // .width(12)  
193 - // .height(12)  
194 - // .margin({ right: 4 })  
195 - // Text('长图')  
196 - // .fontSize(10)  
197 - // .fontWeight(400)  
198 - // .textShadow({  
199 - // radius: 1,  
200 - // color: `rgba(0,0,0,0.5)`,  
201 - // offsetY:1,  
202 - // offsetX:1  
203 - // })  
204 - // .fontColor(0xffffff)  
205 - // .fontFamily('PingFang SC')  
206 - // .visibility(  
207 - // weight / height > 2 || height / weight > 2  
208 - // ? Visibility.Visible : Visibility.None  
209 - // )  
210 - // }  
211 - // .width(48)  
212 - // .align(Alignment.BottomEnd)  
213 - // .padding({ bottom: 8 }) 190 + if (weight / height > 2 || height / weight > 2){
  191 + Flex({ direction: FlexDirection.Row }) {
  192 + Image($r('app.media.icon_long_pic'))
  193 + .width(12)
  194 + .height(12)
  195 + .margin({ right: 4 })
  196 + Text('长图')
  197 + .fontSize(10)
  198 + .fontWeight(400)
  199 + .textShadow({
  200 + radius: 1,
  201 + color: `rgba(0,0,0,0.5)`,
  202 + offsetY:1,
  203 + offsetX:1
  204 + })
  205 + .fontColor(0xffffff)
  206 + .fontFamily('PingFang SC')
  207 + .visibility(
  208 + weight / height > 2 || height / weight > 2
  209 + ? Visibility.Visible : Visibility.None
  210 + )
  211 + }
  212 + .width(48)
  213 + .align(Alignment.BottomEnd)
  214 + .padding({ bottom: 8 })
  215 + }
214 } 216 }
215 217
216 build() { 218 build() {