摘要: 项目中做身份证识别时,需要传送图片的 base64 格式编码,但是手机拍摄的照片都太大了,转成 base64 简直可怕,因此找了一下解决办法 涉及到的知识点 input 标签的 onchange 事件是在上传完文件之后触发 当 input 标签 type="file" 时,使用 files 属性获取 阅读全文
posted @ 2021-01-05 16:23 alisa.huang 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 弹窗展示列表,可滚动,而滚动到底部就会穿透到body滚动 1、body { overflow: hidden }; 点击弹出的时候 document.body.style.overflow = 'hidden'; 关闭弹窗时:document.body.style.overflow = 'auto' 阅读全文
posted @ 2020-12-08 16:58 alisa.huang 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 控制元素层级可通过z-index和transform来实现。 1、通过z-index控制z轴,需要配合position属性,且position的属性值为relative、absolute、fixed和sticky时。并且给z-index显式的设置数值,数值越大,其层级越高。简单点说,数值越高,元素越 阅读全文
posted @ 2020-12-08 11:10 alisa.huang 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1、不同路由切换,会触发 constructor ,componentDidMount等 例如: http://qastatic.56qq.com/etcPrCreditCard/#/step3 跳转到 http://qastatic.56qq.com/etcPrCreditCard/#/step4 阅读全文
posted @ 2020-12-07 17:48 alisa.huang 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 1、ie11 https请求会被http域名拦截 2、0 || '' =》 结果是'',所以在接口数据处理时,传0的地方不能进行field || '' 阅读全文
posted @ 2020-12-07 17:31 alisa.huang 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 如果取的在线图片记得加时间戳 否则在线图片更新后不会生效 有缓存同时处理在线图片无法获取时,加载本地图片 // 给url添加时间戳,解决浏览器缓存 export function timestamp(url) { let result = ''; const getTimestamp = new D 阅读全文
posted @ 2020-12-07 17:30 alisa.huang 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 1、border 1px兼容性问题 解决办法:1PX(px大写) 2、iOS上使用-webkit-user-select:none导致input/textarea输入框无法输入 3、antd-mobile tabs在ios如果不禁用swipeable会出现向下滚动时触发左滑动 4、ios加载顺序打包 阅读全文
posted @ 2020-12-07 17:16 alisa.huang 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 解决办法:弹出键盘时,隐藏按钮 componentDidMount: // 修复键盘弹起导致的页面fixed定位元素布局错乱 if (device 'ios') { window.addEventListener('focusin', this.focusin); window.addEventLi 阅读全文
posted @ 2020-12-07 17:15 alisa.huang 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 问题描述 1、最近在做H5项目的时候,发现使用history.back()在IOS上返回上一页的时候,会有很严重的bug。我的场景是列表页滚动了超出一屏之后,进入详情页,再点击返回列表页,在iOS上就出现了白屏的现象,但是触屏或者滑一下,页面就又恢复了。 解决方案 使用history.back返回上 阅读全文
posted @ 2020-12-07 16:36 alisa.huang 阅读(1055) 评论(0) 推荐(0) 编辑
摘要: import { utils } from 'goblin'; import { ListView, Button, PullToRefresh } from 'antd-mobile'; import { NoDataPanel } from 'components'; import { conn 阅读全文
posted @ 2020-12-07 16:21 alisa.huang 阅读(206) 评论(0) 推荐(0) 编辑