72 lines
2.2 KiB
PHP
72 lines
2.2 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('content')
|
|
<form action="{{ route('orders.activitystore') }}">
|
|
<section class="padding_btm" >
|
|
<!-- 支付信息 Start -->
|
|
<div class="buy_hurry">
|
|
<div class="buy_hurry_left">{{ $activity->title }}</div>
|
|
<div class="buy_hurry_right"><span class="price_span">¥</span>{{ $activity->price }}</div>
|
|
</div>
|
|
<div class="buy_hurry">
|
|
<div class="buy_hurry_left">数量</div>
|
|
<div class="buy_hurry_right">
|
|
<button class="buy_plus" type="button" > + </button>
|
|
<input type="text" class="buy_num" name="number" placeholder="1" value="1" data-price="{{ $activity->price }}" readonly="">
|
|
<button class="buy_minus " type="button" > - </button>
|
|
</div>
|
|
</div>
|
|
<div class="buy_hurry">
|
|
<div class="buy_hurry_left">合计</div>
|
|
<div class="buy_hurry_right main_color"><span class="price_span">¥</span>{{ $activity->price }}</div>
|
|
</div>
|
|
<!-- 支付信息 End -->
|
|
|
|
</section>
|
|
<div class="button_btm">
|
|
<input type="hidden" name="activity_id" value="{{ $activity->id }}">
|
|
<input type="hidden" name="express_type" value="0">
|
|
@csrf
|
|
<button type="button" class="btn ajax-post">立即支付</button>
|
|
</div>
|
|
|
|
</form>
|
|
|
|
@endsection
|
|
|
|
@section('footer')
|
|
@endsection
|
|
|
|
@section('js')
|
|
<script src="/assets/home/js/operation.js"></script>
|
|
@endsection
|
|
|
|
@section('script')
|
|
<script type="text/javascript">
|
|
//减数量
|
|
$('.buy_minus').click(function () {
|
|
var num = getMax('-', $('.buy_num').val(), 1);
|
|
if (num < 1) {
|
|
updateAlert('数量不能小于1', false);
|
|
return false;
|
|
}
|
|
$('.buy_num').val(num);
|
|
total();
|
|
});
|
|
|
|
//加数量
|
|
$('.buy_plus').click(function () {
|
|
var num = getMax('+', $('.buy_num').val(), 1);
|
|
$('.buy_num').val(num);
|
|
total();
|
|
});
|
|
|
|
function total() {
|
|
var num = $('.buy_num').val();
|
|
var price = $('.buy_num').data('price');
|
|
var order_total = getMax('*',num,price);
|
|
$('.main_color').html('<span class="price_span">¥</span>'+parseFloat(order_total).toFixed(2));
|
|
}
|
|
</script>
|
|
@endsection
|