Showing
1 changed file
with
27 additions
and
15 deletions
| @@ -16,6 +16,7 @@ const TAG = 'Zh_Single_Row-03' | @@ -16,6 +16,7 @@ const TAG = 'Zh_Single_Row-03' | ||
| 16 | @Component | 16 | @Component |
| 17 | export struct ZhSingleRow03 { | 17 | export struct ZhSingleRow03 { |
| 18 | @State compDTO: CompDTO = {} as CompDTO | 18 | @State compDTO: CompDTO = {} as CompDTO |
| 19 | + @State isEndEdge: boolean = false; | ||
| 19 | scroller: Scroller = new Scroller() | 20 | scroller: Scroller = new Scroller() |
| 20 | 21 | ||
| 21 | format(timeNum: number) { | 22 | format(timeNum: number) { |
| @@ -106,6 +107,19 @@ export struct ZhSingleRow03 { | @@ -106,6 +107,19 @@ export struct ZhSingleRow03 { | ||
| 106 | } | 107 | } |
| 107 | .scrollable(ScrollDirection.Horizontal) | 108 | .scrollable(ScrollDirection.Horizontal) |
| 108 | .scrollBar(BarState.Off) | 109 | .scrollBar(BarState.Off) |
| 110 | + .onScrollEdge((side: Edge) => { | ||
| 111 | + if (side === Edge.End) { | ||
| 112 | + this.isEndEdge = true; | ||
| 113 | + } | ||
| 114 | + }) | ||
| 115 | + .onScrollStop(() => { | ||
| 116 | + if (this.isEndEdge) { | ||
| 117 | + this.jumpToMore(); | ||
| 118 | + } | ||
| 119 | + }) | ||
| 120 | + .onScroll((xOffset: number, yOffset: number) => { | ||
| 121 | + this.isEndEdge = false; | ||
| 122 | + }) | ||
| 109 | } | 123 | } |
| 110 | .padding({ | 124 | .padding({ |
| 111 | left: $r('app.float.card_comp_pagePadding_lf'), | 125 | left: $r('app.float.card_comp_pagePadding_lf'), |
| @@ -143,6 +157,19 @@ export struct ZhSingleRow03 { | @@ -143,6 +157,19 @@ export struct ZhSingleRow03 { | ||
| 143 | right: $r('app.float.card_comp_pagePadding_lf'), | 157 | right: $r('app.float.card_comp_pagePadding_lf'), |
| 144 | }) | 158 | }) |
| 145 | .onClick(() => { | 159 | .onClick(() => { |
| 160 | + this.jumpToMore(); | ||
| 161 | + }) | ||
| 162 | + } | ||
| 163 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 164 | + .margin({ top: 8, bottom: 8 }) | ||
| 165 | + .width('100%') | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + private jumpToLiveMorePage() { | ||
| 169 | + WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage) | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + private jumpToMore() { | ||
| 146 | if (this.compDTO.linkUrl) { | 173 | if (this.compDTO.linkUrl) { |
| 147 | let taskAction: Action = { | 174 | let taskAction: Action = { |
| 148 | type: 'JUMP_H5_BY_WEB_VIEW', | 175 | type: 'JUMP_H5_BY_WEB_VIEW', |
| @@ -154,23 +181,8 @@ export struct ZhSingleRow03 { | @@ -154,23 +181,8 @@ export struct ZhSingleRow03 { | ||
| 154 | } else { | 181 | } else { |
| 155 | this.jumpToLiveMorePage() | 182 | this.jumpToLiveMorePage() |
| 156 | } | 183 | } |
| 157 | - }) | ||
| 158 | - } | ||
| 159 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 160 | - .margin({ top: 8, bottom: 8 }) | ||
| 161 | - .width('100%') | ||
| 162 | } | 184 | } |
| 163 | 185 | ||
| 164 | - private jumpToLiveMorePage() { | ||
| 165 | - // let taskAction: Action = { | ||
| 166 | - // type: 'JUMP_INNER_NEW_PAGE', | ||
| 167 | - // params: { | ||
| 168 | - // pageID: 'LIVE_MORE_PAGE' | ||
| 169 | - // } as Params, | ||
| 170 | - // }; | ||
| 171 | - // WDRouterRule.jumpWithAction(taskAction) | ||
| 172 | - WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage) | ||
| 173 | - } | ||
| 174 | } | 186 | } |
| 175 | 187 | ||
| 176 | @Extend(Text) | 188 | @Extend(Text) |
-
Please register or login to post a comment