order.js 9.8 KB

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