Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: fix: 组件用的是comp上的coverUrl 稿件用的是programInfo上的ullColumnImgUrls里的url appstyle有值的是稿件 compstyle有值是组件 fix |> 电子报支持系统侧滑返回http://192.168.1.3:8080/zentao/bug-view-20008.html fix |> 空串解析json报错 ref |> 处理评论列表间距和展开展示一半问题 fix: 19928 横划卡配置跳转到外链,跳转后页面比例与安卓不一致,且无返回按钮,见截图 fix: 20069 信息流页面广告-封面图左右间距应和上门稿件封面图左右间距一致,边距16 fix: 关注分割线左右留白
Showing
22 changed files
with
86 additions
and
44 deletions
| @@ -25,6 +25,7 @@ export struct WdWebComponent { | @@ -25,6 +25,7 @@ export struct WdWebComponent { | ||
| 25 | @State subjectData : string = '' | 25 | @State subjectData : string = '' |
| 26 | 26 | ||
| 27 | @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm'; | 27 | @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm'; |
| 28 | + @State userAgent:string = 'Mozilla/5.0 (Phone; OpenHarmony 5.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 ArkWeb/4.1.6.1 Mobile automobile/792 Android' | ||
| 28 | 29 | ||
| 29 | currentChanged(){ | 30 | currentChanged(){ |
| 30 | ///折叠屏转换 | 31 | ///折叠屏转换 |
| @@ -54,6 +55,9 @@ export struct WdWebComponent { | @@ -54,6 +55,9 @@ export struct WdWebComponent { | ||
| 54 | let url: string = event.data.getRequestUrl().toString() | 55 | let url: string = event.data.getRequestUrl().toString() |
| 55 | return this.onLoadIntercept(url); | 56 | return this.onLoadIntercept(url); |
| 56 | }) | 57 | }) |
| 58 | + .onControllerAttached(() => { | ||
| 59 | + this.webviewControl.setCustomUserAgent(this.userAgent); | ||
| 60 | + }) | ||
| 57 | } | 61 | } |
| 58 | } | 62 | } |
| 59 | 63 |
| @@ -52,8 +52,8 @@ export struct CardAdvBigImageComponent { | @@ -52,8 +52,8 @@ export struct CardAdvBigImageComponent { | ||
| 52 | } | 52 | } |
| 53 | .width(CommonConstants.FULL_WIDTH) | 53 | .width(CommonConstants.FULL_WIDTH) |
| 54 | .padding({ | 54 | .padding({ |
| 55 | - left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 56 | - right: $r('app.float.card_comp_pagePadding_lf'), | 55 | + left: 10, |
| 56 | + right: 10, | ||
| 57 | top: $r('app.float.card_comp_pagePadding_tb'), | 57 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 58 | bottom: $r('app.float.card_comp_pagePadding_tb') | 58 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 59 | }) | 59 | }) |
sight_harmony/features/wdComponent/src/main/ets/components/cardViewAdv/CardAdvLongImageComponent.ets
| @@ -54,8 +54,8 @@ export struct CardAdvLongImageComponent { | @@ -54,8 +54,8 @@ export struct CardAdvLongImageComponent { | ||
| 54 | } | 54 | } |
| 55 | .width(CommonConstants.FULL_WIDTH) | 55 | .width(CommonConstants.FULL_WIDTH) |
| 56 | .padding({ | 56 | .padding({ |
| 57 | - left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 58 | - right: $r('app.float.card_comp_pagePadding_lf'), | 57 | + left: 10, |
| 58 | + right: 10, | ||
| 59 | top: $r('app.float.card_comp_pagePadding_tb'), | 59 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 60 | bottom: $r('app.float.card_comp_pagePadding_tb') | 60 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 61 | }) | 61 | }) |
| @@ -87,8 +87,8 @@ export struct CardAdvSmallImageComponent { | @@ -87,8 +87,8 @@ export struct CardAdvSmallImageComponent { | ||
| 87 | .width("100%") | 87 | .width("100%") |
| 88 | .height(this.isBigThreeLine ? 127 : 106) | 88 | .height(this.isBigThreeLine ? 127 : 106) |
| 89 | .padding({ | 89 | .padding({ |
| 90 | - left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 91 | - right: $r('app.float.card_comp_pagePadding_lf'), | 90 | + left: 10, |
| 91 | + right: 10, | ||
| 92 | top: $r('app.float.card_comp_pagePadding_tb'), | 92 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 93 | bottom: $r('app.float.card_comp_pagePadding_tb') | 93 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 94 | }) | 94 | }) |
| @@ -78,8 +78,8 @@ export struct CardAdvThreeImageComponent { | @@ -78,8 +78,8 @@ export struct CardAdvThreeImageComponent { | ||
| 78 | } | 78 | } |
| 79 | .width(CommonConstants.FULL_WIDTH) | 79 | .width(CommonConstants.FULL_WIDTH) |
| 80 | .padding({ | 80 | .padding({ |
| 81 | - left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 82 | - right: $r('app.float.card_comp_pagePadding_lf'), | 81 | + left: 10, |
| 82 | + right: 10, | ||
| 83 | top: $r('app.float.card_comp_pagePadding_tb'), | 83 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 84 | bottom: $r('app.float.card_comp_pagePadding_tb') | 84 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 85 | }) | 85 | }) |
| @@ -62,8 +62,8 @@ export struct CardAdvVideoComponent { | @@ -62,8 +62,8 @@ export struct CardAdvVideoComponent { | ||
| 62 | } | 62 | } |
| 63 | .width(CommonConstants.FULL_WIDTH) | 63 | .width(CommonConstants.FULL_WIDTH) |
| 64 | .padding({ | 64 | .padding({ |
| 65 | - left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 66 | - right: $r('app.float.card_comp_pagePadding_lf'), | 65 | + left: 10, |
| 66 | + right: 10, | ||
| 67 | top: $r('app.float.card_comp_pagePadding_tb'), | 67 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 68 | bottom: $r('app.float.card_comp_pagePadding_tb') | 68 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 69 | }) | 69 | }) |
| @@ -85,8 +85,8 @@ export struct CardAdvVideoExComponent { | @@ -85,8 +85,8 @@ export struct CardAdvVideoExComponent { | ||
| 85 | } | 85 | } |
| 86 | .width(CommonConstants.FULL_WIDTH) | 86 | .width(CommonConstants.FULL_WIDTH) |
| 87 | .padding({ | 87 | .padding({ |
| 88 | - left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 89 | - right: $r('app.float.card_comp_pagePadding_lf'), | 88 | + left: 10, |
| 89 | + right: 10, | ||
| 90 | top: $r('app.float.card_comp_pagePadding_tb'), | 90 | top: $r('app.float.card_comp_pagePadding_tb'), |
| 91 | bottom: $r('app.float.card_comp_pagePadding_tb') | 91 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 92 | }) | 92 | }) |
| @@ -111,7 +111,7 @@ export struct Card10Component { | @@ -111,7 +111,7 @@ export struct Card10Component { | ||
| 111 | } | 111 | } |
| 112 | // 大图 | 112 | // 大图 |
| 113 | Stack() { | 113 | Stack() { |
| 114 | - Image(this.loadImg ? this.contentDTO?.coverUrl : '') | 114 | + Image(this.loadImg ? this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '') |
| 115 | .backgroundColor(0xf5f5f5) | 115 | .backgroundColor(0xf5f5f5) |
| 116 | .width('100%') | 116 | .width('100%') |
| 117 | .borderRadius({ | 117 | .borderRadius({ |
| @@ -80,7 +80,7 @@ export struct Card14Component { | @@ -80,7 +80,7 @@ export struct Card14Component { | ||
| 80 | .margin({right: 12}) | 80 | .margin({right: 12}) |
| 81 | .width('64%') | 81 | .width('64%') |
| 82 | 82 | ||
| 83 | - Image(this.loadImg ? this.contentDTO.coverUrl : '') | 83 | + Image(this.loadImg ? this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '') |
| 84 | .backgroundColor(0xf5f5f5) | 84 | .backgroundColor(0xf5f5f5) |
| 85 | .aspectRatio(3 / 2) | 85 | .aspectRatio(3 / 2) |
| 86 | .height(78) | 86 | .height(78) |
| @@ -80,7 +80,7 @@ export struct Card15Component { | @@ -80,7 +80,7 @@ export struct Card15Component { | ||
| 80 | } | 80 | } |
| 81 | //大图 | 81 | //大图 |
| 82 | Stack() { | 82 | Stack() { |
| 83 | - Image(this.loadImg ? this.contentDTO.coverUrl : '') | 83 | + Image(this.loadImg ? this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '') |
| 84 | .backgroundColor(0xf5f5f5) | 84 | .backgroundColor(0xf5f5f5) |
| 85 | .borderRadius($r('app.float.image_border_radius')) | 85 | .borderRadius($r('app.float.image_border_radius')) |
| 86 | //播放状态+时长 | 86 | //播放状态+时长 |
| @@ -197,14 +197,14 @@ struct createImg { | @@ -197,14 +197,14 @@ struct createImg { | ||
| 197 | alignContent: Alignment.BottomEnd | 197 | alignContent: Alignment.BottomEnd |
| 198 | }) { | 198 | }) { |
| 199 | if (this.getPicType(item.weight, item.height) === 1) { | 199 | if (this.getPicType(item.weight, item.height) === 1) { |
| 200 | - Image(this.loadImg ? item.fullUrl || item.url : '') | 200 | + Image(this.loadImg ? item.url || item.fullUrl : '') |
| 201 | .backgroundColor(0xf5f5f5) | 201 | .backgroundColor(0xf5f5f5) |
| 202 | .width('100%') | 202 | .width('100%') |
| 203 | .height(198) | 203 | .height(198) |
| 204 | .autoResize(true) | 204 | .autoResize(true) |
| 205 | .borderRadius(this.caclImageRadius(index)) | 205 | .borderRadius(this.caclImageRadius(index)) |
| 206 | } else if (this.getPicType(item.weight, item.height) === 2) { | 206 | } else if (this.getPicType(item.weight, item.height) === 2) { |
| 207 | - Image(this.loadImg ? item.fullUrl || item.url : '') | 207 | + Image(this.loadImg ? item.url || item.fullUrl : '') |
| 208 | .width('100%') | 208 | .width('100%') |
| 209 | .height(305) | 209 | .height(305) |
| 210 | .autoResize(true) | 210 | .autoResize(true) |
| @@ -153,7 +153,7 @@ struct createImg { | @@ -153,7 +153,7 @@ struct createImg { | ||
| 153 | span: { xs: 12 } | 153 | span: { xs: 12 } |
| 154 | }) { | 154 | }) { |
| 155 | Stack() { | 155 | Stack() { |
| 156 | - Image(this.loadImg ? this.contentDTO.coverUrl : '') | 156 | + Image(this.loadImg ? this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '') |
| 157 | .backgroundColor(0xf5f5f5) | 157 | .backgroundColor(0xf5f5f5) |
| 158 | .width(CommonConstants.FULL_WIDTH) | 158 | .width(CommonConstants.FULL_WIDTH) |
| 159 | .aspectRatio(16 / 9) | 159 | .aspectRatio(16 / 9) |
| @@ -176,7 +176,7 @@ struct createImg { | @@ -176,7 +176,7 @@ struct createImg { | ||
| 176 | span: { xs: 6 } | 176 | span: { xs: 6 } |
| 177 | }) { | 177 | }) { |
| 178 | Stack() { | 178 | Stack() { |
| 179 | - Image(this.loadImg ? this.contentDTO.coverUrl : '') | 179 | + Image(this.loadImg ? this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '') |
| 180 | .backgroundColor(0xf5f5f5) | 180 | .backgroundColor(0xf5f5f5) |
| 181 | .width(CommonConstants.FULL_WIDTH) | 181 | .width(CommonConstants.FULL_WIDTH) |
| 182 | .borderRadius($r('app.float.image_border_radius')) | 182 | .borderRadius($r('app.float.image_border_radius')) |
| @@ -79,7 +79,7 @@ export struct Card21Component { | @@ -79,7 +79,7 @@ export struct Card21Component { | ||
| 79 | 79 | ||
| 80 | GridItem() { | 80 | GridItem() { |
| 81 | Stack() { | 81 | Stack() { |
| 82 | - Image(this.loadImg ? this.contentDTO.coverUrl : '') | 82 | + Image(this.loadImg ? this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '') |
| 83 | .backgroundColor(0xf5f5f5) | 83 | .backgroundColor(0xf5f5f5) |
| 84 | .width(CommonConstants.FULL_WIDTH) | 84 | .width(CommonConstants.FULL_WIDTH) |
| 85 | .borderRadius($r('app.float.image_border_radius')) | 85 | .borderRadius($r('app.float.image_border_radius')) |
| 1 | //全标题 "appStyle":"2", | 1 | //全标题 "appStyle":"2", |
| 2 | import { CompDTO, ContentDTO } from 'wdBean'; | 2 | import { CompDTO, ContentDTO } from 'wdBean'; |
| 3 | -import { CommonConstants } from 'wdConstant/Index'; | 3 | +import { CommonConstants, CompStyle } from 'wdConstant/Index'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; |
| 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| @@ -44,6 +44,14 @@ export struct Card2Component { | @@ -44,6 +44,14 @@ export struct Card2Component { | ||
| 44 | this.textArr = titleInitRes.textArr; | 44 | this.textArr = titleInitRes.textArr; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | + getCover() { | ||
| 48 | + if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { | ||
| 49 | + return this.contentDTO.coverUrl | ||
| 50 | + } else if (this.contentDTO.appStyle === CompStyle.Card_02) { | ||
| 51 | + return this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl | ||
| 52 | + } | ||
| 53 | + return '' | ||
| 54 | + } | ||
| 47 | 55 | ||
| 48 | build() { | 56 | build() { |
| 49 | Column() { | 57 | Column() { |
| @@ -96,7 +104,7 @@ export struct Card2Component { | @@ -96,7 +104,7 @@ export struct Card2Component { | ||
| 96 | 104 | ||
| 97 | //大图 | 105 | //大图 |
| 98 | Stack() { | 106 | Stack() { |
| 99 | - Image(this.loadImg ? this.contentDTO.coverUrl : '') | 107 | + Image(this.loadImg ? this.getCover() : '') |
| 100 | .width(CommonConstants.FULL_WIDTH) | 108 | .width(CommonConstants.FULL_WIDTH) |
| 101 | .aspectRatio(16 / 9) | 109 | .aspectRatio(16 / 9) |
| 102 | .borderRadius($r('app.float.image_border_radius')) | 110 | .borderRadius($r('app.float.image_border_radius')) |
| 1 | import { ContentDTO, CompDTO } from 'wdBean'; | 1 | import { ContentDTO, CompDTO } from 'wdBean'; |
| 2 | -import { CommonConstants } from 'wdConstant'; | ||
| 3 | import { ProcessUtils } from 'wdRouter'; | 2 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 3 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 5 | import { Notes } from './notes'; | 4 | import { Notes } from './notes'; |
| @@ -7,7 +6,8 @@ import { getNotesContentWidth } from '../../utils/FuncUtils' | @@ -7,7 +6,8 @@ import { getNotesContentWidth } from '../../utils/FuncUtils' | ||
| 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 6 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 7 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 9 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; | 8 | import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed'; |
| 10 | -import router from '@ohos.router' | 9 | +import router from '@ohos.router'; |
| 10 | +import { CommonConstants, CompStyle } from 'wdConstant/Index'; | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | const TAG: string = 'Card5Component'; | 13 | const TAG: string = 'Card5Component'; |
| @@ -42,9 +42,18 @@ export struct Card5Component { | @@ -42,9 +42,18 @@ export struct Card5Component { | ||
| 42 | this.textArr = titleInitRes.textArr; | 42 | this.textArr = titleInitRes.textArr; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | + getCover() { | ||
| 46 | + if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | ||
| 47 | + return this.contentDTO.coverUrl | ||
| 48 | + } else if (this.contentDTO.appStyle === CompStyle.Card_05) { | ||
| 49 | + return this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl | ||
| 50 | + } | ||
| 51 | + return '' | ||
| 52 | + } | ||
| 53 | + | ||
| 45 | build() { | 54 | build() { |
| 46 | Stack() { | 55 | Stack() { |
| 47 | - Image(this.loadImg ? this.contentDTO.coverUrl : '') | 56 | + Image(this.loadImg ? this.getCover() : '') |
| 48 | .backgroundColor(0xf5f5f5) | 57 | .backgroundColor(0xf5f5f5) |
| 49 | .width(CommonConstants.FULL_WIDTH) | 58 | .width(CommonConstants.FULL_WIDTH) |
| 50 | .borderRadius( | 59 | .borderRadius( |
| @@ -35,12 +35,22 @@ export struct Card6Component { | @@ -35,12 +35,22 @@ export struct Card6Component { | ||
| 35 | const curRouter = router.getState().name; | 35 | const curRouter = router.getState().name; |
| 36 | this.clicked = hasClicked(this.contentDTO.objectId, curRouter) | 36 | this.clicked = hasClicked(this.contentDTO.objectId, curRouter) |
| 37 | } | 37 | } |
| 38 | + | ||
| 38 | titleInit() { | 39 | titleInit() { |
| 39 | const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); | 40 | const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); |
| 40 | this.titleMarked = titleInitRes.titleMarked; | 41 | this.titleMarked = titleInitRes.titleMarked; |
| 41 | this.textArr = titleInitRes.textArr; | 42 | this.textArr = titleInitRes.textArr; |
| 42 | } | 43 | } |
| 43 | 44 | ||
| 45 | + getCover() { | ||
| 46 | + if (this.compDTO.compStyle === CompStyle.Card_13) { | ||
| 47 | + return this.contentDTO.coverUrl | ||
| 48 | + } else if (this.contentDTO.appStyle === CompStyle.Card_06) { | ||
| 49 | + return this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl | ||
| 50 | + } | ||
| 51 | + return '' | ||
| 52 | + } | ||
| 53 | + | ||
| 44 | build() { | 54 | build() { |
| 45 | Row() { | 55 | Row() { |
| 46 | Column() { | 56 | Column() { |
| @@ -109,7 +119,7 @@ export struct Card6Component { | @@ -109,7 +119,7 @@ export struct Card6Component { | ||
| 109 | 119 | ||
| 110 | 120 | ||
| 111 | Stack({alignContent: Alignment.BottomEnd}) { | 121 | Stack({alignContent: Alignment.BottomEnd}) { |
| 112 | - Image(this.loadImg ? this.contentDTO.coverUrl || this.contentDTO.fullColumnImgUrls?.[0]?.url || this.contentDTO.fullColumnImgUrls?.[0]?.fullUrl : '') | 122 | + Image(this.loadImg ? this.getCover() : '') |
| 113 | .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) | 123 | .backgroundColor(this.loadImg ? $r('app.color.color_B0B0B0') : 0xf5f5f5) |
| 114 | .borderRadius(5) | 124 | .borderRadius(5) |
| 115 | .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) | 125 | .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4) |
| @@ -714,7 +714,7 @@ struct commentHeaderView { | @@ -714,7 +714,7 @@ struct commentHeaderView { | ||
| 714 | dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction | 714 | dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction |
| 715 | }).margin({ left: 60, right: 16 }) | 715 | }).margin({ left: 60, right: 16 }) |
| 716 | }.alignItems(HorizontalAlign.Start) | 716 | }.alignItems(HorizontalAlign.Start) |
| 717 | - .padding({bottom: 8}) | 717 | + .padding({bottom: 0}) |
| 718 | } | 718 | } |
| 719 | 719 | ||
| 720 | @Builder headerView() { | 720 | @Builder headerView() { |
| @@ -842,6 +842,7 @@ struct commentFooterView { | @@ -842,6 +842,7 @@ struct commentFooterView { | ||
| 842 | }) | 842 | }) |
| 843 | } | 843 | } |
| 844 | } | 844 | } |
| 845 | + // .alignItems(VerticalAlign.Bottom) | ||
| 845 | .justifyContent(FlexAlign.SpaceBetween) | 846 | .justifyContent(FlexAlign.SpaceBetween) |
| 846 | .width('100%') | 847 | .width('100%') |
| 847 | .height(30) | 848 | .height(30) |
| @@ -110,9 +110,12 @@ export struct CommentText { | @@ -110,9 +110,12 @@ export struct CommentText { | ||
| 110 | // this.maxLineMesssage = this.maxLineMesssage.slice(0, this.maxLineMesssage.length - 1) | 110 | // this.maxLineMesssage = this.maxLineMesssage.slice(0, this.maxLineMesssage.length - 1) |
| 111 | // } | 111 | // } |
| 112 | 112 | ||
| 113 | + // console.log(`XXXXXXXXXXGY:${thisTextWidth - maxLineTextWidth}`) | ||
| 113 | ///早晚报三行显示 展开功能显示末尾 | 114 | ///早晚报三行显示 展开功能显示末尾 |
| 114 | if (this.isMorningEveningPaper) { | 115 | if (this.isMorningEveningPaper) { |
| 115 | this.maxLineMesssage = this.maxLineMesssage.substring(0,this.maxLineMesssage.length - 7) | 116 | this.maxLineMesssage = this.maxLineMesssage.substring(0,this.maxLineMesssage.length - 7) |
| 117 | + } else if (thisTextWidth > maxLineTextWidth + 5) { | ||
| 118 | + this.maxLineMesssage = this.maxLineMesssage.substring(0,this.maxLineMesssage.length - 1) | ||
| 116 | } | 119 | } |
| 117 | break | 120 | break |
| 118 | } | 121 | } |
| @@ -34,7 +34,7 @@ export struct PeopleShipAttentionContentListTopComponent { | @@ -34,7 +34,7 @@ export struct PeopleShipAttentionContentListTopComponent { | ||
| 34 | .width('100%') | 34 | .width('100%') |
| 35 | .height('102vp') | 35 | .height('102vp') |
| 36 | 36 | ||
| 37 | - Divider().strokeWidth(1).color($r('app.color.color_F5F5F5')) | 37 | + Divider().strokeWidth(1).color($r('app.color.color_F5F5F5')).padding({ left: 10, right: 10 }) |
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | 40 |
| @@ -3,6 +3,7 @@ import { DateTimeUtils, Logger } from 'wdKit'; | @@ -3,6 +3,7 @@ import { DateTimeUtils, Logger } from 'wdKit'; | ||
| 3 | import common from '@ohos.app.ability.common'; | 3 | import common from '@ohos.app.ability.common'; |
| 4 | import window from '@ohos.window'; | 4 | import window from '@ohos.window'; |
| 5 | import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; | 5 | import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; |
| 6 | +import { router } from '@kit.ArkUI'; | ||
| 6 | 7 | ||
| 7 | const TAG = 'ENewspaper'; | 8 | const TAG = 'ENewspaper'; |
| 8 | 9 | ||
| @@ -64,6 +65,7 @@ struct ENewspaper { | @@ -64,6 +65,7 @@ struct ENewspaper { | ||
| 64 | 65 | ||
| 65 | onBackPress() { | 66 | onBackPress() { |
| 66 | Logger.info(TAG, 'onBackPress'); | 67 | Logger.info(TAG, 'onBackPress'); |
| 68 | + router.back() | ||
| 67 | return true | 69 | return true |
| 68 | } | 70 | } |
| 69 | } | 71 | } |
| @@ -13,6 +13,7 @@ import { BusinessError } from '@kit.BasicServicesKit'; | @@ -13,6 +13,7 @@ import { BusinessError } from '@kit.BasicServicesKit'; | ||
| 13 | import { BottomNavigationComponent } from './view/BottomNavigationComponent'; | 13 | import { BottomNavigationComponent } from './view/BottomNavigationComponent'; |
| 14 | import LaunchDataModel from './viewModel/LaunchDataModel'; | 14 | import LaunchDataModel from './viewModel/LaunchDataModel'; |
| 15 | import { LaunchPageModel } from './viewModel/LaunchPageModel'; | 15 | import { LaunchPageModel } from './viewModel/LaunchPageModel'; |
| 16 | +import { JSON } from '@kit.ArkTS'; | ||
| 16 | 17 | ||
| 17 | const TAG = 'MainPage'; | 18 | const TAG = 'MainPage'; |
| 18 | 19 | ||
| @@ -46,14 +47,19 @@ struct MainPage { | @@ -46,14 +47,19 @@ struct MainPage { | ||
| 46 | LogoutViewModel.clearLoginInfo() | 47 | LogoutViewModel.clearLoginInfo() |
| 47 | }) | 48 | }) |
| 48 | 49 | ||
| 49 | - let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_MOURNS_INFO_DATA_MODEL,'') as string | ||
| 50 | - let dataModel : LaunchDataModel = JSON.parse(dataModelStr) | ||
| 51 | - // console.log(dataModelStr) | ||
| 52 | - // 处理国殇模式数据 | ||
| 53 | - let mourns: mournsInfoModel = dataModel.mourns as mournsInfoModel | ||
| 54 | let GrayManage = new GrayManageModel() | 50 | let GrayManage = new GrayManageModel() |
| 55 | - GrayManage.setMourning(mourns) | ||
| 56 | - AppStorage.setOrCreate('GrayManage', GrayManage) | 51 | + let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_MOURNS_INFO_DATA_MODEL,'') as string |
| 52 | + try { | ||
| 53 | + if (dataModelStr && dataModelStr.length > 0) { | ||
| 54 | + let dataModel : LaunchDataModel = JSON.parse(dataModelStr) as LaunchDataModel | ||
| 55 | + // 处理国殇模式数据 | ||
| 56 | + let mourns: mournsInfoModel = dataModel.mourns as mournsInfoModel | ||
| 57 | + GrayManage.setMourning(mourns) | ||
| 58 | + } | ||
| 59 | + AppStorage.setOrCreate('GrayManage', GrayManage) | ||
| 60 | + } catch (e) { | ||
| 61 | + Logger.error(TAG, `Unexpected Text in JSON ??` + JSON.stringify(e) +" " + dataModelStr); | ||
| 62 | + } | ||
| 57 | } | 63 | } |
| 58 | 64 | ||
| 59 | pageTransition() { | 65 | pageTransition() { |
| @@ -19,15 +19,6 @@ struct DefaultWebPage { | @@ -19,15 +19,6 @@ struct DefaultWebPage { | ||
| 19 | 19 | ||
| 20 | build() { | 20 | build() { |
| 21 | Column() { | 21 | Column() { |
| 22 | - Column() { | ||
| 23 | - WdWebComponent({ | ||
| 24 | - webviewControl: this.webviewControl, | ||
| 25 | - webUrl: this.webUrl, | ||
| 26 | - isPageEnd: $isPageEnd | ||
| 27 | - }) | ||
| 28 | - }.layoutWeight(1) | ||
| 29 | - | ||
| 30 | - | ||
| 31 | Row() { | 22 | Row() { |
| 32 | Button({ type: ButtonType.Normal }) { | 23 | Button({ type: ButtonType.Normal }) { |
| 33 | Image($r("app.media.back_icon_black")) | 24 | Image($r("app.media.back_icon_black")) |
| @@ -42,6 +33,14 @@ struct DefaultWebPage { | @@ -42,6 +33,14 @@ struct DefaultWebPage { | ||
| 42 | }.width("100%").height(44) | 33 | }.width("100%").height(44) |
| 43 | .alignItems(VerticalAlign.Center) | 34 | .alignItems(VerticalAlign.Center) |
| 44 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) | 35 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) |
| 36 | + | ||
| 37 | + Column() { | ||
| 38 | + WdWebComponent({ | ||
| 39 | + webviewControl: this.webviewControl, | ||
| 40 | + webUrl: this.webUrl, | ||
| 41 | + isPageEnd: $isPageEnd | ||
| 42 | + }) | ||
| 43 | + }.layoutWeight(1) | ||
| 45 | } | 44 | } |
| 46 | .width(CommonConstants.FULL_WIDTH) | 45 | .width(CommonConstants.FULL_WIDTH) |
| 47 | .height(CommonConstants.FULL_HEIGHT).padding({ | 46 | .height(CommonConstants.FULL_HEIGHT).padding({ |
-
Please register or login to post a comment