截流自动化的商城平台
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.

index.html 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. {layout name="layout1" /}
  2. <style>
  3. .btns {
  4. margin-top: 15px;
  5. }
  6. .layui-table-cell {
  7. height: auto;
  8. }
  9. .layui-form-label {
  10. width: 120px;
  11. }
  12. </style>
  13. <div class="wrapper">
  14. <div class="layui-card">
  15. <!--操作提示-->
  16. <div class="layui-card-body">
  17. <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
  18. <div class="layui-colla-item">
  19. <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
  20. <div class="layui-colla-content layui-show">
  21. <p>*查看商品分销佣金比例;</p>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. <!--搜索区域-->
  27. <div class="layui-card-body layui-form">
  28. <div class="layui-form-item">
  29. <div class="layui-inline">
  30. <div class="layui-form-label">商品信息:</div>
  31. <div class="layui-input-inline">
  32. <input type="text" id="keyword" name="keyword" class="layui-input" />
  33. </div>
  34. </div>
  35. <div class="layui-inline">
  36. <div class="layui-form-label">平台商品分类:</div>
  37. <div class="layui-input-inline">
  38. <select name="platform_cate_id" id="platform_cate_id" placeholder="请选择" >
  39. <option value="all">全部</option>
  40. {foreach $cate_list as $val }
  41. <option value="{$val.id}">{$val.html}{$val.name}</option>
  42. {/foreach}
  43. </select>
  44. </div>
  45. </div>
  46. <!-- <div class="layui-inline">-->
  47. <!-- <div class="layui-form-label">分销状态:</div>-->
  48. <!-- <div class="layui-input-inline">-->
  49. <!-- <select name="is_distribution" id="is_distribution" placeholder="请选择" >-->
  50. <!-- <option value="all">全部</option>-->
  51. <!-- <option value="0">不参与</option>-->
  52. <!-- <option value="1">参与</option>-->
  53. <!-- </select>-->
  54. <!-- </div>-->
  55. <!-- </div>-->
  56. <div class="layui-inline">
  57. <button class="layui-btn layui-btn-primary layui-bg-blue" lay-submit lay-filter="search">搜索</button>
  58. <button class="layui-btn layui-btn-primary" lay-submit lay-filter="reset">重置</button>
  59. </div>
  60. </div>
  61. </div>
  62. <!--主体区域-->
  63. <div class="layui-card-body">
  64. <!--数据表格-->
  65. <table id="lists" lay-filter="lists"></table>
  66. <!--工具条模板-->
  67. <script type="text/html" id="operate">
  68. <a class="layui-btn layui-btn-sm layui-bg-blue" lay-event="detail">查看佣金设置</a>
  69. </script>
  70. <!--自定义模板-->
  71. <script type="text/html" id="shop-info">
  72. <img src="{{d.Shop.logo}}" style="height:60px;width: 60px" class="image-show">
  73. <div class="layui-input-inline" style="text-align: left;">
  74. <p>商家编号:{{d.Shop.id}}</p>
  75. <p>商家名称:{{d.Shop.name}}</p>
  76. </div>
  77. </script>
  78. <script type="text/html" id="goods-info">
  79. <img src="{{d.image}}" style="height:60px;width: 60px" class="image-show">
  80. <div class="layui-input-inline" style="text-align: left;">
  81. <p>商品编号:{{d.code}}</p>
  82. <p>商品名称:{{d.name}}</p>
  83. </div>
  84. </script>
  85. <script type="text/html" id="goods-price">
  86. ¥ {{d.min_price}} - ¥ {{d.max_price}}
  87. </script>
  88. <script type="text/html" id="goods-distribution">
  89. {{# if(d.distribution_flag){ }}
  90. 参与
  91. {{# } else { }}
  92. 不参与
  93. {{# } }}
  94. </script>
  95. </div>
  96. </div>
  97. </div>
  98. <script>
  99. layui.config({
  100. version:"{$front_version}",
  101. base: '/static/lib/'
  102. }).use(['table', 'form'], function () {
  103. let $ = layui.$
  104. , form = layui.form
  105. , table = layui.table;
  106. //监听搜索
  107. form.on('submit(search)', function(data){
  108. var field = data.field;
  109. //执行重载
  110. table.reload('lists', {
  111. where: field,
  112. page: {curr: 1}
  113. });
  114. });
  115. //清空查询
  116. form.on('submit(reset)', function(){
  117. $('#keyword').val('');
  118. $('#platform_cate_id').val('all');
  119. $('#shop_cate_id').val('all');
  120. $('#is_distribution').val('all');
  121. form.render('select');
  122. //刷新列表
  123. table.reload('lists', {
  124. where: [], page: {curr: 1}
  125. });
  126. });
  127. // 数据表格渲染
  128. table.render({
  129. elem: '#lists'
  130. ,url: '{:url("distribution.distribution_goods/index")}' //数据接口
  131. ,method: 'post'
  132. ,page: true //开启分页
  133. ,cols: [[ //表头
  134. {templet: '#shop-info', title: '商家信息'}
  135. ,{templet: '#goods-info', title: '商品信息'}
  136. ,{templet: '#goods-price', title: '价格', width:200}
  137. // ,{templet: '#goods-distribution',align:'center', title: '分销状态', width: 150}
  138. ,{title: '操作', align:'center', toolbar: '#operate', width: 150}
  139. ]]
  140. , text: {none: '暂无数据!'}
  141. , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
  142. return {
  143. "code": res.code,
  144. "msg": res.msg,
  145. "count": res.data.count, //解析数据长度
  146. "data": res.data.lists, //解析数据列表
  147. };
  148. },
  149. response: {
  150. statusCode: 1
  151. }
  152. ,done: function(res, curr, count){
  153. // 解决操作栏因为内容过多换行问题
  154. $(".layui-table-main tr").each(function (index, val) {
  155. $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
  156. $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
  157. });
  158. }
  159. });
  160. // 工具条事件
  161. table.on('tool(lists)', function(obj){
  162. var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
  163. if(layEvent === 'detail'){ // 设置佣金
  164. id = obj.data.id;
  165. // 弹窗显示添加页
  166. layer.open({
  167. type: 2
  168. ,title: "查看佣金比例"
  169. ,content: "{:url('distribution.distribution_goods/detail')}?id=" + id
  170. ,area: ["90%", "90%"]
  171. ,btn: ["返回"]
  172. });
  173. }
  174. });
  175. });
  176. </script>