常用js

<%@page language="java" contentType="text/html; charset=UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@include file="../../../common/dqdp_common.jsp" %>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>幸运大转盘</title>
    <link href="${baseURL}/jsp/h5/themes/css/base.css" rel="stylesheet" type="text/css"/>
    <link href="${baseURL}/jsp/h5/themes/css/index.css" rel="stylesheet" type="text/css"/>
    <script src="${baseURL}/jsp/h5/themes/js/adaptive-version3.js" type="text/javascript"></script>
    <script src="${baseURL}/jsp/h5/themes/js/jquery.min.js" type="text/javascript"></script>
    <script src="${baseURL}/jsp/h5/themes/js/main.js" type="text/javascript"></script>
	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script type="text/javascript">
	window['adaptive'].desinWidth = 640;
    window['adaptive'].baseFont = 18;
    window['adaptive'].maxWidth = 640;
    window['adaptive'].init();
    </script>
</head>
<style type="text/css">
.rMain{
    width: 6rem;
    background:#FFF;
    border-radius: 0.1rem;
    border: 0.04rem solid #fcc802;
}
.rBox{
    padding: 0.32rem 0.26rem 0.22rem;
}
.rBox p{
    font-size: 0.28rem;
    color: #333333;
    line-height: 0.38rem;
}
.iCtrl{
    text-align: center;
    font-size: 0;
    padding: 0.1rem 0 0.38rem;
}
.iCtrl .b_btn{
    width: 3rem;
}
.userful_l li span{
	width:2rem;
}
.lqBtn {
    background: url(../themes/images/lq.png) center no-repeat;
    background-size: 100% 100%;
     width: 1.53rem;
     height: 0.53rem;
     position: absolute;
    top: 3.2rem;
    right: 1.8rem;
    z-index: 1005;
}

.lq{
    height:0.5rem;
}
.utip{
    margin-top: -0.2rem;
}
.userful_l {
    float: left;
    width: 100%;
}
</style>

<body>
	<header>
		<!--幸运大转盘<div class="fixed_app_top">
		</div>-->

			<!--<a href="javascript:history.go(-1);" class="btn_back"></a>-->

	</header>
	<!--转盘
   <!--end 转盘
    <div class="index_wrap index_wrap_z" style="background:#87d8ea url(/hyyd/uploadfile/activity/7be09986-aef4-4703-98d3-d1c734553cf4.jpg) center no-repeat;background-size:100% 100%;overflow-x: hidden;margin-top:-0.2rem;">
      <section>
         <div class="game_wrap" style="margin-top: 1.45rem;"><div class="rotate_wrap"><div id="outercont"><div id="outer-cont"  style="padding-top:0.8rem" >
                        <div id="outer" class="rotate_main" style="margin: 0 auto;background: url(/hyyd/uploadfile/activity/61fb4352-8c46-4a73-9203-74f858cc5af8.gif) center no-repeat;background-size:100% 100%;width: 4.95rem;height: 5.0rem;margin-bottom: -0.8rem;">

                        </div>
						<div id="inner" class="beginPlay"></div></div></div></div><div class="gema_info"><div class="iCtrl"><a href="javascript:getMyPrize();" class="myAward">我的奖品</a>
                            <a href=# class="dtBtn">活动详情</a>
                        </div></div></div></section></div>
    </div>-->
	<div class="dzp"> </div>

     <!--loading-->
    <div class="app_loading hideObj">
    	 <img src="${baseURL}/jsp/h5/themes/images/loading.gif"/>
    	 <b>加载中...</b>
    </div>

    <!--透明背景-->
    <div class="opacityDiv hideObj"></div>

    <!--分享弹窗-->
    <div class="popBox popBox_f1 hideObj">
    	<a href="javascript:;" class="closeBtn"></a>
    	<h3 class="share_title">分享给周围的小伙伴吧</h3>
    	<div class="share_wrap">
    		<a href="#"><img src="${baseURL}/jsp/h5/themes/images/ico_qq.png" alt="qq"/></a>
    		<a href="#"><img src="${baseURL}/jsp/h5/themes/images/ico_wx.png" alt="微信"/></a>
    		<a href="#"><img src="${baseURL}/jsp/h5/themes/images/ico_group.png" alt="朋友圈"/></a>
    		<a href="#"><img src="${baseURL}/jsp/h5/themes/images/ico_wb.png" alt="微博"/></a>
    	</div>
    </div>

	<div class="popupBg" id="popupBg1"></div>
	<div class="popup" id="popup3" style="display:none;">
     	<div class="tipsBox">
     		<p><span id="confirm"></span></p>
       	</div>
       	<div class="ctrl">
       		<ul class="halfBar">
       			<li><a href="javascript:showPopup4();" class="cBtn" id="showPopup4">放弃领取</a></li>
				<li><a href="javascript:confirm('0');" class="sBtn" id="receiveBtn">确认领取</a></li>
 			</ul>
		</div>
	</div>

	<div class="popup" id="popup4" style="display:none;">
     	<div class="tipsBox">
     		<p><span>放弃领取视频包奖品后将不会再次抽中视频包,请再次确认是否放弃。</span></p>
       	</div>
       	<div class="ctrl">
       		<ul class="halfBar">
			    <li><a href="javascript:confirm('1');" class="sBtn" id="giveupBtn">确认</a></li>
       			<li><a href="javascript:hidePopup4();" class="cBtn" id="hidePopup4">取消</a></li>
 			</ul>
		</div>
	</div>
     <!--兑换弹窗-->
    <div class="popBox popBox_user hideObj">
    	<a href="javascript:;" class="closeBtn"></a>
    	<h3 class="share_title">您获得的奖品</h3>
    	<div class="userful">
    		<div class="userful_l">
    			<nav>
    				<ul id="showMyPrize">
    					<li class="active">
    						<i><input type="radio" name="" id="" value="1" class="form_radio"/></i>
    						<p id="showPrize"></p>
    					</li>
    				</ul>
    			</nav>
    		</div>
    		<!--
    		<div class="userful_r">

    			<a href="javascript:;" class="btn_dh">兑换</a>
    		</div>
    		 -->
    	</div>
    	<p class="utip"></p>
        <p class="lq"></p>
    </div>

    <!--兑换弹窗-->
		<div class="dPop hideObj">
			<a href="javascript:;" class="dClose"></a>
			<h3 class="d_title"></h3>
			<div class="dBox">
				<div class="dMain">
				</div>
			</div>
		</div>
		 <!--号码弹窗-->
    <div class="popup" id="popup5" style="display:none;">
     	<div class="tipsBox">
     		<p><span style="margin-top: -20px;">请输入密码:</span></p>
       	    <p><input type="number" placeholder="请输入密码"  style="margin-top:15px;border: 1px solid #ccc;width: 100%;padding: 10px 10px;font-size: 14px;color: #333;-webkit-appearance: none;border-radius: 10px;" id="mobile" name="mobile"></input></p>

       	</div>
       	<div class="ctrl">
       		<ul class="halfBar">
				<li style="text-align: center;height: 40px;"><a href="javascript:inputmobile();" style="margin-top: 3px;background: #0085d0;font-size: 14px;color: #fff;height: 35px;line-height: 38px;display: inline-block;text-align: center;width: 60%;border-radius: 10px;">确认</a></li>
       			<li style="text-align: center;height: 40px;"><a href="javascript:hidePopup5();" style="margin-top: 3px;background: gray;font-size: 14px;color: #fff;height: 35px;line-height: 38px;display: inline-block;text-align: center;width: 60%;border-radius: 10px;" >取消</a></li>

 			</ul>
		</div>
	</div>
	<!--二维马-->
	<div class="popup focusPop">
        <div class="rMain">
            <!-- <h3 class="t_title">活动规则</h3> -->
            <div class="rBox">
                <center><p style="color:red">长按二维码扫描关注</p></center>
                <center><img src="${baseURL}/jsp/h5/themes/images/ydgzh.jpg" style="width:80%"/></center>
                <p style="color:red"><B>1、请先关注“河源移动沟通100”微信公众号,回复“绑定”;</B></p>
                <p style="color:red"><B>2、绑定“河源移动沟通100”后需重新进入游戏页面</B></p>
            </div>
            <div class="iCtrl">
                <a href="javascript:closeFocus();" class="icon-start-play-btn mar-auto tc ver-m family-PingFang-Medium fw-semibold tcol-white fs-36">关闭</a>
            </div>
        </div>
     </div>
     <!--二维马-->
    <!--号码弹窗-->
    <input type="hidden" id="activity_Id" value=""/>
    <input type="hidden" id="activityType" value=""/>
<script type="text/javascript">

  var subscribe = "0";
		var openid = "";
		var mobile = "";
		var info = "";
		var shareopenid = "${param.shareopenid}";
		var shareUrl = "";

		if(isEmpty(shareopenid)){
			shareopenid = "";
		}
		$(function(){
          
			// window.location.href="http://wap.gd.10086.cn/weixin/bigRotaryActivity/index.jsps?activityCode=HY_Z5DZP91&branch=HY&openId=%OPEN_ID%";
			initSign();
			if(isEmpty(getCookie("userinfo_c"))){
			if(!isEmpty(shareopenid)){
				if(shareopenid.indexOf("info")>-1){
					info=shareopenid.split("?")[1].split("=")[1];
				}
				shareopenid=shareopenid.split("?")[0];

			}else{
				info = "${param.info}";
			}
			if(isEmpty(info)){

/* 				var shareopenidCookie = getCookie("shareopenid");
				alert("shareopenidCookie_1:"+shareopenidCookie); */
				var host = window.location.host;
	        	var redirectUrl = "";
	        if(isEmpty(shareopenid)){
                    redirectUrl = "http://"+host+"${baseURL}/jsp/h5/activity/dzp/activity_lottery.jsp";
                }else{
                    redirectUrl = "http://"+host+"${baseURL}/jsp/h5/activity/dzp/activity_lottery.jsp?shareopenid="+shareopenid+"";
                }
                window.location.href="http://10086.hygmcc.net/hyyd/wx/wechat!toAuthorize.action?redirectUrl="+redirectUrl;
			}else{
				getOpenidAndPhone(info,shareopenid);
			}
			}else{
				var userinfo = getCookie("userinfo_c");
        		openid = userinfo.split("&")[1].split("=")[1];
        		mobile = userinfo.split("&")[0].split("=")[1];
				subscribe=userinfo.split("&")[2].split("=")[1];
        		if(isEmpty(shareopenid)){

        		}else{
        		   shareopenid=shareopenid.split("?")[0];
        		}

				shareUrl = "http://10086.hygmcc.net/hyyd/jsp/h5/activity/dzp/activity_lottery.jsp?shareopenid="+openid;

				if(subscribe=="1"){
                if(isEmpty(mobile) || mobile == "phone") {
                window.location="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx124bf5735423440b&redirect_uri=https://wap.gd.10086.cn/weixin/subBind/newbind.jsps?appCode=HY&response_type=code&scope=snsapi_base&state=HY#wechat_redirect";
                return;
                }else{
                        //alert(subscribe);
                        //setCookie("userinfo_c",userinfo);
						showpop();
                       // initactivity();
                        return;
                    }

			 }else{
                //alert(subscribe);
                window.location.href="http://10086.hygmcc.net/hyyd/jsp/h5/activity2/gz.jsp"
                return;
            }

		}
			//alert('游戏活动已结束');
		});

		//判断是否为空
		function isEmpty(message){
			return  message=="" || message==null || message==undefined ;
	 	}
    	function getOpenidAndPhone(info,shareopenid) {

				$.ajax({
				url:"http://10086.hygmcc.net/hyydt/wx/wechat!getOpenidAndPhone.action",
		        type:"post",
		        dataType:"json",
		        data:{
		        	"info":info
		        },
		        success:function (result) {
						console.log(result);
		    		if (result.code == "0") {
		    			openid = result.data.openid;
						mobile = result.data.phone;
						shareUrl = "https://10086.hygmcc.net/hyydt/jsp/h5/activity/dzp/activity_lottery.jsp?shareopenid="+openid;
						var subscribe = result.data.subscribe;
						var nickname = result.data.nickname;
						var headimgurl = result.data.headimgurl;
						var userinfo = "mobile="+mobile+"&openid="+openid+"&subscribe="+subscribe+"&nickname="+nickname+"&headimgurl="+headimgurl;
						userinfo = userinfo + "&shareopenid="+shareopenid+"";
						if(subscribe=="1"){
						if(isEmpty(mobile) || mobile == "phone") {
						window.location="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx124bf5735423440b&redirect_uri=https://wap.gd.10086.cn/weixin/subBind/newbind.jsps?appCode=HY&response_type=code&scope=snsapi_base&state=HY#wechat_redirect";
						return;
						}else{
                        //alert(subscribe);
                        setCookie("userinfo_c",userinfo);
                        setCookie("info",info);
                        initactivity();
                        return;
                    }

					}else{
					//alert(subscribe);
					window.location.href="http://10086.hygmcc.net/hyydt/jsp/h5/activity2/gz.jsp"
					return;
					}
				    }
		        },
		        error:function () {
		        	alert("网络开小差^^");
		        }
		    });
		}
    function initSign(){
		  	$.ajax({
		  		url : 'http://10086.hygmcc.net/hyydt/wx/wechat!initSign.action',
		  		type : 'post',
		  		dataType: 'json',
		  		data:{"url":location.href.split('#')[0]},
		  		success : function(rst){
					console.log(rst)
	                if(rst.code == 0){
		  				wx.config({
		  				    appId: rst.data.jsticketinfo.appId,
		  				    timestamp: rst.data.jsticketinfo.timestamp,
		  				    nonceStr: rst.data.jsticketinfo.nonceStr,
		  				    signature: rst.data.jsticketinfo.signature,
		  				    jsApiList: [ 'checkJsApi','onMenuShareAppMessage', 'onMenuShareTimeline', 'hideMenuItems', 'hideOptionMenu']
		  				});
		  			}
		  		},
		  		error : function(error){
					console.log(error)
		  		}
		  	});
		  }
		  	wx.ready(function(){
			wx.hideMenuItems({
			  	    menuList: ['menuItem:share:qq','menuItem:share:weiboApp','menuItem:share:facebook','menuItem:share:QZone','menuItem:copyUrl','menuItem:openWithQQBrowser','menuItem:openWithSafari']
			  	});
			  	wx.onMenuShareAppMessage({
			  		title: '周五幸运大转盘',
			  	    link: shareUrl,
			  	  	desc: '百万话费+数万G流量等你瓜分!',
			  	    imgUrl: 'http://10086.hygmcc.net/hyydt/jsp/h5/themes/images/share.jpg',
			  	    success: function () {
			  	    },
			  	    cancel: function () {
			  	    }
			  	});
			  	wx.onMenuShareTimeline({
			  		title: '周五幸运大转盘',
			  	    link: shareUrl,
			  	    desc: '百万话费+数万G流量等你瓜分!',
			  	    imgUrl: 'http://10086.hygmcc.net/hyydt/jsp/h5/themes/images/share.jpg',
			  	    success: function () {
			  	    },
			  	    cancel: function () {
			  	    }
			  	});
		});
  function showfocus(){
		$('.popupBg, .focusPop').show();
	}
	var unclaimedPrize = "";
	var prizeName="";
	var prizeCode="";
	var activityId="";
   function initactivity()
   {
    //获取大转盘详细信息
    $.ajax({
        url:'${baseURL}/h5/activity/ActivityAction!getLottery.action',
        type:'post',
        dataType:'json',
        data:{},
        success:function(data){
			var activityInfo = data.data.activityInfoVO;
			//$("#activityId").val(activityInfo.id);
		    activityId=activityInfo.id;
            $("#activityType").val(activityInfo.type);
            $(".dMain").html(activityInfo.duringCfg);
			$("#prizeInfo").attr("src","img/jp.jpg");
            var dzphtml="";
            dzphtml='<div class="index_wrap index_wrap_z" style="background:#87d8ea url(img/7be09986-aef4-4703-98d3-d1c734553cf4.jpg)';
            dzphtml+='center no-repeat;background-size:100% 100%;overflow-x: hidden;margin-top:-0.2rem;"><section>';
            dzphtml+='<div class="game_wrap" style="margin-top: 1.45rem;">';
            dzphtml+='<div class="rotate_wrap">';
            dzphtml+='<div id="outercont">';
            dzphtml+='<div id="outer-cont"  style="padding-top:0.8rem" >';
            dzphtml+='<div id="outer" class="rotate_main" style="margin: 0 auto;background: url(img/dzp.gif)';
            dzphtml+='center no-repeat;background-size:100% 100%;width: 4.95rem;height: 5.0rem;margin-bottom: -0.8rem;">';
            dzphtml+='</div><div id="inner" class="beginPlay"></div></div></div></div><div class="gema_info"><div class="iCtrl"><a href="javascript:getMyPrize();" class="myAward">我的奖品</a>';
            dzphtml+='<a href="javascript:getactivity();" class="dtBtn">活动详情</a>';
            dzphtml+='</div></div></div></section></div>';
		    $(".dzp").append(dzphtml);
		    initLottery(activityId);
            //inputmobile();

        },
        error:function(data){

        }
    });
}
	function getactivity(){
	//活动详情弹窗
	$('.dtBtn').on('click', function() {
		$('.opacityDiv,.dPop').show();
		$('.dPop').addClass('bounceIn');
	});

	}

    //跳转至我的奖品
    function getMyPrize(){
    	//activityId=$("#activityId").val();
    	if(null==activityId||"activityId"==activityId||""==activityId||"undefined"==activityId){
    		alert("获取活动信息失败!");
    		return;
    	}

		info =  getCookie("info");
		console.log(activityId)
    	window.location="${baseURL}/jsp/h5/activity/dzp/activity_myprize.jsp?info="+info+"&activityId="+activityId;

    }

	//游戏转盘
	//$(function() {
		//activityId=$("#activityId").val();
	//	initLottery(activityId);   //初始化大转盘
	//});

	function handleName(name){
		if(null!=name&&""!=name&&"undefined"!=name){
			if(4==name.length){
				return name.substring(0,2)+"</br>"+name.substring(2,name.length);
			}else if(5==name.length){
				return name.substring(0,3)+"</br>"+name.substring(3,name.length);
			}else if(6==name.length){
				return name.substring(0,4)+"</br>"+name.substring(4,name.length);
			}else if(7==name.length){
				return name.substring(0,4)+"</br>"+name.substring(4,name.length);
			}else if(8==name.length){
				return name.substring(0,4)+"</br>"+name.substring(4,name.length);
			}else{
				return name;
			}
		}
	}

	//初始化大转盘
	function initLottery(activityId){
		window.requestAnimFrame = (function() {
	        return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) {
	            window.setTimeout(callback, 1000 / 60)
	        }
	    })();
	    var totalDeg = 360 * 3 + 0;
	    var steps = [];
	    var sncode;
	    var now = 0;
	    var a = 0.01;
	    var outter, inner, timer, running = false;
	    //设置旋转次数与角度
	    function countSteps() {
	        var t = Math.sqrt(2 * totalDeg / a);
	        var v = a * t;
	        for (var i = 0; i < t; i++) {
	            steps.push((2 * v * i - a * i * i) /2)
	        }
	        //console.info(totalDeg);
	        steps.push(totalDeg)
	    }
	    function step() {
	        outter.style.webkitTransform = 'rotate(' + steps[now++] + 'deg)';  //控制图片旋转
	        outter.style.MozTransform = 'rotate(' + steps[now++] + 'deg)';
	        if (now < steps.length) {  //旋转中
	            requestAnimFrame(step)
	        } else {//旋转结束
	            //running = false;
	        }
	    }

	    function start(deg) {

	        clearInterval(timer);
	        totalDeg = 360 * 3 + deg;  //旋转角度
	        steps = [];
	        now = 0;
	        countSteps();
	        requestAnimFrame(step)
	    }
	    var i=1;
	    window.start = start;
	    outter = document.getElementById('outer');
	    inner = document.getElementById('inner');
		$(".beginPlay").click(function() {
			//location.reload(false);  7  17
            if(time_range ("6:59", "23:59")&&week(" 5")){
	        if (running){
	        	return;
	        }
	        $('.app_loading,.opacityDiv').show();
	        running = true;
		info = getCookie("info");
	        $.ajax({
	    		url:'${baseURL}/h5/activity/ActivityAction!getLotteryResult.action',
	    		datatype:'json',
	    		data:{"activityId":activityId,"info":info},
	    		type:'post',
	    		success:function(data){
	    			 $('.app_loading,.opacityDiv').hide();
	                 //alert(data);
					 console.log(data);
	                 //var data=JSON.parse(data);
	                 if("0"==data.code){

	                	 var tp=data.data.tp;
	                	 if(null!=tp&&"null"!=tp){
			                 prizeName=tp.prizeName;
			                 prizeCode=tp.prizeCode;
			                 //console.info(tp.prizeLocation+"--"+prizeName);
			                 start(tp.prizeLocation);  //开始旋转
			                 var intervalId = setInterval(function() {  //5秒后转盘旋转完毕
			                	 if("1"==tp.groupType){
									 if(i==1){
										 alert("不要灰心,你还有次机会。");
										 i++;
									 }else{
										 alert("谢谢参与!");
									     i=1;
									 }
			                	 }else{
									 i=1;
					                 //展示中奖信息
					                 var showPage="";
					                 showPage+='<li class="active">';
					                 showPage+='<i><input type="radio" name="" id="" value="1" class="form_radio"/></i>';
					                 showPage+='<span id="showPrize" >'+prizeName+'</span>';

					                 	 $(".utip").html(tp.prizeHint);
                                          $(".lq").html('<a href="javascript:getlq();" class="lqBtn" ></a>');
					                 	 showPage+='</li>';
						                 $("#showMyPrize").html(showPage);
						                 $(".opacityDiv,.popBox_user").show();
						                 $('.popBox_user').addClass('bounceIn');

			                	 }

			                 	 running = false;  //恢复按钮
			                 	 clearInterval(intervalId);
			                 },5000);
	                	 }else{
		                	 alert("亲活动太火爆了,请稍后再试!");
		                	 running = false;  //恢复按钮
		                 }
	                 }else{
	                	 alert(data.desc);
	                	 running = false;  //恢复按钮
	                 }
	    		},error:function(msg){
	                alert("亲活动太火爆了,请稍后再试!");
	                $('.app_loading,.opacityDiv').hide();
	                running = false;
	    		}
	    	});

			}else{
				 //console.log(time_range ("9:00", "24:00")&&week("5"))
				 alert("请前往公众号<河源移动沟通100>点击我要优惠周五幸运大转盘进行抽奖。");
			}
	    })

	}

	$('.userful_l').on('click','li',function(){
  	    var _el=$(this);
  	    _el.addClass('active').siblings().removeClass('active');
    });

   //分享弹窗
	$('.shareGame').on('click',function(){
		$('.opacityDiv,.popBox_f1').show();
		$('.popBox_f1').addClass('bounceIn');
	});
	//隐藏分享弹窗
	$('.closeBtn').on('click',function(){
		$('.opacityDiv,.popBox').hide();
		$('.popBox').removeClass('bounceIn');
	})

	//隐藏活动详情弹窗
	$('.dClose').on('click', function() {
		$('.opacityDiv,.dPop').hide();
		$('.dPop').removeClass('bounceIn');
	})
	function showpop(){
         $('#popup5,#popupBg1').show();
	}
	function hidePopup3(){
       	$('#popup3,#popupBg1').hide();
    }

	function hidePopup4(){
		$('#popup4').hide();
		$('#popup3').show();
	}

	function hidePopup5(){
		$('#popup5,#popupBg1').hide();
		$("#mobile").val(" ");
		console.log($("#mobile").val());
	}
	function showPopup4(){
       	$('#popup3').hide();
		$('#popup4').show();
	}

	function confirm(isGiveup){
		$('#giveupBtn').attr("href", "#");
		$('#receiveBtn').attr("href", "#");
		$('#hidePopup4').attr("href", "#");
		$('#showPopup4').attr("href", "#");
		var activityId=$("#activityId").val();
		 $.ajax({
	    	url:'${baseURL}/h5/activity/ActivityAction!confirmReceivePrize.action',
	    	datatype:'json',
	    	data:{"activityId":activityId,"unclaimedPrize":unclaimedPrize,"isGiveup":isGiveup,"prizeName":prizeName,"prizeCode":prizeCode},
	    	type:'post',
			async:false,
	   		success:function(data){
				var data=JSON.parse(data);
				if(data.desc!=null){
					alert(data.desc)
		   			$('#popup3,#popupBg1').hide();
				}else{
		   			$('#popup4,#popupBg1').hide();
				}
	   		},
	   		error:function(msg){
				alert("领取失败")
	   			$('#popup3,#popupBg1').hide();
    		}
    	});
		$('#giveupBtn').attr("href", "javascript:confirm('1');");
		$('#receiveBtn').attr("href", "javascript:confirm('0');");
		$('#hidePopup4').attr("href", "javascript:hidePopup4();");
		$('#showPopup4').attr("href", "javascript:showPopup4();");
	}

	function adview(){
		var activityId=$("#activityId").val();
		 $.ajax({
	    	url:'${baseURL}/h5/activity/ActivityAction!adNumber.action',
	    	datatype:'json',
	    	data:{"activityId":activityId},
	    	type:'post',
	   		success:function(data){
				window.location="http://lnyph5.vpclub.cn/lnyp/templates/cities/home/home.html?areaActId=794&areaJgid=287491";
	   		},
	   		error:function(msg){

				    		}
    	});

	}


 window.alert = function (message) {
    try {
        var iframe = document.createElement("IFRAME");
        iframe.style.display = "none";
        iframe.setAttribute("src", 'data:text/plain,');
        document.documentElement.appendChild(iframe);
        var alertFrame = window.frames[0];
        var iwindow = alertFrame.window;
        if (iwindow == undefined) {
            iwindow = alertFrame.contentWindow;
        }
        iwindow.alert(message);
        iframe.parentNode.removeChild(iframe);
    }
    catch (exc) {
        return wAlert(message);
    }
}

  function isPoneAvailable(str) {
            var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
            if (!myreg.test(str)) {
                return false;
            } else {
                return true;
            }
        }
		//取cookies函数
		function getCookie(name){
		 	var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
		 	if (arr != null) return unescape(arr[2]); return null;
		}
		//两个参数,一个是cookie的名子,一个是值
		function setCookie(name,value){
		 	var Days = 1;//此 cookie 将被保存 1 天
		 	var exp = new Date();//new Date("December 31, 9998");
		 	exp.setTime(exp.getTime() + 30*60*1000);
		 	document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
		}

		// 删除cookies
		function delCookie(name){
			var exp = new Date();
			exp.setTime(exp.getTime() - 1);
			var cval=getCookie(name);
			if(cval!=null)
				document.cookie= name + "="+cval+";expires="+exp.toGMTString();
		}
		function activityEnd(){
            alert('游戏活动已结束');
        }
		function week(day){
              if("7123456".charAt(new Date().getDay())==day){
			  return true;
			  }else{
			  return  false;
			  }
        }
		var time_range = function (beginTime, endTime) {
		var strb = beginTime.split (":");
		if (strb.length != 2) {
		return false;
		}

		var stre = endTime.split (":");
		if (stre.length != 2) {
		return false;
		}

		var b = new Date ();
		var e = new Date ();
		var n = new Date ();

		b.setHours (strb[0]);
		b.setMinutes (strb[1]);
		e.setHours (stre[0]);
		e.setMinutes (stre[1]);

		if (n.getTime () - b.getTime () > 0 && n.getTime () - e.getTime () < 0) {
		return true;
		} else {
		return false;
		}
		}

        function getlq(){
            window.location="http://lnyph5.vpclub.cn/lnyp/templates/lnypMall/flashSale.html?fsId=2310&fromMall=1&fsType=4&channelcode=HYDZP";
        }

		function inputmobile(){
			var mobile=$("#mobile").val();
			if(mobile=="123456"){
				initactivity();
				hidePopup5();
			}else{
				alert("密码错误!!!请前往服务厅办理.");
				//hidePopup5();
			}
           
        }


</script>
</body>
</html>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值