pay.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <form bindsubmit='doBuy'>
  2. <div class="tit ">正在购买</div>
  3. <div class='msg' node-act="buytip">查看购买说明</div>
  4. <div id="tips" style="display: none;">查看购买说明</div>
  5. <div class="list">
  6. <div class="item active" data-id="1">
  7. <span class='name'>购买1本</span>
  8. <span>¥8.00</span>
  9. </div>
  10. <div class="item" data-id="2">
  11. <span class='name'>购买1本</span>
  12. <span>¥8.00</span>
  13. </div>
  14. <div class="item" data-id="3">
  15. <span class='name'>购买1本</span>
  16. <span>¥8.00</span>
  17. </div>
  18. <div class="item" data-id="4">
  19. <span class='name'>购买1本</span>
  20. <span>¥8.00</span>
  21. </div>
  22. <div class="item" data-id="5">
  23. <span class='name'>购买1本</span>
  24. <span>¥8.00</span>
  25. </div>
  26. <div class="item" data-id="6">
  27. <span class='name'>购买1本</span>
  28. <span>¥8.00</span>
  29. </div>
  30. </div>
  31. <div class="btn-wrapper ">
  32. <div class="button cancel" node-act="hideBuy">取消</div>
  33. <div class="button primary " node-act="doBuy">确认</div>
  34. </div>
  35. </form>
  36. <script>
  37. $('[node-act="hideBuy"]').on('click',function(){
  38. $('#buylayer').removeClass('slidein')
  39. $('#buylayermask').hide();
  40. })
  41. $('[node-act="doBuy"]').on('click',function(){
  42. if (payStatus == false) {
  43. console.info($('.active'));
  44. var url = $('.list .active').attr('data-pay');
  45. if (!url) {
  46. alert('错误的信息');
  47. location.reload();
  48. return;
  49. }
  50. $(this).html('支付中...');
  51. $('#buytip .p').html($('#tips').html());
  52. payStatus = true;
  53. pay(url);
  54. }
  55. })
  56. $('[node-act="buytip"]').on('click', function () {
  57. $('#buytip').show()
  58. })
  59. $('[node-act="hideTip"]').on('click', function () {
  60. $('#buytip').hide()
  61. })
  62. </script>