<?php require APPPATH_MVC.'views/header.php'; ?>
<!--2017-11-28-->
<script>
    var timer;
    $(document).ready(function () {
        timer = setInterval("ajaxStatus()", 3000);
        setTimeout("codeExpire()", 1000 * 30 * 60);
    });
    function codeExpire(){
        var str = "交易超时，<a onclick='location.reload();' style='cursor: pointer;color:red;'>刷新</a>页面继续支付";
        $('#refresh').html(str);
        $('.ewmpass').show();
    }
    function ajaxStatus(){
        $.ajax({
            url: "/user/queryOrder/<?=$orderData['transaction_id']?>",
            type: "GET",
            dataType: "json",
            success: function (data) {
                if (data.status == 1) { //订单状态为1表示支付成功
                    $(".paysuc .release-failBack").show();
                    $(".paysuc .release-fail").show();
                    clearInterval(timer);
                }
            },
            error: function () {
                alert("请求订单状态出错");
            }
        });
    }
</script>
<div class="suc">
    <div class="suctit bold">微信支付</div>
    <div class="mt10">
        <span class="sucword bold ">支付金额：￥<span class="red"><?=$orderData['price']?></span> 请使用微信扫描下方二维码完成支付 </span><span class="orange f12" id="refresh">30分钟有效，请尽快支付</span>
    </div>
    <div class="sucpic">
        <img src="../css/images/paysuc1.jpg" />
        <!--二维码-->
        <img class="ewm" src="<?=$url?>" />
        <!--过期-->
        <div class="ewmpass" style="display: none;">
            二维码已过期
        </div>
    </div>
</div>
<div class="paysuc popw" >
    <div class="release-failBack"
        <?php if(!isset($is_test) || $is_test != 1){?>
         style="display:none;"
        <?php }?>
    >
    </div>
    <div class="release-fail yz-pop"
        <?php if(!isset($is_test) || $is_test != 1){?>
         style="display:none;"
        <?php }?>
    >
        <div class="tit">
            <span>支付成功 </span>
            <div class="closes"></div>
        </div>
        <div class="poplist">
            <div class="pstit">支付成功</div>
            <div class="f16 c3 mt20">前往 <a href="<?php echo USER_CENTER; ?>" class="orange">个人中心>></a></div>
            <div class="f14 c3 mt10" >支付金额：<span class="bold red"><?=$orderData['price']?>元</span>
                <a href="<?php echo USER_CENTER.'user/orderInvoice/'.$orderData['id']?>">
                    <span class="f14 oranget hand">我要开发票</span>
                </a>
            </div>
        </div>
        <p>重要提醒：不点陌生链接、不泄露银行卡和验证码信息，谨防诈骗！</p>
    </div>
</div>
<!--2017-11-28 end-->
<?php require APPPATH_MVC.'views/footer.php'; ?>
