pay_xfb_new.blade.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!DOCTYPE html>
  2. <html class="bg-white">
  3. <head>
  4. <meta charset="utf-8">
  5. <!--此行代码为禁止苹果手机自动识别电话号码-->
  6. <meta name="format-detection" content="telephone=no">
  7. <meta name="viewport"
  8. content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
  9. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  10. <title>{{$shop_info['shop_name']}}支付</title>
  11. <link rel="stylesheet" type="text/css" href="{{asset('wap/css/weui.min.css')}}"/>
  12. <link rel="stylesheet" type="text/css" href="{{asset('wap/css/common.css')}}"/>
  13. <link rel="stylesheet" type="text/css" href="{{asset('wap/css/pay-page.css')}}"/>
  14. <script src="{{asset('wap/js/jquery-2.1.4.js')}}"></script>
  15. <script src="{{asset('wap/js/vue.js')}}?a=1"></script>
  16. <script src="{{asset('wap/js/common.js')}}?a=1"></script>
  17. </head>
  18. <body>
  19. <div id="app">
  20. <!-- 导航栏 -->
  21. <div class="nav-bar" v-if="false">
  22. <div>
  23. <img src="{{asset('wap/images/49@2x.png')}}" class="nav-img">
  24. </div>
  25. <div class="nav-title">{{$shop_info['shop_name']}}</div>
  26. <div>
  27. <img src="{{asset('wap/images/117@2x.png')}}" class="nav-img">
  28. </div>
  29. </div>
  30. <!-- 支付详情 -->
  31. <div class="pay-detail">
  32. <div class="pay-layout">
  33. <div class="spend-total">消费总额</div>
  34. <div class="input-money">
  35. <span>¥</span>
  36. <form id="zfb_pay" method="post" action="{{route('pay.zfb_pay')}}">
  37. <input type="number" v-model="pay_money" name="pay_money" autofocus="autofocus" mix="0.01">
  38. <input type="hidden" name="shop_id" value="{{$shop_info['id']}}"></input>
  39. </form>
  40. </div>
  41. <div class="prompt">可询问工作人员应缴费用总额</div>
  42. </div>
  43. </div>
  44. <!-- button -->
  45. <div class="button-layout" @click="creatZfbPay">
  46. <div class="button">
  47. <span>支付</span>
  48. </div>
  49. </div>
  50. <!--BEGIN toast-->
  51. <div id="toast" style="display: none;">
  52. <div class="weui-mask_transparent"></div>
  53. <div class="weui-toast">
  54. <i class="weui-icon-success-no-circle weui-icon_toast"></i>
  55. <p class="weui-toast__content">@{{success_msg}}</p>
  56. </div>
  57. </div>
  58. <!--BEGIN toast-->
  59. <div id="textMoreToast" v-show="error_show">
  60. <div class="weui-mask_transparent"></div>
  61. <div class="weui-toast weui-toast_text-more">
  62. <i class="weui-icon-warn weui-icon_toast"></i>
  63. <p class="weui-toast__content">@{{error_msg}}</p>
  64. </div>
  65. </div>
  66. </div>
  67. <script>
  68. $(function () {
  69. var vm = new Vue({
  70. el: '#app',
  71. data: {
  72. pay_money: '',
  73. success_msg: '',
  74. error_msg: '',
  75. error_show: false,
  76. success_show: false,
  77. is_pay: false,
  78. is_ajax: false,
  79. },
  80. methods: {
  81. 'errorMgs': function (error_msg) {
  82. this.error_msg = error_msg;
  83. this.error_show = true;
  84. setTimeout(function () {
  85. vm.error_show = false;
  86. }, 2000)
  87. },
  88. 'successMsg': function (success_msg) {
  89. this.success_msg = success_msg;
  90. this.success_show = true;
  91. setTimeout(function () {
  92. vm.success_show = false;
  93. }, 2000)
  94. },
  95. 'creatZfbPay': function () {
  96. console.log('---------------------')
  97. if (this.is_ajax) {
  98. return false;
  99. }
  100. this.is_ajax = true;
  101. $('#zfb_pay').submit();
  102. }
  103. },
  104. watch: {
  105. 'pay_money': function () {
  106. if (this.pay_money * 1 == 0) {
  107. this.is_pay = false;
  108. return false;
  109. }
  110. if (this.pay_money != '') {
  111. if (isNaN(this.pay_money) || this.pay_money * 1 < 0) {
  112. this.is_pay = false;
  113. this.pay_money = '';
  114. this.errorMgs('支付金额不合法');
  115. return false;
  116. }
  117. if (this.pay_money * 1 < 0.01) {
  118. this.is_pay = false;
  119. this.errorMgs('最低支付金额0.01元');
  120. return false;
  121. }
  122. }
  123. this.is_pay = true;
  124. }
  125. },
  126. created: function () {
  127. console.log('------------------')
  128. }
  129. });
  130. })
  131. </script>
  132. </body>
  133. </html>