1 |
- window.dx={user:{},handler:{}},function(){var e=String.prototype.toString;Array.isArray||(Array.isArray=function(o){return"[object Array]"===e.call(o)})}(),function(e,o){e.funs={openCap:function(){$("body").css("overflow","hidden");var r=$('<iframe id="uniauthframe" src="http://localhost:8090/cap/CAP-AUTH.html"></iframe>');r.on("load",function(){$.ajax({url:getRootPath()+"/ini/gensign",data:{fog:$("#fog_tt").val()},dataType:"JSON",method:"POST",success:function(e){$("#uniauthframe")[0].contentWindow.postMessage(JSON.stringify(e),"http://localhost:8090/cap/")}})}),$("body").append(r),o.addEventListener("message",function(o){var r=JSON.parse(o.data);switch(r.resultcode){case"0":e.user.token=r.token,e.user.userid=decodeURIComponent(r.userid),e.user.userid1=r.userid1,$("iframe").remove(),$("body").css("overflow","auto");break;case"9001":$("iframe").remove(),$("body").css("overflow","auto");break;case"0001":case"0003":case"0006":case"4444":break;default:$("iframe").remove(),$("body").css("overflow","auto"),e.utils.showToast(r.errorinfo)}},!1)},order:function(){}}}(dx,window),function(dx,window){dx.flow={init:function(){dx.user.productName="今日头条定向流量9元10G月包",dx.user.productPrice="9.00元",dx.user.productId="8434545",dx.funs.postInit(),dx.flow.bindEvent()},bindEvent:function(){$("#btn-order").unbind("click").on("click",function(){dx.handler.openCap=function(e){dx.flow.order(e.SERVICE_ID,e.RSP.DATA[0].TOKEN)},dx.funs.openCap(dx.query.phone||dx.user.phone,dx.user.cpid,"1")})},order:function(usermob,token){dx.user.order="1",dx.handler.order=function(data){var resCode=eval(data.resultCode);switch(resCode){case"0000":dx.utils.showToast("订购成功!"),dx.user.order=0;break;case"0013":dx.utils.showToast("该号码归属省分2/3G暂未开通此产品!");break;case"6611":dx.utils.showToast("订购失败,请重试!"),dx.user.order=0;break;case 6615:dx.utils.showToast("订购失败,请确定用户套餐!"),dx.user.order=0;break;case 6622:dx.utils.showToast("用户已订购过此产品!"),dx.user.order=0;break;case 7777:break;default:dx.utils.showToast(msg.errorInfo),dx.user.order=0}},dx.funs.order(usermob,token)}},dx.flow.init()}(dx,window);
|