123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- @extends('admin.public.base')
- @section('body_class')
- style="margin: 0 auto;width: 96%;padding: 30px 0px;"
- @endsection
- @section('content')
- <form class="post-form" action="" method="post">
- <div class="form-group col-sm-12">
- <label class="control-label">优惠券名称 <span class="text-red">*</span></label>
- <input class="form-control" required="required" type="text" placeholder="优惠券名称" maxlength="20" name="name" value="{{$oldData['name']}}" />
- </div>
- <div class="form-group col-sm-12">
- <label class="control-label">优惠券类型 <span class="text-red">*</span></label>
- <select class="form-control" required="required" name="rebate_type" id="rebate_type">
- <option value="1" @if ( $oldData['rebate_type'] == '1' ) selected="selected" @endif>满减券</option>
- <option value="2" @if ( $oldData['rebate_type'] == '2' ) selected="selected" @endif>折扣券</option>
- <option value="3" @if ( $oldData['rebate_type'] == '3' ) selected="selected" @endif>赠品券</option>
- </select>
- </div>
- <div class="form-group col-sm-12">
- <label class="control-label">优惠力度 <span class="text-red">*</span></label>
- <div class="form-group col-sm-12">
- <label class="control-label"> </label>
- <div class="form-group col-sm-2">
- <input required="required" class="form-control" type="text" placeholder="满多少元" name="std_pay" value="{{$oldData['std_pay']}}" />
- </div>
- <div class="form-group col-sm-2">
- <input required="required" class="form-control" id="rebate" type="text" placeholder="减多少元" name="rebate" value="{{$oldData['rebate']}}" />
- </div>
- </div>
- </div>
- <div class="form-group col-sm-12">
- <label class="control-label">优惠券有效期 <span class="text-red">*</span></label>
- <div class="form-group col-sm-12">
- <div class="form-group col-sm-2">
- <label class="control-label"><input type="radio" checked name="exp_type" value="1" @if ( $oldData['exp_type'] == 1 ) checked="" @endif > 领取后X天有效 </label>
- <input class="form-control" type="number" placeholder="天数" name="exp_days" @if ( $oldData['exp_type'] == 1 ) value="{{intval($oldData['exp_time'])}}" @endif />
- </div>
- <div class="form-group col-sm-2">
- <label class="control-label"><input type="radio" name="exp_type" value="2" @if ( $oldData['exp_type'] == 2 ) checked="" @endif > 固定有效期</label>
- <input class="form-control" id="rebate" type="date" placeholder="开始时间" name="start_time" @if ( $oldData['exp_type'] == 2 ) value="{{date('Y-m-d',$oldData['start_time'])}}" @endif />
- <input class="form-control" id="rebate" type="date" placeholder="结束时间" name="end_time" @if ( $oldData['exp_type'] == 2 ) value="{{date('Y-m-d',$oldData['end_time'])}}" @endif />
- </div>
- </div>
- </div>
- <div class="form-group col-sm-12">
- <label class="control-label">发行数量 <span class="text-red">*</span> </label>
- <input class="form-control" required="required" type="number" placeholder="发行数量" min="0" max="999999" name="issue_total" value="{{$oldData['issue_total']}}" />
- </div>
- <div class="form-group col-sm-12">
- <label class="control-label">适用商品</label>
- <div class="form-group col-sm-12">
- <div class="form-group col-sm-2">
- <label class="control-label"><input type="radio" name="type_id" value="2" @if ( $oldData['type_id'] == 2 ) checked="" @endif> 全部商品范围</label>
- </div>
- <div class="form-group col-sm-2">
- <label class="control-label"><input type="radio" name="type_id" value="1" @if ( $oldData['type_id'] == 1 ) checked="" @endif > 指定商品范围</label>
- <input class="form-control" type="file" placeholder="适用商品范围" maxlength="20" name="product_file" value="" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
- </div>
- </div>
- </div>
- <div class="form-group col-sm-12">
- <label class="control-label">适用客户</label>
- <div class="form-group col-sm-12">
- <div class="form-group col-sm-2">
- <label class="control-label"><input type="radio" name="is_appt" value="0" @if ( $oldData['is_appt'] == 0 ) checked="" @endif> 全部客户</label>
- </div>
- <div class="form-group col-sm-2">
- <label class="control-label"><input type="radio" name="is_appt" value="1" @if ( $oldData['is_appt'] == 1 ) checked="" @endif> 指定客户范围</label>
- <input class="form-control" type="file" placeholder="适用客户范围" name="custom_file" value="" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
- </div>
- </div>
- </div>
- <div class="form-group col-sm-12">
- @csrf
- <input type="hidden" name="id" value="{{$oldData['id']}}" />
- <input id="send" type="submit" value="提交" class="btn btn-primary btn-block" />
- </div>
- </form>
- @endsection
- @section('javascript')
- <script>
- $(function(){
- // 类型变更
- $('#rebate_type').change(function(){
- // 获取值
- var rebateType = $(this).val();
- // 如果是满减
- if( rebateType == 1 ) $('#rebate').attr('placeholder','减多少元');
- // 如果是折扣
- if( rebateType == 2 ) $('#rebate').attr('placeholder','打几折');
- // 如果是赠品
- if( rebateType == 3 ) $('#rebate').attr('placeholder','产品编码');
- })
- })
- </script>
- @endsection
|