|
@@ -7,6 +7,9 @@ import { WebViewJavascriptBridge, WVJBResponseCallback } from '@yue/webview_java
|
|
|
|
|
|
|
|
@Component
|
|
@Component
|
|
|
struct PrivacyPolicyPage {
|
|
struct PrivacyPolicyPage {
|
|
|
|
|
+ @Require fromText: string
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@State targetUrl: string = ''
|
|
@State targetUrl: string = ''
|
|
|
@State title: string = ''
|
|
@State title: string = ''
|
|
|
// 是否有进度条
|
|
// 是否有进度条
|
|
@@ -140,7 +143,10 @@ struct PrivacyPolicyPage {
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
Scroll() {
|
|
Scroll() {
|
|
|
- Web({ src: $rawfile('index.html'), controller: this.controller })
|
|
|
|
|
|
|
+ Web({
|
|
|
|
|
+ src: '',
|
|
|
|
|
+ controller: this.controller
|
|
|
|
|
+ })
|
|
|
.geolocationAccess(false)
|
|
.geolocationAccess(false)
|
|
|
.domStorageAccess(true)
|
|
.domStorageAccess(true)
|
|
|
.mixedMode(MixedMode.Compatible)
|
|
.mixedMode(MixedMode.Compatible)
|
|
@@ -148,6 +154,10 @@ struct PrivacyPolicyPage {
|
|
|
.multiWindowAccess(true)
|
|
.multiWindowAccess(true)
|
|
|
.onControllerAttached(() => {
|
|
.onControllerAttached(() => {
|
|
|
this.setupWebViewJavascriptBridge();
|
|
this.setupWebViewJavascriptBridge();
|
|
|
|
|
+ const url = `<!DOCTYPE html> <html></body> ${this.fromText} </body></html>`
|
|
|
|
|
+ console.log('url',url)
|
|
|
|
|
+ this.controller.loadData(this.fromText, '', '');
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
.onProgressChange((date) => {
|
|
.onProgressChange((date) => {
|
|
|
if (date) {
|
|
if (date) {
|
|
@@ -180,6 +190,7 @@ struct PrivacyPolicyPage {
|
|
|
return isPayment
|
|
return isPayment
|
|
|
})
|
|
})
|
|
|
.onPageEnd((event) => {
|
|
.onPageEnd((event) => {
|
|
|
|
|
+ // this.controller.runJavaScript('document.forms[0].submit()')
|
|
|
if (this.orderUrl && event.url == this.orderUrl) {
|
|
if (this.orderUrl && event.url == this.orderUrl) {
|
|
|
this.controller.clearHistory()
|
|
this.controller.clearHistory()
|
|
|
}
|
|
}
|
|
@@ -315,6 +326,6 @@ export enum StatusBarColor {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Builder
|
|
@Builder
|
|
|
-function PrivacyPolicyBuilder() {
|
|
|
|
|
- PrivacyPolicyPage()
|
|
|
|
|
|
|
+function PrivacyPolicyBuilder(_: string, fromText: string) {
|
|
|
|
|
+ PrivacyPolicyPage({fromText})
|
|
|
}
|
|
}
|