liyubing

fix:1)电子报-电子报最后一版进入读报纸列表后_未展示该版内容

... ... @@ -60,10 +60,11 @@ export struct ENewspaperPageComponent {
//watch监听报纸页码回调
onCurrentPageNumUpdated(): void {
console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
let _swiperIndex = Number.parseInt(this.currentPageNum)
console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "_swiperIndex:", _swiperIndex)
this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
// let _swiperIndex = Number.parseInt(this.currentPageNum)
// console.log("ENewspaperPageComponent-onCurrentPageNumUpdated", "_swiperIndex:", _swiperIndex)
// this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
this.swiperIndex = this.newspaperListBean?.list.findIndex(_item => _item?.pageNum === this.currentPageNum)
//电子报--版面序号选择点击
TrackingContent.clickWithEvent('panel_number_selection_click', TrackConstants.PageName.NewsPaperPage,
TrackConstants.PageName.NewsPaperPage
... ... @@ -140,7 +141,8 @@ export struct ENewspaperPageComponent {
let screenHeight = this.displayTool.height;
// bottomSafeHeight 底导高度 topSafeHeight 顶导高度 44 顶部高度 60 底部高度
// newspaper_shadow 49 高度 e_newspaper_content 59 margin top
let height = screenHeight - this.bottomSafeHeight - this.topSafeHeight - vp2px(44) - vp2px(60) - vp2px(49) -vp2px(59)
let height =
screenHeight - this.bottomSafeHeight - this.topSafeHeight - vp2px(44) - vp2px(60) - vp2px(49) - vp2px(59)
this.picHeight = height
let ratio = this.ratio == '100%' ? 1 : 0.5
... ... @@ -176,6 +178,7 @@ export struct ENewspaperPageComponent {
this.resize()
});
}
resize() {
this.screenWidth = this.windowClass?.getWindowProperties()?.windowRect.width || this.displayTool.width
// 2000折叠屏 TODO DeviceUtil 方法完善了换判断条件
... ... @@ -262,7 +265,7 @@ export struct ENewspaperPageComponent {
.width(px2vp(this.picWidth))
.height(px2vp(this.picHeight))
.margin({ top: 59, left: 10, right: 10 })
// .padding({ right: 10, left: 10 })
// .padding({ right: 10, left: 10 })
}
if (this.newspaperListBean && this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
... ... @@ -422,7 +425,7 @@ export struct ENewspaperPageComponent {
.width('100%')
.height('100%')
.backgroundColor($r('app.color.color_80000000'))
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
.id('e_newspaper_container')
if (this.isOpenListDialog) {
... ... @@ -455,7 +458,7 @@ export struct ENewspaperPageComponent {
try {
if (NetworkUtil.isNetConnected()) {
let listBean =
await NewspaperViewModel.getNewspaperList(this.calendarDate, this.itemPicWidth + 'x' + this.itemPicHeight)
await NewspaperViewModel.getNewspaperList(this.calendarDate, this.itemPicWidth + 'x' + this.itemPicHeight)
this.newspaperListBean = listBean;
} else {
this.showToastTip('网络出小差了,请检查网络后重试')
... ...
... ... @@ -48,6 +48,9 @@ export struct ENewspaperListDialog {
@State topHeight: number = 124
private deviceHeight: number = 0
selectPageNum : boolean = true
//watch监听报纸页码回调
onCurrentPageNumUpdated(): void {
// console.log(TAG, "onCurrentPageNumUpdated currentPageNum:", this.currentPageNum)
... ... @@ -56,6 +59,8 @@ export struct ENewspaperListDialog {
// let scrollIndexEnd = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex
if (this.newspaperListBean != undefined) {
this.selectPageNum = false
// 从业务数据中找到编号
let scrollIndexEnd = this.newspaperListBean?.list.findIndex(_item => _item?.pageNum === this.currentPageNum)
... ... @@ -82,10 +87,12 @@ export struct ENewspaperListDialog {
this.isCurrentViewOpen = true
console.log(TAG, "aboutToAppear currentPageNum:", this.currentPageNum)
let _scrollIndex = Number.parseInt(this.currentPageNum)
console.log(TAG, "aboutToAppear _scrollIndex:", _scrollIndex)
this.scrollIndex = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex
// let _scrollIndex = Number.parseInt(this.currentPageNum)
// console.log(TAG, "aboutToAppear _scrollIndex:", _scrollIndex)
// this.scrollIndex = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex
// this.listScroller.scrollToIndex(this.scrollIndex)
this.scrollIndex = this.newspaperListBean?.list.findIndex(_item => _item?.pageNum === this.currentPageNum)
}
aboutToDisappear() {
... ... @@ -292,10 +299,15 @@ export struct ENewspaperListDialog {
// this.currentPageNum = `${firstIndex < 9 ? '0' + (firstIndex + 1) : firstIndex + 1}`
if (this.newspaperListBean != undefined) {
this.currentPageNum = this.newspaperListBean?.list[lastIndex].pageNum
if(this.selectPageNum){
if (this.newspaperListBean != undefined) {
this.currentPageNum = this.newspaperListBean?.list[lastIndex].pageNum
}
}else {
this.selectPageNum = true
}
})
}
.margin({ top: this.topHeight })
... ...