微信小程序踩坑(二)

1.弹窗点透:(加z-index提高层级)

2.微信小程序原生组件button组件的去除border:

.btn::after{ border: none; }

3.自定义弹出框底部页面会出现滚动:使用方法catchtouchmove

4.url传值,出现JSON.parse错误:

4.ios---Date问题(同样存在移动端):iosDate支持2018/07/19

“2017-11-11 11:11:11”格式不支持会直接返回null,ios要这种格式:”2014-09-25T13:24:00”,因为要计算时间差getTime()

方法一:

 strToDate(dateObj){

    dateObj = dateObj.replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '').replace(/(-)/g, '/')

    dateObj = dateObj.slice(0, dateObj.indexOf("."))

    return new Date(dateObj)

}

方法二:

safari兼容写法 : var safariTime = "2017-04-28 23:59:59".replace(/\-/g, '/')

猜你喜欢

转载自blog.csdn.net/Running_FE/article/details/81121072