add.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox float-e-margins">
  6. <div class="ibox-title">
  7. <h5>{$meta_title}</h5>
  8. <div class="ibox-tools">
  9. <a class="toback" href="{:url('index')}">
  10. 返回上一页
  11. </a>
  12. </div>
  13. </div>
  14. <div class="ibox-content">
  15. <form method="post" action="{:url('add')}" class="form-horizontal">
  16. <input type="hidden" name="id" value="{$info['id']|default='0'}">
  17. <div class="form-group">
  18. <label class="col-sm-2 control-label">商品名称<span class="text-danger">*</span></label>
  19. <div class="col-sm-6">
  20. <input type="text" class="form-control" name="title" value="{$info.title|default=''}">
  21. </div>
  22. </div>
  23. <div class="form-group">
  24. <label class="col-sm-2 control-label">商品价格<span class="text-danger">*</span></label>
  25. <div class="col-sm-6">
  26. <input type="number" class="form-control" name="price" value="{$info.price|default=''}">
  27. </div>
  28. </div>
  29. <div class="form-group">
  30. <label class="col-sm-2 control-label">库存<span class="text-danger">*</span></label>
  31. <div class="col-sm-6">
  32. <input type="number" class="form-control" name="stock" value="{$info.stock|default='0'}">
  33. </div>
  34. </div>
  35. <div class="form-group">
  36. <label class="col-sm-2 control-label">商品分类<span class="text-danger">*</span></label>
  37. <div class="col-sm-6">
  38. <select name="cate_id" class="form-control">
  39. <option value="0">选择商品分类</option>
  40. {volist name='goods_cate' id='v'}
  41. <option value="{$v.cate_id|default=''}">{$v['title']}</option>
  42. {/volist}
  43. </select>
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="col-sm-2 control-label">商品图片<span class="text-danger">*</span></label>
  48. <div class="col-sm-6">
  49. {:widget_view('common/upimg',['name'=>'img','multi'=>0,'val'=>isset($info)?$info['img']:''])}
  50. </div>
  51. </div>
  52. <div class="form-group">
  53. <label class="col-sm-2 control-label">宣传图<span class="text-danger">*</span></label>
  54. <div class="col-sm-6">
  55. {:widget_view('common/upimg',['name'=>'imgs','multi'=>1,'val'=>isset($info)?$info['imgs']:''])}
  56. </div>
  57. </div>
  58. <div class="form-group">
  59. <label class="col-sm-2 control-label">排序</label>
  60. <div class="col-sm-6">
  61. <input type="number" class="form-control" name="sort" value="{$info.sort|default='0'}">
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. <label class="col-sm-2 control-label">状态</label>
  66. <div class="col-sm-6">
  67. <label class="cr-inline">
  68. <input type="radio" value="1" name="enable">正常&nbsp;&nbsp;
  69. </label>
  70. <label class="cr-inline">
  71. <input type="radio" value="0" name="enable">禁用
  72. </label>
  73. </div>
  74. </div>
  75. <div class="form-group">
  76. <label class="col-sm-2 control-label">是否特价商品</label>
  77. <div class="col-sm-6">
  78. <label class="cr-inline">
  79. <input type="radio" value="0" name="type">否&nbsp;&nbsp;
  80. </label>
  81. <label class="cr-inline">
  82. <input type="radio" value="1" name="type">是
  83. </label>
  84. </div>
  85. </div>
  86. <div class="form-group">
  87. <label class="col-sm-2 control-label">限时特价价格</label>
  88. <div class="col-sm-6">
  89. <input type="number" class="form-control" name="sale_price" value="{$info.sale_price|default=''}">
  90. </div>
  91. </div>
  92. <div class="form-group">
  93. <label class="col-sm-2 control-label">详情<span class="text-danger">*</span></label>
  94. <div class="col-sm-6">
  95. {:widget_view('common/ueditor',['name'=>'content','height'=>300,'val'=>isset($info)?$info['content']:''])}
  96. </div>
  97. </div>
  98. <div class="hr-line-dashed"></div>
  99. <div class="form-group">
  100. <div class="col-sm-6 col-sm-offset-2">
  101. <button class="btn btn-primary ajax-post" target-form="form-horizontal" type="submit">确 定</button>
  102. <a href="{:url('index')}" class="btn btn-default">取 消</a>
  103. </div>
  104. </div>
  105. </form>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. {/block}
  111. {block name="script"}
  112. <script>
  113. $(document).ready(function(){
  114. formSetValue("enable", {$info.enable|default=1});
  115. });
  116. $(document).ready(function(){
  117. formSetValue("cate_id", {$info.cate_id|default=0});
  118. });
  119. $(document).ready(function(){
  120. formSetValue("type", {$info.type|default=0});
  121. });
  122. </script>
  123. {/block}