index.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {extend name="layout:home" /}
  2. {block name="container"}
  3. <div class="layui-tab layui-tab-card">
  4. <input type="text" style="display: none" name="id" id="id" value="{$id}">
  5. <ul class="layui-tab-title">
  6. {volist name="fartherProduct" id="value"}
  7. <li id="li-{$value.product_id}" onclick="showCurrent({$value.product_id})">
  8. <a>{$value.product_name}</a>
  9. </li>
  10. {/volist}
  11. </ul>
  12. <div class="layui-tab-content page-tab-content">
  13. <table class="layui-table lay-even">
  14. <colgroup>
  15. <col width="150">
  16. <col width="200">
  17. <col>
  18. </colgroup>
  19. <thead>
  20. <tr>
  21. <th>服务名称</th>
  22. <th>服务简介</th>
  23. <th>服务报价</th>
  24. <th>状态</th>
  25. <th>图片</th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. {if count($sonProduct)}
  30. {volist name="sonProduct" id="value"}
  31. <tr>
  32. <td>{$value.product_name}</td>
  33. <td><?php echo mb_substr($value->product_content,0,30, 'utf-8');?>...</td>
  34. <td>{$value.product_money}</td>
  35. <td>{$value.product_status == 1 ? '启用' : '下线'}</td>
  36. <td>
  37. {if $value.product_img}
  38. <img src="{$Think.HOME_SITE_ROOT}{$value.product_img}" style="width: 100px;height: 100px">
  39. {/if}
  40. </td>
  41. </tr>
  42. {/volist}
  43. {else}
  44. <td colspan="99" style="text-align: center">无数据</td>
  45. {/if}
  46. </tbody>
  47. </table>
  48. {$show_page}
  49. </div>
  50. </div>
  51. <script>
  52. const myHost = "http://" + window.location.host;
  53. let current = $("#id").val();
  54. $("#li-" + current).attr("class","layui-this")
  55. function showCurrent(id) {
  56. if (id) {
  57. $("#status").val(id)
  58. }
  59. let timeRang = $("#timeRang").val();
  60. let status = $("#status").val();
  61. window.location.href = myHost + "/User/cost/orderManagement.html?timeRang=" + timeRang + "&status=" + status;
  62. }
  63. function getQueryString(name) {
  64. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  65. var url=decodeURI(decodeURI(window.location.search))
  66. var r = url.substr(1).match(reg);
  67. if (r != null) return unescape(r[2]); return null;
  68. }
  69. layui.use('laydate', function(){
  70. var laydate = layui.laydate;
  71. //执行一个laydate实例
  72. laydate.render({
  73. elem: '#creatTime' //指定元素
  74. });
  75. laydate.render({
  76. elem:'#timeRang',
  77. range:true,
  78. format: 'yyyy/MM/dd',
  79. done: function(value, date){
  80. /* 时间选择完成后的回调 */
  81. }
  82. })
  83. });
  84. </script>
  85. {/block}