Ios与安卓的兼容性 问题

  • Ios拍照上传给服务端图片进行了旋转
    • 解决办法:前端上传后转成Base64后发现图是没有被旋转的,只有传给服务端就旋转了,费了好久的时间在本地使用Exif、Canvas进行旋转发现没有用,因为在本地是正常的,进行旋转之后反而是歪的了,所以交了给服务端来,结果服务端说从文件流中拿不到参数,所以给服务端传了个图片角度。服务端进行了旋转,正常了。
图片角度获取代码
// 通过EXIF来获取角度,传给服务端及可
getOrientation (file) {
      console.log('file', 'file', file)
      return new Promise((resolve) => {
        EXIF.getData(file, function () {
          const orient = EXIF.getTag(file, 'Orientation')
          resolve(orient)
        })
      })
    }
  • 安卓上传图片设置了multiple,依旧不可多选(没有解决,待更新)

  • ios 滑动不流畅问题及回到顶部效果生硬

在html,body上添加,我之前使用的*,依旧不流畅
html,
body
  width: 100%
  height: 100%
  scroll-behavior: smooth
  overflow-x: hidden
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0)
  -webkit-touch-callout: none
  -webkit-overflow-scrolling: touch
// 滑动平滑不生硬参考文章: https://www.zhangxinxu.com/wordpress/2018/10/scroll-behavior-scrollintoview-%E5%B9%B3%E6%BB%91%E6%BB%9A%E5%8A%A8/
  • 在输入框较大时,滑动会触发焦点从而拉起键盘。Ios及安卓都存在
mounted () {
    window.addEventListener('touchmove', this.myTouchMove)
  },
myTouchMove () {
   if (document.hasFocus) {
     document.activeElement.blur()
   }
},

你可能感兴趣的:(Ios与安卓的兼容性 问题)