pay.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport"
  6. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <title>精美时尚</title>
  8. <link href="css/global.css?v=3f8cf811" rel="stylesheet"><link href="css/pay.css?v=3f8cf811" rel="stylesheet"></head>
  9. <body>
  10. <div class="container">
  11. <div>
  12. <div class="h1">正在购买《xxxx》</div>
  13. <div class='buytip' id="open">
  14. <p>查看购买说明</p>
  15. </div>
  16. <div class="list">
  17. <a class="item active" bind-id="item" href="#">
  18. <p>购买10本</p>
  19. <p>¥6</p>
  20. </a>
  21. <a class="item" bind-id="item" href="#">
  22. <p>购买10本</p>
  23. <p>¥6</p>
  24. </a>
  25. <a class="item" bind-id="item" href="#">
  26. <p>购买10本</p>
  27. <p>¥6</p>
  28. </a>
  29. </div>
  30. </div>
  31. <div class='fix-footer'>
  32. <a href="javascript:history.go(-1)" class='back-btn'>返回</a>
  33. <a href="javascript:;" id="dopay" class="fix-button">确认购买</a>
  34. </div>
  35. </div>
  36. <div class="mask fn-hide" id="layer">
  37. <div class="layer ">
  38. <h3 class="title">购买说明</h3>
  39. <div class="richtext">asdfsdf</div>
  40. <div class="btn-wrapper">
  41. <div class="button opposite" node-act="close">我知道了</div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="mask fn-hide" id="pay-layer">
  46. <div class="layer buy-result">
  47. <h3 class="title">购买提示</h3>
  48. <div class="res" id="buyyes">您已成功购买1000本电子刊</div>
  49. <div class="btn-wrapper">
  50. <a href="codedetail.html" class="button" id="viewcode">查看兑换码</a>
  51. <div class="button" node-act="close">继续购买</div>
  52. </div>
  53. </div>
  54. </div>
  55. <div id="pay"></div>
  56. <script type="text/javascript" src="js/global.js?v=3f8cf811"></script><script type="text/javascript" src="js/pay.js?v=3f8cf811"></script></body>
  57. <script>
  58. var payStatus = false;
  59. $(document).on('click', '[bind-id="item"]', function(){
  60. $(this).addClass('active').siblings('.item').removeClass('active');
  61. //$('#pay-layer').show();
  62. });
  63. $('#dopay').on('click',function(){
  64. if (payStatus == false) {
  65. $(this).html('支付中...');
  66. var url = $('.active').attr('data-pay');
  67. payStatus = true;
  68. pay(url);
  69. }
  70. });
  71. $('#open').on('click',function(){
  72. $('#layer').show();
  73. });
  74. $('[node-act="close"]').on('click',function(){
  75. $(this).closest('.mask').hide();
  76. });
  77. function pay(url)
  78. {
  79. $.get(url, function(t) {
  80. $("#pay").html(t);
  81. payStatus = false;
  82. $('#dopay').html('确认购买');
  83. })
  84. }
  85. </script>
  86. </html>