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