add.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .laydate-time-list{padding-bottom:0;overflow:hidden}
  5. .laydate-time-list>li{width:50%!important;}
  6. .laydate-time-list>li:last-child { display: none;}
  7. .laydate-time-list ol>li:last-child{margin-bottom:.26rem;}
  8. .rr{
  9. /*padding-right: 10px;*/
  10. }
  11. </style>
  12. <div class="row">
  13. <div class="col-sm-12">
  14. <div class="ibox float-e-margins">
  15. <div class="ibox-content">
  16. <form method="post" action="{:url('add')}" class="form-horizontal">
  17. <input type="hidden" name="id" value="{$info['id']|default='0'}">
  18. <input type="hidden" name="cate" value="0">
  19. <div class="col-sm-6">
  20. <div class="form-group">
  21. <label class="control-label">食品名<span class="text-danger">*</span></label></br>
  22. <input type="text" class="form-control" name="name" value="{$info.name|default=''}">
  23. </div>
  24. </div>
  25. <div class="col-sm-6">
  26. <div class="form-group">
  27. <label class="control-label">价格<span class="text-danger">*</span></label></br>
  28. <input type="text" class="form-control" name="money" value="{$info.money|default=''}">
  29. </div>
  30. </div>
  31. <div class="col-sm-6">
  32. <div class="form-group">
  33. <label class="control-label">(预售)可以售卖的开始时间<span class="text-danger">*</span></label></br>
  34. <div class="rr">
  35. <input type="text" readonly placeholder="请选择" class="form-control" id="start_time" name="start_time" value="{$info.start_time|default=''}">
  36. </div>
  37. </div>
  38. </div>
  39. <div class="col-sm-6">
  40. <div class="form-group">
  41. <label class="control-label">(预售)可以售卖的结束时间<span class="text-danger">*</span></label></br>
  42. <input type="text" readonly placeholder="请选择" class="form-control" id="end_time" name="end_time" value="{$info.end_time|default=''}">
  43. </div>
  44. </div>
  45. <div class="col-sm-6">
  46. <div class="form-group">
  47. <label class="control-label">(当日)可以售卖的开始时间<span class="text-danger">*</span></label></br>
  48. <div class="rr">
  49. <input type="text" readonly placeholder="请选择" class="form-control" id="today_start_time" name="today_start_time" value="{$info.today_start_time|default=''}">
  50. </div>
  51. </div>
  52. </div>
  53. <div class="col-sm-6">
  54. <div class="form-group">
  55. <label class="control-label">(当日)可以售卖的结束时间<span class="text-danger">*</span></label></br>
  56. <input type="text" readonly placeholder="请选择" class="form-control" id="today_end_time" name="today_end_time" value="{$info.today_end_time|default=''}">
  57. </div>
  58. </div>
  59. <div class="col-sm-6">
  60. <div class="form-group">
  61. <label class="control-label">分类<span class="text-danger">*</span></label></br>
  62. <select name="dinner_type_id" class="form-control">
  63. <option value="">选择分类</option>
  64. {foreach $typeList as $k=>$v}
  65. <option value="{$v.id}">{$v.name}</option>
  66. {/foreach}
  67. </select>
  68. </div>
  69. </div>
  70. <div class="col-sm-6">
  71. <div class="form-group">
  72. <label class="control-label">特殊人群是否免费<span class="text-danger">*</span></label></br>
  73. <select name="free" class="form-control">
  74. <option value="0">否</option>
  75. <option value="1">是</option>
  76. </select>
  77. </div>
  78. </div>
  79. <div class="col-sm-6">
  80. <div class="form-group">
  81. <label class="control-label">特殊人群折扣(0-1之间的数)<span class="text-danger">*</span></label></br>
  82. <input type="text" class="form-control" name="discount" value="{$info.discount|default='1'}">
  83. </div>
  84. </div>
  85. <div class="col-sm-6">
  86. <div class="form-group">
  87. <label class="control-label">排序(正序)<span class="text-danger">*</span></label></br>
  88. <input type="text" class="form-control" name="sort" value="{$info.sort|default='0'}">
  89. </div>
  90. </div>
  91. <div class="col-sm-12">
  92. <div class="form-group">
  93. <label class="control-label">图片<span class="text-danger">*</span></label>
  94. {:widget_view('common/upimg',['name'=>'imgs','multi'=>10,'val'=>isset($info)?$info['imgs']:''])}
  95. </div>
  96. </div>
  97. <div class="col-sm-12">
  98. <div class="form-group">
  99. <label class="control-label">描述</label></br>
  100. <textarea name="content" class="form-control" cols="30" rows="3" >{$info.content|default=''}</textarea>
  101. </div>
  102. </div>
  103. <div class="col-sm-12">
  104. <div class="hr-line-dashed">
  105. </div>
  106. </div>
  107. <div class="form-group">
  108. <div class="col-sm-6 col-sm-offset-2">
  109. <button class="btn btn-primary ajax-post" data-layer="1" target-form="form-horizontal" type="submit">确 定</button>
  110. </div>
  111. </div>
  112. </form>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. {/block}
  118. {block name="script"}
  119. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  120. <script>
  121. $(function () {
  122. laydate.render({
  123. elem: '#start_time'
  124. ,type: 'time',
  125. trigger: 'click' ,
  126. format:'HH:mm',
  127. });
  128. laydate.render({
  129. elem: '#end_time'
  130. ,type: 'time',
  131. trigger: 'click' ,
  132. format:'HH:mm',
  133. });
  134. laydate.render({
  135. elem: '#today_start_time'
  136. ,type: 'time',
  137. trigger: 'click' ,
  138. format:'HH:mm',
  139. });
  140. laydate.render({
  141. elem: '#today_end_time'
  142. ,type: 'time',
  143. trigger: 'click' ,
  144. format:'HH:mm',
  145. });
  146. })
  147. $(document).ready(function(){
  148. formSetValue("enable", {$info.enable|default=1});
  149. formSetValue("free", {$info.free|default=0});
  150. formSetValue("dinner_type_id", {$info.dinner_type_id|default=''});
  151. });
  152. </script>
  153. {/block}