100 lines
3.7 KiB
HTML
100 lines
3.7 KiB
HTML
{extend name="public/base" /}
|
||
|
||
{block name="footer"}
|
||
<!-- 主体 -->
|
||
<section class="ce-content">
|
||
<div class="open-vip-block ce-padding-sm">
|
||
<p>支付金额:<span class="text-danger">298元</span></p>
|
||
<p>支付方式:<span class="text-gray">微信支付</span></p>
|
||
<p>商品名称:<span class="text-gray">超级助手VIP(有效期一年)</span></p>
|
||
<p>订 单 号:<span class="text-gray">{$orderid}</span></p>
|
||
</div>
|
||
<!-- 支付方式选择 -->
|
||
<form>
|
||
<ul class="modular-list order-confirm-list ce-margin-t-sm">
|
||
<li>
|
||
<i class="order-pay-icon weixin-icon"></i>
|
||
微信支付
|
||
<div class="address-list-radio ce-float-r">
|
||
<input type="radio" class="model" name="pay-mode" value="weixin" id="weixin" checked/>
|
||
<label for="weixin">
|
||
<i class="icon icon-check-circle"></i>
|
||
</label>
|
||
</div>
|
||
</li>
|
||
<li>
|
||
<i class="order-pay-icon balance-icon"></i>
|
||
积分兑换
|
||
<div class="address-list-radio ce-float-r">
|
||
<input type="radio" class="model" name="pay-mode" value="balance" id="balance"/>
|
||
<label for="balance">
|
||
<i class="icon icon-check-circle"></i>
|
||
</label>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</form>
|
||
<div class="vip-btn ce-padding-sm">
|
||
<button type="button" onclick="pay()">立即支付</button>
|
||
</div>
|
||
</section>
|
||
{/block}
|
||
|
||
{block name="script"}
|
||
<script type="text/javascript">
|
||
function pay() {
|
||
if (typeof WeixinJSBridge == "undefined") {
|
||
if (document.addEventListener) {
|
||
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
|
||
} else if (document.attachEvent) {
|
||
document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
|
||
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
|
||
}
|
||
}else{
|
||
|
||
onBridgeReady();
|
||
}
|
||
}
|
||
|
||
function onBridgeReady() {
|
||
var model = $("input[name='pay-mode']:checked").val();
|
||
if (model=='weixin') {
|
||
WeixinJSBridge.invoke (
|
||
'getBrandWCPayRequest',
|
||
{$payParams},
|
||
function(res) {
|
||
if (res.err_msg == "get_brand_wcpay_request:ok" ) {
|
||
updateAlert('支付成功');
|
||
setTimeout(function() {
|
||
window.location.href = "{:url('center/index')}";
|
||
}, 1000);
|
||
} else {
|
||
$('#createPay').text('立即支付').removeAttr('disabled');
|
||
updateAlert('取消支付');
|
||
setTimeout(function() {
|
||
window.location.href = "{:url('vip/index')}";
|
||
}, 1000);
|
||
}
|
||
}
|
||
);
|
||
}else{
|
||
var orderid= '{$orderid}';
|
||
$.post("{:url('pay/exchange')}",{orderid:orderid}, function(data) {
|
||
if (data.code == 1) {
|
||
updateAlert(data.msg, 'success');
|
||
setTimeout(function() {
|
||
window.location.href = "{:url('center/index')}";
|
||
}, 1000);
|
||
} else {
|
||
updateAlert(data.msg, 'warning');
|
||
setTimeout(function() {
|
||
window.location.href = "{:url('vip/index')}";
|
||
}, 1000);
|
||
}
|
||
});
|
||
}
|
||
}
|
||
</script>
|
||
{/block}
|
||
|