<script type="text/template" id="template_content">
<!-- 文本内容 -->
[[each modules as module index]]
    <li class="form-group custom-group dragItem" data-index="[[index]]" style="width: 100%">
    [[if module.contentData.template_name=='text']]
        <div class="col-sm-12"><h3>[[module.contentData.data.text]]</h3></div>
    [[else if module.contentData.template_name=='singleImage']]
        <div class="col-sm-12">
            <img src="[[module.contentData.data[0].src]]" title="[[module.contentData.data[0].title]]">
        </div>
    [[else if module.contentData.template_name=='smallPic']]
        [[each module.contentData.data as item i]]
        <div class="col-sm-6">
                <img src="[[item.src]]" title="[[item.title]]">
        </div>
        [[/each]]
    [[else if module.contentData.template_name=='goods']]
        [[each module.contentData.data as item i]]
        <div class="col-sm-6">
                <img src="[[item.src]]" title="[[item.title]]">
        </div>
        [[/each]]
    [[else if module.contentData.template_name=='link']]
        <div class="col-sm-12">
            <div class="wordText">
                <span>一个链接</span>
            </div>
        </div>
    [[else if module.contentData.template_name=='goodsGroup']]
        <div class="form-group">
        [[each module.contentData.data as items i]]
        <div class="col-sm-3">
            <img src="[[items.cover.cover]]" >
        </div>
        [[/each]]
        </div>

        [[each module.contentData.data[0].list as item index]]
        <div class="col-sm-6">
            <img src="[[item.src]]" title="[[item.id]]">
        </div>
        [[/each]]

    </div>
    [[else if module.contentData.template_name=='blkBrand']]
        <div class="form-group">
        [[each module.contentData.data.list as item i]]
        [[if i<=2]]
        <div class="col-sm-3">
            <img src="[[item.src]]" title="[[item.productName]]">
        </div>
         <div class="col-sm-3">
          [[item.productName]]
         </div>
         [[/if]]
        [[/each]]
        </div>
    [[else if module.contentData.template_name=='titleFloor']]
        <div class="col-sm-12">
            <div class="wordText">
                <span>[[module.contentData.data.title.name]]</span>
                <div style="float: right;">[[module.contentData.data.title.more_name]]</div>
            </div>
        </div>
    [[else if module.contentData.template_name=='sixLinesFloor']]
    [[each module.contentData.data.list as item i]]
    <div class="col-sm-6">
        <img src="[[item.src]]" title="[[item.title]]">
    </div>
    [[/each]]
    <%include 'taoyu2'%>
    [[/if]]
        <div class="actions-box">
            <div class="actions-wrap">
                <span class="edit" data-index="[[index]]">编辑</span>
                <span class="del" data-index="[[index]]">删除</span>
            </div>
        </div>
     </li>
[[/each]]

</script>

<!-- 文本弹层 -->
<script type="text/template" id="template_dialog_text">
    <div class="rows">
       <textarea rows="2" class="form-control observe" placeholder="文章摘要" data-field="text" style="resize: none">[[contentData.data.text]]</textarea>
    </div>
</script>

<!-- 一张图片/两张小图 -->
<script type="text/template" id="oneimage-template">
<input type="button" class="btn btn-info btn-xs addBtn" data-event="oneimage.data" value="添加图片" style="margin:10px;"><br>
    <div class="rows">
        <div id="grid-baseFrom"> 
            <ul class="draggable" data-array="data">
                [[each contentData.data as item index]]
                <li>
                    <table class="table table-hover table-bordered responsive dataTable no-footer">
                        <tbody>
                        <tr>
                            <td align="center">[[index+1]]</td>
                            <td align="center">
                                <input type="file" name="file" id="src-[[index]]" value="[[item.src]]"
                                       data-field="[[index]].src" data-index="[[index]]" required/>
                            </td>
                            <td>
                                <div class="form-group">
                                    <div class="col-sm-10">
                                        <select class="form-control observe" data-field="[[index]].url.action"
                                                value='[[item.url?item.url.action:""]]'>
                                            [[layout action_template]]
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class="col-sm-10">
                                        <input class="form-control observe" placeholder="跳转地址" data-field="[[index]].url.url"
                                               value="[[item.url?item.url.url:'']]"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-10">
                                        <input class="form-control observe" value="[[item.alt?item.alt:'']]" placeholder="图片描述"
                                               data-field='[[index]].alt'/>
                                    </div>
                                </div>
                            </td>
                            <td><button class="btn btn-danger btn-sm delBtn" data-event="oneimage.data" type="button" data-index="[[index]]">删除</button></td>
                        </tr>
                        </tbody>
                    </table>
                </li>
                [[/each]]
            </ul>
        </div>
    </div>
    <div class="rows">
        <a href="javascript:void(0);" class="set_show_time" style="font-size: 12px;">[[contentData.begin_show_time?"删除":"设置"]]展示时间</a>
    </div>
    [[if contentData.begin_show_time || contentData.begin_show_time]]
    <div class="rows show_time_input" style="margin-top: 10px;">
        <label class="control-label pull-left" style="margin-top: 10px;">展示时间:</label>
        <div class="panel-col">
            <input type="text" data-field="..begin_show_time" data-type="time" class="form-control panel-input hasDatepicker observe" readonly required placeholder="开始时间" value="[[contentData.begin_show_time]]">
        </div>
        <div class="col-sm-1" style="width: 28px;">~</div>
        <div class="panel-col">
            <input type="text" data-field="..end_show_time" data-type="time" class="form-control panel-input hasDatepicker observe" readonly required placeholder="结束时间" value="[[contentData.end_show_time]]">
        </div>
    </div>
    [[/if]]
</script>
<script type="text/template" id="set_show_time_template">
    <div class="rows show_time_input" style="margin-top: 10px;">
        <label class="control-label pull-left" style="margin-top: 10px;">展示时间:</label>
        <div class="panel-col">
            <input type="text" data-field="..begin_show_time" data-type="time" class="form-control panel-input hasDatepicker observe" readonly required placeholder="开始时间" value="">
        </div>
        <div class="col-sm-1" style="width: 28px;">~</div>
        <div class="panel-col">
            <input type="text" data-field="..end_show_time" data-type="time" class="form-control panel-input hasDatepicker observe" readonly required placeholder="结束时间" value="">
        </div>
    </div>
</script>
<!--多张小图-->
<script type="text/template" id="smallPic-template">
    [[if contentData.data.length]]
    <ul class="draggable" data-array="data">
        [[each contentData.data as item index]]
        <li>
            <table class="table table-hover table-bordered responsive dataTable no-footer">
                <tbody>
                <tr>
                    <td align="center">[[index+1]]</td>
                    <td align="center">
                        <input type="file" name="file" id="src-[[index]]" value="[[item.src]]"
                               data-field="[[index]].src" data-index="[[index]]" required/>
                    </td>
                    <td>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <select class="form-control observe" data-field="[[index]].url.action"
                                        value='[[item.url?item.url.action:""]]'>
                                    [[layout action_template]]
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-10">
                                <input class="form-control observe" placeholder="跳转地址" data-field="[[index]].url.url"
                                       value="[[item.url?item.url.url:'']]"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <input class="form-control observe" value="[[item.alt?item.alt:'']]" placeholder="图片描述"
                                       data-field='[[index]].alt'/>
                            </div>
                        </div>
                    </td>
                    <td><button class="btn btn-danger btn-sm delBtn" data-event="smallPic.data" type="button" data-index="[[index]]">删除</button></td>
                </tr>
                </tbody>
            </table>
        </li>
        [[/each]]
    </ul>
    [[/if]]
    <p><input type="button" name="select-pic" class="btn btn-info btn-xs addBtn" value="继续添加" style="margin:10px;" data-event="smallPic.data"></p>
    </ul>
</script>
<!-- 选择商品 -->
<script type="text/template" id="template_dialog_goods">
    <div class="rows">
        <div class="form-group">
            <div class="col-sm-12">
                <ul class="cover-image-list col-sm-10 imagegroup" id="goodspic">
                    [[each contentData.data as item index]]
                    <li class="cover-image-item image-list" data-index="2">
                        <div class="goods-img">
                            <a class="fileinput-button-icon" href="javascript:void(0);">
                                <img src="[[item.src]]">
                            </a>
                            <i class="remove-item-btn removepic glyphicon glyphicon-remove-circle"
                               data-index="[[index]]"></i>
                        </div>
                    </li>
                    [[/each]]
                </ul>
            </div>

        </div>
        <div class="form-group">
            <div class="col-sm-1">
                <button class="btn btn-info" type="button" id="goodsSelectBtn">选择标签</button>
            </div>
        </div>
    </div>
</script>

<script type="text/template" id="template_dialog_goodsimgs">
    [[each datas as data index]]
        <li class="cover-image-item image-list" data-index="2">
            <div class="goods-img">
                <a class="fileinput-button-icon" href="javascript:void(0);">
                    <img src="[[data.src]]">
                </a>
                <i class="remove-item-btn removepic glyphicon glyphicon-remove-circle" data-index="[[index]]"></i>
            </div>
        </li>
    [[/each]]
</script>

<!-- 推荐商品 -->
<script type="text/tempalte" id="template_dialog_remgoods">
    <div class="rows" id="groupsgoods">
       [[layout template_dialog_remgoodsgroup]]
    </div>
    <div class="rows">
     <div class="form-group">
            <div class="col-sm-1">
                <button class="btn btn-info" type="button" id="goodsaddBtn">添加组</button>
            </div>
        </div>
    </div>
</script>

<script type="text/template" id="template_dialog_remgoodsgroup">
    [[each contentData.data as items i]]
    <div class="form-group">
        <div class="col-sm-10">
            <ul class="cover-image-list col-sm-10 imagegroup" data-i="[[i]]">
                [[each items.list as item index]]
                <li class="cover-image-item image-list" data-index="2">
                    <div class="goods-img">
                        <a class="fileinput-button-icon" href="javascript:void(0);">
                            <img src="[[item.src]]">
                        </a>
                        <i class="remove-item-btn removepic glyphicon glyphicon-remove-circle"
                           data-index="[[index]]"></i>
                    </div>
                </li>
                [[/each]]
            </ul>
        </div>
        <div class="col-sm-2">
            <button class="btn btn-info goodsSelectBtn" type="button" data-index="[[i]]">选择标签</button>
        </div>
    </div>
    [[/each]]
</script>
<!-- 一个连接 -->
<script type="text/template" id="template_dialog_link">
    <div class="rows">
        <div class="form-group">
            <label class="col-sm-2 control-label">选择跳转目的地:</label>
            <div class="col-sm-8">
                <select class="form-control observe" data-field="0.url.action" value='[[contentData.data[0].url.action]]'>     
                    [[layout action_template]]
                </select>

            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">跳转地址:</label>
            <div class="col-sm-8">
                <textarea rows="2" class="form-control observe" placeholder="跳转地址" data-field="0.url.url" style="resize: none;">[[contentData.data[0].url.url]]</textarea>
            </div>
           
        </div>
    </div>
</script>

<!--添加商品/商品组--选择标签界面模板-->
<script type="text/template" id="template_dialog_goodsgird">
    <h4>1、搜索商品或标签</h4>
    <nav>
        <a class="hand select" href="javascript:void(0)" style="font-size: 14px;padding:20px;color: red">手动输入</a>
        <a class="tag" href="javascript:void(0)" style="font-size: 14px;padding:20px;color: #000000">标签筛选</a>
    </nav>
    <div class="search-con1 form-group">
        <div class="col-sm-3">
            <input type="text" id="skns" class="form-control" placeholder="输入skn,多个skn以逗号分隔">
        </div>
        <div class="col-sm-2">
            <a id="search" class="go-search btn btn-primary">搜索商品</a>
        </div>

    </div>
    <div class="search-con2 form-group" hidden="hidden">
        <div class="col-sm-3">
            <input type="text" id="tags" class="form-control" placeholder="输入关键字搜索标签">
        </div>
        <div class="col-sm-1">
            <span style="line-height: 300%;margin-left: 50px">或</span>
        </div>
         
        <div class="col-sm-3">
            <input type="text" id="skns2" class="form-control" placeholder="输入skn搜索标签">
        </div>
        <div class="col-sm-1">
            <a type="button" id="search-tag" class="go-search  btn btn-primary">搜索标签</a>
        </div>
    </div>
    <div class="tag-con" style="border: 1px solid rgb(0, 0, 0); padding: 10px; margin-top: 10px;" hidden="hidden">
        <div class="sort" style="display: none">
            [[layout tag-template]]
        </div>
        <div class="orther">
            [[layout sorts-template]]
        </div>
        <p style="margin-top:40px;">
            <a class="go-search tag-goods btn btn-primary" id="search2">搜索商品</a>
        </p>
    </div>
    <div class="goods-list form-group" style="display: none">
        <h4>2、选择商品</h4>

        <div class="form-group">
            <label class="col-sm-1" for="min-price">价格筛选:</label>

            <div class="col-sm-2">
                <input type="text" id="min-price" class="form-control">
            </div>
            <div class="col-sm-1">
                <span>---</span>
            </div>
            <div class="col-sm-2">
                <input type="text" id="max-price"  class="form-control">
            </div>
            <div class="col-sm-1">
                <a class="go-search price btn btn-primary" id="price-search">筛选</a>
            </div>
        </div>

        <div class="gird" id="goodsgird">
        </div>
    </div>
</script>
<script type="text/template" id="sorts-template">
    <div class="row" style="margin-bottom: 40px" id="tabSelect">
        <ul>
            <li class="selectRow">
                <dl>
                    <dt class="col-sm-1">颜色:</dt>
                    <dd class="form-inline col-sm-10 _show" data-index="0">
                        [[each colors as item index]]
                        [[if index < 5]]
                        <div class="form-group" >
                            <input type="checkbox"  class="changeCheck" name="colorName" data-val="[[item.colorName?item.colorName:item.name]]" value="[[item.id]]">
                            <label>[[item.colorName?item.colorName:item.name]]</label>
                        </div>
                        [[else]]
                        <div class="form-group hide" >
                            <input type="checkbox"  class="changeCheck" name="colorName" data-val="[[item.colorName?item.colorName:item.name]]" value="[[item.id]]">
                            <label>[[item.colorName?item.colorName:item.name]]</label>
                        </div>
                        [[/if]]
                        [[/each]]
                    </dd>
                    [[if colors.length>5]]
                    <dd class="col-sm-1 more" data-index="0"><a href="javasript:">更多</a></dd>
                    [[/if]]
                    <div class="clearfix"></div>
                </dl>
            </li>
        </ul>
        <ul>
            <li class="selectRow">
                <dl>
                    <dt class="col-sm-1">风格:</dt>
                    <dd class="form-inline col-sm-10 _show" data-index="0">
                        [[each styles as item index]]
                        [[if index < 5]]
                        <div class="form-group" >
                            <input type="checkbox"  class="changeCheck" name="stylename" data-val="[[item.stylename?item.stylename:item.name]]" value="[[item.id]]">
                            <label>[[item.stylename?item.stylename:item.name]]</label>
                        </div>
                        [[else]]
                        <div class="form-group hide" >
                            <input type="checkbox"  class="changeCheck" name="stylename" data-val="[[item.stylename?item.stylename:item.name]]" value="[[item.id]]">
                            <label>[[item.stylename?item.stylename:item.name]]</label>
                        </div>
                        [[/if]]
                        [[/each]]
                    </dd>
                    [[if styles.length>5]]
                    <dd class="col-sm-1 more" data-index="0"><a href="javasript:">更多</a></dd>
                    [[/if]]
                    <div class="clearfix"></div>
                </dl>
            </li>
        </ul>
        <ul>
            <li class="selectRow">
                <dl>
                    <dt class="col-sm-1">品类:</dt>
                    <dd class="form-inline col-sm-10 _show" data-index="0">
                        [[each sorts as item index]]
                        [[if index < 5]]
                        <div class="form-group" >
                            <input type="checkbox"  class="changeCheck" name="sortName" data-val="[[item.sortName?item.sortName:item.name]]" value="[[item.id]]">
                            <label>[[item.sortName?item.sortName:item.name]]</label>
                        </div>
                        [[else]]
                        <div class="form-group hide" >
                            <input type="checkbox"  class="changeCheck" name="sortName" data-val="[[item.sortName?item.sortName:item.name]]" value="[[item.id]]">
                            <label>[[item.sortName?item.sortName:item.name]]</label>
                        </div>
                        [[/if]]
                        [[/each]]
                    </dd>
                    [[if sorts.length>5]]
                    <dd class="col-sm-1 more" data-index="0"><a href="javasript:">更多</a></dd>
                    [[/if]]
                    <div class="clearfix"></div>
                </dl>
            </li>
        </ul>

        <ul>
            <li class="selectRow">
                <dl>
                    <dt class="col-sm-1">品牌</dt>
                    <dd class="form-inline col-sm-10 brandShow">
                        [[each brands1.items as item index]]
                        [[if index < 5]]
                        <div class="form-group">
                            <input type="checkbox" name="brand_name" class="changeCheck brandId_[[item.id]]" data-val="[[item.brand_name]]" value="[[item.id]]">
                            <label>[[item.brand_name]]</label>
                        </div>
                        [[/if]]
                        [[/each]]
                    </dd>
                    <dd class="col-sm-10 brandHide" style="display: none">
                        <div class="brandSearch form-group">
                            <span class="brand-all"><a>全部</a></span>
                            [[each brands as brand index]]
                            <span class="brand-index1"><a>[[brand.name]]</a></span>
                            [[/each]]
                            <span><input type="text" placeholder="搜索" id="brandsearch1"/></span>
                            <div class="clearfix"></div>
                        </div>
                        <div class="brandDetail form-inline" id="all">
                            [[each brands as item index]]
                            [[each item.items as _item _index]]
                            <div class="form-group" name="[[item.name]]">
                                <input type="checkbox" name="brand_name" class="changeCheck brandId_[[_item.id]]" data-val="[[_item.brand_name]]" value="[[_item.id]]">
                                <label>[[_item.brand_name]]</label>
                            </div>
                            [[/each]]
                            [[/each]]
                        </div>
                    </dd>
                    <dd class="col-sm-1 brandMore"><a href="javasript:">更多</a></dd>
                    <div class="clearfix"></div>
                </dl>
            </li>
        </ul>
        <ul>
            <li class="selectRow">
                <dl>
                    <dt class="col-sm-1">性别:</dt>
                    <dd class="form-inline col-sm-10 _show" data-index="0">
                        [[each genders as item index]]
                        [[if index < 5]]
                        <div class="form-group" >
                            <input type="checkbox"  class="changeCheck" name="gendername" data-val="[[item.gendername?item.gendername:item.name]]" value="[[item.id]]">
                            <label>[[item.gendername?item.gendername:item.name]]</label>
                        </div>
                        [[else]]
                        <div class="form-group hide" >
                            <input type="checkbox"  class="changeCheck" name="gendername" data-val="[[item.gendername?item.gendername:item.name]]" value="[[item.id]]">
                            <label>[[item.gendername?item.gendername:item.name]]</label>
                        </div>
                        [[/if]]
                        [[/each]]
                    </dd>
                    [[if genders.length>5]]
                    <dd class="col-sm-1 more" data-index="0"><a href="javasript:">更多</a></dd>
                    [[/if]]
                    <div class="clearfix"></div>
                </dl>
            </li>
        </ul>
    </div>
</script>
<script type="text/template" id="tag-template">
    <div class="form-group">
        <label style="width: 70px">已选标签:</label>
        [[each sorts as sort index]]
        [[each sort.list as _item _index]]
        <span class="tag1"><span>[[_item.name]]</span><a href="#" title="Removing tag" name="[[sort.tagName]]" data-field="[[_item.id]]" data-val="[[index]]" data-index='[[_index]]'>x</a></span>
        [[/each]]
        [[/each]]
    </div>
</script>

<!--LBK-->
<script type="text/template" id="blkBrand-template">
    <div class="form-group">
        <div class="col-sm-12">
            <label>标题:</label>
            <input type="text" placeholder="标题" class="observe form-control input-form" data-field="title" value="[[contentData.data.title]]" style="width:100px;">
            &emsp;
            <label>显示名称: </label>
            <input type="radio" name="is_show_name2" class="is_show_name2" value="Y" [[contentData.data.is_show_name=="Y"?"checked":""]]> 是
            <input type="radio" name="is_show_name2" class="is_show_name2" value="N" [[contentData.data.is_show_name=="N"?"checked":""]]> 否 &emsp;
            <input type="hidden" id="is_show_name2" for="radio" value="[[contentData.data.is_show_name]]" />
            <label>每行显示:</label>
            <input style="width:60px;" type="text" data-field="number" class="observe number form-control input-form" value="[[contentData.data.number]]"> 张图片
        </div>
    </div>
    <p><input type="button" name="select-pic" class="btn btn-info btn-xs addBtn" value="添加图片" style="margin:10px;" data-event="blkBrand.list"></p>
    [[if contentData.data.list.length]]
    <ul class="draggable" data-array="data.list">
        [[each contentData.data.list as item index]]
        <li>
            <table class="table table-hover table-bordered responsive dataTable no-footer">
                <tbody>
                <tr>
                    <td align="center">[[index+1]]</td>
                    <td align="center"><input type="file" name="file" value="[[item.src]]" class="observe" data-field="list.[[index]].src" required/></td>
                    <td>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <select name="goTo" class="observe form-control" value="[[item.url.action]]" data-field="list.[[index]].url.action">
                                    [[layout action_template]]
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <input type="text" placeholder="url" value="[[item.url.url]]" class="observe form-control" required="required" data-field="list.[[index]].url.url"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <input type="text" placeholder="品牌或者商品名称" value="[[item.productName]]" class="observe form-control" data-field="list.[[index]].productName"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <input type="text" placeholder="品牌或者商品描述" value="[[item.productDesc]]" class="observe form-control" data-field="list.[[index]].productDesc"/>
                            </div>
                        </div>
                    </td>
                    <td><button class="btn btn-danger btn-sm delBtn" data-event="list" type="button" data-index="[[index]]">删除</button></td>
                </tr>
                </tbody>
            </table>
        </li>
        [[/each]]
    </ul>
    [[/if]]
</script>

<!-- 9-1 标题标签 -->
<script type="text/template" id="titleFloor-template">
    <div class="rows">
        <div class="form-group ">
            <div class="col-sm-6">
                <label>标题名称</label>&emsp;&emsp;
                <input class="form-control observe input-form" placeholder="标题名称" type="text" value="[[contentData.data.title.name]]" data-field="title.name" required>
            </div>
            <div class="col-sm-6">
                <label>更多名称</label>&emsp;&emsp;
                <input class="form-control observe input-form" type="text" placeholder="更多名称" value="[[contentData.data.title.more_name]]" data-field="title.more_name">
            </div>
        </div>
        <div class="form-group ">
            <div class="col-sm-6">
                <label>跳转目的</label>&emsp;&emsp;
                <select name="goTo" class="form-control observe input-form" value="[[contentData.data.title.more_url.action]]" data-field="title.more_url.action">
                    [[layout action_template]]
                </select>
            </div>
            <div class="col-sm-6">
                <label>链接</label>&emsp;&emsp;&emsp;&emsp;
                <input value="[[contentData.data.title.more_url.url]]" class="form-control observe input-form" data-field="title.more_url.url" placeholder="url"/>
                <p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
            </div>
        </div>
    </div>
</script>