form.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. {extend name='admin@main'}
  2. {block name="content"}
  3. {include file='mall@store_goods/form_style'}
  4. <link rel="stylesheet" href="/static/plugs/layui/css/layui.css" media="all">
  5. <script src="/static/plugs/layui/layui.all.js" charset="utf-8"></script>
  6. <div class="think-box-shadow" style="height: 85%">
  7. <form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
  8. <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  9. <legend>平台需求</legend>
  10. </fieldset>
  11. <div class="layui-tab-content">
  12. <div class="layui-tab-item layui-show">
  13. <div class="layui-form-item">
  14. <label class="layui-form-label label-required">需求标题</label>
  15. <div class="layui-input-block">
  16. <input name="title" maxlength="60" value='{$vo.title|default=""}' placeholder="" class="layui-input">
  17. </div>
  18. </div>
  19. <div class="layui-form-item ">
  20. <label class="layui-form-label">需求标签</label>
  21. <div class="layui-input-block">
  22. <textarea placeholder="请输入标签" class="layui-textarea" name="label">{$vo.label|default=''}</textarea>
  23. </div>
  24. </div>
  25. <div class="layui-form-item">
  26. <label class="layui-form-label">会员账号</label>
  27. <div class="layui-input-block">
  28. <input name="phone" value='{$vo.phone|default=""}' placeholder="请输入会员账号" class="layui-input">
  29. </div>
  30. </div>
  31. <div class="layui-form-item">
  32. <label class="layui-form-label label-required">需求图片</label>
  33. <div class="layui-input-block">
  34. <table class="layui-table">
  35. <thead>
  36. <tr>
  37. <th class="text-center">封面</th>
  38. <th class="text-left">展示图片</th>
  39. </tr>
  40. <tr>
  41. <td width="90px" class="text-center"><input name="cover" type="hidden" value="{$vo.cover|default=''}"></td>
  42. <td width="auto" class="text-left"><input name="images" type="hidden" value="{$vo.images|default=''}"></td>
  43. </tr>
  44. </thead>
  45. </table>
  46. </div>
  47. </div>
  48. <div class="layui-form-item">
  49. <label class="layui-form-label">发布会员</label>
  50. <div class="layui-input-block">
  51. <input value='{$user_info.name|default=""}' placeholder="" class="layui-input">
  52. </div>
  53. </div>
  54. <div class="layui-form-item">
  55. <label class="layui-form-label">相关链接</label>
  56. <div class="layui-input-block">
  57. <input name="link" value='{$vo.link|default=""}' placeholder="" class="layui-input">
  58. </div>
  59. </div>
  60. <div class="layui-form-item">
  61. <label class="layui-form-label">关联资料</label>
  62. <div class="layui-input-inline">
  63. <select name="datum_id" lay-filter ="datum_id">
  64. <option value="0">请选择</option>
  65. {foreach $datum_list as $dk=>$dv}
  66. <option {if isset($vo.datum_id) && $vo.datum_id == $dv['id'] }selected{/if} data-dl_key="{$dk}" value="{$dv['id']}">{$dv['title']}</option>
  67. {/foreach}
  68. </select>
  69. </div>
  70. <div class="layui-input-inline">
  71. <select name="datum_item" lay-filter ="datum_item">
  72. <option value="0">请选择</option>
  73. {foreach $datum_list as $vk=>$vv}
  74. {if isset($vo.datum_id) && $vo.datum_id == $vv['id'] }
  75. {foreach $vv['url_arr'] as $cln}
  76. <option {if isset($vo.datum_item) && $vo.datum_item == $cln['id']} selected {/if} value="{$cln['id']}">{$cln['title']}</option>
  77. {/foreach}
  78. {/if}
  79. {/foreach}
  80. </select>
  81. </div>
  82. </div>
  83. <div class="layui-form-item">
  84. <label class="layui-form-label">需求价格</label>
  85. <div class="layui-input-block">
  86. <input name="money" value='{$vo.money|default=""}' placeholder="" class="layui-input">
  87. </div>
  88. </div>
  89. <div class="layui-form-item">
  90. <label class="layui-form-label ">是否完成</label>
  91. <div class="layui-input-inline">
  92. <select name="is_over" lay-filter ="is_over" class="layui-select">
  93. {foreach ['待解决','已解决','开源项目'] as $ck=>$cv}
  94. <option {if isset($vo.is_over) && $vo.is_over == $ck } selected {/if} value="{$ck}">{$cv}</option>
  95. {/foreach}
  96. </select>
  97. </div>
  98. </div>
  99. <div class="layui-form-item">
  100. <label class="layui-form-label ">评论开关</label>
  101. <div class="layui-input-inline">
  102. <select class="layui-select" name="comment_switch" id="comment_switch" lay-filter="comment_switch" lay-search>
  103. <option {if isset($vo.comment_switch) && $vo.comment_switch == 1 }selected{/if} value="1">开启</option>
  104. <option {if isset($vo.comment_switch) && $vo.comment_switch == 0 }selected{/if} value="0">关闭</option>
  105. </select>
  106. </div>
  107. </div>
  108. <div class="layui-form-item">
  109. <label class="layui-form-label">需求排序</label>
  110. <div class="layui-input-block">
  111. <input type="number" name="sort" value='{$vo.sort|default=""}' placeholder="请输入排序号" class="layui-input">
  112. </div>
  113. </div>
  114. <div class="layui-form-item">
  115. <label class="layui-form-label">热搜阅读量</label>
  116. <div class="layui-input-block">
  117. <input type="number" name="hot_num" value='{$vo.hot_num|default=""}' placeholder="请输入热搜阅读量" class="layui-input">
  118. <input type="hidden" name="hot_num_old" value='{$vo.hot_num|default=""}'>
  119. </div>
  120. </div>
  121. <div class="layui-form-item">
  122. <label class="layui-form-label ">上架时间</label>
  123. <div class="layui-input-block">
  124. <input name="release_time" value='{$vo.release_time|default=""}' class="layui-input">
  125. </div>
  126. </div>
  127. <div class="layui-form-item">
  128. <label class="layui-form-label">发布方电话</label>
  129. <div class="layui-input-block">
  130. <input name="solve_phone" value='{$vo.solve_phone|default=""}' placeholder="" class="layui-input">
  131. </div>
  132. </div>
  133. <div class="layui-form-item">
  134. <label class="layui-form-label">发布方邮件</label>
  135. <div class="layui-input-block">
  136. <input name="solve_email" value='{$vo.solve_email|default=""}' placeholder="" class="layui-input">
  137. </div>
  138. </div>
  139. <div class="layui-form-item">
  140. <label class="layui-form-label">发布方二维码</label>
  141. <div class="layui-input-block">
  142. <table class="layui-table">
  143. <thead>
  144. <tr>
  145. <td width="auto" class="text-left">
  146. <input name="solve_qrcode" type="hidden" value="{$vo.solve_qrcode|default=''}">
  147. </td>
  148. </tr>
  149. </thead>
  150. </table>
  151. </div>
  152. </div>
  153. <div class="layui-form-item ">
  154. <label class="layui-form-label">需求描述</label>
  155. <div class="layui-input-block">
  156. <textarea name="content">{$vo.content|default=""}</textarea>
  157. </div>
  158. </div>
  159. {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
  160. <div class="layui-form-item text-center">
  161. <button class="layui-btn" type='submit'>保 存</button>
  162. <button class="layui-btn layui-btn-danger" type='button' onclick="history.go(-1)" data-close>返回</button>
  163. </div>
  164. </div>
  165. </div>
  166. </form>
  167. </div>
  168. <script>
  169. window.form.render();
  170. $('[name="cover"]').uploadOneImage();
  171. $('[name="solve_qrcode"]').uploadOneImage();
  172. $('[name="images"]').uploadMultipleImage();
  173. laydate.render({type: 'datetime', elem: '[name="release_time"]'})
  174. $('[name="company_logo"]').uploadOneImage();
  175. require(['ckeditor', 'angular'], function () {
  176. window.createEditor('[name="content"]', {
  177. height: 300,
  178. });
  179. })
  180. // 关联资料监听
  181. form.on('select(datum_id)', function(data){
  182. var cl_html = '<option value="0">请选择</option>';
  183. if(data.value == 0) {
  184. $("select[name='datum_item']").html(cl_html);
  185. }else{
  186. var dl_key = data.elem[data.elem.selectedIndex].dataset.dl_key;
  187. var datum_list = {:json_encode($datum_list)};
  188. $.each(datum_list[dl_key]['url_arr'],function (ck,cv) {
  189. cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
  190. })
  191. $("select[name='datum_item']").html(cl_html);
  192. }
  193. window.form.render();
  194. });
  195. </script>
  196. {/block}