<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>支付宝</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" />
  <meta http-equiv="Cache-Control" content="max-age=0" />
  <meta name="apple-touch-fullscreen" content="yes" />
  <meta name="Description" content="思埠美埠购" />
  <meta name="Keywords" content="思埠美埠购" />
  <meta name="renderer" content="webkit">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <link rel="stylesheet" type="text/css" href="<%=basePath%>resources/alipay/css/OrangeMallApp.min.css" />
  <style type="text/css">
  	.wrapper-main{
  		padding: 0;
  		margin:0 15px;
  	}
  	.first{
  		border-bottom: 1px solid #EFEFEF;
  		padding: 40px 0;
      text-align: center;
  	}
    .first img{
      width: 120px;
    }
  	.first p{
  		text-align: center;
  	}
  	.first .p_1{
      margin-top: 15px;
  		color: #606060;
  		font-size: 20px;
  		line-height: 20px;
  		font-weight: 600;
  	}
  	.first .p_2{
  		color: #939393;
  		font-size: 12px;
  		line-height: 12px;  
  		margin-top: 15px;
  	}
  	.alipay-over{
  		color: #FEFEFE;
  		background-color: #FF9600;
  		width: 120px;
  		padding: 5px 0;
  		font-size: 14px;
  		border-radius: 5px;
  		display: block;
  		text-align: center;
  		margin:10px auto;
  	}
    .alipay-group{
      width: 100%;
      padding: 20px 0;
    }
    .alipay-group:after,
    .alipay-group div:after{
      content:' ';
      display: table;
      clear:both;
    }
    .alipay-group>div{
      height: 150px;
      display: inline-block;
      float: left;
      width: 50%;
      text-align: center;

    }
    .alipay-group>div>div{
      height: 120px;
      background-position: 50%;
      background-repeat: no-repeat;
    }
    .alipay-group >div .i-1{
      background-image: url(<%=basePath%>resources/alipay/img/i-1.png);
      background-size: 50px;
    }
    .alipay-group >div .i-2{
      background-image: url(<%=basePath%>resources/alipay/img/i-2.png);
      background-size: 100px;
    }
    .alipay-group img{
      margin-top: 20px;
      display: inline-block;
    }
    .alipay-group .i-1-t{
      width: 80px;
    }
    .alipay-group .i-2-t{
      width: 170px;
    }
    #pos-right-top{
      position: absolute;
      top: 3px;
      right: 3px;
      width: 150px;
      height: 53px;
      background-image: url(<%=basePath%>resources/alipay/img/m.png);
      background-size: 100% auto;
      display: none;
      z-index: 200;
      color: #DEE4E4;
      font-size: 14px;
      line-height: 60px;
    }
    #pos-right-top i{
      display: inline-block;
      width: 18px;
      height: 18px;
      background-image: url(<%=basePath%>resources/alipay/img/i-b.png);
      background-size: 18px auto;
      float: left;
      margin: 21px 5px 0px 8px;
    }
  </style>
  
</head>
 <body>
 	<div id="pos-right-top">
    <i></i>
    在浏览器中打开
  </div>
	<div class="wrapper-main">
		<div class="first">
      <img src="<%=basePath%>resources/alipay/img/head.png" alt="">
			<p class="p_1">如何通过支付宝支付订单</p>
			<p class="p_2">由于微信屏蔽支付宝,您需要按照以下步骤操作。</p>
		</div>
		<div>
      <div class='alipay-group'>
        <div>
          <div class="i-1"></div>
          <img class="i-1-t" src="<%=basePath%>resources/alipay/img/i-1-t.png" alt="">
        </div>
        <div>
          <div class="i-2"></div>
          <img class="i-2-t"  src="<%=basePath%>resources/alipay/img/i-2-t.png" alt="">
        </div>
      	</div>
			<a class="alipay-over" onclick="document.getElementById('pos-right-top').style.display='block';">去支付</a>
			<a class="alipay-over" style="margin-top: 30px; background-color: #51C332;" href="<%=basePath%>resources/client/index.html#/myorder/delivered">支付完成</a>
		</div>
	</div>
  <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  <script type="text/javascript" src="<%=basePath%>resources/alipay/js/jquery.min.js"></script>
	<script>
    $(function(){
      var wxConfig = function (conf) {
          wx.config({
              debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
              appId: conf.appId, // 必填,公众号的唯一标识
              timestamp: conf.timestamp, // 必填,生成签名的时间戳
              nonceStr: conf.nonceStr, // 必填,生成签名的随机串
              signature: conf.signature,// 必填,签名,见附录1
              jsApiList: [
                  'checkJsApi',
                  'onMenuShareTimeline',
                  'onMenuShareAppMessage',
                  'onMenuShareQQ',
                  'onMenuShareWeibo',
                  'hideMenuItems',
                  'showMenuItems',
                  'hideAllNonBaseMenuItem',
                  'showAllNonBaseMenuItem',
                  'onRecordEnd',
                  'openLocation',
                  'getLocation',
                  'hideOptionMenu',
                  'showOptionMenu',
                  'chooseImage',
                  'uploadImage',
                  'previewImage',
                  'closeWindow',
                  'scanQRCode',
                  'chooseWXPay'
              ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
          });
      }
      var FXhide = function () {
          wx.ready(function () {
            wx.hideMenuItems({
                  menuList: [
                    'menuItem:share:appMessage', // 发送给朋友
                    'menuItem:share:timeline', // 分享到朋友圈
                    'menuItem:share:qq', // 分享到QQ
                    'menuItem:share:weiboApp', //分享到微博
                    'menuItem:share:QZone', //分享到qq空间
                    'menuItem:onMenuShareQZone'
                  ],
                  success: function (res) {
                    //alert('已隐藏“阅读模式”,“分享到朋友圈”,“复制链接”等按钮');
                  },
                  fail: function (res) {
                    // alert(JSON.stringify(res));
                  }
             });
          });
      }
      
      var showAll= function(){
        wx.ready(function () {
          wx.showAllNonBaseMenuItem();
        })
      }
      $.post('<%=basePath%>jsapi/sign',
        {
          share_url:window.location.href
        },
        function(data){
          wxConfig(data.data)
          showAll();
          FXhide();
        }
      )
    })
	</script>
 </body>
</html>