index.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <extend name="Public:pinduoduobase" />
  2. <block name="content">
  3. <script type="text/javascript">
  4. window.use_screen_base = '750';
  5. (function (a, b) {
  6. var c = "orientationchange" in b ? "orientationchange" : "resize",
  7. d = use_screen_base.indexOf("_mate"),
  8. e = parseInt(use_screen_base),
  9. f = a.documentElement,
  10. g = function () {
  11. var a = f.clientWidth,
  12. c = b.innerWidth;
  13. c >= 750 ? c = 750 : c;
  14. f.style.fontSize = 100 * (c / e) + "px"
  15. };
  16. if (/iPad.*OS|iPhone.*OS/.test(navigator.userAgent) && d > 0) {
  17. var h = a.querySelectorAll("meta[name=viewport]"),
  18. i = b.devicePixelRatio;
  19. i = i != 1 ? 2 : 1, h[0] && h[0].setAttribute("content",
  20. "width=device-width, user-scalable=no, minimum-scale=" + 1 / i + ", maximum-scale=" + 1 / i +
  21. ", initial-scale=" + 1 / i)
  22. }
  23. g(), b.addEventListener(c, g, !1), delete use_screen_base
  24. })(document, window);
  25. </script>
  26. <link rel="stylesheet" href="__PUBLIC__/mogu/bonus/css/index.css">
  27. <div id="main">
  28. <div class="duo-red-packet-container mobile-container">
  29. <div class="rp-main">
  30. <div class="main-bg-top"><img src="__PUBLIC__/mogu/bonus/image/red_packet_main_bg_top.png"></div>
  31. <div class="main-bg-middle"><img src="__PUBLIC__/mogu/bonus/image/red_packet_main_bg_middle.png"></div>
  32. <div class="main-bg-bottom">
  33. <img src="__PUBLIC__/mogu/bonus/image/red_packet_main_bg_bottom.png">
  34. </div>
  35. <img src="__PUBLIC__/mogu/bonus/image/red_packet_main_bg_ribbon.png" class="main-bg-ribbon">
  36. <img src="__PUBLIC__/mogu/bonus/image/cl_main_title.png" class="main-title">
  37. <img src="__PUBLIC__/mogu/bonus/image/cl_sub_title.png" class="main-sub-title">
  38. <!-- 未开 -->
  39. <div class="not_open">
  40. <img src="__PUBLIC__/mogu/bonus/image/red_packet_main_rp_bg.png" class="main-red-packet">
  41. <div role="button" class="main-open-btn">
  42. <img src="__PUBLIC__/mogu/bonus/image/red_packet_main_rp_open.png" class="main-open-btn-open">
  43. </div>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. {~W('Share/common_quan_share',array($id))}
  49. <script>
  50. var id = {$id};
  51. $('.main-open-btn').click(function () {
  52. $.ajax({
  53. url: 'index.php?s=/bonus/get_bonus_voucher/',
  54. type: 'GET',
  55. dataType: 'json',
  56. data: {
  57. voucher_id: id
  58. },
  59. })
  60. .done(function (res) {
  61. if (res.code == 0) {
  62. if (res.get_voucher_info.end_time > res.cur_time) {
  63. window.location.href = '{:U("bonus/bonus","id=$id&type=1","")}';
  64. } else {
  65. window.location.href = '{:U("bonus/overdue")}';
  66. }
  67. return;
  68. }
  69. if (res.code == -1) {
  70. alert('券被抢光了');
  71. return;
  72. }
  73. if (res.code == -2) {
  74. console.log('已领过')
  75. if (res.get_voucher_info.end_time > res.cur_time) {
  76. console.log('有效')
  77. window.location.href = '{:U("bonus/bonus","id=$id","")}';
  78. } else {
  79. window.location.href = '{:U("bonus/overdue")}';
  80. }
  81. return;
  82. }
  83. })
  84. .fail(function () {
  85. alert('请求错误');
  86. })
  87. })
  88. </script>
  89. </block>