1 |
- !function(e){var n={};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=n,o.d=function(e,n,t){o.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,n){if(1&n&&(e=o(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)o.d(t,r,function(n){return e[n]}.bind(null,r));return t},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="/Users/jiangtao/Documents/Creator/Directional/Code/orderchannel/src/main/webapp./baidu/dist/",o(o.s=0)}([function(e,n,o){"use strict";function t(e,n){var o=$('<div class="overlay"></div>'),t=$('<div class="dialog-alert"><h1>温馨提示</h1><div class="content">'+e+'</div><div class="actions"> <div class="btn">关闭</div></div></div>');$("body").css("overflow","hidden"),o.appendTo($(document.body)),t.appendTo($(document.body)),1==n&&t.find(".btn").remove(),t.close=function(){$("body").css("overflow","auto"),o.remove(),t.remove(),t=null};var r=$.Deferred();return t.find(".btn").on("click",(function(){t.close(),r.resolve(t)})),r}function r(e){window.$loading&&window.$loading.trigger("close");var n=e||"处理中,请稍后...",o=$('<div class="overlay"></div>'),t=$('<div class="loading"> <div class="content">'+n+"</div></div>");return o.appendTo($(document.body)),t.appendTo($(document.body)),$("body").addClass("lockScroll"),t.on("close",(function(){o.remove(),t.remove(),t=null,$("body").removeClass("lockScroll")})),window.$loading=t,t}function i(e){e?e.trigger("close"):window.$loading&&window.$loading.trigger("close")}function a(e){return"1"!=$(e||document.body).data("use")&&($(e||document.body).data("use","1"),!0)}function c(e){$(e||document.body).data("use","0")}function s(e){var n=(e=Math.round(100*parseFloat(e))/100).toString().split(".");return 1==n.length?e=e.toString()+".00":n.length>1?(n[1].length<2&&(e=e.toString()+"0"),e):void 0}o.r(n),Date.prototype.from=function(e){var n=e.replace(/-/g,"/");return n=n.replace(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/,"$1/$2/$3 $4:$5:$6"),new Date(n)},Date.prototype.format=function(e){var n={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var o in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+o+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[o]:("00"+n[o]).substr((""+n[o]).length)));return e};var l={},u={},d={},f={},v=null;function g(){y(),function(){var e,n,o=window.location.search.substring(1),t=0;for(;o.length>0&&-1!=(e=o.indexOf("=",t));){-1==(n=o.indexOf("&",e+1))&&(n=o.length);var r=o.substring(t,e),i=o.substring(e+1,n);l[r]=decodeURIComponent(i),t=n+1}}(),$("#useraccount_tt").attr("value",O("freeflow_token"));var e={fes:l.fes,sou:l.sou},n=$.Deferred();return $.ajax({url:v+"/ini/getstyle",type:"POST",contentType:"application/json",data:JSON.stringify(e)}).then((function(e){var o=JSON.parse(e);if("0000"!=o.resultCode)return n.reject(),n;for(u=o.product[0],r=0;r<o.product.length;r++)d[o.product[r].productid]=o.product[r];$("#fog_"+u.url).attr("value",u.fog);for(var t=u.icon.split(","),r=0;r<t.length;r++)0==r&&$("#sendsms_order_"+u.url).attr("value",t[r]),1==r&&$("#sendsms_cancel_"+u.url).attr("value",t[r]),2==r&&$("#sendsms_yuyue_"+u.url).attr("value",t[r]);n.resolve(o)})),n}function m(e,n,o){var r=$.Deferred();if(!(null!=e.attr("n")&&e.attr("n")>0)){var i=e.find(".usermob").val();if(null==i||""==i.trim())return t("请输入联通手机号码"),r.reject(),r;if(!i.startsWith("1")||11!=i.length)return t("手机号码格式不正确"),r.reject(),r;var a={fes:l.fes,sou:l.sou,fog:u.fog,usermob:i,smstype:n};f.usermob=i;var c=60;e.attr("n",c),$.ajax({url:v+"/sms/send",type:"POST",contentType:"application/json",data:JSON.stringify(a)}).then((function(n){if("0000"!=n.resultCode)return c=0,e.attr("n",c),void t(n.errorInfo);var o=e.find(".sendcode");o.text("重新发送({}s)".replace("{}",c)),o.addClass("sendcode-wait");var r=setInterval((function(){c-=1,e.attr("n",c),o.text("重新发送({}s)".replace("{}",c)),0===c&&(clearInterval(r),o.text("获取验证码"),e.attr("n",c),o.removeClass("sendcode-wait"))}),1e3)}))}}function p(e,n){var o=$.Deferred(),r=e.find(".usermob").val(),i=e.find(".smscode").val();if(null==n&&(n=!1),null==r||""==r.trim())return t("请输入联通手机号码"),o.reject(),o;if(null==i||""==i.trim())return t("请输入验证码"),o.reject(),o;if(6!=i.length)return t("短信验证码不正确"),o.reject(),o;var a={fes:l.fes,sou:l.sou,fog:u.fog,code:i,usermob:r};return $.ajax({url:v+"/checkvercode",type:"POST",contentType:"application/json",data:JSON.stringify(a)}).then((function(i){switch(e.find(".smscode").val(""),i.resultCode){case"0000":f.userid=i.userid,f.usermob=r,f.usertime=(new Date).getTime(),n||(e.find(".usermob").val(""),e.find(".usermob").val("")),o.resolve(i.userid);break;default:t(i.errorInfo),o.reject(i)}})).fail((function(e){o.reject("服务调用异常")})),o}var h=!0;function w(e,n,o,a,c,s){h=!1;var d,g="http://800.wo.cn/cap/CAP-AUTH.html",m="http://800.wo.cn/";if(window.location.href.indexOf("https")>=0&&(g="https://800.wo.cn/cap/CAP-AUTH.html",m="https://800.wo.cn/"),window.location.href.indexOf("festivalchannel")>=0&&(g="https://800.wo.cn/festivalcap/CAP-AUTH.html",m="https://800.wo.cn/"),(d=$("#uniauthframe").length>=1?$("#uniauthframe").attr("src",g):$('<iframe id="uniauthframe" src="'+g+'"></iframe>')).css({width:"100%",height:"100%",position:"fixed",top:0,left:0,margin:0,padding:0,"-webkit-overflow-scrolling":"touch",border:"0px"}),r(),d.on("load",(function(){$capoverlay.remove(),function(e){var n={fog:u.fog||e||"",channel:""};return $.ajax({url:v+"/ini/gensign",type:"POST",contentType:"application/json",data:JSON.stringify(n)})}(e).then((function(e){i(),e.orderChannel=l.fes+"_"+l.sou,null!=n&&""!=n&&(e.productName=n),null!=s&&""!=s&&(e.capTemplet=s),d[0].contentWindow.postMessage(JSON.stringify(e),m)}))})),navigator.userAgent.indexOf("MicroMessenger")>=0){var p;window.capTimer=setInterval((function(){p=document.documentElement.scrollTop||document.body.scrollTop,p-=1,window.top.scrollTo(0,p),p+=1,window.top.scrollTo(0,p)}),200)}window.$capoverlay=$('<div class="overlay" style="z-index: 0"></div>'),$capoverlay.appendTo($(document.body)),0==$("#uniauthframe").length?$("body").append(d):d.css("position","unset").css("min-height","10rem"),o||$("body").css("overflow","hidden");var w=$.Deferred();return window.addEventListener("message",(function(e){var n=JSON.parse(e.data);switch(n.resultcode){case"0":d.remove(),$capoverlay.remove(),$("body").css("overflow","auto"),clearInterval(window.capTimer),f.token=n.token,f.userid=decodeURIComponent(n.userid),f.userid1=n.userid1,f.usermob=n.usermob,f.usertime=(new Date).getTime(),c&&b(),w.resolve(f);break;case"9001":d.remove(),$capoverlay.remove(),clearInterval(window.capTimer),$("body").css("overflow","auto"),w.reject(n),null!=a&&a&&!h&&("1"==l.test&&alert(navigator.userAgent),function(){var e=navigator.userAgent.indexOf("Baidu")>-1;if(e)return e;var n=navigator.userAgent.indexOf("OPR")>-1,o=navigator.userAgent.indexOf("Firefox")>-1,t=navigator.userAgent.indexOf("UCBrowser");if(!n||!o||!t)return!1;var r=navigator.userAgent.indexOf("MicroMessenger")>-1,i=navigator.userAgent.indexOf("Safari")>-1,a=navigator.userAgent.indexOf("Chrome")>-1;return r||e||i||a}()&&(h=!0,history.back()));break;case"0001":case"0003":case"0006":case"4444":break;default:d.remove(),$capoverlay.remove(),$("body").css("overflow","auto"),clearInterval(window.capTimer),t(n.errorinfo),w.reject(n)}})),w}function b(e){var n={fog:u.fog||fog||"",userid:e||f.userid};$.ajax({url:v+"/decodeUserid",type:"POST",contentType:"application/json",data:JSON.stringify(n)}).then((function(e){"0"==e.resultCode&&(f.usermob=e.usermob)}))}function x(e){localStorage.setItem("user",JSON.stringify(f)),localStorage.setItem("time",e||(new Date).getTime()+"")}function y(){var e=window.document.location.href,n=window.document.location.pathname,o=e.indexOf(n),t=e.substring(0,o),r=n.substring(0,n.substr(1).indexOf("/")+1);return v=t+r,t+r}function O(e){if("https://800.wo.cn/orderchannel/hd/Dy/order202005.html?fes=jh7"!=window.location.href){window.location.href.indexOf("jiangtao")>=0&&alert(window.location.href);var n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),o=window.location.search.substr(1).match(n);if(null!=o)return o[2];switch(e){case"con":return"1";case"freeflow_token":return"";default:var t=y()+"/404.html";$(location).attr("href",t)}}else window.location.href="https://800.wo.cn/orderchannel/hd/Dy/order202005.html?fes=jh7&sou=12"}function k(e,n,o){var t,r,i=S("uuid"),a=S("vvid");if(null!=i&&""!=i.trim()||T("uuid",i=j(),(t=new Date,r=t.from(t.getFullYear()+"-"+(t.getMonth()+1)+"-"+t.getDate()+" 23:59:59"),console.log(r.getTime()-t),r.getTime()-t.getTime())),null!=a&&""!=a.trim()||T("vvid",a=j(),-1),null!=e&&""!=e){var c={operid:e,uuid:i,vvid:a,fog:u.fog,userid:f.userid,fes:l.fes,sou:l.sou,url:encodeURIComponent(o||window.location.href),remark:encodeURIComponent(n||"")};$.ajax({url:v+"/burypoint/logid",type:"POST",contentType:"application/json",data:JSON.stringify(c)}).then((function(e){}))}}function S(e){var n,o=new RegExp("(^| )"+e+"=([^;]*)(;|$)");return(n=document.cookie.match(o))?unescape(n[2]):null}function T(e,n,o){o=null==o?0:o;var t=new Date;o<0?document.cookie=e+"="+escape(n):(t.setTime(t.getTime()+o),document.cookie=e+"="+escape(n)+";expires="+t.toGMTString())}function j(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=16*Math.random()|0;return("x"==e?n:3&n|8).toString(16)}))}o(1);function C(e){switch(null==e&&(location.href.indexOf("index.html")>=0&&(e="order"),location.href.indexOf("cancel.html")>=0&&(e="cancel"),location.href.indexOf("active.html")>=0&&(e="active"),location.href.indexOf("flow.html")>=0&&(e="flow")),e){case"active":!function(){if(location.href.indexOf("active.html")<0)return void(window.location.href="active.html?fes="+l.fes+"&sou="+l.sou+"&F="+l.F+"&page=active");var e=$(".section-login").find(".form-group");e.find(".sendcode").unbind("click").on("click",(function(){m(e,"activelogin")})),e.find(".login").unbind("click").on("click",(function(n){a()&&p(e).then((function(){var e;c(),(e=$.Deferred(),WeiboJSBridge.invoke("unicomFreeTraffic",{type:0},{success:function(n){e.resolve(n)},fail:function(n,o){e.reject(n,o)},final:function(n){e.reject(n)}}),e).then((function(){t("激活成功").then((function(){x(),D()}))}))})).fail((function(){c()}))})),window.scrollTo(0,0)}();break;case"cancel":F();break;case"draw":alert("参数错误");break;case"flow":D();break;default:I()}}function I(){function e(){a()&&w(null,null,!1,!0).then((function(e){var n,o,t;c(),n=e.userid,o=e.token,t=e.usermob,r("处理中,请稍后..."),function(e,n,o){var t={fes:l.fes,sou:l.sou,fog:u.fog,token:n,userid:e||f.userid,usermob:o||f.usermob,useraccount:"",f:l.F};return $.ajax({url:v+"/comm/order",type:"POST",contentType:"application/json",data:JSON.stringify(t)})}(n,o,t).then((function(e){switch(i(),e.resultCode){case"0000":return x(),void D();case"0013":M("orderFailure","该号码归属省分2/3G暂未开通此产品!");break;case"6611":M("orderFailure","错误代码(6611),订购失败,请重试!");break;case"6615":M("orderFailure","订购失败,请确定用户套餐!");break;case"6622":localStorage.setItem("message","您已经订购了本产品~"),x(),D();break;default:M("orderFailure",e.errorInfo+",订购失败,请确定用户套餐!")}})).fail((function(e){console.log(e)}))})).fail((function(e){c()}))}"none"==$(".section-order").css("display")?e():$(".btn-order").unbind("click").on("click",(function(n){e()}))}function D(){if(location.href.indexOf("flow.html")<0)window.location.href="flow.html?fes="+l.fes+"&sou="+l.sou+"&userid="+f.userid+"&usermob="+f.usermob+"&usertime="+(f.usertime||(new Date).getTime());else{var e=$(".section-flow"),n=f.usermob;e.find(".phone").html(n.substring(0,3)+"xxxx"+n.substring(7,11)),e.find(".btn").unbind("click").on("click",(function(){P().then((function(e){c(),null!=e&&""!=e&&t(e)})).fail((function(){c()}))})),P()}}function F(){if(location.href.indexOf("cancel.html")<0)window.location.href="cancel.html?fes="+l.fes+"&sou="+l.sou;else{var e=$(".section-login").find(".form-group");e.find(".sendcode").unbind("click").on("click",(function(){m(e,"cancellogin")})),e.find(".login").unbind("click").on("click",(function(){r(),p(e).done((function(){var e,n,o;(o={fes:l.fes,sou:l.sou,fog:u.fog,userid:e||f.userid,usermob:n||f.usermob,useraccount:""},$.ajax({url:v+"/comm/cancel",type:"POST",contentType:"application/json",data:JSON.stringify(o)})).done((function(e){switch(i(),e.resultCode){case"0000":M("cancelSuccess","您已成功退订该商品,退订次月生效",(function(){D()}));break;case"7605":M("cancelFailure",e.errorInfo,(function(){D()}));break;default:var n="";e.errorInfo.indexOf("退订失败")<0&&(n="退订失败,"),M("cancelFailure",n+e.errorInfo)}})).fail((function(e){i()}))})).fail((function(e){i()}))})),window.scrollTo(0,0)}}function M(e,n,o){var t="";switch(e){case"orderSuccess":t="dialog-message-order-success";break;case"orderFailure":t="dialog-message-order-failure";break;case"activeSuccess":t="dialog-message-active-success";break;case"activeFailure":t="dialog-message-active-failure";break;case"cancelSuccess":t="dialog-message-cancel-success";break;case"cancelFailure":t="dialog-message-cancel-failure"}var r=$('<div class="overlay"></div>'),i=$('<div class="dialog dialog-message '+t+'"> <div class="title"></div> <div class="content">'+n+'</div> <div class="actions"> <div class="btn">确定</div> </div></div>');return r.appendTo($(document.body)),i.appendTo($(document.body)),i.find(".btn").unbind("click").on("click",(function(){i.close()})),i.close=function(){r.remove(),i.remove(),i=null,o&&o()},i}function P(){var e=$(".section-flow");r("处理中,请稍后...");var n,o,t,a=$.Deferred();return(t={fes:l.fes,sou:l.sou,fog:u.fog,userid:n||f.userid,usermob:o||f.usermob},$.ajax({url:v+"/flow/query",type:"POST",contentType:"application/json",data:JSON.stringify(t)})).then((function(n){switch(i(),n.resultCode){case"0000":var o=s(JSON.parse(n.data).surplusFlow/1024/1024);e.find(".surplus").html(o+"GB");var t=parseInt(JSON.parse(n.data).usedFlow);if(t>0&&t<1024)a.resolve("剩余流量更新成功,为您免流了"+t+"KB~");else if(t>1024){var r=s(t/1024);a.resolve("剩余流量更新成功,为您免流了"+r+"MB~")}else a.resolve("剩余流量更新成功~");break;case"9201":a.resolve("您未订购百度定向流量包~"),e.find(".phone").html("用户未订购此产品!");break;case"9203":a.resolve("剩余流量更新成功~"),e.find(".suplus").html("本月剩余<br>8.00GB");break;default:a.resolve("剩余流量更新成功~")}})),a}c(),$((function(){var e=!1;window.addEventListener("pageshow",(function(){e&&window.location.reload()})),window.addEventListener("pagehide",(function(){e=!0}))})),function(){try{var e=localStorage.getItem("message");null!=e&&""!=e&&(e.indexOf("您已经订购")>=0?M("orderFailure",e):t(e),localStorage.removeItem("message"))}catch(e){}r(),g().then((function(e){i(),u=e.product[0],e.festival,function(e){if(l.userid)return f.userid=l.userid,void(f.usermob=l.usermob);try{var n=localStorage.getItem("time");if(n)if((new Date).getTime()<=parseFloat(n)+(e||36e5)){var o=localStorage.getItem("user");(f=JSON.parse(o)).userid=f.userid,f.usermob=f.usermob,"18674842761"==f.usermob&&setTimeout((function(){alert(n+e||36e5)}),100)}else localStorage.removeItem("time"),localStorage.removeItem("user")}catch(e){}}(),location.href.indexOf("index.html")>=0?f.userid?C("flow"):I():C(),location.href.indexOf("/cancel")>=0?k("110002"):location.href.indexOf("/draw")>=0?k("110003"):location.href.indexOf("/flow")>=0?k("110004"):location.href.indexOf("/active")>=0?k("110005"):location.href.indexOf("/refund")>=0?k("110006"):k("110001")}))}(),$("#btn-cancel").unbind("click").on("click",(function(){F()})),$("#btn-active").unbind("click").on("click",(function(){})),$(".section-agr").find(".footer").on("click",(function(){$($(".section-agr .scope").find("li")[2]).hasClass("hidden")?$(".section-agr .scope").find("li").each((function(e,n){$(n).removeClass("hidden")})):$(".section-agr .scope").find("li").each((function(e,n){e>=0&&$(n).addClass("hidden")}))}))},function(e,n){}]);
|