wangliang_wd

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

@@ -1042,30 +1042,32 @@ struct createImg { @@ -1042,30 +1042,32 @@ struct createImg {
1042 1042
1043 @Builder 1043 @Builder
1044 longPicTip(weight: number, height: number) { 1044 longPicTip(weight: number, height: number) {
1045 - Flex({ direction: FlexDirection.Row }) {  
1046 - Image($r('app.media.icon_long_pic'))  
1047 - .width(12)  
1048 - .height(12)  
1049 - .margin({ right: 4 })  
1050 - Text('长图')  
1051 - .fontSize(10)  
1052 - .fontWeight(400)  
1053 - .textShadow({  
1054 - radius: 1,  
1055 - color: `rgba(0,0,0,0.5)`,  
1056 - offsetY:1,  
1057 - offsetX:1  
1058 - })  
1059 - .fontColor(0xffffff)  
1060 - .fontFamily('PingFang SC')  
1061 - .visibility(  
1062 - weight / height > 2 || height / weight > 2  
1063 - ? Visibility.Visible : Visibility.None  
1064 - ) 1045 + if (weight / height > 2 || height / weight > 2){
  1046 + Flex({ direction: FlexDirection.Row }) {
  1047 + Image($r('app.media.icon_long_pic'))
  1048 + .width(12)
  1049 + .height(12)
  1050 + .margin({ right: 4 })
  1051 + Text('长图')
  1052 + .fontSize(10)
  1053 + .fontWeight(400)
  1054 + .textShadow({
  1055 + radius: 1,
  1056 + color: `rgba(0,0,0,0.5)`,
  1057 + offsetY:1,
  1058 + offsetX:1
  1059 + })
  1060 + .fontColor(0xffffff)
  1061 + .fontFamily('PingFang SC')
  1062 + .visibility(
  1063 + weight / height > 2 || height / weight > 2
  1064 + ? Visibility.Visible : Visibility.None
  1065 + )
  1066 + }
  1067 + .width(48)
  1068 + .align(Alignment.BottomEnd)
  1069 + .padding({ bottom: 8 })
1065 } 1070 }
1066 - .width(48)  
1067 - .align(Alignment.BottomEnd)  
1068 - .padding({ bottom: 8 })  
1069 } 1071 }
1070 1072
1071 build() { 1073 build() {
@@ -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() {