{yun:}include file="$wapstyle/member/lheader.htm"{/yun}
|
<section class="wap_member">
|
<div class="wap_member_comp_h1" style="position:relative"><span>微信支付</span></div>
|
<div class="yun_wap_addresume_box" >
|
|
|
<form name='alipayment' onSubmit="return CheckForm(this);" action="index.php?c=pay" method="post">
|
|
<div class="yun_wap_addresume_box_group" style="background: transparent; border: none;">
|
{yun:}if $wxpay{/yun}
|
<input type="button" value="微信支付" class="reinputText2" id="wxpay">
|
{yun:}/if{/yun}
|
|
{yun:}if $alipay{/yun}
|
<input type="button" value="支付宝支付" class="reinputText2" id="alipay">
|
{yun:}/if{/yun}
|
|
</div>
|
</form>
|
</div>
|
</div>
|
</section>
|
|
<script src="{yun:}$wap_style{/yun}/js/wx.sdk.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
|
<script>
|
var id = '{yun:}$id{/yun}';
|
|
|
//调用微信JS api 支付
|
function jsApiCall()
|
{
|
|
|
WeixinJSBridge.invoke(
|
'getBrandWCPayRequest',
|
{yun:}$jsApiParameters{/yun},
|
function(res){
|
|
if(res.err_msg == "get_brand_wcpay_request:ok" ) {
|
setInterval("wxorderstatus(" + id + ")", 3000);
|
}else{
|
showToast(res.err_code+res.err_desc+res.err_msg,2,function(){location.href = 'index.php?c=pay';});
|
}
|
|
}
|
);
|
|
}
|
function wxorderstatus(orderid) {
|
$.post('{yun:}$config.sy_weburl{/yun}/api/wxpay/wxorder.php',{orderid:orderid},function(data){
|
if(data==1){
|
showToast('支付成功!',2,function(){location.href = 'index.php?c=com';});
|
}
|
});
|
}
|
|
$(document).ready(function(){
|
|
|
|
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>
|
{yun:}include file="$wapstyle/member/public/phptoast.htm"{/yun}
|
</body></html>
|