123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- {template '_header'}
- <div class='page-heading'><h2>满额立减设置</h2></div>
-
- <form id="dataform" {ifp 'sale.enough'}action="" method="post"{/if} class="form-horizontal form-validate">
-
-
- <div class="form-group">
-
- <div class="col-sm-12">
- {ifp 'sale.enough'}
- <div class='input-group'>
- <span class="input-group-addon">单笔订单满</span>
- <input type="text" name="data[enoughmoney]" value="{$data['enoughmoney']}" class="form-control" />
- <span class='input-group-addon'>元 立减</span>
- <input type="text" name="data[enoughdeduct]" value="{$data['enoughdeduct']}" class="form-control" />
- <span class='input-group-addon'>元</span>
- <div class="input-group-btn"><button type='button' class="btn btn-default" ><i class="fa fa-minus"></i></button></div>
- </div>
- {else}
- <div class='form-control-static'>{if empty($data['enoughmoney'])}全场包邮{else}订单金额满{$data['enoughmoney']}元包邮{/if}</div>
- {/if}
- </div>
- </div>
- <div class="form-group">
-
- <div class="col-sm-12">
- <div class='recharge-items'>
-
- {loop $data['enoughs'] $item}
-
- <div class="input-group recharge-item" style="margin-top:5px">
- <span class="input-group-addon">单笔订单满</span>
- <input type="text" class="form-control" name='enough[]' value='{$item['enough']}' />
- <span class="input-group-addon">元 立减</span>
- <input type="text" class="form-control" name='give[]' value='{$item['give']}' />
- <span class="input-group-addon">元</span>
- <div class='input-group-btn'>
- <button class='btn btn-danger' type='button' onclick="removeConsumeItem(this)"><i class='fa fa-remove'></i></button>
- </div>
-
- </div>
- {/loop}
- </div>
-
- <div style="margin-top:5px">
- <button type='button' class="btn btn-default" onclick='addConsumeItem()' style="margin-bottom:5px"><i class='fa fa-plus'></i> 增加优惠项</button>
- </div>
- <span class="help-block">两项都填写才能生效</span>
-
-
-
-
- </div>
- </div>
-
- {ifp 'sale.enough'}
- <div class="form-group"></div>
- <div class="form-group">
-
- <div class="col-sm-9 col-xs-12">
- <input type="submit" value="保存设置" class="btn btn-primary"/>
-
- </div>
- </div>
- {/if}
-
-
- </form>
-
- <script language='javascript'>
-
- $(function () {
- $(":checkbox[name='data[enoughfree]']").click(function () {
- if ($(this).prop('checked')) {
- $("#enoughfree").show();
- }
- else {
- $("#enoughfree").hide();
- }
- })
-
-
- })
-
-
- function addConsumeItem(){
- var html= '<div class="input-group recharge-item" style="margin-top:5px">';
- html+='<span class="input-group-addon">单笔订单满</span>';
- html+='<input type="text" class="form-control" name="enough[]" />';
- html+='<span class="input-group-addon">元 立减</span>';
- html+='<input type="text" class="form-control" name="give[]" />';
- html+='<span class="input-group-addon">元</span>';
- html+='<div class="input-group-btn"><button class="btn btn-danger" onclick="removeConsumeItem(this)"><i class="fa fa-remove"></i></button></div>';
- html+='</div>';
- $('.recharge-items').append(html);
- }
- function removeConsumeItem(obj){
- $(obj).closest('.recharge-item').remove();
- }
- </script>
- {template '_footer'}
-
|