window.onpageshow = function(event) {
	if(event.persisted) {
		window.location.reload()
	}
		

	getBannerList();
	$(".video-button").show();

	$(".video").click(function() {
		$(".video").hide();
		var video = document.getElementById("video");
        video.pause();
        video.currentTime = 0;
	});
	$(".video-button-close").click(function(e) {
		e.stopPropagation();
		$(".video-button").hide();
		localStorage.setItem("videobuttonclose","true");
	});
	
	
	$(".open-ali").click(function() {
		var share_schema = "alipay://";
		location.href = share_schema;
	})
	$(".shareHongbao").click(function() {
		clipboardHb()
	})
	
	$(".add-back").click(function() {
		$(".add-to-desk-mask,.add-to-desk").hide();
		$("body").removeClass("no-scroll");
	})
	if(is_android()){
		$(".index-bottom-guide-fa").hide();
	}
	
	
}

//轮播图列表以及试玩人数
function getBannerList() {
			var mySwiper = new Swiper('.swiper-container', {
				loop: true,
				pagination: '.swiper-pagination',
				autoplay: 2500,
			});
			
}

//添加到桌面相关的信息
function addDesk() {
			$('#enterImg').attr("src", "https://new.52tzs.com/uploads/20231105/7fb1a7a92526aa2ea8d6776bcc4083d3.jpg");
			$('#enterTitle').html("abcd");
			$('#enterDiscribe').html("添加入口到桌面，永不走丢");
			$('.add-icon-img').attr("src", "https://new.52tzs.com/uploads/20231105/7fb1a7a92526aa2ea8d6776bcc4083d3.jpg");
			var _url = window.location.host;
			$('.add-link').html(_url);
			var _icon = '<link rel="apple-touch-icon" href="https://new.52tzs.com/uploads/20231105/7fb1a7a92526aa2ea8d6776bcc4083d3.jpg" type="image/png">';
			var _icon2 = '<link rel="shortcut icon" href="https://new.52tzs.com/uploads/20231105/7fb1a7a92526aa2ea8d6776bcc4083d3.jpg" type="image/png">';
			$("head").append(_icon).append(_icon2);
		
}

//复制板
function clipboardHb() {
	var clipboard = new Clipboard('.shareHongbao');
	clipboard.on('success', function(e) {
		var msg = e.trigger.getAttribute('aria-label');
		alert(msg);
		$(".mask").hide();
		$("#copydiv").hide();
		$('body').removeClass('no-scroll');
		e.clearSelection();
	});
	clipboard.on('error', function(e) {
		$(".mask").hide();
		$("#copydiv").hide();
		$('body').removeClass('no-scroll');
		e.clearSelection();
	});
}




