<script src="/public/m/zepto.min.js"></script>
<script src="https://res.wx.qq.com/open/libs/weuijs/1.2.1/weui.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/2.0.1/weui.min.css">
<link rel="stylesheet" href="/public/m/mobile.css">
<link rel="stylesheet" href="//at.alicdn.com/t/font_1538380_v7nu1ofa3el.css">
<!-- <script src="https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js"></script>
<script>var vConsole = new VConsole();</script> -->
<script>
//处理ios键盘回收后页面底部出现空白Bug
function loseFocus() {
	var ua = navigator.userAgent.toLowerCase();
	var u = navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
	if(ua.match(/MicroMessenger/i) == 'micromessenger' && !!u) {
		var currentPosition, timer;
		var speed = 0; //页面滚动距离
		timer = setInterval(function() {
			currentPosition = document.documentElement.scrollTop || document.body.scrollTop;
			currentPosition -= speed;
			window.scrollTo(0, currentPosition); //页面向上滚动
			currentPosition += speed; //speed变量
			window.scrollTo(0, currentPosition); //页面向下滚动
			clearInterval(timer);
		}, 1);
	}
}

Zepto(function($){
	//阻止拖拽tabbar滑动
	document.querySelector('.weui-tabbar').addEventListener('touchmove', function (e) {
		e.preventDefault();
	}, {passive: false}); //passive 参数不能省略，用来兼容ios和android

	let ua = window.navigator.userAgent;
	if (/\(i[^;]+;( U;)? CPU.+Mac OS X/.test(ua)) {
		console.log('ios端');
		$('body').on('blur', 'input,textarea',function(){
			loseFocus();
		});
	}
})
</script>