Commit 4d5cf9919141903ec461f02b0250264613eea625
1 parent
a10e0712
华为和荣耀手机浏览器,search页面返回时键盘区域灰框单独处理,重新请求接口初始化页面~
Showing
2 changed files
with
18 additions
and
0 deletions
src/pages/common/common.vue
src/pages/search/search.vue
| ... | ... | @@ -915,6 +915,22 @@ |
| 915 | 915 | // // 获取用户定位坐标 |
| 916 | 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 | 936 | </script> | ... | ... |