82 lines
2.4 KiB
PHP
82 lines
2.4 KiB
PHP
@extends('layouts.app')
|
|
@section('footer')
|
|
@endsection
|
|
|
|
@section('content')
|
|
<section class="padding_btm" >
|
|
<!-- 支付信息 Start -->
|
|
@if($order->item_type=='ACTIVITY')
|
|
<div class="buy_hurry" >
|
|
<div class="buy_hurry_left" style="width: 100%">{{ $order->detail->item->getTitle() }}</div>
|
|
</div>
|
|
@endif
|
|
<div class="buy_hurry">
|
|
<div class="buy_hurry_left">支付金额</div>
|
|
<div class="buy_hurry_right main_color"><span class="price_span">¥</span>{{ $order->amount - $order->score + $order->freight}}</div>
|
|
</div>
|
|
<!-- 支付信息 End -->
|
|
<!-- 支付方式 Start -->
|
|
<div class="enroll_pay_price" style="margin-bottom: .75rem">
|
|
<div class=" wechat_pay"><i class="icon-wechat"></i></div>
|
|
微信支付
|
|
<div class="radio wechat_pay_radio">
|
|
<input type="radio" name="payment" value="WECHAT" placeholder="" checked="">
|
|
<label for="payment"></label>
|
|
</div>
|
|
|
|
</div>
|
|
<!-- 支付方式 End -->
|
|
</section>
|
|
|
|
<div class="button_btm">
|
|
<button type="button" id="paybtn" class="btn">确认支付</button>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('script')
|
|
<script>
|
|
var json='';
|
|
$("#paybtn").click(function(){
|
|
var me=$("input[name='payment']:checked");
|
|
|
|
if(me.attr('value')=='WECHAT'){
|
|
$.get("{{ route('pay.wechatnew', $order->orderid) }}", function(data) {
|
|
if (data.statusCode == 200) {
|
|
json = JSON.parse(data.message);
|
|
pay();
|
|
}
|
|
});
|
|
}
|
|
})
|
|
|
|
|
|
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() {
|
|
WeixinJSBridge.invoke('getBrandWCPayRequest', json, function(res) {
|
|
if (res.err_msg == "get_brand_wcpay_request:ok" ) {
|
|
setTimeout(function() {
|
|
location.href = "{{ route('pay.ok') }}";
|
|
}, 1000);
|
|
} else {
|
|
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
@endsection
|