page.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. var users = {};
  2. //1.循环遍历users数据
  3. var usermob = getQueryString("userid");
  4. var root = null;
  5. /*
  6. 获取订购记录
  7. */
  8. root = getRootPath();
  9. queryWeiboUserInfoak(usermob);
  10. function queryWeiboUserInfoak(usermob) {
  11. // var productid = 2020010201
  12. var param = {
  13. "fog": 'df3958be828815ec18613612fa1e7a55e6077a33cfc0098b64a25eeabaa4e118976fdec7a362c595035df466add330085bd685bd54bf9abc229f4b59abe09f1618473ede33aa3665bd2c88a2ad1bc7cc690066e6a331a0cc078fd38b86681cbab250b233fcb92ba4b318f90df696b5ae',
  14. 'userid': usermob
  15. }
  16. var def = $.Deferred();
  17. $.ajax({
  18. url: root + "-s1api" + "/rights/query",
  19. type: "POST",
  20. contentType: "application/json",
  21. data: JSON.stringify(param)
  22. }).then(function(response) {
  23. var more = ''
  24. response.data.forEach(function(item) {
  25. console.log(response.data)
  26. switch (item.vipname) {
  27. case '爱奇艺视频会员周卡':
  28. var img = '202203/images/爱奇艺.png'
  29. break;
  30. case '美团外卖红包5元':
  31. var img = '202203/images/美团.png'
  32. break;
  33. case '抖音币50个':
  34. var img = '202203/images/抖音币.png'
  35. break;
  36. case '优酷视频会员周卡':
  37. var img = '202203/images/优酷.png'
  38. break;
  39. case '腾讯视频会员周卡':
  40. var img = '202203/images/腾讯视频.png'
  41. break;
  42. case '芒果TV PC移动影视会员周卡':
  43. var img = '202203/images/芒果tv.png'
  44. break;
  45. case '蜻蜓FM超级会员周卡':
  46. var img = '202203/images/蜻蜓.png'
  47. break;
  48. default:
  49. break;
  50. }
  51. more += `
  52. <div class="body-a">
  53. <div class="ge-box">
  54. <div class="box-ace">
  55. <img class="img-ace" src="${img}" alt="">
  56. <span class="text-ace">${item.vipname}</span>
  57. </div>
  58. <span class="text-a">所属产品:</span><span class="text-e">抖音定向流量权益包</span>
  59. <span class="text-b">领取号码:</span><span class="text-f">${item.vipuser}</span>
  60. <span class="text-c">领取时间:</span><span class="text-g">${item.ordertime}</span>
  61. </div>
  62. </div>
  63. `
  64. })
  65. $('#bodyt').append(more)
  66. switch (response.resultCode) {
  67. case "0000":
  68. def.resolve(response);
  69. break;
  70. case "1066":
  71. def.resolve(response);
  72. break;
  73. default:
  74. compnt.showAlert(response.errorInfo)
  75. def.reject(response);
  76. break;
  77. }
  78. }).fail(function(error) {
  79. def.reject('服务调用异常')
  80. })
  81. return def;
  82. };
  83. /*
  84. 获取root
  85. */
  86. function getRootPath() {
  87. //获取当前网址,如: http://localhost:8080/ems/Pages/Basic/Person.jsp
  88. var curWwwPath = window.document.location.href;
  89. //获取主机地址之后的目录,如: /ems/Pages/Basic/Person.jsp
  90. var pathName = window.document.location.pathname;
  91. var pos = curWwwPath.indexOf(pathName);
  92. //获取主机地址,如: http://localhost:8080
  93. var localhostPath = curWwwPath.substring(0, pos);
  94. //获取带"/"的项目名,如:/ems
  95. var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
  96. root = (localhostPath + projectName);
  97. return (localhostPath + projectName + "-s1api");
  98. }
  99. function getQueryString(name) {
  100. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  101. var r = window.location.search.substr(1).match(reg);
  102. if (r != null) return unescape(r[2]);
  103. return null;
  104. }