陈剑华

fix: 直播预约卡滚动到底跳转更多预约

... ... @@ -16,6 +16,7 @@ const TAG = 'Zh_Single_Row-03'
@Component
export struct ZhSingleRow03 {
@State compDTO: CompDTO = {} as CompDTO
@State isEndEdge: boolean = false;
scroller: Scroller = new Scroller()
format(timeNum: number) {
... ... @@ -106,6 +107,19 @@ export struct ZhSingleRow03 {
}
.scrollable(ScrollDirection.Horizontal)
.scrollBar(BarState.Off)
.onScrollEdge((side: Edge) => {
if (side === Edge.End) {
this.isEndEdge = true;
}
})
.onScrollStop(() => {
if (this.isEndEdge) {
this.jumpToMore();
}
})
.onScroll((xOffset: number, yOffset: number) => {
this.isEndEdge = false;
})
}
.padding({
left: $r('app.float.card_comp_pagePadding_lf'),
... ... @@ -143,17 +157,7 @@ export struct ZhSingleRow03 {
right: $r('app.float.card_comp_pagePadding_lf'),
})
.onClick(() => {
if (this.compDTO.linkUrl) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: this.compDTO.linkUrl
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
} else {
this.jumpToLiveMorePage()
}
this.jumpToMore();
})
}
.justifyContent(FlexAlign.SpaceBetween)
... ... @@ -162,15 +166,23 @@ export struct ZhSingleRow03 {
}
private jumpToLiveMorePage() {
// let taskAction: Action = {
// type: 'JUMP_INNER_NEW_PAGE',
// params: {
// pageID: 'LIVE_MORE_PAGE'
// } as Params,
// };
// WDRouterRule.jumpWithAction(taskAction)
WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage)
}
private jumpToMore() {
if (this.compDTO.linkUrl) {
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
url: this.compDTO.linkUrl
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
} else {
this.jumpToLiveMorePage()
}
}
}
@Extend(Text)
... ...