wangliang_wd

feat:调整早晚报,调整人民号展示

... ... @@ -68,8 +68,8 @@ export struct MorningEveningPaperComponent {
@Provide progressVal: number = 0;
@State mixedBgColor: string = ''
// 顶部安全高度赋值
@State topSafeHeight: number = 0;
@State bottomSafeHeight: number = 0;
@State topSafeHeight: number = px2vp(AppStorage.get<number>('topSafeHeight') || 0)
@State bottomSafeHeight: number = px2vp(AppStorage.get<number>('bottomSafeHeight') || 0)
@State isHasTopView: boolean = false;
@State scrollOffset: number = 0
@State currentStatus: number | string |undefined = 0;
... ... @@ -121,11 +121,11 @@ export struct MorningEveningPaperComponent {
}
async aboutToAppear() {
let windowHight: window.Window = await window.getLastWindow(getContext(this));
// let windowHight: window.Window = await window.getLastWindow(getContext(this));
// await windowHight.setWindowLayoutFullScreen(true);
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height)
this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height)
// this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height)
// this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height)
const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String
console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId)
... ... @@ -331,13 +331,14 @@ export struct MorningEveningPaperComponent {
.height('100%')
.objectFit(ImageFit.Contain)
Image($r('app.media.icon_listen'))
.width(24)
.height(24)
.margin({ left: 10 })
.width(20)
.height(20)
.margin({ left: 20 })
.alignSelf(ItemAlign.Start)
Text(`${this.pageInfoBean.topicInfo?.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo?.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`)
.fontSize(14)
.fontWeight(FontWeight.Medium)
.margin({ left: 50 })
.fontColor(Color.Black)
.maxLines(1)
... ...
... ... @@ -346,7 +346,9 @@ export struct SearchResultContentComponent {
}.offset({ left: this.listLeft })
ListItem(){
if (this.data_rmh.length === 10){
this.itemEnd()
}
}.height('100%')
.margin({left:'23lpx'})
}
... ... @@ -375,6 +377,8 @@ export struct SearchResultContentComponent {
console.info(TAG,'Pan start')
})
.onActionUpdate((event: GestureEvent) => {
///小于10个不展示滑动
if (this.data_rmh.length < 10) return;
if (event && this.isEnd) {
// console.log('event.offsetX',event.offsetX)
this.listLeft = event.offsetX < -60 ? -60 : event.offsetX > 0 ? 0 : event.offsetX
... ... @@ -384,6 +388,7 @@ export struct SearchResultContentComponent {
}
})
.onActionEnd((event: GestureEvent) => {
if (this.data_rmh.length < 10) return;
console.info(TAG,'Pan end')
this.listLeft = 0
// this.moreWidth = 20
... ...