{layout name="manager/layout" /}
<div class="layuimini-container location-operate-page">
    <div class="layuimini-main">
        <div class="layui-form layuimini-form">

            <div class="layui-form-item">
                <label class="layui-form-label required">名称</label>
                <div class="layui-input-block">
                    <input type="text" name="item[name]" lay-verify="required" value="" lay-reqtext="标题不能为空" placeholder="请输入标题" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">所属商家</label>
                <div class="layui-input-block">
                    <select name="item[business_code]"   lay-search="">
                        <option value=""></option>
                        {foreach $business as $bitem}
                        <option value="{$bitem['code']}">{$bitem['business_name']}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">优惠券类型</label>
                <div class="layui-input-block">
                    <select name="item[type]"   lay-search="">
                        <option value=""></option>
                        {foreach $type as $titem}
                        <option value="{$titem['id']}">{$titem['name']}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">总数</label>
                <div class="layui-input-block">
                    <input type="number" name="item[count]" lay-verify="required|number" value="" lay-reqtext="总数必须大于0,不能为空" placeholder="请输入" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">开始时间</label>
                <div class="layui-input-block">
                    <input type="text" name="item[start_time]" lay-verify="required" id="start_time" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">结束时间</label>
                <div class="layui-input-block">
                    <input type="text" name="item[end_time]" lay-verify="required" id="end_time" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">金额</label>
                <div class="layui-input-block">
                    <input type="number" name="item[money]" lay-verify="required|number" value="" lay-reqtext="必须>0,不能为空" placeholder="请输入" class="layui-input">
                </div>
            </div>

<!--            <div class="layui-form-item">-->
<!--                <label class="layui-form-label required">扣除金额</label>-->
<!--                <div class="layui-input-block">-->
<!--                    <input type="number" name="item[deduction_money]" lay-verify="required|number" value="" lay-reqtext="必须>=0,不能为空" placeholder="请输入" class="layui-input">-->
<!--                </div>-->
<!--            </div>-->




            <div class="layui-form-item layui-row field-div current-field-cover" >
            <label class="layui-form-label">封面:</label>
            <div class="layui-inline layui-col-xs12 layui-col-md8">
                <div class="layui-row upload-file-div">
                    <div class=" layui-col-xs12 layui-col-md8">
                        <input class="layui-input upload-file-value" name="item[image_url]" type="text" value="">
                        <div class="layui-form-mid layui-word-aux">图片尺寸:请选择合适尺寸</div>
                    </div>
                    <div class="layui-col-xs12 layui-col-md3">
                                <span>
                                    <button type="button" class="layui-btn layui-btn-danger upload-btn">
                                        <i class="fa fa-upload"></i> 上传
                                    </button>
                                </span>
                        <span><button type="button" class="layui-btn layui-btn-primary upload-choose-btn" data-url="/manager/attachment/image" data-type="image" data-multiple="false"><i class="fa fa-list"></i> 选择</button></span>
                    </div>
                    <ul class="layui-row layui-col-xs12 layui-col-md9 preview-list layui-col-space5"></ul>
                </div>
            </div>
        </div>

            <div class="layui-form-item">
                <label class="layui-form-label">使用规则</label>
                <div class="layui-input-block">
                    <textarea name="item[using_rule]"  cols="30" rows="10"></textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">处罚规则</label>
                <div class="layui-input-block">
                    <textarea name="item[using_rule]"  cols="30" rows="10"></textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-block">
                    <input type="radio"  checked="checked" name="item[status]" value="0" title="开启" />
                    <input type="radio" name="item[status]" value="1" title="关闭" />
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">上架状态</label>
                <div class="layui-input-block">
                    <input type="radio"  checked="checked" name="item[on_shelf]" value="0" title="上架" />
                    <input type="radio" name="item[on_shelf]" value="1" title="下架" />
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">内容</label>
                <div class="layui-input-block editor-text">
                    <div class="editor"></div>
                    <textarea name="item[intro]" id="ueditor" class="layui-textarea layui-hide"></textarea>
                </div>
            </div>


            <fieldset class="layui-elem-field layui-field-title site-title">
                <legend><a name="compatibility">请填写完整整数  总和为100</a></legend>
            </fieldset>

            <div class="layui-form-itemBox2 between-center">
                <div class="layui-form-item">
                    <label class="layui-form-label">渠道商占比(%)</label>
                    <div class="layui-input-block">
                        <input class="layui-input" type="number" name="item[commission_agency]" lay-verify="required|number"  value="{$distributionProportion.agency ?? 0}"/>
                    </div>
                </div>
            </div>


            <div class="layui-form-itemBox2 between-center">
                <div class="layui-form-item">
                    <label class="layui-form-label">平台占比(%)</label>
                    <div class="layui-input-block">
                        <input class="layui-input" type="number" name="item[commission_admin]" lay-verify="required|number"  value="{$distributionProportion.admin ?? 0}"/>
                    </div>
                </div>
            </div>


            <div class="layui-form-itemBox2 between-center">
                <div class="layui-form-item">
                    <label class="layui-form-label">消费者占比(%)</label>
                    <div class="layui-input-block">
                        <input class="layui-input" type="number" name="item[commission_consumer]" lay-verify="required|number"  value="{$distributionProportion.consumer ?? 0}"/>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn layui-btn-normal" data-url="/manager/coupon/release" lay-submit lay-filter="saveBtn">确认保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__MANAGER__/js/coupon/index.js?v={:mt_rand()}"></script>