pay.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. var url = $('.list .active').attr('data-pay');
  44. if (!url) {
  45. alert('错误的信息');
  46. location.reload();
  47. return;
  48. }
  49. $(this).html('支付中...');
  50. payStatus = true;
  51. pay(url);
  52. }
  53. })
  54. $('[node-act="buytip"]').on('click', function () {
  55. $('#buytip .p').html($('#tips').html());
  56. $('#buytip').show()
  57. })
  58. $('[node-act="hideTip"]').on('click', function () {
  59. $('#buytip').hide()
  60. })
  61. </script>