var _a=window.location.pathname; _a='//h.t-time.com.tw/lthd/hd210722gk7q'; $.ajaxSetup({xhrFields: {withCredentials: true}}); var fid=getQueryVariable("channel"); $(function(){ var phone=getCookie("phone"),phoneType=getCookie("phoneType"); if(phone){ $("div.yuyuediv").hide();$("div.yuyueed").show();$("div.yuyueed").find("div.yytxt").html("手機號:+"+phoneType+phone+" 已預約成功。"); } if(yys){ if(!IsMobile()){ if(yys>=200000 && yys<400000){ $("div.lcpic").find("div:eq(0)").css({"width":"20%"}); $("div.lcpic").find("div:eq(1)").css({"width":"20%"}); } if(yys>=400000 && yys<600000){ $("div.lcpic").find("div:eq(0)").css({"width":"40%"});$("div.lcpic").find("div:eq(1)").css({"width":"40%"}); } if(yys>=600000 && yys<800000){ $("div.lcpic").find("div:eq(0)").css({"width":"60%"});$("div.lcpic").find("div:eq(1)").css({"width":"60%"}); } if(yys>=800000 && yys<1000000){ $("div.lcpic").find("div:eq(0)").css({"width":"80%"});$("div.lcpic").find("div:eq(1)").css({"width":"80%"}); } if(yys>=1000000){ $("div.lcpic").find("div:eq(0)").css({"width":"100%"});$("div.lcpic").find("div:eq(1)").css({"width":"100%"}); } } else{ if(yys>=200000 && yys<400000){ $("div.lcpic").find("div:eq(0)").addClass("f01");$("div.lcpic").find("div:eq(1)").css({"height":"20%"}); } else if(yys>=400000 && yys<600000){ $("div.lcpic").find("div:eq(0)").addClass("f02");$("div.lcpic").find("div:eq(1)").css({"height":"40%"}); } else if(yys>=600000 && yys<800000){ $("div.lcpic").find("div:eq(0)").addClass("f03");$("div.lcpic").find("div:eq(1)").css({"height":"60%"}); } else if(yys>=800000 && yys<1000000){ $("div.lcpic").find("div:eq(0)").addClass("f04");$("div.lcpic").find("div:eq(1)").css({"height":"80%"}); } else if(yys>=1000000){ $("div.lcpic").find("div:eq(0)").addClass("f05");$("div.lcpic").find("div:eq(1)").css({"height":"100%"}); } } } $("[tag=yuyue]").click(function(){ if(!fid)fid=''; var phoneType = $('.area').val(),phone = $('.phone').val(); if(!phone || phoneType == '886' && phone.length != 9 && phone.length != 10 || phoneType == '852' && phone.length != 8 || phoneType == '853' && phone.length != 8){ alert('手機號碼格式不對,請重新輸入'); return false; } var agree=$("[tag=agree]").is(':checked'); if(!agree){alert("勾選服務條款");return false;} var json={'parmtype':'yuyue',phone:phone,fid:fid,phoneType:phoneType}; $.ajax({ headers: { Accept: "application/json; charset=utf-8", "X-Requested-With":'XMLHttpRequest' }, url:_a, type: "post",dataType:'json', data:json, success: function (data){ if(data.code==100){ addCookie("yuyue",1,3*24);addCookie("phone",phone,3*24);addCookie("phoneType",phoneType,3*24); window.location.href=window.location.href; } else alert(data.message); } }); }); $("[tag=share]").click(function(){ var is_yuyue=getCookie("yuyue");if(is_yuyue!="1"){alert("還未預約");} var phone=getCookie("phone"); var url1='https://h.t-time.com.tw/';if(phone)url1+='?channel='+phone; var url="https://www.facebook.com/sharer.php?u="+url1; window.location.href=url; }); });