Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
liyubing
2024-06-20 16:55:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cd19d58f4a39cf727af9c818f1cb14a13a2144e9
cd19d58f
1 parent
76b94baf
fix:1)电子报-电子报最后一版进入读报纸列表后_未展示该版内容
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/template/TemplatePageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperListDialog.ets
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperPageDialog.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/template/TemplatePageComponent.ets
View file @
cd19d58
...
...
@@ -122,7 +122,6 @@ export default struct TemplatePageComponent {
LazyForEach(this.templatePage.compList, (compDTO: CompDTO, index: number) => {
ListItem() {
Column() {
CompParser({
compDTO: compDTO,
nextCompDTO: index === this.templatePage.compList.getDataArray().length - 1 ? new CompDTO() : this.templatePage.compList.get(index + 1) as CompDTO,
...
...
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperListDialog.ets
View file @
cd19d58
...
...
@@ -4,7 +4,7 @@ import { WDRouterRule } from 'wdRouter/Index'
import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'
import { Logger } from 'wdKit';
import { font, window } from '@kit.ArkUI';
const TAG: string = 'ENewspaperListDialog';
/**
* 读报纸半屏弹窗
* 弹窗嵌套参考资料(https://developer.harmonyos.com/cn/docs/documentation/doc-references-V2/ts-methods-custom-dialog-box-0000001580345722-V2)
...
...
@@ -19,12 +19,16 @@ export struct ENewspaperListDialog {
@State scrollOffset: number = 0
@State isCurrentViewOpen: boolean = false
@Consume bottomSafeHeight:number
firstFlag : boolean = true
//文字版选择弹框
pageListDialogController: CustomDialogController = new CustomDialogController({
builder: ENewspaperPageDialog({
dialogType: 1,
newspaperListBean: this.newspaperListBean,
dialogVisibility: (visibility: boolean) => {
console.log(TAG, "ENewspaperPageDialog visibility:", visibility)
this.isCurrentViewOpen = !visibility
}
}),
...
...
@@ -47,10 +51,15 @@ export struct ENewspaperListDialog {
//watch监听报纸页码回调
onCurrentPageNumUpdated(): void {
console.log("ENewspaperListDialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
this.firstFlag = false
console.log(TAG, "onCurrentPageNumUpdated currentPageNum:", this.currentPageNum)
let _scrollIndex = Number.parseInt(this.currentPageNum)
console.log(
"ENewspaperListDialog-onCurrentPageNumUpdated", "
_scrollIndex:", _scrollIndex)
console.log(
TAG, "onCurrentPageNumUpdated
_scrollIndex:", _scrollIndex)
let scrollIndexEnd = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex
console.log(TAG, "onCurrentPageNumUpdated scrollIndexEnd:", scrollIndexEnd)
console.log(TAG, "onCurrentPageNumUpdated (!this.isCurrentViewOpen):", ""+!this.isCurrentViewOpen)
if (!this.isCurrentViewOpen) {
this.listScroller.scrollToIndex(scrollIndexEnd)
}
...
...
@@ -69,9 +78,9 @@ export struct ENewspaperListDialog {
this.deviceHeight = px2vp(windowClass.getWindowProperties().windowRect.height) - changeHeight
this.isCurrentViewOpen = true
console.log(
"ENewspaperListDialog-aboutToAppear", "
currentPageNum:", this.currentPageNum)
console.log(
TAG, "aboutToAppear
currentPageNum:", this.currentPageNum)
let _scrollIndex = Number.parseInt(this.currentPageNum)
console.log(
"ENewspaperListDialog-aboutToAppear", "
_scrollIndex:", _scrollIndex)
console.log(
TAG, "aboutToAppear
_scrollIndex:", _scrollIndex)
this.scrollIndex = _scrollIndex > 0 ? _scrollIndex - 1 : _scrollIndex
// this.listScroller.scrollToIndex(this.scrollIndex)
}
...
...
@@ -285,7 +294,12 @@ export struct ENewspaperListDialog {
// }
// console.info(`this.scrollOffset:` + this.scrollOffset)
// if (this.scrollOffset == 0) {
this.currentPageNum = `${firstIndex < 9 ? '0' + (firstIndex + 1) : firstIndex + 1}`
if(this.firstFlag){
this.currentPageNum = `${firstIndex < 9 ? '0' + (firstIndex + 1) : firstIndex + 1}`
}else {
this.firstFlag = true
}
// }
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/dialog/ENewspaperPageDialog.ets
View file @
cd19d58
...
...
@@ -12,7 +12,7 @@ export struct ENewspaperPageDialog {
public dialogVisibility?: (visibility: boolean) => void
onCurrentPageNumUpdated(): void {
console.log(
"ENewspaperList
Dialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
console.log(
'ENewspaperListDialog',"ENewspaperPage
Dialog-onCurrentPageNumUpdated", "currentPageNum:", this.currentPageNum)
}
aboutToAppear(): void {
...
...
Please
register
or
login
to post a comment