61 lines
2.0 KiB
JavaScript
Executable File
61 lines
2.0 KiB
JavaScript
Executable File
|
||
var swiperTest = null;
|
||
var banerArray = new Array();
|
||
|
||
mui.init({
|
||
swipeBack: true //启用右滑关闭功能
|
||
});
|
||
|
||
/**/
|
||
mui.back = function() {};
|
||
mui.plusReady(function() {
|
||
var timestamp1 = Date.parse(new Date());
|
||
if(timestamp1 >= 1542470400000) {
|
||
plus.storage.setItem("lauchFlag", "true"); //第一次登陆显示
|
||
plus.navigator.setFullscreen(false);
|
||
plus.webview.currentWebview().close();
|
||
return;
|
||
}
|
||
$.ajax('http://www.juzi199.com/get_startup.php', {
|
||
dataType: 'json', //服务器返回json格式数据
|
||
type: 'post', //HTTP请求类型
|
||
timeout: 10000, //超时时间设置为10秒;
|
||
success: function(data) { //服务器返回响应,根据响应结果,分析是否登录成功;
|
||
// var data = toJson(data, 1);
|
||
var html = '';
|
||
$.each(data.img, function() {
|
||
html += '<div class="mui-slider-item "><img src="' + this + '"/></div>'
|
||
});
|
||
$('.mui-slider-group').html(html)
|
||
$('.mui-slider-item').eq(0).addClass('mui-slider-item-duplicate');
|
||
$('.mui-slider-item').eq(data.img.length - 1).append('<button id="close" class="mui-btn mui-btn-warning mui-btn-outlined">跳过</button>');
|
||
var slider = mui("#slider");
|
||
swiperTest = document.getElementById('swiperTest');
|
||
plus.navigator.setFullscreen(true);
|
||
plus.navigator.closeSplashscreen();
|
||
|
||
},
|
||
error: function(xhr, type, errorThrown) { //异常处理;
|
||
// mui.alert(errorThrown);
|
||
}
|
||
});
|
||
|
||
mui('body').on('tap', '#close', function() {
|
||
// plus.storage.setItem("lauchFlag", "true"); //第一次登陆显示
|
||
plus.storage.removeItem("lauchFlag");
|
||
plus.navigator.setFullscreen(false);
|
||
plus.webview.currentWebview().close();
|
||
|
||
})
|
||
setTimeout(function(){
|
||
// plus.storage.setItem("lauchFlag", "true"); //第一次登陆显示
|
||
plus.storage.removeItem("lauchFlag");
|
||
plus.navigator.setFullscreen(false);
|
||
plus.webview.currentWebview().close();
|
||
},5000)
|
||
|
||
});
|
||
//立即体验按钮点击事件
|
||
//document.getElementById("close").addEventListener('tap', function(event) {
|
||
//
|
||
//}, false);
|