wangliang_wd

feat:优化早晚报

@@ -68,6 +68,7 @@ export struct MorningEveningPaperComponent { @@ -68,6 +68,7 @@ export struct MorningEveningPaperComponent {
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 @State isHasTopView: boolean = false;
  71 + @State scrollOffset: number = 0
71 72
72 private audioDataList: AudioDataList[] = [] 73 private audioDataList: AudioDataList[] = []
73 private playerController: WDPlayerController = new WDPlayerController(); 74 private playerController: WDPlayerController = new WDPlayerController();
@@ -267,24 +268,22 @@ export struct MorningEveningPaperComponent { @@ -267,24 +268,22 @@ export struct MorningEveningPaperComponent {
267 compListItem: this.compListItem, 268 compListItem: this.compListItem,
268 }) 269 })
269 .margin({ 270 .margin({
270 - top: this.pageInfoBean?.topicInfo?.frontLinkObject ? 10 : 44 271 + top: this.isHasTopView ? 10 : 44+this.topSafeHeight
271 }) 272 })
272 } 273 }
273 } 274 }
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 - } 275 + // .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`)
  276 + .scrollBar(BarState.Off)
  277 + .onWillScroll(scrollOffset =>{
  278 + this.scrollOffset = this.scrollOffset + scrollOffset as number
280 }) 279 })
281 280
282 - PaperTitleComponent().margin({top:this.isHasTopView?this.topSafeHeight:0}).backgroundColor(this.mixedBgColor).opacity(this.isHasTopView?0:1) 281 + this.topPaperTitle()
283 } 282 }
284 .width('100%') 283 .width('100%')
285 .height('100%') 284 .height('100%')
286 .padding({ 285 .padding({
287 - top: this.isHasTopView?0:this.topSafeHeight, 286 + top: 0,
288 // bottom: this.bottomSafeHeight 287 // bottom: this.bottomSafeHeight
289 }) 288 })
290 // .backgroundColor(Color.Black) 289 // .backgroundColor(Color.Black)
@@ -293,6 +292,13 @@ export struct MorningEveningPaperComponent { @@ -293,6 +292,13 @@ export struct MorningEveningPaperComponent {
293 } 292 }
294 293
295 @Builder 294 @Builder
  295 + topPaperTitle(){
  296 + Column(){
  297 + PaperTitleComponent().margin({top:this.topSafeHeight})
  298 + }.height(44+this.topSafeHeight).backgroundColor(this.scrollOffset > 100?this.mixedBgColor:'')
  299 + }
  300 +
  301 + @Builder
296 AudioBarView(dialog: CustomDialogController) { 302 AudioBarView(dialog: CustomDialogController) {
297 Row() { 303 Row() {
298 Stack({ alignContent: Alignment.Start }) { 304 Stack({ alignContent: Alignment.Start }) {
@@ -438,7 +438,7 @@ export struct PaperSingleColumn999CardView { @@ -438,7 +438,7 @@ export struct PaperSingleColumn999CardView {
438 Stack({ alignContent: Alignment.BottomEnd }) { 438 Stack({ alignContent: Alignment.BottomEnd }) {
439 Image(this.item?.coverUrl) 439 Image(this.item?.coverUrl)
440 .borderRadius(5) 440 .borderRadius(5)
441 - .aspectRatio(16 / 9) 441 + .aspectRatio(319 / 179) ///图片设计比例
442 .padding({ top: 10 }) 442 .padding({ top: 10 })
443 if (this.item?.videoInfo) { 443 if (this.item?.videoInfo) {
444 Row() { 444 Row() {
@@ -9,6 +9,7 @@ import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils @@ -9,6 +9,7 @@ import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils
9 import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; 9 import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';
10 import { channelSkeleton } from '../skeleton/channelSkeleton'; 10 import { channelSkeleton } from '../skeleton/channelSkeleton';
11 import { TrackConstants, TrackingButton } from 'wdTracking/Index'; 11 import { TrackConstants, TrackingButton } from 'wdTracking/Index';
  12 +import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
12 13
13 const TAG = 'TopNavigationComponent'; 14 const TAG = 'TopNavigationComponent';
14 15
@@ -170,13 +171,7 @@ export struct TopNavigationComponentNew { @@ -170,13 +171,7 @@ export struct TopNavigationComponentNew {
170 .height(30) 171 .height(30)
171 .width(124) 172 .width(124)
172 .onClick(() => { 173 .onClick(() => {
173 - if (NetworkUtil.isNetConnected()) {  
174 - ProcessUtils.gotoMorningEveningPaper()  
175 - TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,  
176 - TrackConstants.SummaryType.MorningAndEveningNews)  
177 - } else {  
178 - ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)  
179 - } 174 + this.clickMorningEveningPaper()
180 }) 175 })
181 }.width('100%') 176 }.width('100%')
182 .justifyContent(FlexAlign.SpaceBetween) 177 .justifyContent(FlexAlign.SpaceBetween)
@@ -621,4 +616,21 @@ export struct TopNavigationComponentNew { @@ -621,4 +616,21 @@ export struct TopNavigationComponentNew {
621 this.indicatorWidth = width 616 this.indicatorWidth = width
622 }) 617 })
623 } 618 }
  619 +
  620 + clickMorningEveningPaper(){
  621 + if (NetworkUtil.isNetConnected()) {
  622 + DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean =>{
  623 + if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
  624 + SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
  625 + ProcessUtils.gotoMorningEveningPaper()
  626 + TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews)
  627 + }else {
  628 + ToastUtils.showToast('暂无早晚报信息', 1000)
  629 + }
  630 + }).catch()
  631 + } else {
  632 + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
  633 + }
  634 + }
  635 +
624 } 636 }
@@ -7,7 +7,6 @@ @@ -7,7 +7,6 @@
7 import { SPHelper } from 'wdKit/Index' 7 import { SPHelper } from 'wdKit/Index'
8 import { WDRouterPage, WDRouterRule } from 'wdRouter' 8 import { WDRouterPage, WDRouterRule } from 'wdRouter'
9 import { TrackingButton, TrackConstants } from 'wdTracking/Index' 9 import { TrackingButton, TrackConstants } from 'wdTracking/Index'
10 -import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'  
11 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 10 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
12 11
13 const TAG = "FirstTabTopSearchComponent" 12 const TAG = "FirstTabTopSearchComponent"
@@ -19,10 +18,6 @@ export struct FirstTabTopSearchComponent { @@ -19,10 +18,6 @@ export struct FirstTabTopSearchComponent {
19 18
20 async aboutToAppear() { 19 async aboutToAppear() {
21 this.getSearchHint() 20 this.getSearchHint()
22 - let dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic()  
23 - if (dailyPaperTopicBean) {  
24 - SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);  
25 - }  
26 } 21 }
27 22
28 getSearchHint() { 23 getSearchHint() {