index.html 5.3 KB
<!DOCTYPE html>
<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="思埠V币商城" />
<meta name="Keywords" content="思埠V币商城" />
<meta name="renderer" content="webkit">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="./css/index.css">
<script type="text/javascript" src='./js/jquery.js'></script>
<script src="./js/flexible.js"></script>
</head>
<body>
	<div class="main-container">
		<header class="header ng-scope">
			<h1 class="title">订单详情</h1>
		</header>
	</div>
	<div class="container order-container">
		<div class="address address-border-image">
			<div class="detail">
				<p>姓名: 白胡子</p>
				<p>手机: 13520058858</p>
				<p>地址: 北京市@市辖区@西城区@啦啦啦啦啦啦啦啊</p>
			</div>
		</div>

		<div class="shop-list">
			<div class="shop-title-name ng-scope" style="margin-top: 0">
				<i class="icon-money left"></i> <span style="padding: 3px 0 0 3px;">待支付产品</span>
			</div>
			<div class="shop-item clearfix">
				<div class="image left">
					<img
						ng-src="http://resources.sibu.cn/resource/load?path=resources/20150911/20150911143508644_750x750.jpg"
						alt=""
						src="http://resources.sibu.cn/resource/load?path=resources/20150911/20150911143508644_750x750.jpg">
				</div>
				<div class="details detail-titles">
					<p class="name ng-binding">黛莱美焕彩水润无瑕BB霜</p>
					<p class="integ">
						<i class="icon-money left"></i> <span class="ng-binding">169</span>
					</p>
					<p class="old ng-binding">
						市场参考价:199 <span class="right ng-binding"> x2 </span>
					</p>
				</div>
			</div>
			<div class="shop-item clearfix">
				<div class="image left">
					<img
						ng-src="http://resources.sibu.cn/resource/load?path=resources/20150911/20150911143508644_750x750.jpg"
						alt=""
						src="http://resources.sibu.cn/resource/load?path=resources/20150911/20150911143508644_750x750.jpg">
				</div>
				<div class="details detail-titles">
					<p class="name ng-binding">黛莱美焕彩水润无瑕BB霜</p>
					<p class="integ">
						<i class="icon-money left"></i> <span class="ng-binding">169</span>
					</p>
					<p class="old ng-binding">
						市场参考价:199 <span class="right ng-binding"> x2 </span>
					</p>
				</div>
			</div>
			<div class="order-state clearfix">
				<span class="right status big"> 总计: <span class="ng-binding">338</span>
				</span>
			</div>
		</div>

		<div class="order-details">
			<p class="text">
				<span>订单单号:</span>0411463788727936
			</p>
			<p class="text">
				<span>下单时间:</span>2016-05-18 04:49:11
			</p>
			<p class="text">
				<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费:</span>0.00
			</p>
			<p class="text">
				<span>买家备注:</span>
			</p>
		</div>
	</div>
	<div class="detail-bottom"
		style="border-top: .02rem solid rgb(233, 233, 233);">
		<div class="right" style="font-size: 12px;">
			<div class="shop-btn btn btn-cancel left">取消订单</div>
			<div class="shop-btn btn right">立即支付</div>
		</div>
	</div>
	<script>
		var jsapiParameter = null;
		var openid = '<{$openid}>', oId = '<{$orderId}>';

		//调用微信JS api 支付
		function jsApiCall() {
			WeixinJSBridge
					.invoke(
							'getBrandWCPayRequest',
							{
								"appId" : "<{$jsApiParameters.appId}>",
								"timeStamp" : "<{$jsApiParameters.timeStamp}>",
								"nonceStr" : "<{$jsApiParameters.nonceStr}>",
								"package" : "<{$jsApiParameters.package}>",
								"signType" : "<{$jsApiParameters.signType}>",
								"paySign" : "<{$jsApiParameters.paySign}>"
							},
							function(res) {
								$("#loading").hide();
								if (res.err_msg == 'get_brand_wcpay_request:cancel') {
									alert("您已经成功取消订单支付");
								} else if (res.err_msg == 'get_brand_wcpay_request:ok') {
									//alert("您已经成功支付改订单,可以去商城订单中查看");
									window.location.href = '../app/index.html#orderinfo/<{$orderId}>/<{$openid}>/<{$fromId}>';
								} else {
									alert("支付异常,提示:" + res.err_msg);
								}
							});
		}
		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();
			}
		}
		//取消订单
		function cancelOrder() {
			if (confirm("您确认要取消该订单吗?")) {
				$
						.ajax({
							type : "GET",
							url : "../controller/order.php?a=cancel_order&oid=<{$orderId}>&pay_ref=<{$pay_ref}>",
							timeout : 30000,
							dataType : "json",
							async : false,
							success : function(res) {
								if (res.code == 0) {
									window.location.href = '../app/index.html#order/<{$openid}>/<{$fromId}>';
								} else {
									alert(res.message);
								}
							}
						});
			}
		}
		$(function() {
			setTimeout(callpay, 3000);
		});
	</script>
</body>
</html>