/// /// /// // // var userID = ''; // // var access_control = $.parseJSON('{"vcode_color1":"#b3d7ff","vcode_reg_graph":"0","vcode_color3":"#d22000","vcode_fontsize":"12","vcode_color2":"#0060ca","vcode_login_graph":"0","verification_manual":"1","verification_ip_reg_limit":"0","vcode_resetps_sms":"1","vcode_length":"5","vcode_resetps_email":"1","vcode_limit_time":"60","vcode_color0":"#ffffff","vcode_reg_email":"0","vcode_sms_graph":"0","vcode_email_graph":"0","verification_order":"1","vcode_font":"Verdana","verification_login":"0","vcode_reg_sms":"0"}'); // var swin = $("#swin"), suwin = $("#suwin"); if (userID != '') { // $(".login").html(',欢迎您!|' + '用户中心|' + '产品服务管理|' + '财务管理|' + '售后服务中心|' + '联系我们|' + '退出登录' + ''); // } function userLogin(action, rurl) { if (rurl == '') rurl = top.location.toString(); if (rurl.length > 3 && rurl.substring(0, 3) == '?c=') rurl = 'process.aspx?c=go&url=' + escape(rurl); if (action == 0) { var imgUrl = 'page.aspx?c=imgcode&t=login'; var str = '
 
' + '

用户名:


' + '

密 码:


' + '

验证码:

' + '
'; swin.html(str); swin.find("form").submit(function(){userLogin(1, rurl);}); swin.find("input").keydown(function (e) { if (e.keyCode == 13) { e.preventDefault(); userLogin(1, rurl); } }); swin.find("input:first").focus(); swin.find('#ccImg').dblclick(function () { $(this).attr('src', imgUrl + '&' + new Date()); }); if (access_control.vcode_login_graph != '1') swin.find('#checkcode').remove(); swin.dialog({ title: "客户登录", autoOpen: false, resizable: false, width: 368, modal: true, buttons: { "登 录": function () { userLogin(1, rurl); }, "免费注册": function () { userReg(0, rurl); }, "关 闭": function () { $(this).dialog("close"); } } }).dialog("open"); } else { var cform = $("#lform"); processing('正在登录,请稍候...'); var delay = 0; var cmd = ''; $.post(cform.attr("action"), cform.serialize(), function (rdata) { var rmsg = rdata.split('|'); if (rmsg[0] == "0") { userID = 1; rdata = '
登录成功!
'; delay = 800; if (rurl.length > 4 && rurl.substring(0, 4) == 'cmd:') { setTimeout(rurl.substring(4), 1000); cmd = 'close'; } else cmd = 'top.location = "' + rurl + ' ";'; } else { switch (rmsg[0]) { case "Invalid_username": rdata = "您输入的用户名无效!"; break; case "Invalid_checkCode": rdata = "您输入的验证码错误!"; break; case "Invalid_password": rdata = "您输入的密码无效!"; break; case "IP_blocked": rdata = "您的IP地址已被禁止访问!"; break; case "Invalid_email": rdata = "请输入正确的电子邮箱地址!"; break; case "Account_pending_verification": rdata = "您的帐户需要通过人工审核后才能登录,请耐心等待!如需帮助,请联系客服!"; break; case "Account_suspended": rdata = "您的帐户已被禁用,请与客服联系!"; break; } } showResults(rdata, delay, cmd); }); return false; } } function userLogout(rurl) { if (rurl == '') rurl = top.location.toString(); if (rurl.length > 3 && rurl.substring(0, 3) == '?c=') rurl = 'process.aspx?c=go&url=' + escape(rurl); swin.html('您确定要退出登录吗?'); swin.dialog({ title: "安全退出", autoOpen: false, resizable: false, width: 368, modal: true, buttons: { "确 定": function () { top.location = 'process.aspx?c=logout&rurl=' + escape(rurl) }, "取 消": function () { $(this).dialog("close"); } } }).dialog("open"); } function userReg(action, rurl) { if (rurl == '') rurl = top.location.toString(); if (rurl.length > 3 && rurl.substring(0, 3) == '?c=') rurl = 'process.aspx?c=go&url=' + escape(rurl); // var ufString = ''; // if (ufString == '') ufString = '{}'; var ufData = $.parseJSON(ufString); if (action == 0) { var str = '
 
' + '

用户名称:*


' + '

输入密码:*


' + '

输入密码:*


' + '

电子邮箱:*


' + '

手机号码:*


' + '

QQ 号码:


' + '

推介人id:


' + '
'; swin.html(str); swin.find("input").css({ "width": "260px" }); swin.find("input:first").focus(); swin.find("input").keydown(function (e) { if (e.keyCode == 13) { e.preventDefault(); userReg(1, rurl); } }); if (access_control.vcode_reg_email == '1') { $('

邮箱验证:

').insertAfter(swin.find("#reg_email")); swin.find("#btn_emailvcode").css({ "height": "auto", "line-height": "normal", "font-size": "13px" }).button().click(function () { sendVerificationCode('email', 'reg', 'email=' + swin.find("input[name='email']").val(), $(this)); }); } if (access_control.vcode_reg_sms == '1') { $('

手机验证:

').insertAfter(swin.find("#reg_mobile")); swin.find("#btn_smsvcode").css({ "height": "auto", "line-height": "normal", "font-size": "13px" }).button().click(function () { sendVerificationCode('sms', 'reg', 'mobile=' + swin.find("input[name='tel']").val(), $(this)); }); } var efkID; $.each(ufData, function (key, value) { if (key.indexOf('label_') > -1 && value != '') { efkID = key.substring(6); swin.find("#rform").append('

' + value + ':' + (ufData['required_' + efkID] == '1' ? '*' : '') + '


'); } }); if (access_control.vcode_reg_graph == '1') { var imgUrl = '/page.aspx?c=imgcode&t=reg'; swin.find("#rform").append('

 验证码:

'); swin.find('#ccImg').click(function () { $(this).attr('src', imgUrl + '&' + new Date()); }); } swin.find("form").tooltip({ track: true, show: { effect: "slideDown", delay: 100 }, content: function () { return $(this).attr("title"); } }); //swin.dialog({ title: "用户注册", autoOpen: false, resizable: false, width: 500, modal: true, buttons: { "提交注册": function () { userReg(1, rurl); }, "登 录": function () { userLogin(0, rurl); }, "关 闭": function () { $(this).dialog("close"); } } }).dialog("open"); swin.dialog({ title: "用户注册", autoOpen: false, resizable: false, width: 500, modal: true, buttons: { "提交注册": function () { if ($("#chkAgreeService").attr("id") != undefined && !$("#chkAgreeService").prop("checked")) { processing("正在处理"); showResults("必须同意商家服务协议才能注册!", 3000, 'close'); return; }; userReg(1, rurl); }, "登 陆": function () { userLogin(0, rurl); }, "关 闭": function () { $(this).dialog("close"); } } }).dialog("open"); $.post('/files/js_plugin/disclaimer/index.ashx?action=getconfig&t=' + new Date(), function (data) { var enable = data.substr(0, 1); if (enable == "1") { swin.find("#rform").append('

            《商家服务协议》

'); $("#showcontent").click(function () { $("#suwin").html(data.substr(1)); $("#suwin").dialog({ title: '商家服务协议:', autoOpen: false, resizable: false, height: 600, width: 550, modal: true, buttons: { "关 闭": function () { $(this).dialog("close");} } }).dialog("open"); }); $("#chkAgreeService").css("cursor", "pointer").click(function () { if ($(this).prop("checked")) $(this).attr("checked", "checked"); else $(this).removeAttr("checked"); }); } }); } else { var cform = $("#rform"); processing('正在提交注册请求,请稍候...'); var delay = 0; var cmd = ''; $.post(cform.attr("action"), cform.serialize(), function (rdata) { var rmsg = rdata.split('|'); if (rmsg[0] == "0") { rdata = '恭喜您已经成功注册!
请牢记您的用户名:' + rmsg[1] + ',密码:' + rmsg[2] + ''; delay = 2900; if (rurl.length > 4 && rurl.substring(0, 4) == 'cmd:') { setTimeout(rurl.substring(4), 3000); cmd = 'close'; } else if (rurl != '') cmd = 'top.location = "' + rurl + ' ";'; } else { switch (rmsg[0]) { case "Invalid_username": rdata = "用户名只能由5~30位的字母及数字组成!"; break; case "Invalid_graph_vCode": rdata = "您输入的图形验证码错误!"; break; case "Invalid_email_vCode": rdata = "请输入正确的邮件验证码!"; break; case "Invalid_sms_vCode": rdata = "请输入正确的短信验证码!"; break; case "Invalid_password_length": rdata = "密码长度不能小于6位!"; break; case "Password_does_not_match": rdata = "两次输入的新密码不相同!"; break; case "Invalid_email": rdata = "请输入正确的电子邮箱地址!"; break; case "Username_exists": rdata = "您输入的用户名称已经存在,请更换其它名称重试!"; break; case "Email_exists": rdata = "您输入的邮箱地址已经存在,请更换其它邮箱重试!"; break; case "Phone_number_exists": rdata = "您输入的手机号码已被使用,请更换其它号码重试!"; break; case "IP_blocked": rdata = "您的IP地址已被禁止访问!"; break; case "IP_reg_limit": rdata = "您当前IP地址今天的注册次数已超系统限制!"; break; case "Username_containing_banned_words": rdata = "您输入的用户名含有禁用词语,请重新选择!"; break; } if (rmsg[0].indexOf('Can not be empty') > -1) { rdata = '[' + ufData['label_' + rmsg[0].substring(0, rmsg[0].indexOf('.'))] + ']不能为空!'; } } showResults(rdata, delay, cmd); }); return false; } } function payOnline(action,amount) { if (action == 0) { suwin.dialog({ title: "在线充值", autoOpen: false, resizable: false, width: 500, height: 308, modal: true, buttons: { "充 值": function () { payOnline(1, amount); }, "取 消": function () { $(this).dialog("destroy"); } } }).dialog("open"); suwin.html(ajaxLoading()); $.getJSON("process.aspx?c=payment&at=select&" + new Date(), function (rdata) { if (rdata == null) suwin.html("在线充值已禁用!"); else { var str = '请选择充值接口:
    '; $(rdata).each(function (i) { str += '
  • '; }); str += '
充值金额:

'; suwin.html(str); suwin.find("label").css("cursor", "pointer"); suwin.find("input:radio").click(function () { suwin.find(".pptext").html(htmlDecode($(this).attr("title"))); }); suwin.find("input:radio:first").click(); } }); } else if (action == 1) { amount = suwin.find("input[name='amount']").val(); if (isNaN(amount) || parseFloat(amount) < 0.01) alert("充值金额必须为大于0.01的数字"); else { var pmid = suwin.find("input[name='pmid']:checked").val(); amount = parseFloat(amount).toFixed(2); suwin.find(".pptext").text("正在处理,请稍候..."); $.get("process.aspx?c=payment&&at=url&pmid=" + pmid + "&amount=" + amount + "&" + new Date(), function (rdata) { var rmsg = rdata.split('|'); if (rmsg[0] == '0') { suwin.html('充值金额:' + amount + ' 元
' + '充值方式:' + suwin.find("label[for='pm" + pmid + "']").text() + '

' + '马上充值' + ''); suwin.dialog({ title: "在线充值确认", autoOpen: false, resizable: false, width: 398, height: 268, modal: true, buttons: { "取 消": function () { $(this).dialog("close"); } } }).dialog("open"); suwin.find("img").click(function () { suwin.dialog("option", "buttons", { "确认已完成充值": function () { payOnline(2, amount); }, "关 闭": function () { $(this).dialog("destroy"); } }); }); } else { switch (rmsg[1]) { case 'Invalid payment method': rdata = '无效的付款方式!'; break; case 'Invalid amount': rdata = '充值金额必须为大于0的数字!'; break; case 'Invalid sign': rdata = '接口[' + rmsg[2] + ']验证错误,请与客服联系!'; break; case 'Amount can not exceed reseller balance': rdata = '充值金额大于允许限制,请与客服联系!'; break; } suwin.find(".pptext").text(rdata); } }); } } else if (action == 2) { processing("正在获取充值结果,请稍候..."); var pid = suwin.find("input:first").val(); if (pid.indexOf('_') > 0) pid = pid.substring(pid.lastIndexOf('_') + 1); var delay = 0; var cmd = ''; $.get("process.aspx?c=payment&at=verifypay&pid=" + pid + "&" + new Date(), function (rdata) { if (rdata == "-1") { rdata = "您的充值操作还没有完成,请点击“马上充值”"; } else { delay = 1000; rdata = '充值成功!您现在可以继续购买操作了...'; cmd = 'close'; } showResults(rdata, delay, cmd); }); } } function checkout(productID, billingCycle) { processing('正在发送购买请求,请稍候...'); var cmd = ''; delay = 0; var cform = $('#OrderConfig'); $.post('/idcSystem.aspx?c=order&at=checkout&pid=' + productID + '&cycle=' + billingCycle + '&' + new Date(), cform.serialize(), function (rdata) { var rmsg = rdata.split('|'); if (rmsg[0] == '0') { rdata = "购买成功!
系统将会尽快为您开通服务,感谢您的购买!"; delay = 1; cmd = 'close'; swin.dialog("close"); swin.html('您已经成功购买,系统将会为您尽快完成服务开通和设置,请选择:'); swin.dialog({ title: "购买成功", autoOpen: false, resizable: false, modal: true, buttons: { "查看和管理我的服务": function () { top.location = 'process.aspx?c=go&url=' + escape('?c=myservice'); }, "继续购买": function () { $(this).dialog("close"); } } }).dialog("open"); } else { switch (rmsg[1]) { case "Outstock": rdata = '此产品已经销售完毕,请选择其它产品!'; break; case "You only get to apply once": rdata = '每位客户只能申请一次试用!'; break; case "Payment is incorrect": rdata = '您选择的付款方式或付款周期有误!'; break; case "Invalid coupon code": rdata = '您输入的优惠码无效!'; break; case "Lack of balance": rdata = '您的余额不足于购买当前产品!'; break; case "Price configuration error": rdata = '产品价格配置错误!'; break; case "Module price error": rdata = '计费模块错误!'; break; case "Pending verification": rdata = '您的帐户需要验证后才能购买,请先到个人资料页面进行验证!'; break; case "无效的节点服务器!": rdata = "服务器资源不足!"; break; default: rdata = rmsg[1]; break; } delay = 0; } showResults(rdata, delay, cmd); }); } function placeOrder(action, url) { if (action == 0) { if (userID == '') userLogin(0, 'cmd:placeOrder(1,"' + url + '");'); else placeOrder(1, url); } else if (action == 1) { if (url.length > 3 && url.substring(0, 3) == '?c=') url = 'process.aspx?c=go&url=' + escape(url); top.location = url; } }