陈剑华

fix: defaultWebPage

@@ -19,6 +19,7 @@ export struct WdWebComponent { @@ -19,6 +19,7 @@ export struct WdWebComponent {
19 receiveH5SendToNativeData: (dataString:string | undefined) => void = () =>{ 19 receiveH5SendToNativeData: (dataString:string | undefined) => void = () =>{
20 20
21 } 21 }
  22 + @Prop isDefaultPage: boolean = false;
22 @Prop webUrl: string = '' 23 @Prop webUrl: string = ''
23 @Prop @Watch('onReloadStateChanged') reload: number = 0 24 @Prop @Watch('onReloadStateChanged') reload: number = 0
24 @Link isPageEnd: boolean 25 @Link isPageEnd: boolean
@@ -56,9 +57,11 @@ export struct WdWebComponent { @@ -56,9 +57,11 @@ export struct WdWebComponent {
56 return this.onLoadIntercept(url); 57 return this.onLoadIntercept(url);
57 }) 58 })
58 // 添加之后影响了专题详情页中 点击稿件进详情的操作,这里先临时注释 59 // 添加之后影响了专题详情页中 点击稿件进详情的操作,这里先临时注释
59 - // .onControllerAttached(() => {  
60 - // this.webviewControl.setCustomUserAgent(this.userAgent);  
61 - // }) 60 + .onControllerAttached(() => {
  61 + if (this.isDefaultPage) {
  62 + this.webviewControl.setCustomUserAgent(this.userAgent);
  63 + }
  64 + })
62 } 65 }
63 } 66 }
64 67
@@ -38,7 +38,8 @@ struct DefaultWebPage { @@ -38,7 +38,8 @@ struct DefaultWebPage {
38 WdWebComponent({ 38 WdWebComponent({
39 webviewControl: this.webviewControl, 39 webviewControl: this.webviewControl,
40 webUrl: this.webUrl, 40 webUrl: this.webUrl,
41 - isPageEnd: $isPageEnd 41 + isPageEnd: $isPageEnd,
  42 + isDefaultPage: true
42 }) 43 })
43 }.layoutWeight(1) 44 }.layoutWeight(1)
44 } 45 }