Commit 4d5cf9919141903ec461f02b0250264613eea625
1 parent
a10e0712
华为和荣耀手机浏览器,search页面返回时键盘区域灰框单独处理,重新请求接口初始化页面~
Showing
2 changed files
with
18 additions
and
0 deletions
src/pages/common/common.vue
| @@ -98,6 +98,7 @@ | @@ -98,6 +98,7 @@ | ||
| 98 | this.helper = new Helper(this); | 98 | this.helper = new Helper(this); |
| 99 | }, | 99 | }, |
| 100 | methods: { | 100 | methods: { |
| 101 | + | ||
| 101 | /** | 102 | /** |
| 102 | * 失去焦点事件,处理微信端页面滚动条不归位的问题 | 103 | * 失去焦点事件,处理微信端页面滚动条不归位的问题 |
| 103 | */ | 104 | */ |
| @@ -115,6 +116,7 @@ | @@ -115,6 +116,7 @@ | ||
| 115 | }, 100); | 116 | }, 100); |
| 116 | } | 117 | } |
| 117 | }, | 118 | }, |
| 119 | + | ||
| 118 | /** | 120 | /** |
| 119 | * 设置访问设备 | 121 | * 设置访问设备 |
| 120 | */ | 122 | */ |
src/pages/search/search.vue
| @@ -915,6 +915,22 @@ | @@ -915,6 +915,22 @@ | ||
| 915 | // // 获取用户定位坐标 | 915 | // // 获取用户定位坐标 |
| 916 | // this.$parent.helper.getLocation(this.positionCallback, this.positionErrorCallback, this.initPage); | 916 | // this.$parent.helper.getLocation(this.positionCallback, this.positionErrorCallback, this.initPage); |
| 917 | // } | 917 | // } |
| 918 | + | ||
| 919 | + | ||
| 920 | + // 页面切换可见状态监听 | ||
| 921 | + document.addEventListener('visibilitychange', () => { | ||
| 922 | + | ||
| 923 | + // 页面显示出来了 | ||
| 924 | + if (document.hidden === false && this.$route.name == 'search') { | ||
| 925 | + | ||
| 926 | + // 判断UA,如果是华为手机或者荣耀手机,重新初始化页面 | ||
| 927 | + if(ua.match(/Android/i) == "huawei" || ua.match(/Android/i) == "honor") { | ||
| 928 | + | ||
| 929 | + // 初始化页面 | ||
| 930 | + this.initPage(); | ||
| 931 | + } | ||
| 932 | + } | ||
| 933 | + }); | ||
| 918 | } | 934 | } |
| 919 | } | 935 | } |
| 920 | </script> | 936 | </script> |