178 lines
7.9 KiB
PHP
178 lines
7.9 KiB
PHP
@extends('layouts.app')
|
||
|
||
@section('content')
|
||
<section class="padding_btm" >
|
||
<form action="{{ route('orders.lessonstore') }}" method="post" accept-charset="utf-8">
|
||
<!-- 顶部 Start -->
|
||
<div class="k_head"><span style="background-image: url(/assets/home/img/cn_01.jpg);"></span></div>
|
||
<div class="k_i">
|
||
<!-- 已选 Start -->
|
||
{!! str_repeat('<span class="k_i_1"></span>',$lists->count()) !!}
|
||
<!-- 已选 End -->
|
||
|
||
<!-- 未选 Start -->
|
||
@if($lists->count() < Params::get('lesson_num'))
|
||
{!! str_repeat('<span class="k_i_0"></span>',Params::get('lesson_num')-Auth::user()->cart_num) !!}
|
||
@endif
|
||
<!-- 未选 End -->
|
||
</div>
|
||
<div class="k_explain"><img src="/assets/home/img/cn_32.jpg"></div>
|
||
<!-- 顶部 End -->
|
||
<!-- 课程 Start -->
|
||
<ul class="k_lesson">
|
||
@php $total =0; @endphp
|
||
@foreach($lists as $key => $cart)
|
||
<li >
|
||
<i class="icon-remove-sign n_delete ajax-get refresh" data-href="{{ route('cart.delete',$cart) }}"></i><!--说明:删除课程按钮-->
|
||
<div class="k_lesson_img img-bg" data-href="{{ route('lessons.show',$cart->lesson) }}">
|
||
@if($cart->lesson->end_at->timestamp < time())
|
||
<span style="background-image: url(/assets/home/img/n_over.png);z-index: 100;opacity: .8"></span><!--说明:课程过期时显示-->
|
||
@endif
|
||
<span style="background-image: url({{ $cart->lesson->storage->path }});"></span>
|
||
</div>
|
||
<div class="k_lesson_name text-nowrap" data-href="{{ route('lessons.show',$cart->lesson) }}">{{ $cart->lesson->title }}</div>
|
||
<input type="hidden" name="cart_ids[]" value="{{ $cart->id }}">
|
||
</li>
|
||
@php $total +=$cart->lesson->price @endphp
|
||
@endforeach
|
||
|
||
@if(Auth::user()->cart_num<Params::get('lesson_num'))
|
||
@for ($i = 0; $i < Params::get('lesson_num')-Auth::user()->cart_num; $i++)
|
||
<li data-href="{{ route('lessons.all') }}">
|
||
<div class="k_lesson_img img-bg">
|
||
<span style="background-image: url(/assets/home/img/cn_33.jpg);"></span>
|
||
</div>
|
||
<div class="k_lesson_name text-nowrap">选择其他课程</div>
|
||
</li>
|
||
@endfor
|
||
@endif
|
||
</ul>
|
||
<!-- 课程 End -->
|
||
<div class="k_top_price">总价:<span class="k_top_price_big">¥@if(Auth::user()->identity->identity_id==1){{ $apply_lesson_price-100 }} @else {{ $apply_lesson_price }} @endif</span><span class="k_top_price_small">¥{{ $total }}</span></div>
|
||
|
||
<div class="k_open">
|
||
<div class="k_open_img img-bg gifts_img"><span id="treasure" style="background-image: url(/assets/home/img/cn_35.png);"></span></div>
|
||
<div class="k_open_name text-nowrap">选择礼品</div>
|
||
</div>
|
||
<!--说明:注释部分为礼物选中后显示,替换宝箱class="k_open"-->
|
||
<div class="k_pay"></div>
|
||
<div class="k_explain_show">
|
||
<i class="icon-remove-sign k_explain_close"></i>
|
||
<div class="lesson_explain_title" style="position: absolute;top: 0;left: 0rem;background:none"><i class="icon-info-sign"></i> 报课说明:</div>
|
||
<ul class="lesson_explain_con" style="background:none;padding: .75rem 0">
|
||
<li>报课后请详看机构课程有效期,过期视为自动放弃。</li>
|
||
<li>请提前3天预约课程,报课后费用不予退还。</li>
|
||
<li>为保证教学质量和效果,若学员未按照学校排课到勤,后期是否补课,请与机构自行协商。</li>
|
||
<li>报课科目只以“宝宝课”成功支付为有效,其他不予承认。</li>
|
||
<li>归法律允许范围内,本活动最终解释权归“宝宝课”所有。</li>
|
||
</ul>
|
||
</div>
|
||
<!-- 礼品 Start -->
|
||
@if(!$gifts->isEmpty())
|
||
<ul class="k_gift">
|
||
@foreach($gifts as $gift)
|
||
<li>
|
||
<div class="k_gift_img img-bg" data-href="{{ route('cart.show',$gift) }}"><span style="background-image: url({{ $gift->goods->storage->path }});"></span></div>
|
||
<div class="k_gift_text text-nowrap-multi">{{ $gift->getTitle() }}</div>
|
||
<div class="radio k_gift_choose">
|
||
<input type="radio" name="gifts_id" value="{{ $gift->id }}" class="input" data-title="{{ $gift->getTitle() }}" data-img="{{ $gift->goods->storage->path }}">
|
||
<label for="payment" style="padding-top: .3rem">选择它</label>
|
||
</div>
|
||
</li>
|
||
@endforeach
|
||
<i class="icon-remove-sign k_gift_close"></i>
|
||
</ul>
|
||
@endif
|
||
|
||
@csrf
|
||
<input type="hidden" name="type" value="lesson">
|
||
<input type="hidden" name="express_type" value="0">
|
||
<input type="hidden" name="baby_id" value="{{ Auth::user()->babys->id??'' }}">
|
||
<input type="hidden" class="tijiao ajax-post">
|
||
<!-- 礼品 End -->
|
||
<!-- 填写报名信息 Start -->
|
||
<!-- <div id="enroll_show">
|
||
<div class="enroll_form">
|
||
<div class="enroll_form_title">填写报名信息</div>
|
||
<i class="icon-remove-circle enroll_form_close" onclick="document.getElementById('enroll_show').style.display='none';"></i>
|
||
<div class="enroll_input">
|
||
<div class="enroll_input_name">宝宝姓名:</div>
|
||
<input type="text" name="name" value="" placeholder="请输入宝宝姓名" class="input">
|
||
</div>
|
||
<div class="enroll_input">
|
||
<div class="enroll_input_name">宝宝年龄:</div>
|
||
<input type="tel" name="age" value="" placeholder="请输入宝宝年龄" class="input ">
|
||
</div>
|
||
<div class="enroll_input">
|
||
<div class="enroll_input_name">联系电话:</div>
|
||
<input type="tel" name="mobile" value="" placeholder="请输入联系电话" class="input ">
|
||
</div>
|
||
<input type="hidden" name="_token" value="">
|
||
<input type="hidden" name="type" value="lesson">
|
||
<input type="hidden" name="express_type" value="0">
|
||
@csrf
|
||
<button type="button" class="btn enroll_form_btn ajax-post">确认信息并支付</button>
|
||
</div>
|
||
</div> -->
|
||
</form>
|
||
<!-- 填写报名信息 End -->
|
||
<div class="k_bg_img"></div>
|
||
<div class="k_bg_color"></div>
|
||
</section>
|
||
@endsection
|
||
@section('js')
|
||
<script src="/assets/home/js/operation.js"></script>
|
||
@endsection
|
||
@section('script')
|
||
<script type="text/javascript">
|
||
/*说明*/
|
||
$(".k_explain").click(function (e) {
|
||
$(".k_explain_show").show();
|
||
});
|
||
$(".k_explain_close").click(function (e) {
|
||
$(".k_explain_show").hide();
|
||
});
|
||
/*选礼品*/
|
||
$(".k_open").click(function (e) {
|
||
$(".k_gift").show();
|
||
});
|
||
$(".k_open_in").click(function (e) {
|
||
$(".k_gift").show();
|
||
});
|
||
$(".k_gift_close").click(function (e) {
|
||
var img = $("input[type='radio']:checked").data('img');
|
||
var title = $("input[type='radio']:checked").data('title');
|
||
if (img) {
|
||
$('#treasure').css('background-image',"url("+ img +")");
|
||
$('.k_open_name').html(title);
|
||
$('.gifts_img').removeClass('k_open_img');
|
||
$('.gifts_img').addClass('k_open_in_img');
|
||
}
|
||
|
||
$(".k_gift").hide();
|
||
});
|
||
/*填写报名信息*/
|
||
$(".k_pay").click(function (e) {
|
||
var gifts_id = $("input[name='gifts_id']:checked").val();
|
||
var baby = $("input[name='baby_id']").val();
|
||
|
||
if (!baby) {
|
||
updateAlert('您还没有录入宝宝信息,请先去录入信息。');
|
||
setTimeout(function(){
|
||
location.href = "{{ route('baby',['callback'=>route('cart.index')]) }}";
|
||
},1500);
|
||
return false;
|
||
}
|
||
|
||
if (!gifts_id) {
|
||
updateAlert('请先去选择礼品。');
|
||
$('.k_open').click();
|
||
return false;
|
||
}
|
||
$(".tijiao").click();
|
||
});
|
||
|
||
|
||
</script>
|
||
@endsection
|