edit.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <div class="titlebar"><i class="iconfont icon-xiugaidenglumima"></i>优惠券权限</div>
  2. <form id="form" action="{:url('coupon/edit',['page' => $page])}">
  3. <input type="hidden" name="id" value="{$info.id}"/>
  4. <input type="hidden" name="img" value="{$info.img}" id="picture" />
  5. <table class="formtable">
  6. <tr><th>使用规则:</th><td>
  7. <label>每天:</label><input class="input w90" datatype="n" type="text" name="daynum" value="{$info.daynum}" /> 次
  8. <label>间隔:</label><input class="input w90" datatype="n" type="text" name="longtime" value="{$info.longtime}" /> 分
  9. <label>生效:</label>
  10. <select class="select w110" datatype="*" name="ontypes" class="select">
  11. <option value="0" {if $info.ontypes == 0}selected{/if}>立即生效</option>
  12. <option value="1" {if $info.ontypes == 1}selected{/if}>隔天生效</option>
  13. </select>
  14. </td></tr>
  15. <tr><th>使用时间:</th><td>
  16. <input class="input ui-date w120" datatype="date" type="text" name="starttime" value="{if !empty($info.starttime)}{$info.starttime|date='Y-m-d'}{/if}" />
  17. <input class="input ui-date w120" datatype="date" type="text" name="endtime" value="{if !empty($info.starttime)}{$info.endtime|date='Y-m-d'}{/if}" />
  18. </td></tr>
  19. <tr><th>周几可用:</th><td>
  20. <span class="badge bg-blue"><input type="checkbox" value="0" name="weekday[]"{if $info.weekday && in_array(0,$info.weekday)} checked{/if}> 星期日</span>
  21. <span class="badge bg-blue"><input type="checkbox" value="1" name="weekday[]"{if $info.weekday && in_array(1,$info.weekday)} checked{/if}> 星期一</span>
  22. <span class="badge bg-blue"><input type="checkbox" value="2" name="weekday[]"{if $info.weekday && in_array(2,$info.weekday)} checked{/if}> 星期二</span>
  23. <span class="badge bg-blue"><input type="checkbox" value="3" name="weekday[]"{if $info.weekday && in_array(3,$info.weekday)} checked{/if}> 星期三</span>
  24. <span class="badge bg-blue"><input type="checkbox" value="4" name="weekday[]"{if $info.weekday && in_array(4,$info.weekday)} checked{/if}> 星期四</span>
  25. <span class="badge bg-blue"><input type="checkbox" value="5" name="weekday[]"{if $info.weekday && in_array(5,$info.weekday)} checked{/if}> 星期五</span>
  26. <span class="badge bg-blue"><input type="checkbox" value="6" name="weekday[]"{if $info.weekday && in_array(6,$info.weekday)} checked{/if}> 星期六</span>
  27. </td></tr>
  28. <tr><th>优惠券价格:</th><td>
  29. <label>买单:</label><input class="input w110" datatype="npot" type="text" name="pay_price" value="{$info.pay_price}" />
  30. <label>购买:</label><input class="input w110" datatype="npot" type="text" name="shop_price" value="{$info.shop_price}" />
  31. </td></tr>
  32. </table>
  33. <div class="titlebar"><i class="iconfont icon-text_icon"></i>优惠券信息</div>
  34. <table class="formtable">
  35. {if empty($info)}
  36. <th>商家:</th>
  37. <td>
  38. <input id="store_id" class="readonly input w100" type="text" name="store_id" value="0" />
  39. <button url="{:url('allwin/store/selectStore',['input' => 'uid'])}" type="button" class="selectid button"><i class="iconfont icon-my_icon"></i>选择店铺</button>
  40. </td>
  41. {/if}
  42. <tr><th>优惠券主题:</th><td>
  43. <select class="select w200" datatype="*" name="theme" class="select">
  44. <option value="blue" {if $info.theme == 'blue'}selected{/if}>石板蓝</option>
  45. <option value="red" {if $info.theme == 'red'}selected{/if}>永固红</option>
  46. <option value="green" {if $info.theme == 'green'}selected{/if}>青草绿</option>
  47. <option value="purple" {if $info.theme == 'green'}selected{/if}>青草绿</option>
  48. <option value="yellow" {if $info.theme == 'yellow'}selected{/if}>晨曦黄</option>
  49. <option value="gray" {if $info.theme == 'gray'}selected{/if}>石板灰</option>
  50. </select>
  51. </td></tr>
  52. <tr><th>优惠券类型:</th><td>
  53. <select id="types" class="select w200" datatype="*" name="types" class="select">
  54. <option value="0" {if $info.types == 0}selected{/if}>抵扣优惠券</option>
  55. <option value="1" {if $info.types == 1}selected{/if}>折扣优惠券</option>
  56. </select>
  57. </td></tr>
  58. <tr><th>优惠券名称:</th><td><input class="input w400" datatype="*" type="text" name="name" value="{$info.name}" /></td></tr>
  59. <tr><th>规则描述:</th><td><input class="input w300" datatype="*" type="text" name="tips" value="{$info.tips}" /></td></tr>
  60. <tr><th>初始发行量:</th><td><input class="input" datatype="n" type="text" name="num_of" value="{$info.num_of}" /> <span class="gray">仅用于剩余发行量百分比计算</span></td></tr>
  61. <tr><th>剩余发现量:</th><td><input class="input" datatype="n" type="text" name="num" value="{$info.num}" /> <span class="gray">库存基数值,剩余比例 </span><span class="fn-fb red percentage">0%</span></td></tr>
  62. <tr><th>额度大小(¥):</th><td><input class="input" datatype="npot" type="text" name="size" value="{$info.size}" /></td></tr>
  63. <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>
  64. <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>
  65. <tr><th>满多少可用(¥):</th><td><input class="input" datatype="npot" type="text" name="howmuch" value="{$info.howmuch}" /></td></tr>
  66. <tr><th>图片样式</th><td><div url="{:url('system/passport.common/upload')}" class="selectid fn-cp img-review">{if $info.img}<img src="{$info.img}">{else /}<img src="__PUBLIC__/admin/review.png">{/if}</div></td></tr>
  67. <tr>
  68. <th></th>
  69. <td>
  70. <input type="submit" value="确定" class="button button-blue submit" />
  71. <input type="reset" value="重置" class="button button-blank"/>
  72. </td>
  73. </tr>
  74. </table>
  75. </div>
  76. </form>
  77. <script type="text/javascript">
  78. Do('base','layer','form','date', function () {
  79. $('#form').isForm();
  80. var num_of = parseInt($("input[name='num_of']").val()),num = parseInt($("input[name='num']").val());
  81. var percentage = parseInt(num/num_of*100);
  82. if(!isNaN(percentage)){ $(".percentage").text(percentage+'%')}
  83. $(".selectid").win();
  84. $("#types").change(function(){
  85. var type = $(this).val();
  86. if(type == 0){
  87. $('.discount').hide();
  88. $('.price').show();
  89. }else{
  90. $('.discount').show();
  91. $('.price').hide();
  92. }
  93. });
  94. })
  95. //添加图片
  96. function setImg(show_src){
  97. $("#picture").val(show_src);
  98. $(".img-review").html('<img src="'+show_src+'">');
  99. }
  100. function setState(store){
  101. $('#store_id').val(store.id);
  102. }
  103. </script>