关于ios 微信内调用jssdk以及base64以及下拉显示网页由微信提供的解决方案(h5页微信内踩坑记)
文章目录
jssdk获取收授权失败
两大原因
1.微信服务号或者订阅号***JS接口安全域名***配置(前端项目的服务器地址域名)用来获取相机wx.chooseImage权限
2.(spa)因为ios微信版本问题导致页面跳转url未变化,导致验签失败 berforeRouteEnter进行拦截直接拉取一个新页面不用路由导航或者直接写location.href
ios无法预览base图片
ios从微信上传的图片返回的base64是没有base64文件格式的前缀的,ios可以显示但是anroid必须是严格的base64格式,要做个兼容
不显示微信下拉“网页由QQ浏览提供技术支持”
**思路
1.禁掉webview的touch事件同时开启滑动优化
2.在某个容器内允许touch事件
this.$nextTick(() => {
this.overscroll(document.querySelector('.custom-create-poster'));
document.body.addEventListener('touchmove' , (evt) => {
// console.log('11111====>', evt._isScroller);
if (!evt._isScroller) {
evt.preventDefault();
}
}, {passive: false});
});
overscroll(el) {
el.addEventListener('touchstart', () => {
console.log('aaaa==================>');
const top = el.scrollTop;
const totalScroll = el.scrollHeight;
const currentScroll = top + el.offsetHeight;
if (top === 0) {
el.scrollTop = 1;
} else if (currentScroll === totalScroll) {
el.scrollTop = top - 1;
}
});
el.addEventListener('touchmove', (evt) => {
if (el.offsetHeight < el.scrollHeight) {
evt._isScroller = true;
}
// console.log('ccccccc');
// evt._isScroller = true;
// console.log('aaaaa======>');
});
},
###
ios长按二维码无法识别弹出发送给朋友选项
也是vue-router的history模式导致,直接loaction.href过去
###
百度统计埋点埋不上,meta标签设置了reffer导致的,直接注释掉就Ok了
###
ios 10.3版本一下不支持base64
###
线上微信安全域名配置后需要把微信文档上的 .text文件上传到服务器,这样才能生效~~~~

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论