activateutil.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*--------------------激活STA-----------------------*/
  2. function sendCan(product) {
  3. closeSe();
  4. if (getMemoValbyId(product, "code") != "") {// 判断用户是否输入了验证码
  5. if (ncode) {//判断验证码是否超时
  6. $(".red_btn").attr("disabled", "disabled");
  7. $(".red_btn").css("background: url(../images/btn_bg_lose.png)");
  8. $("#major").val("正在激活请稍等....");
  9. $.ajax({
  10. type : "POST",
  11. contentType : "application/json; charset=utf-8",
  12. dataType : "Json",
  13. url : getRootPath() + "-s1api" + '/com/act',
  14. data : JSON.stringify(GetMasData(product)),
  15. success : function(msg) {
  16. $(".red_btn").removeAttr("disabled");
  17. $(".red_btn").removeAttr("style");
  18. $("#major").val("立即激活");
  19. var resCode = eval(msg["resultCode"]);
  20. if (resCode == "0000") {
  21. pro_bounced("您已激活成功", "恭喜您APP端激活成功", "确定",true);
  22. } else {
  23. emptyM();
  24. if (msg["resultCode"] == "6611") {
  25. hint("code",product, msg["errorInfo"]);
  26. } else {
  27. pro_bounced("激活失败","激活失败激活设备号:"+getMemoValbyId(product, "useraccount"), "确定",false);
  28. }
  29. }
  30. },
  31. error : function(XMLHttpRequest, textStatus,
  32. errorThrown) {
  33. pro_bounced("激活失败","激活失败,请点击“确认”按键,尝试重新激活", "确定",false);
  34. $(".red_btn").removeAttr("disabled");
  35. $(".red_btn").removeAttr("style");
  36. $("#major").val("立即激活");
  37. },
  38. });
  39. } else {
  40. hint("code",product, "验证码已失效请重新获取");
  41. }
  42. } else {
  43. hint("code",product, "请输入验证码");
  44. }
  45. }
  46. /*--------------------激活END-----------------------*/