Showing
1 changed file
with
30 additions
and
18 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,17 +157,7 @@ export struct ZhSingleRow03 { | @@ -143,17 +157,7 @@ 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(() => { |
| 146 | - if (this.compDTO.linkUrl) { | ||
| 147 | - let taskAction: Action = { | ||
| 148 | - type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 149 | - params: { | ||
| 150 | - url: this.compDTO.linkUrl | ||
| 151 | - } as Params, | ||
| 152 | - }; | ||
| 153 | - WDRouterRule.jumpWithAction(taskAction) | ||
| 154 | - } else { | ||
| 155 | - this.jumpToLiveMorePage() | ||
| 156 | - } | 160 | + this.jumpToMore(); |
| 157 | }) | 161 | }) |
| 158 | } | 162 | } |
| 159 | .justifyContent(FlexAlign.SpaceBetween) | 163 | .justifyContent(FlexAlign.SpaceBetween) |
| @@ -162,15 +166,23 @@ export struct ZhSingleRow03 { | @@ -162,15 +166,23 @@ export struct ZhSingleRow03 { | ||
| 162 | } | 166 | } |
| 163 | 167 | ||
| 164 | private jumpToLiveMorePage() { | 168 | 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) | 169 | WDRouterRule.jumpWithPage(WDRouterPage.reserveMorePage) |
| 173 | } | 170 | } |
| 171 | + | ||
| 172 | + private jumpToMore() { | ||
| 173 | + if (this.compDTO.linkUrl) { | ||
| 174 | + let taskAction: Action = { | ||
| 175 | + type: 'JUMP_H5_BY_WEB_VIEW', | ||
| 176 | + params: { | ||
| 177 | + url: this.compDTO.linkUrl | ||
| 178 | + } as Params, | ||
| 179 | + }; | ||
| 180 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 181 | + } else { | ||
| 182 | + this.jumpToLiveMorePage() | ||
| 183 | + } | ||
| 184 | + } | ||
| 185 | + | ||
| 174 | } | 186 | } |
| 175 | 187 | ||
| 176 | @Extend(Text) | 188 | @Extend(Text) |
-
Please register or login to post a comment