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
张善主
2024-06-20 17:28:49 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
706cc18a2c9ea2c24a556db75d0f71cd53967502
706cc18a
2 parents
5d1bf71e
a2a1952d
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
12 deletions
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
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/ENewspaperPageComponent.ets
View file @
706cc18
...
...
@@ -296,13 +296,13 @@ export struct ENewspaperPageComponent {
Row() {
Image($r('app.media.newspaper_shadow'))
.height($r('app.float.vp_12'))
.width(
'100%'
)
.width(
px2vp(this.picWidth)
)
.objectFit(ImageFit.Contain)
}.margin({ top: -1
,left: 10, right: 10
}).alignRules({
}.margin({ top: -1 }).alignRules({
top: { anchor: "e_newspaper_content", align: VerticalAlign.Bottom },
// left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start },
// right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End }
left: { anchor: 'e_newspaper_content', align: HorizontalAlign.Start },
right: { anchor: 'e_newspaper_content', align: HorizontalAlign.End }
})
.id('e_newspaper_shadow')
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/template/TemplatePageComponent.ets
View file @
706cc18
...
...
@@ -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 @
706cc18
...
...
@@ -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 @
706cc18
...
...
@@ -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