123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- /**
- * 头条订购页面初始化
- */
- $(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"));
- //window.history.pushState({}, "", getHref()+"?fes="+fes+"&sou="+sou);
- });
- /**
- * 刷新页面中提示
- */
- function refresh_hint() {
- $(".head").empty();
- $(".coupon").empty();
- }
- /**
- * 关闭当前页面中弹窗
- */
- function close_popup() {
- $(".warning").attr("style", "display:none;");
- $(".layer").attr("style", "display:none;");
- }
- /*--------------------退订STA-----------------------*/
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_open' + $('#nanyanlabel').val(), ct: 'web', ct: 'web', pm: parseInt(getUrlParam("sou"), 32) })
- function sendCan(product) {
- var cancelReason = JSON.parse(window.localStorage.getItem('kye'))
- console.log(cancelReason)
- closeSe();
- if (getMemoValbyId(product, "code") != "") { // 判断用户是否输入了验证码
- console.log(product)
- 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, cancelReason.canceltype, cancelReason.cancelmsg)),
- success: function(msg) {
- $(".red_btn").removeAttr("disabled");
- $(".red_btn").removeAttr("style");
- $("#major").val("立即退订");
- var resCode = eval(msg["resultCode"])
- if (resCode == "0000") {
- pro_bounced("您已退订成功", "当前流量包已退订成功,结果以短信告知为准", "确定", true);
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_success' + $('#nanyanlabel').val(), ct: 'web', ct: 'web', pm: parseInt(getUrlParam("sou"), 32) })
- window.localStorage.removeItem("kye");
- } else {
- if (msg["resultCode"] == "6611") {
- hint("code", product, msg["errorInfo"]);
- } else {
- pro_bounced("退订失败", msg["errorInfo"], "确定", false);
- }
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_failure' + $('#nanyanlabel').val(), ct: 'web', ct: 'web', pm: parseInt(getUrlParam("sou"), 32) })
- }
- },
- error: function(XMLHttpRequest, textStatus,
- errorThrown) {
- pro_bounced("退订失败", "退订失败,请点击“确认”按键,尝试重新退订", "确定", false);
- $(".red_btn").removeAttr("disabled");
- $(".red_btn").removeAttr("style");
- $("#major").val("立即退订");
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_failure' + $('#nanyanlabel').val(), ct: 'web', ct: 'web', pm: parseInt(getUrlParam("sou"), 32) })
- },
- });
- } else {
- hint("code", product, "验证码已失效请重新获取");
- }
- } else {
- hint("code", product, "请输入验证码");
- }
- WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_click_confirm_btn' + $('#nanyanlabel').val(), ct: 'web', ct: 'web', pm: parseInt(getUrlParam("sou"), 32) })
- }
|