截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

select_goods.html 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {layout name="layout1" /}
  2. <div class="layui-fluid">
  3. <div class="layui-card">
  4. <div class="layui-tab layui-tab-card" lay-filter="tab-all">
  5. <div class="layui-tab-item layui-show">
  6. <div class="layui-card">
  7. <div class="layui-form layui-card-header layuiadmin-card-header-auto">
  8. <div class="layui-form-item type">
  9. <div class="layui-inline">
  10. <label class="layui-form-label">商品名称:</label>
  11. <div class="layui-input-block">
  12. <input type="text" name="keyword" id="keyword" placeholder="请输入关键词" autocomplete="off" class="layui-input">
  13. </div>
  14. </div>
  15. <div class="layui-inline">
  16. <button class="layui-btn layuiadmin-btn-like {$view_theme_color}" lay-submit lay-filter="like-table-search">查询</button>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="layui-card-body">
  21. <table id="like-table-lists" lay-filter="like-table-lists"></table>
  22. <script type="text/html" id="goods-info">
  23. <img src="{{d.image}}" style="height:60px;width: 60px" class="image-show"> {{d.name}}
  24. </script>
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="layui-form-item layui-hide">
  31. <input type="button" lay-submit lay-filter="select-submit" class="select-submit" id="select-submit" value="确认">
  32. </div>
  33. </div>
  34. <style>
  35. .layui-table-cell {
  36. height: auto;
  37. }
  38. </style>
  39. <script>
  40. var table;
  41. layui.use(["table", "element", "laydate"], function(){
  42. var $ = layui.$;
  43. var form = layui.form;
  44. var like = layui.like;
  45. var element = layui.element;
  46. table = layui.table;
  47. //监听搜索
  48. form.on('submit(like-table-search)', function(data){
  49. var field = data.field;
  50. //执行重载
  51. table.reload('like-table-lists', {
  52. where: field
  53. });
  54. });
  55. });
  56. like.tableLists('#like-table-lists', '{:url("common.goods/selectGoods")}', [
  57. {type: 'radio'}
  58. , {field: 'name', title: '商品名称', toolbar: '#goods-info'}
  59. , {field: 'price', title: '价格'}
  60. , {field: 'stock', title: '库存'}
  61. ]);
  62. var callbackdata = function () {
  63. var data = table.checkStatus('like-table-lists').data
  64. ,index = parent.layer.getFrameIndex(window.name);
  65. parent.layer.close(index);
  66. return data;
  67. }
  68. </script>