edit.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <form id="form" action="{:url('coupon/edit')}">
  2. <input type="hidden" name="id" value="{$info.id}"/>
  3. <div class="titlebar"><i class="iconfont icon-text_icon"></i>优惠券信息</div>
  4. <table class="formtable">
  5. {if empty($info)}
  6. <th>商家:</th>
  7. <td>
  8. <input id="store_id" class="readonly input w100" type="text" name="store_id" value="0" />
  9. <button url="{:url('smartbc/store/selectStore',['input' => 'uid'])}" type="button" class="selectid button"><i class="iconfont icon-my_icon"></i>选择店铺</button>
  10. </td>
  11. {/if}
  12. <tr><th>优惠券类型:</th><td>
  13. <select id="types" class="select w200" datatype="*" name="types" class="select">
  14. <option value="0" {if $info.types == 0}selected{/if}>代金券</option>
  15. <option value="1" {if $info.types == 1}selected{/if}>折扣券</option>
  16. </select>
  17. </td></tr>
  18. <tr><th>优惠券名称:</th><td><input class="input w400" datatype="*" type="text" name="name" value="{$info.name}" /></td></tr>
  19. <tr><th>规则描述:</th><td><input class="input w300" datatype="*" type="text" name="tips" value="{$info.tips}" /></td></tr>
  20. <tr class="discount{$info.types == 0 ?' fn-hide':''}"><th>单次折扣:</th><td><input class="input" datatype="npot" type="text" name="discount" value="{$info.discount}" /> 折</td></tr>
  21. <tr class="price{$info.types == 1 ?' fn-hide':''}"><th>单次减免(¥):</th><td><input class="input" datatype="npot" type="text" name="price" value="{$info.price}" /> 元</td></tr>
  22. <tr><th>满多少可用(¥):</th><td><input class="input" datatype="npot" type="text" name="howmuch" value="{$info.howmuch}" /></td></tr>
  23. <tr>
  24. <th></th>
  25. <td>
  26. <input type="submit" value="确定" class="button button-blue submit" />
  27. <input type="reset" value="重置" class="button"/>
  28. </td>
  29. </tr>
  30. </table>
  31. </div>
  32. </form>
  33. <script type="text/javascript">
  34. Do('base','layer','form','date', function () {
  35. $('#form').isForm();
  36. $(".selectid").win();
  37. $("#types").change(function(){
  38. var type = $(this).val();
  39. if(type == 0){
  40. $('.discount').hide();
  41. $('.price').show();
  42. }else{
  43. $('.discount').show();
  44. $('.price').hide();
  45. }
  46. });
  47. })
  48. function setState(store){
  49. $('#store_id').val(store.id);
  50. }
  51. </script>