<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>微信订单支付</title>
<script src="<{$__PUBLIC__}>js/jquery.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="http://res.wx.qq.com/open/js/jweixin-1.1.0.js"></script> 
<script type="text/javascript">
function alertObj(obj){
	var output = "";
	for(var i in obj){  
		var property=obj[i];  
		output+=i+" = "+property+"\n"; 
	}  
	alert(output);
}
//调用微信JS api 支付
function wxInit(){
	wx.config({
		//debug:true,
		appId:"<{$row.jscfg.appid}>",
		timestamp:"<{$row.jscfg.timestamp}>",
		nonceStr:"<{$row.jscfg.noncestr}>",
		signature:"<{$row.jscfg.signature}>",
		jsApiList:["chooseWXPay"]
	});
}
function pay(){ 
	wxInit();
	wx.ready(function(){
		wx.chooseWXPay({
			timestamp:"<{$row.paycfg.timeStamp}>", 
			nonceStr:"<{$row.paycfg.nonceStr}>", 
			package:"<{$row.paycfg.package}>", 
			signType:"<{$row.paycfg.signType}>", 
			paySign:"<{$row.paycfg.paySign}>", 
			success: function(res){
				if(res.errMsg == "chooseWXPay:ok") { 
					alert("支付成功");
					location.href="<{$row.jump_url}>";
				}else{ 
					alert("支付失败");
					alert(res.errMsg);
					history.back(-1);
				}
			},
			cancel:function(){ 
				// alert('取消操作');
				history.back(-1);
			}
		}); 
	});
}  
pay();
</script>
</head>
<body>
</body>
</html>