page.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. var users = {};
  2. //1.循环遍历users数据
  3. var timestamp = new Date()
  4. console.log(timestamp)
  5. var usermob = getQueryString("userid");
  6. var root = null;
  7. /*
  8. 获取订购记录
  9. */
  10. root = getRootPath();
  11. queryWeiboUserInfoak(usermob);
  12. function queryWeiboUserInfoak(usermob) {
  13. // var productid = 2020010201
  14. var param = {
  15. "fog": 'df3958be828815ec18613612fa1e7a55e6077a33cfc0098b64a25eeabaa4e118976fdec7a362c595035df466add330085bd685bd54bf9abc229f4b59abe09f1618473ede33aa3665bd2c88a2ad1bc7cc690066e6a331a0cc078fd38b86681cbab250b233fcb92ba4b318f90df696b5ae',
  16. 'userid': usermob,
  17. 'vipcode': '10001'
  18. }
  19. var def = $.Deferred();
  20. $.ajax({
  21. url: root + "-s1api" + "/rights/querys",
  22. type: "POST",
  23. contentType: "application/json",
  24. data: JSON.stringify(param)
  25. }).then(function(response) {
  26. // console.log(response)
  27. var more = ''
  28. response.data.forEach(function(item) {
  29. if (item.status == "3") {
  30. more += ` <div class="body-as">
  31. <div class="ge-box">
  32. <div class="box-ace">
  33. <img class="img-ace" src="./202203/images/抖音币.png" alt="">
  34. <span class="text-ace">${item.productName}</span>
  35. </div>
  36. <span class="text-a">领取权益</span><span id='${item.spid}' class="text-ak">立即领取</span>
  37. </div>
  38. </div>
  39. `
  40. }
  41. // console.log(response.data)
  42. switch (item.vipname) {
  43. case '爱奇艺视频会员周卡':
  44. var img = '202203/images/爱奇艺.png'
  45. break;
  46. case '美团外卖红包5元':
  47. var img = '202203/images/美团.png'
  48. break;
  49. case '抖音币50个':
  50. var img = '202203/images/抖音币.png'
  51. break;
  52. case '优酷视频会员周卡':
  53. var img = '202203/images/优酷.png'
  54. break;
  55. case '腾讯视频会员周卡':
  56. var img = '202203/images/腾讯视频.png'
  57. break;
  58. case '芒果TV PC移动影视会员周卡':
  59. var img = '202203/images/芒果tv.png'
  60. break;
  61. case '蜻蜓FM超级会员周卡':
  62. var img = '202203/images/蜻蜓.png'
  63. break;
  64. default:
  65. break;
  66. }
  67. if (item.vipuser != null) {
  68. more += `
  69. <div class="body-a">
  70. <div class="ge-box">
  71. <div class="box-ace">
  72. <img class="img-ace" src="${img}" alt="">
  73. <span class="text-ace">${item.productName}</span>
  74. </div>
  75. <!-- <span class="text-a">所属产品</span><span class="text-e">抖音定向流量权益包</span> -->
  76. <span class="text-a">领取权益</span><span class="text-e">${item.vipname}</span>
  77. <span class="text-b">领取号码</span><span class="text-f">${item.vipuser}</span>
  78. <span class="text-c">领取时间</span><span class="text-g">${item.ordertime}</span>
  79. </div>
  80. </div>
  81. `
  82. }
  83. })
  84. $('#bodyt').append(more)
  85. switch (response.resultCode) {
  86. case "0000":
  87. def.resolve(response);
  88. break;
  89. case "1066":
  90. def.resolve(response);
  91. break;
  92. default:
  93. compnt.showAlert(response.errorInfo)
  94. def.reject(response);
  95. break;
  96. }
  97. $('.text-ak').click(function() {
  98. var d1 = new Date(timestamp); //已知时间戳
  99. var d2 = new Date(); //当前时间戳
  100. let minute = (parseInt(d2 - d1) / 1000 / 60) //算出相差的分钟
  101. console.log(d2)
  102. console.log(minute)
  103. if (minute < 10) {
  104. var spid = $(this).attr("id")
  105. var a = getQueryString("cpid");
  106. var b = getQueryString("userid");
  107. var c = getQueryString("usermob");
  108. var fes = getQueryString("fes");
  109. var sou = getQueryString("sou");
  110. var cbUrls;
  111. if (window.location.href.indexOf("https://800.wo.cn/orderchannel") >= 0) {
  112. cbUrls = "https://800.wo.cn/orderchannel/douyin/15/draw20220313.html?fes=jjd&sou=1m&cpid=" + a + '&userid=' + b + '&usermob=' + c + '&' + spid;
  113. } else if (window.location.href.indexOf("http://100.0.4.69:3344") >= 0) {
  114. cbUrls = "http://100.0.4.69:3344/orderchannel/douyin/15/draw20220313.html?fes=" + fes + "&sou=" + sou + '&cpid=' + a + '&userid=' + b + '&usermob=' + c + '&' + spid;
  115. }
  116. location.href = cbUrls
  117. } else {
  118. var spid = $(this).attr("id")
  119. var cbUrl = 'https://800.wo.cn/orderchannel/douyin/15/draw20220313.html?fes=jjd&sou=1m&' + spid;
  120. // var cbUrl = 'https://800.wo.cn/orderchannel/douyin/15/draw20220313.html?' + 'fes=' + fes + '&sou=' + sou;
  121. if (cbUrl.indexOf('cpid=') > 0) {
  122. cbUrl = cbUrl.substr(0, cbUrl.indexOf('cpid=') - 1)
  123. }
  124. if (window.location.href.indexOf('?') >= 0) {
  125. cbUrl += '&cpid=2017060800064876';
  126. } else {
  127. cbUrl += '?cpid=2017060800064876';
  128. }
  129. // 调用南研一键取号页面
  130. window.location.href = 'https://account.bol.wo.cn/cuuser/unity/redirectOnekeyLogin?clientId=directflow&redirectUrl=' + encodeURIComponent(encodeURIComponent(cbUrl))
  131. }
  132. });
  133. }).fail(function(error) {
  134. def.reject('服务调用异常')
  135. })
  136. return def;
  137. };
  138. /*
  139. 获取root
  140. */
  141. function getRootPath() {
  142. //获取当前网址,如: http://localhost:8080/ems/Pages/Basic/Person.jsp
  143. var curWwwPath = window.document.location.href;
  144. //获取主机地址之后的目录,如: /ems/Pages/Basic/Person.jsp
  145. var pathName = window.document.location.pathname;
  146. var pos = curWwwPath.indexOf(pathName);
  147. //获取主机地址,如: http://localhost:8080
  148. var localhostPath = curWwwPath.substring(0, pos);
  149. //获取带"/"的项目名,如:/ems
  150. var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
  151. root = (localhostPath + projectName);
  152. return (localhostPath + projectName);
  153. }
  154. function getQueryString(name) {
  155. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  156. var r = window.location.search.substr(1).match(reg);
  157. if (r != null) return unescape(r[2]);
  158. return null;
  159. }