wangliang_wd

feat:优化早晚报

... ... @@ -68,6 +68,7 @@ export struct MorningEveningPaperComponent {
@State topSafeHeight: number = 0;
@State bottomSafeHeight: number = 0;
@State isHasTopView: boolean = false;
@State scrollOffset: number = 0
private audioDataList: AudioDataList[] = []
private playerController: WDPlayerController = new WDPlayerController();
... ... @@ -267,24 +268,22 @@ export struct MorningEveningPaperComponent {
compListItem: this.compListItem,
})
.margin({
top: this.pageInfoBean?.topicInfo?.frontLinkObject ? 10 : 44
top: this.isHasTopView ? 10 : 44+this.topSafeHeight
})
}
}
.height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off)
.onAreaChange((oldValue: Area, newValue: Area) => {
let persent = Math.abs(Number(newValue.globalPosition.y)) / 150
if (persent > 1) {
persent = 1
}
// .height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`)
.scrollBar(BarState.Off)
.onWillScroll(scrollOffset =>{
this.scrollOffset = this.scrollOffset + scrollOffset as number
})
PaperTitleComponent().margin({top:this.isHasTopView?this.topSafeHeight:0}).backgroundColor(this.mixedBgColor).opacity(this.isHasTopView?0:1)
this.topPaperTitle()
}
.width('100%')
.height('100%')
.padding({
top: this.isHasTopView?0:this.topSafeHeight,
top: 0,
// bottom: this.bottomSafeHeight
})
// .backgroundColor(Color.Black)
... ... @@ -293,6 +292,13 @@ export struct MorningEveningPaperComponent {
}
@Builder
topPaperTitle(){
Column(){
PaperTitleComponent().margin({top:this.topSafeHeight})
}.height(44+this.topSafeHeight).backgroundColor(this.scrollOffset > 100?this.mixedBgColor:'')
}
@Builder
AudioBarView(dialog: CustomDialogController) {
Row() {
Stack({ alignContent: Alignment.Start }) {
... ...
... ... @@ -438,7 +438,7 @@ export struct PaperSingleColumn999CardView {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.item?.coverUrl)
.borderRadius(5)
.aspectRatio(16 / 9)
.aspectRatio(319 / 179) ///图片设计比例
.padding({ top: 10 })
if (this.item?.videoInfo) {
Row() {
... ...
... ... @@ -9,6 +9,7 @@ import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils
import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';
import { channelSkeleton } from '../skeleton/channelSkeleton';
import { TrackConstants, TrackingButton } from 'wdTracking/Index';
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
const TAG = 'TopNavigationComponent';
... ... @@ -170,13 +171,7 @@ export struct TopNavigationComponentNew {
.height(30)
.width(124)
.onClick(() => {
if (NetworkUtil.isNetConnected()) {
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
TrackConstants.SummaryType.MorningAndEveningNews)
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
this.clickMorningEveningPaper()
})
}.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
... ... @@ -621,4 +616,21 @@ export struct TopNavigationComponentNew {
this.indicatorWidth = width
})
}
clickMorningEveningPaper(){
if (NetworkUtil.isNetConnected()) {
DailyPaperTopicModel.getDailyPaperTopic().then(dailyPaperTopicBean =>{
if (dailyPaperTopicBean && dailyPaperTopicBean.id > 0) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews)
}else {
ToastUtils.showToast('暂无早晚报信息', 1000)
}
}).catch()
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
}
}
\ No newline at end of file
... ...
... ... @@ -7,7 +7,6 @@
import { SPHelper } from 'wdKit/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter'
import { TrackingButton, TrackConstants } from 'wdTracking/Index'
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
const TAG = "FirstTabTopSearchComponent"
... ... @@ -19,10 +18,6 @@ export struct FirstTabTopSearchComponent {
async aboutToAppear() {
this.getSearchHint()
let dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic()
if (dailyPaperTopicBean) {
SPHelper.default.saveSync('dailyPaperTopicPageId', dailyPaperTopicBean.id);
}
}
getSearchHint() {
... ...