edit.html 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <form id="form" action="{:url('coupon.index/edit')}">
  2. <input type="hidden" name="id" value="{$info.id}"/>
  3. <div class="titlebar"><i class="iconfont icon-text_icon"></i>优惠券信息</div>
  4. <div class="tipbox tipbox-error mb5">
  5. <p>1、代金券是一次性减免多少钱。</p>
  6. <p>2、折扣券是一次性再满多少的基础上打折。</p>
  7. <p>3、兑换券不减免金额仅在满多少的基础上,可使用多少次。</p>
  8. </div>
  9. <table class="formtable">
  10. {if empty($info)}
  11. <th>商家:</th>
  12. <td>
  13. <input id="store_id" class="readonly input w100" type="text" name="store_id" value="0" />
  14. <button url="{:url('store.index/selectStore',['input' => 'uid'])}" type="button" class="selectid button"><i class="iconfont icon-my_icon"></i>选择店铺</button>
  15. </td>
  16. {/if}
  17. <tr><th>优惠券类型:</th><td>
  18. <select id="types" class="select w200" datatype="*" name="types" class="select">
  19. <option value="0" {if $info.types == 0}selected{/if}>代金券</option>
  20. <option value="1" {if $info.types == 1}selected{/if}>折扣券</option>
  21. <option value="2" {if $info.types == 2}selected{/if}>兑换券</option>
  22. </select>
  23. </td></tr>
  24. <tr><th>优惠券名称:</th><td><input class="input" datatype="*" type="text" name="name" value="{$info.name}" /></td></tr>
  25. <tr><th>规则描述:</th><td><input class="input w300" datatype="*" type="text" name="tips" value="{$info.tips}" /></td></tr>
  26. <tr><th>发行数量:</th><td><input class="input" datatype="n" type="text" name="num" value="{$info.num}" /></td></tr>
  27. <tr class="types1 {$info.types == 0 ?'':'fn-hide'}"><th>减免金额:</th><td><input class="input" datatype="n" type="text" name="price" value="{$info.price}" /></td></tr>
  28. <tr class="types2 {$info.types == 1 ?'':'fn-hide'}"><th>单次折扣:</th><td><input class="input" datatype="npot" type="text" name="discount" value="{$info.discount}" /> <span class="gray">折</span></td></tr>
  29. <tr class="types3 {$info.types == 2 ?'':'fn-hide'}"><th>兑换次数:</th><td><input class="input" datatype="n" type="text" name="amount" value="{$info.amount}" /> <span class="gray">次</span></td></tr>
  30. <tr><th>满多少可用(¥):</th><td><input class="input" datatype="npot" type="text" name="howmuch" value="{$info.howmuch}" /></td></tr>
  31. <tr>
  32. <th></th>
  33. <td>
  34. <input type="submit" value="确定" class="button button-blue submit" />
  35. <input type="reset" value="重置" class="button"/>
  36. </td>
  37. </tr>
  38. </table>
  39. </div>
  40. </form>
  41. <script type="text/javascript">
  42. Do('base','layer','form','date', function () {
  43. $('#form').isForm();
  44. $(".selectid").win();
  45. $("#types").change(function(){
  46. switch (parseInt($(this).val())){
  47. case 1:
  48. $('.types1').hide();$('.types2').show();$('.types3').hide();
  49. break;
  50. case 2:
  51. $('.types1').hide();$('.types2').hide();$('.types3').show();
  52. break;
  53. default:
  54. $('.types1').show();$('.types2').hide();$('.types3').hide();
  55. break;
  56. }
  57. });
  58. })
  59. function setState(store){
  60. $('#store_id').val(store.id);
  61. }
  62. </script>