manual.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. @extends('user.layouts')
  2. @section('css')
  3. <style>
  4. .tab {
  5. display: none;
  6. }
  7. .hide {
  8. display: none;
  9. }
  10. #ad {
  11. position: fixed;
  12. z-index: 9999;
  13. right: 30px;
  14. bottom: 30px;
  15. margin-left: 535px;
  16. }
  17. #ad > button {
  18. position: absolute;
  19. right: 0;
  20. top: 0;
  21. }
  22. </style>
  23. @endsection
  24. @section('content')
  25. <div id="ad">
  26. <button class="btn btn-icon btn-default" type="button" onclick="document.getElementById('ad').style.display = 'none'">
  27. <i class="icon wb-close"></i>
  28. </button>
  29. <img src="{{asset('assets/images/help/作者要饭求放过.PNG')}}" class="w-lg-250 w-150" alt="">
  30. </div>
  31. <div class="page-content container">
  32. <div class="panel panel-bordered">
  33. <div class="panel-heading">
  34. <h1 class="panel-title cyan-600">
  35. <i class="icon wb-payment"></i>{{sysConfig('website_name').' '.trans('common.payment.manual')}}
  36. </h1>
  37. </div>
  38. <div class="panel-body border-primary">
  39. <div class="steps row w-p100">
  40. <div class="step col-lg-4 current">
  41. <span class="step-number">1</span>
  42. <div class="step-desc">
  43. <span class="step-title">须知</span>
  44. <p>如何正确使用本支付</p>
  45. </div>
  46. </div>
  47. <div class="step col-lg-4">
  48. <span class="step-number">2</span>
  49. <div class="step-desc">
  50. <span class="step-title">支付</span>
  51. <p>获取支付二维码,进行支付</p>
  52. </div>
  53. </div>
  54. <div class="step col-lg-4">
  55. <span class="step-number">3</span>
  56. <div class="step-desc">
  57. <span class="step-title">等待</span>
  58. <p>等待支付被确认</p>
  59. </div>
  60. </div>
  61. </div>
  62. <div id="payment-group" class="w-p100 text-center mb-20">
  63. <div class="w-md-p50 w-p100 mx-auto btn-group">
  64. @if(sysConfig('wechat_qrcode'))
  65. <button id="btn-wechat" class="btn btn-lg btn-block" onclick="show(0)">{{trans('common.payment.wechat')}}</button>
  66. @endif
  67. @if(sysConfig('alipay_qrcode'))
  68. <button id="btn-alipay" class="btn mt-0 btn-lg btn-block" onclick="show(1)">{{trans('common.payment.alipay')}}</button>
  69. @endif
  70. </div>
  71. </div>
  72. <div class="tab">
  73. <div class="wechat hide">
  74. <div class="mx-auto text-center">
  75. <h4>备注账号</h4>
  76. <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{asset('assets/images/help/manual_wechat1.png')}}" alt=""/>
  77. <h4>填入登录使用的账号</h4>
  78. <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{asset('assets/images/help/manual_wechat2.png')}}" alt=""/>
  79. </div>
  80. </div>
  81. <div class="alipay hide">
  82. <div class="mx-auto text-center">
  83. <h4>备注账号</h4>
  84. <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{asset('assets/images/help/manual_alipay1.png')}}" alt=""/>
  85. <h4>填入登录使用的账号</h4>
  86. <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{asset('assets/images/help/manual_alipay2.png')}}" alt=""/>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="tab">
  91. <div class="wechat hide">
  92. <div class="mx-auto text-center">
  93. <div class="alert alert-info">
  94. {!! trans('user.payment.qrcode_tips', ['software' => trans('common.payment.wechat')]) !!}
  95. </div>
  96. <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{asset(sysConfig('wechat_qrcode'))}}" alt=""/>
  97. </div>
  98. </div>
  99. <div class="alipay hide">
  100. <div class="mx-auto text-center">
  101. <div class="alert alert-info">
  102. {!! trans('user.payment.qrcode_tips', ['software' => trans('common.payment.alipay')]) !!}
  103. </div>
  104. <img class="w-lg-350 w-md-p50 w-p100 mb-10" src="{{asset(sysConfig('alipay_qrcode'))}}" alt=""/>
  105. </div>
  106. </div>
  107. <div class="alert alert-danger text-center">
  108. {!! trans('user.payment.mobile_tips') !!}
  109. </div>
  110. </div>
  111. <div class="tab">
  112. <div class="alert alert-danger text-center">
  113. 支付时,请充值正确金额(多不退,少要补)
  114. </div>
  115. <div class="mx-auto w-md-p50">
  116. <ul class="list-group list-group-dividered">
  117. <li class="list-group-item">{{trans('user.shop.service').':'.$name}}</li>
  118. <li class="list-group-item">{{trans('user.shop.price').':¥'.$payment->amount}}</li>
  119. @if($days !== 0)
  120. <li class="list-group-item">{{trans('common.available_date').':'.$days.trans_choice('validation.attributes.day', 1)}}</li>
  121. @endif
  122. </ul>
  123. </div>
  124. </div>
  125. <div class="clearfix">
  126. <button type="button" class="btn btn-lg btn-default float-left" id="prevBtn" onclick="nextPrev(-1)">上一步</button>
  127. <button type="button" class="btn btn-lg btn-default float-right" id="nextBtn" onclick="nextPrev(1)">下一步</button>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. @endsection
  133. @section('javascript')
  134. <script>
  135. let currentTab = 0; // Current tab is set to be the first tab (0)
  136. showTab(currentTab); // Display the current tab
  137. show({{sysConfig('wechat_qrcode')? 0 : 1}});
  138. function showTab(n) {
  139. // This function will display the specified tab of the form ...
  140. const x = document.getElementsByClassName('tab');
  141. x[n].style.display = 'block';
  142. // ... and fix the Previous/Next buttons:
  143. if (n === 0) {
  144. document.getElementById('prevBtn').style.display = 'none';
  145. } else {
  146. document.getElementById('prevBtn').style.display = 'inline';
  147. }
  148. if (n === x.length - 1) {
  149. document.getElementById('payment-group').style.display = 'none';
  150. document.getElementById('nextBtn').classList.remove('btn-default');
  151. document.getElementById('nextBtn').classList.add('btn-primary');
  152. document.getElementById('nextBtn').innerHTML = '{{trans('user.status.completed')}}';
  153. } else {
  154. document.getElementById('payment-group').style.display = 'inline-flex';
  155. document.getElementById('nextBtn').innerHTML = '下一步';
  156. document.getElementById('nextBtn').style.display = 'inline';
  157. }
  158. fixStepIndicator(n);
  159. }
  160. function nextPrev(n) {
  161. // This function will figure out which tab to display
  162. const x = document.getElementsByClassName('tab');
  163. // Hide the current tab:
  164. x[currentTab].style.display = 'none';
  165. // if you have reached the end of the form... :
  166. if (currentTab === x.length - 1) {
  167. //...the form gets submitted:
  168. $.post('{{route('manual.inform', ['payment' => $payment->trade_no])}}', {_token: '{{csrf_token()}}'}, function(ret) {
  169. if (ret.status === 'success') {
  170. swal.fire({title: '已受理', text: ret.message, icon: 'success'}).then(() => window.location.href = '{{route('invoice')}}');
  171. } else {
  172. swal.fire({title: ret.message, icon: 'error'}).then(() => window.location.reload());
  173. }
  174. });
  175. return false;
  176. } else {
  177. // Increase or decrease the current tab by 1:
  178. currentTab += n;
  179. showTab(currentTab);
  180. }
  181. }
  182. function fixStepIndicator(n) {
  183. // This function removes the "current" class of all steps...
  184. let i, x = document.getElementsByClassName('step');
  185. for (i = 0; i < x.length; i++) {
  186. x[i].className = x[i].className.replace(' current', ' ');
  187. }
  188. //... and adds the "active" class to the current step:
  189. x[n].className += ' current';
  190. }
  191. function show(check) {
  192. @if(sysConfig('wechat_qrcode'))
  193. const $wechat = document.getElementsByClassName('wechat');
  194. const $btn_wechat = document.getElementById('btn-wechat');
  195. if (check) {
  196. for (let i = 0; i < $wechat.length; i++) {
  197. $wechat[i].style.display = 'none';
  198. }
  199. $btn_wechat.classList.remove('btn-success');
  200. } else {
  201. for (let i = 0; i < $wechat.length; i++) {
  202. $wechat[i].style.display = 'inline';
  203. }
  204. $btn_wechat.classList.add('btn-success');
  205. }
  206. @endif
  207. @if(sysConfig('alipay_qrcode'))
  208. const $alipay = document.getElementsByClassName('alipay');
  209. const $btn_alipay = document.getElementById('btn-alipay');
  210. if (check) {
  211. for (let i = 0; i < $alipay.length; i++) {
  212. $alipay[i].style.display = 'inline';
  213. }
  214. $btn_alipay.classList.add('btn-primary');
  215. } else {
  216. for (let i = 0; i < $alipay.length; i++) {
  217. $alipay[i].style.display = 'none';
  218. }
  219. $btn_alipay.classList.remove('btn-primary');
  220. }
  221. @endif
  222. }
  223. </script>
  224. @endsection