12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- {include file="../application/h5/view/wx_book_dinner/header.html"}
- <title>微信支付</title>
- <script type="text/javascript">
- //调用微信JS api 支付
- var jasapi = {:json_decode($params["jsApiParameters"])};
- var oid = '{$params["orderid"]}';
- function jsApiCall()
- {
- WeixinJSBridge.invoke(
- 'getBrandWCPayRequest',
- jasapi,
- function(res){
- WeixinJSBridge.log(res.err_msg);
- //alert("支付完成");
- // $("#payButton").hide();
- // $("#payMessage").show();
- //alert(res.err_code+res.err_desc+res.err_msg);
- if(res.err_msg == "get_brand_wcpay_request:ok" ){
- // 使用以上方式判断前端返回,微信团队郑重提示:
- //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
- var url = 'payresult?id='+oid;
- window.location.href=url;
- }
- }
- );
- }
- function callpay()
- {
- if (typeof WeixinJSBridge == "undefined"){
- if( document.addEventListener ){
- document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
- }else if (document.attachEvent){
- document.attachEvent('WeixinJSBridgeReady', jsApiCall);
- document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
- }
- }else{
- jsApiCall();
- }
- }
- </script>
- <script type="text/javascript">
- window.onload = function(){
- if (typeof WeixinJSBridge == "undefined"){
- if( document.addEventListener ){
- document.addEventListener('WeixinJSBridgeReady', editAddress, false);
- }else if (document.attachEvent){
- document.attachEvent('WeixinJSBridgeReady', editAddress);
- document.attachEvent('onWeixinJSBridgeReady', editAddress);
- }
- }else{
- editAddress();
- }
- };
- </script>
- </head>
- <body>
- <div class="weui-pay" id="payButton" >
- <h1 class="weui-payselect-title">订单金额</h1>
- <p class="weui-pay-num">{$params['localorder']['price']}</p>
- <div class="pay-div">
- <button class="weui_btn weui_btn_primary" id="pay" onclick="callpay()">立即支付</button>
- </div>
- </div>
- </body>
- </html>
|