tuil-nongetstyle.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  1. $(function () {
  2. ncode = false;
  3. fes = getUrlParam("fes");
  4. sou = getUrlParam("sou");
  5. $("#useraccount_tt").attr("value", getUrlParam("freeflow_token"));
  6. });
  7. function goto404() {
  8. if (window.location.href == "https://800.wo.cn/orderchannel/hd/Dy/order202005.html?fes=jh7") {
  9. window.location.href = "https://800.wo.cn/orderchannel/hd/Dy/order.html?fes=9on&sou=12";
  10. return;
  11. }
  12. if (window.location.href == "https://optest.bol.wo.cn/orderchannel/orderchannel-s1h5/douyin/5G618/index.html?fes=jme&sou=vt") return;
  13. if (window.location.href.indexOf('jiangtao') >= 0) {
  14. alert(window.location.href)
  15. }
  16. // return
  17. var url = getRootPath() + "/404.html";
  18. $(location).attr('href', url);
  19. }
  20. $('.circular').click(function () {
  21. $('.circular').toggleClass("active")
  22. });
  23. $('.iphone').focus(function () {
  24. $(this).css('border', '1px solid #FF14CB');
  25. $(this).css('opacity', '1');
  26. })
  27. $('.iphone').blur(function () {
  28. $(this).css('border', '1px solid #fff');
  29. if ($(this).val() == '') {
  30. $(this).css('opacity', '0.49');
  31. } else {
  32. $(this).css('opacity', '1');
  33. }
  34. })
  35. $('.yanzhenma').focus(function () {
  36. $(this).css('border', '1px solid #FF14CB');
  37. $(this).css('opacity', '1');
  38. })
  39. $('.yanzhenma').blur(function () {
  40. $(this).css('border', '1px solid #fff')
  41. if ($(this).val() == '') {
  42. $(this).css('opacity', '0.49');
  43. } else {
  44. $(this).css('opacity', '1');
  45. }
  46. })
  47. $('.btn').mousedown(function () {
  48. $(this).css('opacity', '0.8')
  49. });
  50. $('.btn').mouseup(function () {
  51. $(this).css('opacity', '1')
  52. })
  53. $('.yuyue').click(function () {
  54. $('.maskArea').show();
  55. $('.tc').show();
  56. $('.close').show();
  57. })
  58. $('.close').click(function () {
  59. $('.maskArea').hide();
  60. $('.tc').hide();
  61. $('.close').hide();
  62. })
  63. var derice = "";
  64. var pattern = /^1[345678]\d{9}$/;
  65. var ncode = false;
  66. var countdown = 60;
  67. function settime(mode) {
  68. if (countdown == 0) {
  69. $("#yzm").attr("onclick", "sendSms('tt','" + mode + "')");
  70. $(".yanzhenma_btn").css('background-color', '#FF14CB')
  71. $(".yanzhenma_btn").attr("disabled", false);
  72. $(".yanzhenma_btn").text("获取验证码");
  73. countdown = 60;
  74. } else {
  75. $(".yanzhenma_btn").attr("disabled", true);
  76. $(".yanzhenma_btn").text(countdown + 's');
  77. countdown--;
  78. setTimeout(function () {
  79. settime(mode)
  80. }, 1000)
  81. }
  82. }
  83. function pro_bounced(headmg, textmg, buttonmg, state) {
  84. if (state) {
  85. $('.maskArea').show();
  86. $('.tc').show();
  87. $("#ts").attr('src', 'img/wancheng.png');
  88. $("#co").text(textmg);
  89. } else {
  90. $('.maskArea').show();
  91. $('.tc').show();
  92. $('.close').show();
  93. $("#ts").attr('src', 'img/wan.png');
  94. $("#co").text(textmg);
  95. }
  96. }
  97. function closeSe() {
  98. $(".maskArea").attr("style", "display:none;");
  99. }
  100. function emptyM() {
  101. $(".coupon").empty();
  102. }
  103. function getMemoValbyId(product, type) {
  104. var val = "";
  105. switch (type) {
  106. case "phone":
  107. val = $("#input_100_" + product).val();
  108. break;
  109. case "code":
  110. val = $("#input_50_" + product).val();
  111. break;
  112. case "fog":
  113. val = $("#fog_" + product).val();
  114. break;
  115. case "useraccount":
  116. val = $("#useraccount_" + product).val();
  117. break;
  118. case "sendsmsorder":
  119. val = $("#sendsms_order_" + product).val();
  120. break;
  121. case "sendsmscancel":
  122. val = $("#sendsms_cancel_" + product).val();
  123. break;
  124. case "sendsmsyuyue":
  125. val = $("#sendsms_yuyue_" + product).val();
  126. break;
  127. case "sendsmsacti":
  128. val = $("#sendsms_acti_" + product).val();
  129. break;
  130. }
  131. if (val == null) {
  132. return "";
  133. } else {
  134. return val;
  135. }
  136. }
  137. function getRootPath() {
  138. var curWwwPath = window.document.location.href;
  139. var pathName = window.document.location.pathname;
  140. var pos = curWwwPath.indexOf(pathName);
  141. var localhostPath = curWwwPath.substring(0, pos);
  142. var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
  143. return (localhostPath + projectName);
  144. }
  145. function getHref() {
  146. var curWwwPath = window.document.location.href;
  147. var pathName = window.document.location.pathname;
  148. var pos = curWwwPath.indexOf(pathName);
  149. var localhostPath = curWwwPath.substring(0, pos);
  150. var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
  151. return (localhostPath + pathName);
  152. }
  153. function sendSmsDate(product, mode) {
  154. var data = {
  155. "fog": getMemoValbyId(product, "fog"),
  156. "usermob": getMemoValbyId(product, "phone"),
  157. "smstype": getMemoValbyId(product, "sendsms" + mode),
  158. "sou": getUrlParam("sou"),
  159. };
  160. return data;
  161. }
  162. function getUrlParam(urlprm) {
  163. var reg = new RegExp("(^|&)" + urlprm + "=([^&]*)(&|$)");
  164. var r = window.location.search.substr(1).match(reg);
  165. if (r != null) {
  166. return r[2];
  167. } else {
  168. switch (urlprm) {
  169. case "con":
  170. return "1";
  171. break;
  172. case "freeflow_token":
  173. return "";
  174. break;
  175. default:
  176. goto404();
  177. break;
  178. }
  179. }
  180. }
  181. function theme(title, icon) {
  182. $("title").text(title);
  183. var sou = getUrlParam("sou");
  184. var fes = getUrlParam("fes");
  185. if (fes == "9om" && sou == "2e") {
  186. $("title").text("免流量看皮皮虾");
  187. }
  188. if (fes == "jh3" || sou == "jh4") {
  189. $("title").text("抗击疫情,温暖同行");
  190. }
  191. }
  192. function postini() {
  193. $.ajax({
  194. url: getRootPath() + "-s1api" + '/ini/getstyle',
  195. type: "POST",
  196. contentType: "application/json; charset=utf-8",
  197. dataType: "Json",
  198. data: JSON.stringify(postiniDate()),
  199. success:
  200. function (msg) {
  201. var resCode = msg["resultCode"];
  202. if (resCode == "0000") {
  203. var festival = msg["festival"];
  204. theme(festival["title"], festival["icon"]);
  205. var productlist = msg["product"];
  206. for (var i = 0, l = productlist.length; i < l; i++) {
  207. $("#fog_" + productlist[i].url).attr("value", productlist[i].fog);
  208. var smslist = productlist[i].icon.split(",");
  209. for (var int = 0; int < smslist.length; int++) {
  210. if (int == 0) {
  211. $("#sendsms_order_" + productlist[i].url).attr("value", smslist[int]);
  212. }
  213. if (int == 1) {
  214. $("#sendsms_cancel_" + productlist[i].url).attr("value", smslist[int]);
  215. }
  216. if (int == 2) {
  217. $("#sendsms_yuyue_" + productlist[i].url).attr("value", smslist[int]);
  218. }
  219. }
  220. }
  221. if (location.href.indexOf('order_imme.html') >= 0) {
  222. $('#major').trigger('click');
  223. }
  224. } else {
  225. goto404();
  226. }
  227. if (location.href.indexOf('/cancel') >= 0) {
  228. burypointLogId('110002');
  229. } else if (location.href.indexOf('/draw') >= 0) {
  230. burypointLogId('110003');
  231. } else if (location.href.indexOf('/flow') >= 0) {
  232. burypointLogId('110004');
  233. } else if (location.href.indexOf('/active') >= 0) {
  234. burypointLogId('110005');
  235. } else {
  236. burypointLogId('110001');
  237. }
  238. },
  239. error:
  240. function (XMLHttpRequest, textStatus, errorThrown) {
  241. goto404();
  242. },
  243. });
  244. }
  245. function gotorder() {
  246. var url = getRootPath() + "/Tou/Dy/order.html" +
  247. "?fes=" + getUrlParam("fes") + "&sou=" + getUrlParam("sou") +
  248. "&con=0";
  249. $(location).attr('href', url);
  250. }
  251. function gotosucc() {
  252. var url = getRootPath() + "/Tou/Dy/orderSucc.html" +
  253. "?fes=" + getUrlParam("fes") + "&sou=" + getUrlParam("sou") +
  254. "&phone=" + getMemoValbyId('tt', 'phone') + "&fog=" + getMemoValbyId('tt', 'fog') + "&fog=" + getMemoValbyId('tt', 'fog') + "&use=" + getMemoValbyId('tt', 'useraccount');
  255. $(location).attr('href', url);
  256. }
  257. function sendSms(product, mode) {
  258. $("#yzm").removeAttr("onclick");
  259. if (getMemoValbyId("tt", "phone") != "") {
  260. if (pattern.test(getMemoValbyId("tt", "phone"))) {
  261. $.ajax({
  262. type: "POST",
  263. contentType: "application/json; charset=utf-8",
  264. dataType: "Json",
  265. url: getRootPath() + "-s1api" + '/smsc',
  266. data: JSON.stringify(sendSmsDate(product, mode)),
  267. success: function (msg) {
  268. var resCode = eval(msg["resultCode"]);
  269. if (resCode == "0000") {
  270. ncode = true;
  271. settime(mode);
  272. } else {
  273. sleep(mode);
  274. pro_bounced("温馨提示", msg["errorInfo"], "", false);
  275. }
  276. },
  277. error: function (XMLHttpRequest, textStatus, errorThrown) {
  278. sleep(mode);
  279. pro_bounced("温馨提示", "短信验证码发送失败", "", false);
  280. },
  281. });
  282. } else {
  283. $("#yzm").attr("onclick", "sendSms('tt','" + mode + "')");
  284. pro_bounced("温馨提示", "请输入正确的中国联通手机号码", "", false);
  285. }
  286. } else {
  287. $("#yzm").attr("onclick", "sendSms('tt','" + mode + "')");
  288. pro_bounced("温馨提示", "手机号码未输入", "", false);
  289. }
  290. if ('acti' == mode) {
  291. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'active_click_send_sms_code_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(getUrlParam("sou"), 32) })
  292. } else {
  293. WoAnalytics.addPoint({ ad: $('#nanyanad').val(), ett: 'click', ea: 'cancel_click_send_sms_code_btn' + $('#nanyanlabel').val(), ct: 'web', pm: parseInt(getUrlParam("sou"), 32) })
  294. }
  295. }
  296. function sleep(mode) {
  297. var start = new Date().getTime();
  298. while (true) {
  299. if (new Date().getTime() - start > 10000) {
  300. $("#yzm").attr("onclick", "sendSms('tt','" + mode + "')");
  301. break;
  302. }
  303. }
  304. }
  305. function gotoUrl(html) {
  306. var url = getRootPath() + "/" + html + ".html?fes=" + getUrlParam("fes") + "&sou=" + getUrlParam("sou") + "&use=" + getMemoValbyId('tt', 'useraccount');
  307. $(location).attr('href', url);
  308. }
  309. function gotoUrlC(html) {
  310. var url = getRootPath().replace(/https/ig, "http") + "/" + html + ".html?fes=" + getUrlParam("fes") + "&sou=" + getUrlParam("sou") + "&use=" + getMemoValbyId('tt', 'useraccount');
  311. $(location).attr('href', url);
  312. }
  313. function postiniDate() {
  314. var data = {
  315. fes: getUrlParam("fes"),
  316. sou: getUrlParam("sou"),
  317. };
  318. return data;
  319. }
  320. function GetFlowJsonData(product) {
  321. var data = {
  322. "fog": fog,
  323. "usermob": phone,
  324. };
  325. return data;
  326. }
  327. function GetMasData(product) {
  328. var data = {
  329. "code": getMemoValbyId(product, "code"),
  330. "fog": getMemoValbyId(product, "fog"),
  331. "usermob": getMemoValbyId(product, "phone"),
  332. "useraccount": getMemoValbyId(product, "useraccount"),
  333. "fes": getUrlParam("fes"),
  334. "sou": getUrlParam("sou"),
  335. };
  336. return data;
  337. }
  338. var se = 0;
  339. function seuid() {
  340. se = se + 1;
  341. if (se == 5) {
  342. se = 0;
  343. alert("sou:" + sou);
  344. }
  345. }
  346. (function () {
  347. Date.prototype.from = function (dateString) {
  348. var pattern2 = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/
  349. var str = dateString.replace(/-/g, '/');
  350. str = str.replace(pattern2, '$1/$2/$3 $4:$5:$6')
  351. return new Date(str)
  352. }
  353. Date.prototype.format = function (fmt) {
  354. var o = {
  355. "M+": this.getMonth() + 1,
  356. "d+": this.getDate(),
  357. "h+": this.getHours(),
  358. "m+": this.getMinutes(),
  359. "s+": this.getSeconds(),
  360. "q+": Math.floor((this.getMonth() + 3) / 3),
  361. "S": this.getMilliseconds()
  362. };
  363. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  364. for (var k in o)
  365. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  366. return fmt;
  367. }
  368. })();
  369. function getTodaySurplusMillis() {
  370. var time1 = new Date();
  371. var time2 = time1.from(time1.getFullYear() + '-' + (time1.getMonth() + 1) + '-' + time1.getDate() + ' 23:59:59');
  372. console.log(time2.getTime() - time1)
  373. return time2.getTime() - time1.getTime();
  374. }
  375. function burypointLogId(operid, remark, url) {
  376. var uuid = getCookie('uuid');
  377. var vvid = getCookie('vvid');
  378. if (uuid == null || uuid.trim() == '') {
  379. uuid = guid();
  380. setCookie('uuid', uuid, getTodaySurplusMillis());
  381. }
  382. if (vvid == null || vvid.trim() == '') {
  383. vvid = guid();
  384. setCookie('vvid', vvid, -1);
  385. }
  386. if (operid == null || operid == '') {
  387. return;
  388. }
  389. var param = {
  390. operid: operid,
  391. uuid: uuid,
  392. vvid: vvid,
  393. fog: getMemoValbyId('tt', 'fog'),
  394. userid: '',
  395. fes: getUrlParam("fes"),
  396. sou: getUrlParam("sou"),
  397. url: encodeURIComponent(url || window.location.href),
  398. remark: encodeURIComponent(remark || '')
  399. }
  400. $.ajax({
  401. type: "POST",
  402. contentType: "application/json; charset=utf-8",
  403. dataType: "Json",
  404. url: getRootPath() + "-s1api" + '/burypoint/logid',
  405. data: JSON.stringify(param),
  406. success: function () { },
  407. error: function () { },
  408. });
  409. }
  410. function getCookie(name) {
  411. var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
  412. if (arr = document.cookie.match(reg))
  413. return unescape(arr[2]);
  414. else
  415. return null;
  416. }
  417. function setCookie(name, value, millis) {
  418. millis = (millis == undefined ? 0 : millis);
  419. var exp = new Date();
  420. if (millis < 0) {
  421. document.cookie = name + "=" + escape(value);
  422. } else {
  423. exp.setTime(exp.getTime() + millis);
  424. document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
  425. }
  426. }
  427. function guid() {
  428. return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  429. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  430. return v.toString(16);
  431. });
  432. }