<script>
(function($, doc) {
$.init({
statusBarBackground: '#f7f7f7'
});
$.plusReady(function() {
plus.screen.lockOrientation("portrait-primary");// 方向
// 预加载界面
var mainPage = $.preload({
"id": 'main',
"url": 'main.html'
});
var toMain = function() {
$.fire(mainPage, 'show', null);
setTimeout(function() {
$.openWindow({
id: 'main',
show: {
aniShow: 'pop-in'
},
waiting: {
autoShow: false
}
});
}, 0);
};
var waiting = plus.nativeUI.showWaiting();
waiting.close();
// plus.nativeUI.toast('您尚未安装微信客户端');
// close splash
setTimeout(function() {
//关闭 splash
plus.navigator.closeSplashscreen();
}, 600);
// 捕获用户点击enter
$.enterfocus('#login-form input', function() {
// 手动执行loginbtn点击事件
$.trigger(loginButton, 'tap');
});
regButton.addEventListener('tap', function(event) {
$.openWindow({
url: 'reg.html',
id: 'reg',
preload: true,
show: {
aniShow: 'pop-in'
},
styles: {
// 关闭滑动屏幕边缘放回手势
popGesture: 'hide'
},
waiting: {
autoShow: false
}
});
}, false);
//监听window大小变化
window.addEventListener('resize', function() {
oauthArea.style.display = document.body.clientHeight > 400 ? 'block' : 'none';
}, false);
//
var backButtonPress = 0;
$.back = function(event) {
backButtonPress++;
if (backButtonPress > 1) {
plus.runtime.quit();
} else {
plus.nativeUI.toast('再按一次退出应用');
}
setTimeout(function() {
backButtonPress = 0;
}, 1000);
return false;
};
});
}(mui, document));
</script>
网友评论