Showing
2 changed files
with
10 additions
and
6 deletions
| @@ -33,6 +33,7 @@ export struct WdWebLocalComponent { | @@ -33,6 +33,7 @@ export struct WdWebLocalComponent { | ||
| 33 | @State progressOpacity: number = 1 | 33 | @State progressOpacity: number = 1 |
| 34 | @State durationStringTime: string = ''; | 34 | @State durationStringTime: string = ''; |
| 35 | private progressTimerNumber: number = 0 | 35 | private progressTimerNumber: number = 0 |
| 36 | + private webIsLoaded:boolean = false | ||
| 36 | @State isPause: boolean = true; | 37 | @State isPause: boolean = true; |
| 37 | controller: VideoController = new VideoController() | 38 | controller: VideoController = new VideoController() |
| 38 | @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm'; | 39 | @StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm'; |
| @@ -197,6 +198,7 @@ export struct WdWebLocalComponent { | @@ -197,6 +198,7 @@ export struct WdWebLocalComponent { | ||
| 197 | Logger.debug(TAG, 'onPageEnd'); | 198 | Logger.debug(TAG, 'onPageEnd'); |
| 198 | this.onWebPrepared() | 199 | this.onWebPrepared() |
| 199 | this.isPageEnd = true | 200 | this.isPageEnd = true |
| 201 | + this.webIsLoaded = true | ||
| 200 | } | 202 | } |
| 201 | onLoadIntercept: (url?: string) => boolean = () => { | 203 | onLoadIntercept: (url?: string) => boolean = () => { |
| 202 | Logger.debug(TAG, 'onLoadIntercept return false'); | 204 | Logger.debug(TAG, 'onLoadIntercept return false'); |
| @@ -231,14 +233,16 @@ export struct WdWebLocalComponent { | @@ -231,14 +233,16 @@ export struct WdWebLocalComponent { | ||
| 231 | } | 233 | } |
| 232 | 234 | ||
| 233 | aboutToAppear(): void { | 235 | aboutToAppear(): void { |
| 236 | + this.webIsLoaded = false | ||
| 234 | EmitterUtils.receiveEvent(EmitterEventId.APP_PAGE_SHOW, () => { | 237 | EmitterUtils.receiveEvent(EmitterEventId.APP_PAGE_SHOW, () => { |
| 235 | let params = {'event':NativeCallH5Event.NativeCallH5EventPageWillAppear} as eventParams; | 238 | let params = {'event':NativeCallH5Event.NativeCallH5EventPageWillAppear} as eventParams; |
| 236 | let jsonString = JSON.stringify(params); | 239 | let jsonString = JSON.stringify(params); |
| 237 | - if (this.isPageEnd) { | ||
| 238 | - this.webviewControl.callHandle(NativeCallH5Type.jsCall_appNotifyEvent, jsonString, (data: string) => { | ||
| 239 | - Logger.debug(TAG, "from js data = " + data); | ||
| 240 | - }) | ||
| 241 | - } | 240 | + Logger.debug(TAG, 'APP_PAGE_SHOW'+this.webIsLoaded); |
| 241 | + // if (this.webIsLoaded) { | ||
| 242 | + // this.webviewControl.callHandle(NativeCallH5Type.jsCall_appNotifyEvent, jsonString, (data: string) => { | ||
| 243 | + // Logger.debug(TAG, "from js data = " + data); | ||
| 244 | + // }) | ||
| 245 | + // } | ||
| 242 | }) | 246 | }) |
| 243 | } | 247 | } |
| 244 | 248 |
-
Please register or login to post a comment