Showing
1 changed file
with
17 additions
and
10 deletions
| @@ -67,6 +67,7 @@ export struct MorningEveningPaperComponent { | @@ -67,6 +67,7 @@ export struct MorningEveningPaperComponent { | ||
| 67 | // 顶部安全高度赋值 | 67 | // 顶部安全高度赋值 |
| 68 | @State topSafeHeight: number = 0; | 68 | @State topSafeHeight: number = 0; |
| 69 | @State bottomSafeHeight: number = 0; | 69 | @State bottomSafeHeight: number = 0; |
| 70 | + @State isHasTopView: boolean = false; | ||
| 70 | 71 | ||
| 71 | private audioDataList: AudioDataList[] = [] | 72 | private audioDataList: AudioDataList[] = [] |
| 72 | private playerController: WDPlayerController = new WDPlayerController(); | 73 | private playerController: WDPlayerController = new WDPlayerController(); |
| @@ -145,7 +146,9 @@ export struct MorningEveningPaperComponent { | @@ -145,7 +146,9 @@ export struct MorningEveningPaperComponent { | ||
| 145 | Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) | 146 | Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) |
| 146 | Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) | 147 | Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) |
| 147 | 148 | ||
| 148 | - this.setComponentBgColor(this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string) | 149 | + this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false |
| 150 | + let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :'' | ||
| 151 | + this.setComponentBgColor(coverUrl) | ||
| 149 | 152 | ||
| 150 | let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) | 153 | let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) |
| 151 | // this.compInfoBean = compInfoBean | 154 | // this.compInfoBean = compInfoBean |
| @@ -202,11 +205,9 @@ export struct MorningEveningPaperComponent { | @@ -202,11 +205,9 @@ export struct MorningEveningPaperComponent { | ||
| 202 | // const pixelMap: image.PixelMap = await image2PixelMap(item.icon); | 205 | // const pixelMap: image.PixelMap = await image2PixelMap(item.icon); |
| 203 | Logger.debug(TAG, "compInfoBean compStyle = " + imageUrl) | 206 | Logger.debug(TAG, "compInfoBean compStyle = " + imageUrl) |
| 204 | 207 | ||
| 205 | - const imageSource: image.ImageSource | undefined = await getPicture(imageUrl) | ||
| 206 | - | ||
| 207 | - if (imageSource && this.pageInfoBean.topicInfo.frontFlag === 1) { | 208 | + if (imageUrl.length > 0 && this.pageInfoBean.topicInfo.frontFlag === 1) { |
| 209 | + const imageSource: image.ImageSource | undefined = await getPicture(imageUrl) | ||
| 208 | this.pickColor(imageSource) | 210 | this.pickColor(imageSource) |
| 209 | - | ||
| 210 | } else { | 211 | } else { |
| 211 | if (this.pageInfoBean.topicInfo.topicPattern === 1) { | 212 | if (this.pageInfoBean.topicInfo.topicPattern === 1) { |
| 212 | this.mixedBgColor = '#66BDBD' | 213 | this.mixedBgColor = '#66BDBD' |
| @@ -271,15 +272,21 @@ export struct MorningEveningPaperComponent { | @@ -271,15 +272,21 @@ export struct MorningEveningPaperComponent { | ||
| 271 | } | 272 | } |
| 272 | } | 273 | } |
| 273 | .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off) | 274 | .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off) |
| 275 | + .onAreaChange((oldValue: Area, newValue: Area) => { | ||
| 276 | + let persent = Math.abs(Number(newValue.globalPosition.y)) / 150 | ||
| 277 | + if (persent > 1) { | ||
| 278 | + persent = 1 | ||
| 279 | + } | ||
| 280 | + }) | ||
| 274 | 281 | ||
| 275 | - PaperTitleComponent().margin({top:this.topSafeHeight}) | 282 | + PaperTitleComponent().margin({top:this.isHasTopView?this.topSafeHeight:0}).backgroundColor(this.mixedBgColor).opacity(this.isHasTopView?0:1) |
| 276 | } | 283 | } |
| 277 | .width('100%') | 284 | .width('100%') |
| 278 | .height('100%') | 285 | .height('100%') |
| 279 | - // .padding({ | ||
| 280 | - // top: this.topSafeHeight, | ||
| 281 | - // bottom: this.bottomSafeHeight | ||
| 282 | - // }) | 286 | + .padding({ |
| 287 | + top: this.isHasTopView?0:this.topSafeHeight, | ||
| 288 | + // bottom: this.bottomSafeHeight | ||
| 289 | + }) | ||
| 283 | // .backgroundColor(Color.Black) | 290 | // .backgroundColor(Color.Black) |
| 284 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) | 291 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) |
| 285 | .backgroundColor(this.mixedBgColor ?? Color.Black) | 292 | .backgroundColor(this.mixedBgColor ?? Color.Black) |
-
Please register or login to post a comment