condition.html 10.4 KB
<div class="row">
    <div class="form-group" id="condition_combine">
        <form id="form_condition_combine">
        <label class="col-sm-1"> 如果下面</label>
        <div class="col-sm-14">
            
            <input type="hidden" name="type" value="condition_combine">
            <select name="aggregator" id="aggregator"  title="" class="col-sm-2" value="">                        
                <option selected="selected" value="all">全部</option>
                <option value="any">任意</option>                         
            </select>
            <label class="col-sm-1 ">条件为</label>
            &nbsp;<input type="hidden" name="operator" value="=="/>
            <select class="col-sm-2" name="value" value="">
                <option value='true'></option>
                <!--
                <option value='false'>否</option>
                -->
            </select>&nbsp;:
        </div>    
        </form>                            
    </div>    

    <div class="form-group" id="rule_condition_0_1">
        <label class="col-sm-1 control-label">第1级操作</label>
        <div class="col-sm-14">
            <button class="btn btn-primary" onclick="PromotionEditor.loadTypeSel('condition_combine', 0, 1);">新增</button>
        </div>                 
    </div>
    
</div>

<input type="hidden" id="id" value="[[id]]">                            

<div class="panel-footer">
    <button class="btn btn-primary" id="save_condition">保存</button>
</div>

<script type="text/template" id="fm_condition_operator_add">
    <label class="col-sm-1 control-label">1级操作</label>
    <div class="col-sm-14">
    <button class="btn btn-primary" id="createLevel1">新增</button>
    </div>    
</script>


<script type="text/template" id="fm_condition_type">
    <select onchange="PromotionEditor.loadOneCondition(this, [[pnodeindex]], [[curnodeIndex]]);" id="condition_type_[[pnodeindex]]_[[curnodeIndex]]">    
        <option value="">请选择一种条件</option>
        [[each typeList as item __index]]    
            <option value="[[item.name]]">[[item.caption]]</option>
        [[/each]]
    </select>
</script>

<script type="text/template" id="fm_condition_payment">
    <div class="form-group" id="rule_condition_[[nodeIndex]]_[[curnodeIndex]]" pnodeIndex="[[nodeIndex]]" nodeIndex="[[curnodeIndex]]">
        <form id="form_[[nodeIndex]]_[[curnodeIndex]]">
        <label class="col-sm-1 control-label">NO.[[curnodeIndex]]</label>
        <div class="col-sm-14">
            <input type="hidden" name="type" value="condition_payment"/>&nbsp;&nbsp;
            <label class="col-sm-1 ">支付方式</label>
                &nbsp;
            <select class="col-sm-1" name="operator" value="">
                <option value="==">等于</option>
                <option value="!=">不等于</option>
            </select>&nbsp;
            <select class="col-sm-1" name="value" value="">
                <option value="cash_online">在线支付</option>
                <option value="cash_ondelivery ">货到付款</option>
            </select>&nbsp;
            <a title="Remove"  href="javascript:void(0)" onclick="PromotionEditor.delCondition([[ nodeIndex ]],[[curnodeIndex]]);">
            删除</a>
        </div>
        </form>
    </div>
</script>

<script type="text/template" id="fm_condition_product">
    <div class="form-group" id="rule_condition_[[nodeIndex]]_[[curnodeIndex]]" pnodeIndex="[[nodeIndex]]" nodeIndex="[[curnodeIndex]]">
        <form id="form_[[nodeIndex]]_[[curnodeIndex]]">
        <label class="col-sm-1 control-label">NO.[[curnodeIndex]]</label>
        <div class="col-sm-14">
            <input type="hidden" name="type" value="condition_product"> 
            &nbsp;&nbsp;
            <label class="col-sm-2 ">如果购物车中符合下面</label>
                &nbsp;
            <select class="col-sm-1" name="aggregator" value="[[aggregator]]">
                <option value="all">全部</option>
                <option value="any">任意</option>
            </select
            >&nbsp;
            <label class="col-sm-1 ">条件的商品的</label>
            &nbsp; 
            <select class="col-sm-1" name="operatobj" value="[[operatobj]]">
                <option value="num">个数</option>
                <option value="amount">金额</option>
            </select>&nbsp; 
            <select class="col-sm-1" name="operator" value="[[operator]]">
                <option value=">" >大于</option>
                <option value=">=">大于等于</option>
                <option value="&lt;">小于</option>
                <option value="&lt;=">小于等于</option>
            </select>&nbsp; 
            <input type="text" class="col-sm-2" name="value" value='[[ value ]]'/>&nbsp; 
            <span class="col-sm-2">
                <a title="Remove" href="javascript:void(0);" onclick="PromotionEditor.delCondition([[ nodeIndex ]],[[curnodeIndex]]);">
                删除
                </a>
            </span>
        </div>
        </form>
    </div>
</script>

<script type="text/template" id="fm_condition_product_sort">
    <div class="form-group" id="rule_condition_[[nodeIndex]]_[[curnodeIndex]]" pnodeIndex="[[nodeIndex]]" nodeIndex="[[curnodeIndex]]">
        <form id="form_[[nodeIndex]]_[[curnodeIndex]]">
        <label class="col-sm-1 control-label">NO.[[nodeIndex]].[[curnodeIndex]]</label>
        <div class="col-sm-14">
            <input type="hidden" name="type" value="condition_product_sort">
            &nbsp;&nbsp;&nbsp;&nbsp;
            <label class="col-sm-1 ">产品分类</label>            
            &nbsp;
            <select class="col-sm-1" name="operator" value="[[operator]]">
                <option value="==">等于</option>
                <option value="!=">不等于</option>
            </select>
            &nbsp;
            
            <div id="sortTree_[[nodeIndex]]_[[curnodeIndex]]" class="col-sm-4 height40" style="border: 0px; padding: 0px;float:left"></div>
            &nbsp;
            <a title="Remove"  href="javascript:void(0)" onclick="PromotionEditor.delCondition([[nodeIndex]],[[ curnodeIndex ]]);">
            删除</a>
        </div>
        </form>
    </div>
</script>

<script type="text/template" id="fm_condition_product_brand">
    <div class="form-group" id="rule_condition_[[nodeIndex]]_[[curnodeIndex]]" pnodeIndex="[[nodeIndex]]" nodeIndex="[[curnodeIndex]]">
        <form id="form_[[nodeIndex]]_[[curnodeIndex]]">
        <label class="col-sm-1 control-label">NO.[[nodeIndex]].[[curnodeIndex]]</label>
        <div class="col-sm-14">

            <input type="hidden" name="type" value="condition_product_brand">
            &nbsp;&nbsp;&nbsp;&nbsp;
            <label class="col-sm-1 ">品牌</label>
            &nbsp;
            <select class="col-sm-1" name="operator" value="[[operator]]">
                <option value="==">等于</option><option value="!=">不等于</option>
                </select> &nbsp;
            <select class="col-sm-4" name="value" id="brands_[[nodeIndex]]_[[curnodeIndex]]" value="[[value]]">
            [[if brandList]]
                [[each brandList as brand __index]]
                <option value="[[  brand.id]]">[[  brand.text]]</option>
                [[/each]]
            [[/if]]
            </select> 
            &nbsp;<a title="Remove"  href="javascript:void(0)" 
            onclick="PromotionEditor.delCondition([[nodeIndex]],[[ curnodeIndex ]]);">
            删除
            </a>
        </div>
        </form>
    </div>
</script>

<script type="text/template" id="fm_condition_promotion_flag">
    <div class="form-group" id="rule_condition_[[nodeIndex]]_[[curnodeIndex]]" pnodeIndex="[[nodeIndex]]" nodeIndex="[[curnodeIndex]]">
        <form id="form_[[nodeIndex]]_[[curnodeIndex]]">
        <label class="col-sm-1 control-label">NO.[[nodeIndex]].[[curnodeIndex]]</label>
        <div class="col-sm-14">
            <input type="hidden" name="type" value="condition_promotion_flag">
            &nbsp;&nbsp;&nbsp;&nbsp;
            <label class="col-sm-1 ">促销标记</label>
            &nbsp;
            <select class="col-sm-1" name="operator" value="[[operator]]">
                <option value="==">等于</option><option value="!=">不等于</option>
            </select>
            &nbsp;
            <select class="col-sm-4" name="value" value="[[value]]" id="promotions_[[nodeIndex]]_[[curnodeIndex]]"> 
                [[if promotionFlagList]]   
                    [[each promotionFlagList as flag __index]]
                    <option value="[[ flag.flagValue]]">[[flag.title]]</option>
                    [[/each]]
                [[/if]]
            </select>
            &nbsp;
            <a title="Remove"  href="javascript:void(0)" onclick="PromotionEditor.delCondition([[nodeIndex]],[[ curnodeIndex ]]);">
                删除
            </a>
        </div>
        </form>
    </div>
</script>

<script type="text/template" id="fm_condition_special_product">
    <div class="form-group" id="rule_condition_[[nodeIndex]]_[[curnodeIndex]]" pnodeIndex="[[nodeIndex]]" nodeIndex="[[curnodeIndex]]">
        <form id="form_[[nodeIndex]]_[[curnodeIndex]]">
        <label class="col-sm-1 control-label">NO.[[nodeIndex]].[[curnodeIndex]]</label>
        <div class="col-sm-14">
            <input type="hidden" name="type" value="condition_special_product">
            &nbsp;&nbsp;&nbsp;&nbsp;
            <label class="col-sm-1 ">特定商品</label>
            &nbsp;
            <select class="col-sm-1" name="operator" value="[[operator]]">
                <option value="!()">不属于</option><option value="()">属于</option><option value="==">等于</option>
                <option value="!=">不等于</option>
            </select>
            &nbsp;
            <textarea rows="" cols="" style="width: 320px; height: 70px;" name="value"></textarea>
            &nbsp;
            <a title="Remove"  href="javascript:void(0)" onclick="PromotionEditor.delCondition([[nodeIndex]],[[ curnodeIndex ]]);">
                删除
            </a>
        </div>
        </form>
    </div>
</script>

<script type="text/template" id="fm_add_level_1">
    <div class="form-group" id="rule_condition_0_[[nextIndex]]">
        <label class="col-sm-1 control-label">1级操作</label>
        <div class="col-sm-14">
            <button class="btn btn-primary" onclick="PromotionEditor.loadTypeSel('condition_combine', 0, [[nextIndex]]);">新增</button>
        </div>    
    </div>    
</script>