<?php defined('IN_YUNYECMS') or exit('No permission.'); ?><!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title><?php echo $seo["title"] ;?></title>
  <meta name="keywords" content="<?php echo $seo["keywords"] ;?>" />
  <meta name="description" content="<?php echo $seo["description"] ;?>" />
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

  <link href="<?php echo YUNYECMS_PUBLIC;?>plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" />
  <!-- Font Awesome -->
  <link rel="stylesheet" href="<?php echo YUNYECMS_UI;?>plugins/fontawesome-free/css/all.min.css"> <!-- Theme style -->
  <link rel="stylesheet" href="<?php echo YUNYECMS_UI;?>plugins/iCheck/all.css">
  <link rel="stylesheet" href="<?php echo YUNYECMS_UI;?>dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="<?php echo YUNYECMS_UI;?>dist/css/skins/_all-skins.min.css">
  <link href="<?php echo YUNYECMS_UI;?>plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
  <link rel="stylesheet" href="<?php echo YUNYECMS_UI;?>dist/css/plugins.css">
  <link rel="stylesheet" href="<?php echo YUNYECMS_UI;?>dist/css/member.css">
  <link rel="stylesheet" href="<?php echo YUNYECMS_PUBLIC;?>member/css/buy.css">
  <link rel="shortcut icon" href="<?php echo YUNYECMS_UI;?>dist/img/favicon.ico" />
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>

<body class="hold-transition skin-green sidebar-mini fixed">
  <div class="wrapper">
    <?php include tpl("left","member"); ?>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
      <!-- Content Header (Page header) -->
      <div class="content-header">
        <div class="container-fluid">
          <div class="row mb-2">
            <div class="col-sm-6">
              <ol class="breadcrumb float-sm-left">
                <li class="breadcrumb-item" id="homeitem"><a href="<?php echo url('member/member/index');?>"
                    target="maincontent"> <i class="fa fa-home"></i>
                    首页</a></li>
                <?php if(is_array($breadcumb)): $i = -1; $__DATA__ = $breadcumb;if(count($__DATA__)==0 )  echo "" ;foreach($__DATA__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                <?php if($i+1!=count($breadcumb)) { ?>
                <li class="breadcrumb-item"><a href="<?php echo $v["url"] ;?>"><?php echo $v["title"] ;?></a></li>
                <?php } else { ?>
                <li class="breadcrumb-item active"><?php echo $v["title"] ;?></li>
                <?php } ?>
                <?php  endforeach;  endif; ?>
              </ol>
            </div>
            <div class="col-sm-6">
              <?php include tpl("fast","member"); ?>
            </div>
          </div>
        </div>
      </div>
      <div class="container-fluid" id="mainwrap">
        <!-- Main content -->
        <section class="content">
          <div class="row">
            <!-- left column -->
            <div class="col-md-12">
              <div class="card box-primary card-outline">
                <div class="card-header">
                  <div class="col-xs-12 col-sm-12 col-md-8 pb10">
                    <h3 class="card-title">会员升级</h3> &nbsp;
                  </div>
                </div>
                <!-- /.box-header -->
                <div class="card-body">

                  <div class="col-md-12">
                    <!-- shop your order table -->
                    <div class="shop--your-order" data-delay=".8">
                      <h4 class="font-weight-bold PT-sens text-center " style="font-size: 20px;">您的订单已提交，订单号为<span
                          class="text-danger"><?php echo $orderitem["sn"] ;?></span>
                      </h4>
                      <table class="order-table table PT-sens mt-30">
                        <tbody>
                          <tr>
                            <td> 产品 </td>
                            <td> <?php echo $orderitem["title"] ;?> </td>
                          </tr>
                          <tr>
                            <td> 期限 </td>
                            <td> <?php echo $orderitem["timelimit_name"] ;?> </td>
                          </tr>
                          <tr>
                            <td> 价格 </td>
                            <td> <?php echo $orderitem["money"] ;?> </td>
                          </tr>
                          <tr>
                            <td>
                              总计 :
                            </td>
                            <td class="text-danger" style="font-size: 20px;">
                              ￥<?php echo $orderitem["money"] ;?>元
                            </td>
                          </tr>
                        </tbody>
                      </table>
                      <div class="shop-payment-method pb-30 text-center">
                        <?php if($orderitem[name]) { ?>姓名： <?php echo $orderitem["name"] ;?> &nbsp;&nbsp; <?php } ?> 电话： <?php echo $orderitem["mobile"] ;?>
                      </div>
                      <?php if($orderitem['paymode']==1) { ?>
                      <form action="<?php echo url('shop/alipay/memberalipay')?>" method="post" target="_blank">
                        <div class="containter text-center" style="padding-top: 35px; padding-bottom: 100px;">
                          <input type="hidden" name="WIDout_trade_no" id="out_trade_no" value="<?php echo $orderitem["sn"] ;?>">
                          <input type="hidden" name="WIDsubject" value="<?php echo $lang["sitename"] ;?>会员升级订单-<?php echo $orderitem["sn"] ;?>">
                          <input type="hidden" name="WIDtotal_fee" value="<?php echo $orderitem["money"] ;?>">
                          <input type="hidden" name="WIDbody"
                            value='<?php echo $lang["sitename"] ;?>会员升级订单-<?php echo $orderitem["sn"] ;?>-<?php echo $orderitem["name"] ;?>-<?php echo $orderitem["mobile"] ;?>'>
                          <button type="submit" name="button" value="Send" class="btn btn-primary btn-flat"><i
                              class="  icon-paper-plane"></i> 支付宝付款 </button>
                        </div>
                      </form>
                      <?php } elseif ($orderitem['paymode']==3) { ?>
                      <form action="<?php echo url('shop/recharge/balancepay')?>" method="post" target="_blank">
                        <div class="containter text-center">
                          <input type="hidden" name="orderid" id="orderid" value="<?php echo $orderitem["id"] ;?>">
                          <input type="hidden" name="sn" id="sn" value="<?php echo $orderitem["sn"] ;?>">
                          <input type="hidden" name="token" id="token" value="<?php echo $token;?>">
                          <button type="submit" name="button" value="Send" class="btn btn-primary btn-flat"><i
                              class="  icon-paper-plane"></i> 使用帐户余额支付 </button>
                        </div>
                      </form>
                      <?php } elseif ($orderitem['paymode']==2) { ?>
                      <?php 
                        if(!is_mobile()):
                      ?>
                      <img alt="模式二扫码支付"
                        src="<?php echo ROOT;?>core/extend/wxpay/qrcode.php?data=<?php echo urlencode($wxpay_para);?>"
                        style="width:150px;height:150px;" />
                      <br /><br /><br />
                      <?php 
                        else:
                      ?>
                      <script type="text/javascript">
                        //调用微信JS api 支付
                        function jsApiCall() {
                          WeixinJSBridge.invoke(
                            'getBrandWCPayRequest',
                             <?php echo $wxpay_para['jsApiParameters']; ?>,
                            function (res) {
                              WeixinJSBridge.log(res.err_msg);
                              if (res.err_msg == "get_brand_wcpay_request:ok") {
                                alert("支付成功");
                                //alert(res.err_code+res.err_desc+res.err_msg);
                                window.location.href = "<?php echo url('shop/recharge/index');?>";
                              } else {
                                if (res.err_msg == "get_brand_wcpay_request:cancel") {
                                  alert("用户取消");
                                  window.location.href = "<?php echo url('shop/recharge/index');?>";
                                } else {
                                  //alert(res.err_code+res.err_desc+res.err_msg);
                                  alert("支付失败");
                                  window.location.href = "<?php echo url('shop/recharge/index');?>";
                                }
                              }
                            }
                          );
                        }
                        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">
                        //获取共享地址
                        function editAddress() {
                          WeixinJSBridge.invoke(
                            'editAddress',                         
                              <?php echo $wxpay_para['editAddress']; ?>,
                            function (res) {
                              var value1 = res.proviceFirstStageName;
                              var value2 = res.addressCitySecondStageName;
                              var value3 = res.addressCountiesThirdStageName;
                              var value4 = res.addressDetailInfo;
                              var tel = res.telNumber;
                              //alert(value1 + value2 + value3 + value4 + ":" + tel);
                            }
                          );
                        }
                        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>
                      <button type="button" name="button" value="Send" class="btn btn-primary btn-flat"
                        onclick="callpay()"><i class="  icon-paper-plane"></i> 微信支付 </button>

                      <?php 
                        endif;
                      ?>

                      <?php } ?>



                    </div>
                    <!--ENd of shop your order table -->
                  </div>




                </div>

              </div>
              <!-- /.box -->
            </div>
            <!--/.col (left) -->
          </div>
          <!-- /.row -->
        </section>
        <!-- /.content -->
      </div>

    </div>
    <!-- /.content-wrapper -->
    <?php include tpl("foot","member"); ?>

    <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->

  </div>
  <!-- ./wrapper -->

  <script src="<?php echo YUNYECMS_UI;?>plugins/jQuery/jquery-3.6.1.min.js"></script>

  <script src="<?php echo YUNYECMS_UI;?>bootstrap/js/bootstrap.min.js"></script>

  <script src="<?php echo YUNYECMS_UI;?>dist/js/adminlte.js"></script>


  <script type="text/javascript">
    $(document).ready(function () {
      $(".search-option").toggle(function () {
        $(this).next(".select").slideDown();
      }, function () {
        $(this).next(".select").slideUp();
      });
      $(".select dd").click(function () {
        $a = $(this).attr('id');
        $b = $(this).html();
        $("#typeid").val($a);

        $(".search-option").html($b + '<i><em></em><span></span></i>');
        $(".select").slideUp();
      });

    });
  </script>
  <script type="text/javascript">
    price();
    function price() {
      var price = $(".host .buy_hover b").data("value");
      var timelimit_name = $(".host .buy_hover b").attr("name");
      var timelimit_id = $(".host .buy_hover b").attr("id");
      $("#zongjia").html("￥" + price + "元");
      $("#orderprice").val(price);
      $("#timelimit_name").val(timelimit_name);
      $("#timelimit_id").val(timelimit_id);
    }
    $(".buywrap").each(function () {
      $(this).find("dd").click(function () {
        $(this).siblings().removeClass("buy_hover");
        $(this).addClass("buy_hover");
        price();
      })
    });
    $(".buywrap dl").hover(
      function () { $(this).css("background", "#f9f9f9"); },
      function () { $(this).css("background", "none"); }
    );
  </script>


</body>

</html>