<?php

!defined('IN_ONEZ') && exit('Access Denied');

$error=$this->view('error');

$G['this'] && $G['this']->viewurl($error);

?>

<script type="text/javascript">

function _error(){

  $.post('<?=$error?>',{orderno:''},function(){

    location.href='';

  });

}

function onBridgeReady(){

  WeixinJSBridge.invoke(

  	'getBrandWCPayRequest',

  	<?=$jsApiParameters?>,

  	function(res){

      if(res.err_code && res.err_code!=0){

        if(res.err_desc){

          alert(res.err_desc);

        }else if(res.err_msg){

          alert(res.err_msg);

        }else{

          alert('error');

        }

      }else if(res.err_msg){

        //var url='$order[goto]';

        location.href='<?=$goto?>&message='+encodeURIComponent(res.err_msg);

      }else{

        alert('error');

      }

  	}

  );

}

if (typeof WeixinJSBridge == "undefined"){

    if( document.addEventListener ){

        document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);

    }else if (document.attachEvent){

        document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 

        document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);

    }

}else{

    onBridgeReady();

}



</script>

<div class="container text-center">

  <p style="padding: 60px 0 30px 0">

    <img src="<?=onez('m')->url?>/images/status_wait.png" width="100">

  </p>

  <p style="margin-bottom: 5px;font-weight: 400;font-size: 20px;">正在支付,请稍候...</p>

</div>

