payment.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. {layout name="common/layout" /}
  2. <style>
  3. .panel-heading h2 {
  4. font-size: 20px;
  5. font-weight: normal;
  6. }
  7. .row-paytype div input {
  8. display: none;
  9. }
  10. .row-paytype img {
  11. height: 30px;
  12. margin: 8px;
  13. vertical-align: inherit;
  14. }
  15. .row-paytype > div {
  16. margin-bottom: 10px;
  17. }
  18. .row-paytype > div > label {
  19. width: 100%;
  20. height: 50px;
  21. display: block;
  22. font-size: 14px;
  23. line-height: 50px;
  24. color: #999;
  25. background: #fff;
  26. -webkit-border-radius: 3px;
  27. -moz-border-radius: 3px;
  28. border-radius: 3px;
  29. cursor: pointer;
  30. text-align: center;
  31. border: 1px solid #ddd;
  32. margin-bottom: 20px;
  33. font-weight: 400;
  34. }
  35. .row-paytype > div > label.active {
  36. border-color: #0d95e8;
  37. color: #0d95e8;
  38. }
  39. .row-paytype > div > label:hover {
  40. z-index: 4;
  41. border-color: #27b0d6;
  42. color: #27b0d6;
  43. }
  44. .countdown i {
  45. font-style: normal;
  46. }
  47. </style>
  48. <div class="container" id="content-container">
  49. <div class="row">
  50. <div class="col-xs-12">
  51. <form id="payment-form" action="" method="post">
  52. <input type="hidden" name="paytype" value="{:config('shop.defaultpaytype')}"/>
  53. <div class="panel panel-default">
  54. <div class="panel-heading">
  55. <h2>订单信息
  56. <div class="pull-right small ">
  57. <span class="">
  58. 请在
  59. <span class="countdown text-danger" data-format="<i>%H</i>时<i>%M</i>分<i>%S</i>秒" data-countdown="{$orderInfo.remainseconds|htmlentities}">
  60. <i>00</i>时<i>00</i>分<i>00</i>秒
  61. </span>
  62. 内完成支付,超时将自动取消
  63. </span>
  64. </div>
  65. </h2>
  66. </div>
  67. <div class="panel-body">
  68. <p>订单编号:{$orderInfo.order_sn|htmlentities}</p>
  69. <p>订单金额:<span class="text-danger">¥{$orderInfo.saleamount|htmlentities}</span></p>
  70. </div>
  71. </div>
  72. <div class="panel panel-default">
  73. <div class="panel-heading">
  74. <h2>支付方式</h2>
  75. </div>
  76. <div class="panel-body">
  77. <div class="row row-paytype row-paytype">
  78. {foreach name="paytypeList" id="paytype"}
  79. <div class="col-xs-6 col-sm-4 col-md-4 col-lg-2 text-center">
  80. <label class="{:$paytype.default?'active':''}" data-value="{$paytype.value|htmlentities}">
  81. <img src="{$paytype.image|cdnurl|htmlentities}" alt="">
  82. </label>
  83. </div>
  84. {/foreach}
  85. </div>
  86. <div class="row" style="margin:10px -15px 10px -15px;">
  87. <div class="col-xs-6 col-sm-4 col-md-4 col-lg-2">
  88. <input type="submit" class="btn btn-primary btn-recharge btn-block btn-lg" value="立即支付"/>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </form>
  94. </div>
  95. </div>
  96. </div>
  97. <script data-render="script" src="__ADDON__/js/jquery.countdown.js"></script>
  98. <script data-render="script">
  99. //切换地址
  100. $(document).on("click", ".address[data-id]", function () {
  101. var that = this;
  102. SHOP.api.ajax({
  103. url: "{:addon_url('shop/checkout/recount')}",
  104. data: $("#checkout-form").serialize()
  105. }, function (data, ret) {
  106. $(".address[data-id]").removeClass("active");
  107. $(that).addClass("active");
  108. $("#goodsprice").text(data.orderInfo.goodsprice);
  109. $("#shippingfee").text(data.orderInfo.shippingfee);
  110. $("#amount").text(data.orderInfo.amount);
  111. return false;
  112. });
  113. });
  114. $(document).on("click", ".row-paytype label", function () {
  115. $(this).closest("form").find("input[name='paytype']").val($(this).data("value"));
  116. $(".row-paytype label").removeClass("active");
  117. $(this).addClass("active");
  118. return false;
  119. });
  120. </script>