人人商城

recharge.html 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. {template '_header'}
  2. <div class='page-heading'><h2>充值优惠设置</h2></div>
  3. <form id="dataform" {ifp 'sale.recharge'}action="" method="post"{/if} class="form-horizontal form-validate">
  4. <div class="form-group">
  5. <div class="col-sm-12">
  6. <div class='recharge-items'>
  7. {loop $recharges $item}
  8. <div class="input-group recharge-item" style="margin-top:5px">
  9. <span class="input-group-addon">满</span>
  10. <input type="text" class="form-control" name='enough[]' value='{$item['enough']}' />
  11. <span class="input-group-addon">赠送</span>
  12. <input type="text" class="form-control" name='give[]' value='{$item['give']}' />
  13. <span class="input-group-addon">元</span>
  14. <div class='input-group-btn'>
  15. <button class='btn btn-danger' type='button' onclick="removeRechargeItem(this)"><i class='fa fa-remove'></i></button>
  16. </div>
  17. </div>
  18. {/loop}
  19. </div>
  20. <div style="margin-top:5px">
  21. <button type='button' class="btn btn-default" onclick='addRechargeItem()' style="margin-bottom:5px"><i class='fa fa-plus'></i> 增加优惠项</button>
  22. </div>
  23. <span class="help-block">两项都填写才能生效,赠送的余额可以固定数或比例(带%)号</span>
  24. <span class="help-block">例如:充值满100,赠送10</span>
  25. <span class="help-block">例如:充值满200,赠送15%,实际赠送30(200*15%)</span>
  26. </div>
  27. </div>
  28. {ifp 'sale.recharge'}
  29. <div class="form-group"></div>
  30. <div class="form-group">
  31. <div class="col-sm-9 col-xs-12">
  32. <input type="submit" value="保存设置" class="btn btn-primary"/>
  33. </div>
  34. </div>
  35. {/if}
  36. </div>
  37. </form>
  38. <script language='javascript'>
  39. function addRechargeItem(){
  40. var html= '<div class="input-group recharge-item" style="margin-top:5px">';
  41. html+='<span class="input-group-addon">满</span>';
  42. html+='<input type="text" class="form-control" name="enough[]" />';
  43. html+='<span class="input-group-addon">赠送</span>';
  44. html+='<input type="text" class="form-control" name="give[]" />';
  45. html+='<span class="input-group-addon">元</span>';
  46. html+='<div class="input-group-btn"><button type="button" class="btn btn-danger" onclick="removeRechargeItem(this)"><i class="fa fa-remove"></i></button></div>';
  47. html+='</div>';
  48. $('.recharge-items').append(html);
  49. }
  50. function removeRechargeItem(obj){
  51. $(obj).closest('.recharge-item').remove();
  52. }
  53. </script>
  54. {template '_footer'}