Edit.html 7.91 KB
<%include '../../common/__ui/header'%>
<%include '../../common/__partail/ListHeader'%>

<div class="contentpanel">
    <div class="row">
        <div class="col-md-12">
            <div id="basicForm" class="form-horizontal form-bordered">

            </div>
        </div>
    </div>
</div>
<script type="text/template" id="couponListAdd-template">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h4 class="panel-title">添加活动</h4>
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="form-group">
                    <label class="col-sm-2 control-label">活动名称 <span class="red">*</span></label>

                    <div class="col-sm-8">
                        <input type="text" placeholder="活动名称" prompt="活动名称" class="form-control observe"
                               data-field="actName" required maxlength="30" value="[[actName]]">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">活动类型 </label>

                    <div class="col-sm-8">
                        <select id="filter-activityType"  tabindex="-1" class="select2-offscreen brandBtn-group  observe"
                                value="[[activityType]]" data-field="activityType" >
                            <option value="-1">活动类型</option>
                            <option value="1">普通活动</option>
                            <option value="2">APP活动</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">活动地址</label>

                    <div class="col-sm-8">
                        <input type="text" placeholder="活动地址" class="form-control observe number" data-field="actUrl"
                               value="[[actUrl]]">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">活动时间</label>

                    <div class="col-sm-6">
                        <div class="col-sm-6">
                            <input type="text" class="form-control observe" data-field="startTime" id="startTime"
                                   placeholder="开始时间" value="[[startTime]]" readonly >
                        </div>
                        <div class="col-sm-6">
                            <input type="text" class="form-control observe" data-field="endTime" id="endTime"
                                   placeholder="结束时间" value="[[endTime]]" readonly >
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">背景图片</label>
                    <div class="col-sm-8">
                        <input type="file"  bucket="couponBgImg" placeholder="背景图片" class="form-control observe"
                               data-field="bgImageUrl" value="[[bgImageUrl]]" name="couponBgImg">
                        <p>图片不是必选项 ,活动类型为APP活动时添加</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">分享标题</label>

                    <div class="col-sm-8">
                        <input type="text" placeholder="分享标题" prompt="名称" class="form-control observe"
                               data-field="shareTitle"  maxlength="30" value="[[shareTitle]]">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">分享描述</label>

                    <div class="col-sm-8">
                        <textarea class="form-control observe" prompt="分享描述" data-field="shareDescribe" maxlength="100"
                                  placeholder="分享描述"  style="resize: none">[[shareDescribe]]</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">分享图片</label>
                    <div class="col-sm-8">
                        <input type="file"  bucket="couponImage" class="form-control observe"
                               data-field="sharePic" value="[[sharePic]]" name="couponImage">
                        <p>支持jpg/png/gif,建议尺寸:640 x 1038,图片不是必选项</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">分享地址</label>

                    <div class="col-sm-8">
                        <input type="text" placeholder="分享地址" class="form-control observe number" data-field="shareUrl"
                               value="[[shareUrl]]">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">是否授权</label>

                    <div class="col-sm-8">
                        <label style="cursor: pointer;"><input type="radio" name="isVerify" value="Y" class="observe" data-field="isVerify"></label>
                        <label style="cursor: pointer;"><input type="radio" name="isVerify" value="N" class="observe" data-field="isVerify"></label>
                    </div>
                    <input type="hidden" id="isVerify" value="[[isVerify]]" for="radio" data-field="isVerify">
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">活动说明</label>

                    <div class="col-sm-8">
                        <textarea class="form-control observe" prompt="分享描述" data-field="instructions" maxlength="100"
                                  placeholder="分享描述"  style="resize: none">[[instructions]]</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">限制新老客户</label>

                    <div class="col-sm-8">
                        <label style="cursor: pointer;"><input type="radio" name="isNewUser" value="0" class="observe" data-field="isNewUser">不限制</label>
                        <label style="cursor: pointer;"><input type="radio" name="isNewUser" value="1" class="observe" data-field="isNewUser">限制新用户</label>
                    </div>
                    <input type="hidden" id="isNewUser" value="[[isNewUser]]" for="radio" data-field="isNewUser">
                </div>
                [[each couponIds as item index]]
                <div class="form-group">
                    <label class="col-sm-2 control-label">优惠券</label>
                    <div class="col-sm-2">
                        <input type="text" id="couponId" class="form-control observe" value="[[item.id]]"
                               placeholder="ID" data-field="couponIds.[[index]].id">
                    </div>
                    <div class="col-sm-2">
                        <a class="col-sm-4 btn btn-primary addBtn" data-index="[[index]]">+</a>
                        <a class="col-sm-4 col-sm-offset-2 btn btn-danger delBtn" data-index="[[index]]">-</a>
                    </div>
                </div>
                [[/each]]
            </div>
        </div>
        <div class="panel-footer">
            <div class="row">
                <div class="col-sm-8 col-sm-offset-2">
                    <a href="javascript:;" onclick="history.go(-1);" class="btn btn-default">取消</a>
                    <button id="save_brand" type="button" data-loading-text="保存中..." class="btn btn-primary">保存</button>
                </div>
            </div>
        </div>
    </div>
</script>