index.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. <!-- 搜索框开始 -->
  6. <div class="search-form">
  7. <div class="layui-form-item">
  8. <div class="layui-inline">
  9. <input type="text" class="layui-input" name="timeRang" id="timeRang" placeholder="选择时间段"
  10. style="width: 170px;">
  11. </div>
  12. <div class="layui-inline">
  13. <label>产品是否到期</label>
  14. <select name="type" id="type" lay-verify="" class="layui-select layui-unselect layui-form-select">
  15. <option value="">请选择</option>
  16. <option value="-1">到期</option>
  17. <option value="1">未到期</option>
  18. </select>
  19. </div>
  20. <div class="layui-inline">
  21. <button type="submit" class="layui-btn search-subBtn" onclick="showCurrent()">搜索</button>
  22. </div>
  23. </div>
  24. </div>
  25. <table class="layui-table lay-even">
  26. <colgroup>
  27. <col width="150">
  28. <col width="200">
  29. <col>
  30. </colgroup>
  31. <thead>
  32. <tr>
  33. <th>订单编号</th>
  34. <th>产品名称</th>
  35. <th>购买时间</th>
  36. <th>购买天数</th>
  37. <th>到期时间</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. {if count($usermessage)}
  42. {volist name="usermessage" id="message"}
  43. <tr>
  44. <td>{$message.userproduct_identity}</td>
  45. <td>{$message.product_name}</td>
  46. <td>{$message.userProduct_buyTime}</td>
  47. <td>{$message.userProduct_dayNumber}</td>
  48. <td>{$message.userProduct_maturityTime}</td>
  49. </tr>
  50. {/volist}
  51. {else}
  52. <td colspan="7" style="text-align: center">无数据</td>
  53. {/if}
  54. </tbody>
  55. </table>
  56. {$show_page}
  57. </div>
  58. </div>
  59. <script>
  60. const myHost = "http://" + window.location.host;
  61. function showCurrent() {
  62. let timeRang = $("#timeRang").val();
  63. let type = $("#type").val();
  64. console.log(type);
  65. window.location.href = myHost + "/User/message/index.html?timeRang=" + timeRang + "&type=" + type;
  66. //window.location.href = myHost + "/User/message/index.html?timeRang=" + timeRang;
  67. }
  68. layui.use('laydate', function(){
  69. var laydate = layui.laydate;
  70. //执行一个laydate实例
  71. laydate.render({
  72. elem: '#creatTime' //指定元素
  73. });
  74. laydate.render({
  75. elem:'#timeRang',
  76. range:true,
  77. format: 'yyyy/MM/dd',
  78. done: function(value, date){
  79. /* 时间选择完成后的回调 */
  80. }
  81. })
  82. });
  83. </script>
  84. {/block}