information.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {extend name="layout:home" /}
  2. {block name="container"}
  3. <div class="layui-tab layui-tab-card">
  4. <div class="layui-tab-content page-tab-content">
  5. <table class="layui-table lay-even">
  6. <colgroup>
  7. <col width="150">
  8. <col width="200">
  9. <col>
  10. </colgroup>
  11. <thead>
  12. <tr>
  13. <th>标题</th>
  14. <th>内容</th>
  15. <th>图片</th>
  16. <th>操作</th>
  17. </tr>
  18. </thead>
  19. <tbody>
  20. {if count($productInfo)}
  21. {volist name="productInfo" id="value"}
  22. <tr>
  23. <td>{$value.productInfo_title}</td>
  24. <td><?php echo mb_substr($value->productInfo_content,0,30, 'utf-8');?>...</td>
  25. <td>
  26. {if $value.productInfo_img}
  27. <img src="{$Think.UPLOADS_ROOT}{$value.productInfo_img}" style="width: 100px;height: 100px">
  28. {/if}
  29. </td>
  30. <td>
  31. <a href="javascript:dsLayerOpen('{:url('Server/editInfo',['productInfo_id'=>$value.productInfo_id])}','编辑-{$value.productInfo_title}')"
  32. class="layui-btn layui-btn-xs"><i class="layui-icon layui-icon-edit"></i>{$Think.lang.ds_edit}</a>
  33. <a href="javascript:dsLayerConfirm('{:url('Server/deleteInfo',['productInfo_id'=>$value.productInfo_id])}','{$Think.lang.ds_confirm_cancel}')"
  34. class="layui-btn layui-btn-danger layui-btn-xs"><i class="layui-icon layui-icon-delete"></i>{$Think.lang.ds_del}</a>
  35. </td>
  36. </tr>
  37. {/volist}
  38. {else}
  39. <td colspan="99" style="text-align: center">无数据</td>
  40. {/if}
  41. </tbody>
  42. </table>
  43. </div>
  44. </div>
  45. <script>
  46. const myHost = "http://" + window.location.host;
  47. let current = $("#id").val();
  48. $("#li-" + current).attr("class","layui-this")
  49. function showCurrent(id) {
  50. window.location.href = myHost + "/Admin/Server/index.html?id=" + id;
  51. }
  52. layui.use('laydate', function(){
  53. var laydate = layui.laydate;
  54. //执行一个laydate实例
  55. laydate.render({
  56. elem: '#creatTime' //指定元素
  57. });
  58. laydate.render({
  59. elem:'#timeRang',
  60. range:true,
  61. format: 'yyyy/MM/dd',
  62. done: function(value, date){
  63. /* 时间选择完成后的回调 */
  64. }
  65. })
  66. });
  67. </script>
  68. {/block}