shopping.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. {include file="layout/header" /}
  2. <style type="text/css">
  3. </style>
  4. <!-- banner -->
  5. <section class="wthree-row" id="pricing">
  6. <div class="container" style="font-size: 18px; font-weight: 800; margin-top: 50px;">
  7. <img src="{$Think.HOME_SITE_ROOT}/images/shopping.png">
  8. 订单支付
  9. </div>
  10. <div class="container" style="font-size: 16px; margin-top: 50px; color: #B7B7B7;">
  11. <div style="display: flex; justify-content: center">
  12. <div>
  13. <div class="shopping_step">1</div>
  14. <div>选购服务</div>
  15. </div>
  16. <div class="shopping_line"></div>
  17. <div>
  18. <div class="shopping_step" style="background: #0074FF; color: #fff; border: 0;">2</div>
  19. <div style="color: #0074FF">订单支付</div>
  20. </div>
  21. <div class="shopping_line"></div>
  22. <div>
  23. <div class="shopping_step">3</div>
  24. <div>支付成功</div>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="container" style="margin-top: 50px; margin-bottom: 50px;">
  29. <table class="gridtable">
  30. <tr>
  31. <td style="width: 33%;background: #ccc !important;">服务名称</td>
  32. <td style="width: 33%;background: #ccc !important;">时长</td>
  33. <td style="width: 33%;background: #ccc !important;">价格</td>
  34. </tr>
  35. </table>
  36. <table class="gridtable" style="margin-top: 20px;">
  37. <tr style="height: 50px;">
  38. <td style="border-right: 0; width: 33%;">{$fatherProduct.product_name} ▪ {$product.product_name}</td>
  39. <td style="border-right: 0; border-left: 0; width: 33%;">{$renewal.renewal_name}</td>
  40. <td style="border-left: 0; width: 33%;color: #FF2929">¥
  41. <?php
  42. switch($renewal->renewal_identity){
  43. case 1:
  44. echo $product->product_TypeOne;
  45. break;
  46. case 2:
  47. echo $product->product_TypeTwo;
  48. break;
  49. case 3:
  50. echo $product->product_TypeThree;
  51. break;
  52. case 4:
  53. echo $product->product_TypeFour;
  54. break;
  55. }
  56. ?>
  57. </td>
  58. </tr>
  59. </table>
  60. </div>
  61. <div class="container" style="margin-top: 50px; margin-bottom: 50px; display: flex;">
  62. <div>
  63. <span>应付金额:¥
  64. <?php
  65. $money = 0;
  66. switch($renewal->renewal_identity){
  67. case 1:
  68. $money = $product->product_TypeOne;
  69. break;
  70. case 2:
  71. $money = $product->product_TypeTwo;
  72. break;
  73. case 3:
  74. $money = $product->product_TypeThree;
  75. break;
  76. case 4:
  77. $money = $product->product_TypeFour;
  78. break;
  79. }
  80. echo $money;
  81. ?>
  82. </span>
  83. <br/>
  84. {if $money <= $userInfo.userInfo_money}
  85. <span>账户余额:¥{$userInfo.userInfo_money}</span>
  86. {else}
  87. <span style="color: #FF2929">账户余额:¥{$userInfo.userInfo_money}</span>
  88. {/if}
  89. </div>
  90. <div style="flex: 1; text-align: right;">
  91. {if $money <= $userInfo.userInfo_money}
  92. <button onclick="shopping('{$product.product_id}','{$renewal.renewal_identity}')" style="background: #0074FF; border: 0;" type="button" class="btn btn-info btn-lg-block w3ls-btn px-4 text-uppercase font-weight-bold">
  93. 确认支付
  94. </button>
  95. {else}
  96. <!--<span style="color: #FF2929; margin-right: 10px; font-size: 14px;">当前余额不足</span>-->
  97. <div style="background: #DDDDDD; border: 0; cursor: not-allowed" class="btn btn-info btn-lg-block w3ls-btn px-4 text-uppercase font-weight-bold">
  98. 确认支付
  99. </div>
  100. {/if}
  101. </div>
  102. </div>
  103. </section>
  104. <script>
  105. const myHost = "http://" + window.location.host;
  106. function shopping(product_id, renewal_identity) {
  107. $.ajax({
  108. url: myHost + "/home/product/purchased.html",
  109. type: 'post',
  110. dataType: 'json',
  111. data: {product_id: product_id, renewal_identity: renewal_identity},
  112. success: function(res){
  113. if (res['success']) {
  114. window.location.href = myHost + "/home/product/purchased.html?data=" + res['data'];
  115. } else {
  116. console.log(res);
  117. }
  118. },
  119. error: function(){
  120. alert("服务器连接失败");
  121. }
  122. });
  123. }
  124. </script>
  125. {include file="layout/footer" /}