checkoutwap.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <?php if(!defined( 'WY_ROOT'))exit;
  2. function is_weixin() {
  3. if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) {
  4. return true;
  5. } return false;
  6. }
  7. ?>
  8. <!doctype html>
  9. <html>
  10. <head>
  11. <meta http-equiv="content-type" content="text/html;charset=utf-8">
  12. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  13. <meta name="viewport" content="width=device-width,initial-scale=1">
  14. <title>
  15. 在线支付
  16. </title>
  17. <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
  18. <link href="/static/common/bootstrap.min.css" type="text/css" rel="stylesheet">
  19. <style>
  20. html,body,div,p,span,ul,ol,dl,h1,h2,h3,h4,h5,h6{margin:0;padding: 0}body{font-family:
  21. 微软雅黑,'Microsoft Yahei';background: #eee}ul,ol{list-style: none}img{border:
  22. 0;outline: none}a{color:#6B6D6E}a:hover{color:#CD1C20;text-decoration:
  23. none}#header{background: #337AB7;}#header .logo{line-height: 50px;font-size:
  24. 1.4em;text-align: center;color:#fff}.paymoney{background: #fff;padding:20px
  25. 0}.bf1{font-size: 2em;color:#E43D40;letter-spacing: 2px}.orderinfo{margin:10px
  26. auto;color:#999}.pay_list{background: #fff}.pay_list ul{margin:10px auto;}.pay_list
  27. ul li{border-bottom:1px solid #ddd}.pay_list ul li label{margin:10px 20px;}.fl1,.fl2{float:left}.fl1
  28. img{margin-left:8px;width:50px}.fl2{margin-left:12px}.fl2 p{color:#999;font-size:13px;line-height:
  29. 24px}.fl2 h4{font-size:14px;margin-top:8px}.fl2 h4 span{background:#E43D40;color:#fff;font-size:12px;padding:2px;border-radius:
  30. 3px}.plist{display:none;border-top:1px solid #ddd;background: #eee;padding:10px
  31. 0 20px 0;}.plist p{float:left;margin-left:25px;margin-top:10px;border:
  32. 1px solid #fff;}.plist p.current{border:1px solid #E43D40}#footer{background:#263445;text-align:center;color:#8392A7;margin-top:30px;padding:20px
  33. 0;
  34. </style>
  35. </style>
  36. <script src="/static/common/jquery-1.12.1.min.js" type="text/javascript">
  37. </script>
  38. <script src="/static/common/bootstrap.min.js" type="text/javascript">
  39. </script>
  40. </head>
  41. <body>
  42. <div id="header">
  43. <div class="logo">
  44. 收银台
  45. </div>
  46. </div>
  47. <div class="paymoney bf1 text-center">
  48. <p style="font-size:14px;color:#666">
  49. 应付金额
  50. </p>
  51. &yen;
  52. <?php echo $orders['total_fee']?>
  53. </div>
  54. <div class="container">
  55. <div class="row">
  56. <div class="orderinfo">
  57. <div class="col-xs-6">
  58. 订单号:
  59. </div>
  60. <div class="col-xs-6 text-right">
  61. <span style="color:#E43D40">
  62. <?php echo $orders['sdorderno']?>
  63. </span>
  64. </div>
  65. <div class="col-xs-6">
  66. 订单备注:
  67. </div>
  68. <div class="col-xs-6 text-right">
  69. <a href="http://<?php echo $userinfo['siteurl']?>" target="_blank">
  70. <?php echo $orderinfo['remark']?>
  71. </a>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <form action="/checkout/subpay?sign=<?php echo $token?>" method="post">
  77. <input type="hidden" name="bankcode" value="">
  78. <div class="pay_list">
  79. <ul>
  80. <!-- <?php if($this->checkacc->isAccExist($userinfo['userid'],'wxh5')):?>
  81. <?php endif;?>
  82. -->
  83. <?php if($this->checkacc->isAccExist($userinfo['userid'],'gzhpay') && is_weixin()):?>
  84. <li>
  85. <label>
  86. <div class="fl1">
  87. <input type="radio" name="paytype" value="gzhpay">
  88. &nbsp;
  89. <img src="/static/default/images/weixin.png">
  90. </div>
  91. <div class="fl2">
  92. <h4>
  93. 微信支付
  94. </h4>
  95. <p>
  96. 推荐微信内用户使用
  97. </p>
  98. </div>
  99. </label>
  100. </li>
  101. <?php elseif($this->checkacc->isAccExist($userinfo['userid'],'weixin')):?>
  102. <li>
  103. <label>
  104. <div class="fl1">
  105. <input type="radio" name="paytype" value="weixin">
  106. &nbsp;
  107. <img src="/static/default/images/weixin.png">
  108. </div>
  109. <div class="fl2">
  110. <h4>
  111. 微信扫码
  112. </h4>
  113. <p>
  114. 长按识别扫码支付
  115. </p>
  116. </div>
  117. </label>
  118. </li>
  119. <?php endif;?>
  120. <?php if($this->checkacc->isAccExist($userinfo['userid'],'alipaywap')):?>
  121. <li>
  122. <label>
  123. <div class="fl1">
  124. <input type="radio" name="paytype" value="alipaywap">
  125. &nbsp;
  126. <img src="/static/default/images/alipay.png">
  127. </div>
  128. <div class="fl2">
  129. <h4>
  130. 支付宝wap
  131. </h4>
  132. <p>
  133. 推荐支付宝Wap用户使用
  134. </p>
  135. </div>
  136. </label>
  137. </li>
  138. <?php endif;?>
  139. <?php if($this->checkacc->isAccExist($userinfo['userid'],'qqwallet')):?>
  140. <li>
  141. <label>
  142. <div class="fl1">
  143. <input type="radio" name="paytype" value="qqwallet">
  144. &nbsp;
  145. <img src="/static/default/images/qqwallet.png">
  146. </div>
  147. <div class="fl2">
  148. <h4>
  149. QQ钱包wap
  150. </h4>
  151. <p>
  152. 推荐QQ钱包用户使用
  153. </p>
  154. </div>
  155. </label>
  156. </li>
  157. <?php endif;?>
  158. <?php if($this->checkacc->isAccExist($userinfo['userid'],'tenpaywap')):?>
  159. <li>
  160. <label>
  161. <div class="fl1">
  162. <input type="radio" name="paytype" value="tenpaywap">
  163. &nbsp;
  164. <img src="/static/default/images/tenpay.png">
  165. </div>
  166. <div class="fl2">
  167. <h4>
  168. 财付通wap
  169. </h4>
  170. <p>
  171. 推荐财付通Wap用户使用
  172. </p>
  173. </div>
  174. </label>
  175. </li>
  176. <?php endif;?>
  177. <?php if($this->checkacc->isAccExist($userinfo['userid'],'bank')):?>
  178. <li>
  179. <label>
  180. <div class="fl1">
  181. <input type="radio" name="paytype" value="bank">
  182. &nbsp;
  183. <img src="/static/default/images/ubank.png">
  184. </div>
  185. <div class="fl2">
  186. <h4>
  187. 网银wap付款
  188. </h4>
  189. <p>
  190. 支持多种手机Wap银行
  191. </p>
  192. </div>
  193. </label>
  194. <div class="plist banklist">
  195. <?php foreach($banklist as $key=>
  196. $val):?>
  197. <p>
  198. <img src="/static/payimg/<?php echo $val['img']?>" data-pid="<?php echo $val['code']?>">
  199. </p>
  200. <?php endforeach;?>
  201. <div style="clear:left">
  202. </div>
  203. </div>
  204. </li>
  205. <?php endif;?>
  206. <?php if($cardlist):?>
  207. <li>
  208. <label>
  209. <div class="fl1">
  210. <input type="radio" name="paytype" value="card">
  211. &nbsp;
  212. <img src="/static/default/images/cards.png">
  213. </div>
  214. <div class="fl2">
  215. <h4>
  216. 点卡支付
  217. </h4>
  218. <p>
  219. 支持多种充值卡支付
  220. </p>
  221. </div>
  222. </label>
  223. <div class="plist cardlist">
  224. <?php foreach($cardlist as $key=>
  225. $val):?>
  226. <p>
  227. <img src="/static/payimg/<?php echo $val['img']?>" data-pid="<?php echo $val['gateway']?>">
  228. </p>
  229. <?php endforeach;?>
  230. <div style="clear:left">
  231. </div>
  232. </div>
  233. </li>
  234. <?php endif;?>
  235. </ul>
  236. </div>
  237. <br>
  238. <div class="text-center" style="margin:auto 20px">
  239. <button type="submit" class="btn btn-danger btn-block btn-lg">
  240. &nbsp;&nbsp;&nbsp;
  241. <span class="glyphicon glyphicon-check">
  242. </span>
  243. &nbsp;确认付款&nbsp;&nbsp;&nbsp;
  244. </button>
  245. <div class="alert alert-warning">
  246. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  247. <span aria-hidden="true">
  248. &times;
  249. </span>
  250. </button>
  251. 重要提示:请尽快付款,30分钟内未付款的订单将会超时关闭。
  252. </div>
  253. </div>
  254. <br>
  255. <br>
  256. </form>
  257. <!-- Modal -->
  258. <div class="modal" id="alipayadd">
  259. <div class="ystYS" style="position: fixed; top: 80%; left: 25%; z-index: 5000;">
  260. <a href="" style="border: 1px solid #fff;padding: 15px 70px;border-radius: 5px; color: #fff;">返回按钮</a>
  261. </div>
  262. <img src="/static/common/zhifubao.jpg" style="width: 100%;position: fixed; top: 0px; left: 0px; height: 100%;" >
  263. </div>
  264. <div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  265. data-backdrop="static">
  266. <div class="modal-dialog" role="document">
  267. <div class="modal-content">
  268. <div class="modal-header">
  269. <h4 class="modal-title" id="myModalLabel">
  270. 付款提示
  271. </h4>
  272. </div>
  273. <div class="modal-body">
  274. 如果您已付款成功,请点击查看付款结果。如果还未付款,请重新选择付款方式进行付款。
  275. </div>
  276. <div class="modal-footer">
  277. <a href="/checkout/payresult?sign=<?php echo $token?>" class="btn btn-success">
  278. 查看付款结果
  279. </a>
  280. <button type="button" class="btn btn-primary" data-dismiss="modal">
  281. 重新选择付款方式
  282. </button>
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287. <div id="footer">
  288. &copy;2016&nbsp;
  289. <?php echo $this->config['sitename']?>&nbsp;版权所有&nbsp;
  290. <?php echo $this->config['icpcode']?>
  291. </div>
  292. <script>
  293. $(function() {
  294. var fp = $('.pay_list ul li').eq(0);
  295. var pt = fp.find('input').val();
  296. fp.find('input').prop('checked', true);
  297. if (pt == 'bank' || pt == 'card') {
  298. if (pt == 'bank') {
  299. $('.banklist').show();
  300. } else {
  301. $('.cardlist').show();
  302. }
  303. $('.plist p').first().addClass('current');
  304. $('[name=bankcode]').val($('.plist p:first').find('img').attr('data-pid'));
  305. }
  306. $('.pay_list ul li').click(function() {
  307. $('.banklist,.cardlist').hide();
  308. var paytype = $(this).find('input').val();
  309. if (paytype == 'bank') {
  310. $('.banklist').show();
  311. }
  312. if (paytype == 'card') {
  313. $('.cardlist').show();
  314. }
  315. if (paytype == 'alipaywap' && is_weixin()) {
  316. $('#alipayadd').show();
  317. }
  318. });
  319. $('.plist p').click(function() {
  320. $('.plist p').removeClass('current');
  321. $(this).addClass('current');
  322. $('[name=bankcode]').val($(this).find('img').attr('data-pid'));
  323. });
  324. $('form').submit(function() {
  325. $('#myModal').modal('show');
  326. /*$('[name=paytype]').each(function(){
  327. if($(this).prop('checked')){
  328. alert('paytype:'+$(this).val());
  329. }
  330. });
  331. return false;*/
  332. });
  333. });
  334. /////////
  335. function is_weixin() {
  336. var ua = navigator.userAgent.toLowerCase();
  337. if (ua.match(/MicroMessenger/i) == "micromessenger") {
  338. return true;
  339. } else {
  340. return false;
  341. }
  342. }
  343. </script>
  344. <div style="display:none">
  345. <?php echo $this->config['stacode'] ?>
  346. </div>
  347. </body>
  348. </html>