/** * 头条订购页面初始化 */ $(document).ready(function () { /** * 初始化页面中开关 */ $(".input_100 , .input_50").focus(function () { $(this).addClass("active"); }); $(".input_100 , .input_50").blur(function () { $(this).removeClass("active"); }); $(".info_data li span").click(function () { if ($(this).hasClass("chose_yes")) { $(this).removeClass("chose_yes").addClass("chose_no"); } else { $(this).addClass("chose_yes").removeClass("chose_no"); } }); $(".mask").click(function () { $(".layer").fadeOut(); }); $(".close").click(function () { $(".layer").fadeOut(); }); $("#useraccount_tt").attr("value", getUrlParam("use")); }); /** * 刷新页面中提示 */ function refresh_hint() { $(".head").empty(); $(".coupon").empty(); } /** * 关闭当前页面中弹窗 */ function close_popup() { $(".warning").attr("style", "display:none;"); $(".layer").attr("style", "display:none;"); } /*--------------------退订STA-----------------------*/ function sendCan(product) { closeSe(); if (getMemoValbyId(product, "code") != "") {// 判断用户是否输入了验证码 if (ncode) {//判断验证码是否超时 $(".red_btn").attr("disabled", "disabled"); $(".red_btn").css("background: url(../images/btn_bg_lose.png)"); $("#major").val("正在退订请稍等..."); $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", dataType: "Json", url: getRootPath() + "-s1api" + '/com/unsuc', data: JSON.stringify(GetMasData(product)), success: function (msg) { $(".red_btn").removeAttr("disabled"); $(".red_btn").removeAttr("style"); $("#major").val("立即退订"); var resCode = eval(msg["resultCode"]); if (resCode == "0000") { pro_bounced("您已退订成功", "当前流量包已退订成功,结果以短信告知为准", "确定", false); } else { emptyM(); if (msg["resultCode"] == "6611") { hint("code", product, msg["errorInfo"]); } else { pro_bounced("退订失败", msg["errorInfo"], "确定", false); } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { pro_bounced("退订失败", "退订失败,请点击“确认”按键,尝试重新退订", "确定", false); $(".red_btn").removeAttr("disabled"); $(".red_btn").removeAttr("style"); $("#major").val("立即退订"); }, }); } else { hint("code", product, "验证码已失效请重新获取"); } } else { hint("code", product, "请输入验证码"); } } /*--------------------退订END-----------------------*/