index.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>双子星</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="icon" href="../static/img/favicon2.ico" type="img/x-ico">
  8. <link rel="stylesheet" href="../static/js/vender/bootstrap/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="../static/css/normalizeTui.css">
  10. <link rel="stylesheet" href="../static/css/mainTui.css">
  11. <link rel="stylesheet" href="../static/js/vender/toastr/toastr.min.css">
  12. <script src="../static/js/vender/jquery-3.4.1.min.js"></script>
  13. <script src="../static/js/vender/bootstrap/js/bootstrap.min.js"></script>
  14. <script src="../static/js/vender/toastr/toastr.min.js"></script>
  15. <script src="../static/js/vender/config.js"></script>
  16. <script>
  17. window.onload = window.onresize = function () {
  18. verticalAlign()
  19. }
  20. function verticalAlign() {
  21. // alert($('body').css('font-size'));
  22. var logo_w = $('body').width();
  23. var logo_t = $('#bottom_img').height() * 0.05;
  24. if (logo_w <= 640) {
  25. $('#logo').css('top', '50px');
  26. $('#logo').width('25%');
  27. } else {
  28. $('#logo').css('top', logo_t);
  29. $('#logo').width(logo_w * 0.1178);
  30. }
  31. var ipt_w = $('#recv_ipt').width();
  32. var ipt_h = ipt_w * 0.18;
  33. var font_sz = ipt_w * 0.06 + 'px';
  34. $('#recv_ipt').height(ipt_h);
  35. $('#recv_ipt').css('font-size', font_sz);
  36. $('#recv_btn').css('font-size', font_sz);
  37. $('#recv_btn2').css('font-size', font_sz);
  38. // $('#recv_ipt').css('line-height', ipt_h);
  39. $('#icon').height(ipt_h);
  40. var icon_w = $('#recv_cont').width() * 0.053333
  41. $('#icon').width(icon_w);
  42. var icon_t = 'calc(' + ipt_h / 6 + 'px' + ' + 3rem)';
  43. $('#icon').css('top', icon_t);
  44. $('#recv_btn').css('padding', ipt_w * 0.01 + 'px');
  45. $('#recv_btn2').css('padding', ipt_w * 0.01 + 'px');
  46. var btn_h = $('#recv_ipt').height() - ipt_w * 0.01;
  47. $('#recv_btn').height(btn_h);
  48. $('#recv_btn2').height(btn_h);
  49. }
  50. </script>
  51. <script>
  52. toastr.options.positionClass = 'toast-top-center';
  53. </script>
  54. </head>
  55. <body>
  56. <header>
  57. <div class="top reg-invite-Pag">
  58. <div>
  59. <div style="position:relative;">
  60. <div class="top-font">
  61. <span class="top-font-m"></span>
  62. <span class="top-font-s">星币</span>
  63. </div>
  64. <picture>
  65. <source media="(max-width: 640px)" srcset="../static/img/p01Tui.png 640w" />
  66. <source media="(min-width: 640px)" srcset="../static/img/01Tui.png 1366w" />
  67. <img src="../static/img/01Tui.png" alt="" class="bottom-img" id="bottom_img">
  68. </picture>
  69. </div>
  70. <div class="center-pic">
  71. <div class="recv-cont" id="recv_cont">
  72. <div style="position: relative;">
  73. <input type="text" class="recv-ipt" id="recv_ipt" placeholder="请输入手机号码领取奖励">
  74. </div>
  75. <div onclick="handleClick()" style="position: relative">
  76. <img src="../static/img/tuiguang_anniu.png" alt="" class="recv-btn">
  77. </div>
  78. <!-- <button type="button" class="bun btn-primary btn-lg recv-btn" id="recv_btn" onclick="handleClick()">点击获取</button>-->
  79. </div>
  80. <div class="load-menu" style="margin-top: 3rem;">
  81. <span class="tb-font">活动说明</span>
  82. <div class="tb-codes" id="tb_codes">
  83. <div class="tb-con">
  84. <p>1.每邀请一位好友,首单购买且是月卡以上套餐,双方皆可获得100星币,以此类推;非月套餐不计入星币推广奖励。</p>
  85. <p>2.每个新用户只能被邀请一次,同一个登陆账号、同一个手机号,都视为同一个用户。</p>
  86. <p>3.邀请好友数量无上限,邀请越多奖励越多。</p>
  87. <p>4.加入双子星云手机交流群893401276,参与群内活动即有机会赢取最高 30 天体验卡哟~</p>
  88. </div>
  89. </div>
  90. <!-- <span class="tb-font">手机扫码下载</span>-->
  91. <!-- <button type="button" class="bun btn-primary btn-lg recv-btn" id="recv_btn2" onclick="handleDownload()">点击下载-->
  92. <!-- </button>-->
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </header>
  98. <script type="text/javascript" th:inline="javascript">
  99. var coins = null
  100. // var baseUrl = 'http://' + url[2]
  101. $("#recv_ipt").bind('input propertychange', function (e) {
  102. var ipt_phones = $('#recv_ipt').val();
  103. var c = $(this);
  104. if (/[^\d]/.test(c.val())) {//替换非数字字符
  105. var temp_amount = c.val().replace(/[^\d]/g, '');
  106. $(this).val(temp_amount);
  107. toastr.error('非法输入')
  108. }
  109. if (ipt_phones.length >= 12) {
  110. toastr.error('非法输入,请输入11位数字')
  111. var recvstr = ipt_phones.substring(0, 11)
  112. $("#recv_ipt").val(recvstr);
  113. }
  114. });
  115. getCoins()
  116. function getCoins() {
  117. $.ajax({
  118. url: baseUrl + '/api/user/promote/rule',
  119. type: 'get',
  120. contentType: "application/json",
  121. dataType: 'json',
  122. cache: false,
  123. success: function (res) {
  124. if (res.status === 0) {
  125. $('.top-font-m').text(res.data.coins);
  126. coins = res.data.coins;
  127. } else {
  128. toastr.error(res.msg);
  129. }
  130. }
  131. })
  132. }
  133. function handleClick() {
  134. var query = window.location.search.substring(1);
  135. var vars = query.split("&");
  136. var data = {}
  137. var username = vars.find(e => {
  138. return e.startsWith('username')
  139. })
  140. var type = vars.find(e => {
  141. return e.startsWith('type')
  142. })
  143. data.userName = username.substring(9, username.length)
  144. data.type = type.substring(5, username.length)
  145. var ipt_phone = $('#recv_ipt').val();
  146. var validator = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/
  147. var res = validator.test(ipt_phone)
  148. if (!ipt_phone) {
  149. toastr.error('请输入手机号码')
  150. } else if (!res) {
  151. toastr.error('非法输入,请输入11位数字')
  152. } else {
  153. data.newPhone = ipt_phone
  154. data.coinCount = [coins]
  155. $.ajax({
  156. url: baseUrl + '/api/user/v1/promote',
  157. data: JSON.stringify(data),
  158. type: 'post',
  159. contentType: "application/json",
  160. dataType: 'json',
  161. cache: false,
  162. success: function (res) {
  163. console.log(res.status)
  164. if (res.status === 0) {
  165. $(window).attr('location', res.data);
  166. } else {
  167. toastr.error(res.msg)
  168. }
  169. }
  170. })
  171. }
  172. }
  173. /*
  174. function handleDownload() {
  175. $.ajax({
  176. url: baseUrl + '/api/user/promote/webUrl',
  177. type: 'get',
  178. cache: false,
  179. dataType: 'text',
  180. success: function (data) {
  181. var uri;
  182. if (data.startsWith('http')) {
  183. uri = data
  184. } else {
  185. uri = 'http://' + data
  186. }
  187. $(window).attr('location',uri);
  188. }
  189. })
  190. }
  191. */
  192. </script>
  193. </body>
  194. </html>