form.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. {extend name='admin@main'}
  2. {block name="content"}
  3. <form onsubmit="return false;" id="GoodsForm" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
  4. <div class="layui-card-body think-box-shadow padding-left-40">
  5. <div class="layui-form-item">
  6. <span class="color-green label-required-prev">藏品图片</span>
  7. <table class="layui-table">
  8. <thead>
  9. <tr>
  10. <td width="90px" class="text-left"><input name="cover" lay-verify="required" type="hidden" value="{$vo.covers|default=''}"></td>
  11. </tr>
  12. </thead>
  13. </table>
  14. <script>$('[name="cover"]').uploadOneImage(), $('[name="covers"]').uploadMultipleImage()</script>
  15. </div>
  16. <div class="layui-form-item">
  17. <span class="color-green label-required-prev">详情图片、视频、glb</span>
  18. <label class="layui-col-xs12 relative">
  19. <label class="layui-col-xs8 think-form-group-left">
  20. <input name="detail_img" value='{$vo.detail_img|default=""}' readonly placeholder="请上传" class="layui-input">
  21. </label>
  22. <a class="layui-col-xs2 layui-btn think-form-group-right" data-file="btn" data-field="detail_img" >
  23. <i class="layui-icon layui-icon-upload"></i> 上传
  24. </a>
  25. </label>
  26. </div>
  27. <!--
  28. <div class="layui-form-item layui-row layui-col-space15" style="display: none">
  29. <label class="layui-col-xs3 relative">
  30. <span class="color-green">发行方式</span>
  31. <select class="layui-select" required name="issue_mode" id="issue_mode" lay-filter="issue_mode" lay-search>
  32. <option value="1" {if isset($vo.issue_mode) && $vo.issue_mode eq 1}selected{/if}>普通发行</option>
  33. <option value="2" {if isset($vo.issue_mode) && $vo.issue_mode eq 2}selected{/if}>抽签发行</option>
  34. </select>
  35. </label>
  36. <label class="layui-col-xs3 relative apply_time" {if !isset($vo.issue_mode) || (isset($vo.issue_mode) && $vo.issue_mode eq 1)}style="display: none"{/if}>
  37. <span class="color-green">报名开始时间</span>
  38. <input name="apply_st" id="apply_st" value='{$vo.apply_st|default=""}' placeholder="" class="layui-input">
  39. </label>
  40. <label class="layui-col-xs3 relative apply_time" {if !isset($vo.issue_mode) || (isset($vo.issue_mode) && $vo.issue_mode eq 1)}style="display: none"{/if}>
  41. <span class="color-green">中签人数</span>
  42. <input name="draw_num" value='{$vo.draw_num|default=""}' placeholder="" class="layui-input">
  43. </label>
  44. </div>-->
  45. <div class="layui-form-item layui-row layui-col-space15">
  46. <label class="layui-col-xs3 relative">
  47. <span class="color-green">藏品名称</span>
  48. <input name="name" required class="layui-input" placeholder="请输入藏品名称" value="{$vo.name|default=''}">
  49. </label>
  50. <label class="layui-col-xs3 relative">
  51. <span class="color-green">藏品标签</span>
  52. <input name="label" required class="layui-input" placeholder="请输入藏品标签" value="{$vo.label|default=''}">
  53. </label>
  54. <label class="layui-col-xs3 relative">
  55. <span class="color-green">藏品库存</span>
  56. <input name="inventory" required type="number" class="layui-input" placeholder="请输入库存" value="{$vo.inventory|default='1'}">
  57. </label>
  58. <label class="layui-col-xs3 relative">
  59. <span class="color-green">藏品价格</span>
  60. <input name="price" required type="number" step="1" class="layui-input" placeholder="请输入价格" value="{$vo.price|default='0'}">
  61. </label>
  62. </div>
  63. <div class="layui-form-item layui-row layui-col-space15">
  64. <label class="layui-col-xs3 relative">
  65. <span class="color-green">发行日期</span>
  66. <input name="sell_time" required id="sell_time" readonly value='{$vo.sell_time|default=""}' placeholder="" class="layui-input">
  67. </label>
  68. <label class="layui-col-xs3 relative">
  69. <span class="color-green">限购数量(每人限购数量)</span>
  70. <input name="buy_count" required type="number" class="layui-input" placeholder="请输入限购数量" value="{$vo.buy_count|default='1'}">
  71. </label>
  72. <label class="layui-col-xs3 relative">
  73. <span class="color-green">转赠时间(第一次转赠限制时间[小时],0为不限制)</span>
  74. <input name="one_given_day" required type="number" class="layui-input" placeholder="转赠时间(第一次转赠限制时间[小时],0为不限制)" value="{$vo.one_given_day|default='0'}">
  75. </label>
  76. <label class="layui-col-xs3 relative">
  77. <span class="color-green">转赠时间(后续转赠限制限制时间[小时],0为不限制)</span>
  78. <input name="other_given_day" required type="number" step="1" class="layui-input" placeholder="转赠时间(后续转赠限制限制时间[小时],0为不限制)" value="{$vo.other_given_day|default='0'}">
  79. </label>
  80. </div>
  81. <div class="layui-form-item layui-row layui-col-space15">
  82. <label class="layui-col-xs3 relative">
  83. <span class="color-green">作者姓名</span>
  84. <input name="auth_name" required class="layui-input" placeholder="请输入作者姓名" value="{$vo.auth_name|default=''}">
  85. </label>
  86. </div>
  87. <div class="layui-form-item">
  88. <span class="color-green label-required-prev">作者头像</span>
  89. <table class="layui-table">
  90. <thead>
  91. <tr>
  92. <td width="90px" class="text-left"><input name="auth_img" type="hidden" value="{$vo.auth_imgs|default=''}"></td>
  93. </tr>
  94. </thead>
  95. </table>
  96. <script>$('[name="auth_img"]').uploadOneImage(), $('[name="auth_imgs"]').uploadMultipleImage()</script>
  97. </div>
  98. <div class="layui-form-item">
  99. <span class="color-green label-required-prev">分享图片</span>
  100. <table class="layui-table">
  101. <thead>
  102. <tr>
  103. <td width="90px" class="text-left"><input name="share_img" type="hidden" value="{$vo.share_img|default=''}"></td>
  104. </tr>
  105. </thead>
  106. </table>
  107. <script>$('[name="share_img"]').uploadOneImage()</script>
  108. </div>
  109. <div class="layui-form-item layui-row layui-col-space15">
  110. <label class="layui-col-xs3 relative">
  111. <span class="color-green">作品介绍</span>
  112. <textarea placeholder="请输入作品介绍" required class="layui-textarea" name="intro">{$vo.intro|default=""}</textarea>
  113. </label>
  114. <label class="layui-col-xs3 relative">
  115. <span class="color-green">权益说明</span>
  116. <textarea placeholder="请输入权益说明" required class="layui-textarea" name="instructions">{$vo.instructions|default=""}</textarea>
  117. </label>
  118. <label class="layui-col-xs3 relative">
  119. <span class="color-green">购买须知</span>
  120. <textarea placeholder="请输入购买须知" required class="layui-textarea" name="buy_notice">{$vo.buy_notice|default=""}</textarea>
  121. </label>
  122. <label class="layui-col-xs3 relative">
  123. <span class="color-green">温馨提示</span>
  124. <textarea placeholder="请输入温馨提示" required class="layui-textarea" name="warm_prompt">{$vo.warm_prompt|default=""}</textarea>
  125. </label>
  126. </div>
  127. <div class="layui-form-item">
  128. <span class="color-green label-required-prev">商品描述(多张图片)</span>
  129. <table class="layui-table">
  130. <thead>
  131. <tr>
  132. <td width="auto" class="text-left"><input name="describe" type="hidden" value="{$vo.describes|default=''}"></td>
  133. </tr>
  134. </thead>
  135. </table>
  136. <script>$('[name="logo"]').uploadOneImage(), $('[name="describe"]').uploadMultipleImage()</script>
  137. </div>
  138. <div class="layui-form-item text-center">
  139. {notempty name='vo.id'}<input type="hidden" name="id" value="{$vo.id}">{/notempty}
  140. <button class="layui-btn layui-btn-danger" onclick="history.go(-1);" type="button">取消编辑</button>
  141. <button class="layui-btn" type="submit">保存</button>
  142. </div>
  143. </div>
  144. </form>
  145. {/block}
  146. {block name='script'}
  147. <textarea class="layui-hide" id="goods-specs">{$vo.specs|raw|default=''}</textarea>
  148. <textarea class="layui-hide" id="goods-value">{$defaultValues|raw|default=''}</textarea>
  149. <script>
  150. layui.form.render();
  151. layui.use(['form', 'layedit', 'laydate'], function(){
  152. var form = layui.form
  153. ,layer = layui.layer
  154. ,layedit = layui.layedit
  155. ,laydate = layui.laydate;
  156. laydate.render({
  157. elem: '#sell_time'
  158. ,type: 'datetime'
  159. ,min:new Date().toLocaleString()
  160. });
  161. laydate.render({
  162. elem: '#apply_st'
  163. ,type: 'datetime'
  164. ,min:new Date().toLocaleString()
  165. });
  166. laydate.render({
  167. elem: '#apply_end'
  168. ,type: 'datetime'
  169. ,min:new Date().toLocaleString()
  170. });
  171. form.render();
  172. //日期
  173. laydate.render({
  174. elem: '#date'
  175. });
  176. laydate.render({
  177. elem: '#date1'
  178. });
  179. });
  180. form.on('select(issue_mode)', function(data){
  181. var issue_mode = data.value;
  182. console.log(issue_mode)
  183. //与之前选择的一样不处理
  184. if(issue_mode == 1){
  185. $(".apply_time").hide();
  186. }else{
  187. $(".apply_time").show();
  188. }
  189. layui.form.render();
  190. })
  191. </script>
  192. {/block}