|
@@ -7,6 +7,8 @@ import { BusinessError } from '@kit.BasicServicesKit';
|
|
|
import { ToolsHelper } from '../utils/ToolsHelper';
|
|
|
import { XWebParams } from '../utils/XWebHelper';
|
|
|
import { WindowHelper } from '../utils/WindowHelper';
|
|
|
+import { SZYXLocalStorageHelper } from '../utils/SZYXLocalStorageHelper';
|
|
|
+import { SZYXLocalStorageKeys } from '../utils/SZYXLocalStorageKeys';
|
|
|
|
|
|
@Entry({ routeName: 'XWebview' })
|
|
|
@Preview
|
|
@@ -15,6 +17,7 @@ export struct XWebview {
|
|
|
// 手机号
|
|
|
@State url: string = (router.getParams() as XWebParams).url
|
|
|
@State title?: string = (router.getParams() as XWebParams).title
|
|
|
+ @State closeTag?: string = (router.getParams() as XWebParams).closeTag
|
|
|
@State showMenu: boolean = (router.getParams() as XWebParams).showMenu ?? false
|
|
|
@State errorInfo: string | null = null
|
|
|
@State progress: number = 0
|
|
@@ -22,9 +25,13 @@ export struct XWebview {
|
|
|
dialogController: XDialogController = {} as XDialogController
|
|
|
|
|
|
aboutToAppear(): void {
|
|
|
+ SZYXLocalStorageHelper.storage.setOrCreate(SZYXLocalStorageKeys.XWebViewCLose, undefined)
|
|
|
}
|
|
|
|
|
|
aboutToDisappear(): void {
|
|
|
+ if (this.closeTag !== undefined) {
|
|
|
+ SZYXLocalStorageHelper.storage.setOrCreate(SZYXLocalStorageKeys.XWebViewCLose, this.closeTag)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
onBackPress(): boolean | void {
|