陈剑华

fix: 19928 横划卡配置跳转到外链,跳转后页面比例与安卓不一致,且无返回按钮,见截图

... ... @@ -25,6 +25,7 @@ export struct WdWebComponent {
@State subjectData : string = ''
@StorageProp('currentBreakpoint') @Watch("currentChanged")currentBreakpoint: string = 'sm';
@State userAgent:string = 'Mozilla/5.0 (Phone; OpenHarmony 5.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 ArkWeb/4.1.6.1 Mobile automobile/792 Android'
currentChanged(){
///折叠屏转换
... ... @@ -54,6 +55,9 @@ export struct WdWebComponent {
let url: string = event.data.getRequestUrl().toString()
return this.onLoadIntercept(url);
})
.onControllerAttached(() => {
this.webviewControl.setCustomUserAgent(this.userAgent);
})
}
}
... ...
... ... @@ -19,15 +19,6 @@ struct DefaultWebPage {
build() {
Column() {
Column() {
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
isPageEnd: $isPageEnd
})
}.layoutWeight(1)
Row() {
Button({ type: ButtonType.Normal }) {
Image($r("app.media.back_icon_black"))
... ... @@ -42,6 +33,14 @@ struct DefaultWebPage {
}.width("100%").height(44)
.alignItems(VerticalAlign.Center)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM])
Column() {
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
isPageEnd: $isPageEnd
})
}.layoutWeight(1)
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT).padding({
... ...