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

detail.html 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. {layout name="layout2" /}
  2. <style>
  3. .layui-form {
  4. margin: 5px;
  5. }
  6. .layui-form-label {
  7. width: 120px;
  8. text-align: left;
  9. padding-left:30px;
  10. }
  11. .layui-input-block {
  12. line-height: 36px;
  13. }
  14. .layui-input {
  15. width: 300px;
  16. }
  17. .layui-textarea {
  18. width: 300px;
  19. }
  20. .reqRed:before {
  21. content: '*';
  22. color: red;
  23. margin-right: 5px;
  24. }
  25. </style>
  26. <form class="layui-form">
  27. <input type="hidden" name="id" value="{$detail.goods.id}" />
  28. <div class="layui-form-item">
  29. <label class="layui-form-label">商品编号</label>
  30. <div class="layui-input-block">
  31. {$detail.goods.code}
  32. </div>
  33. </div>
  34. <div class="layui-form-item">
  35. <label class="layui-form-label">商品名称</label>
  36. <div class="layui-input-block">
  37. {$detail.goods.name}
  38. </div>
  39. </div>
  40. <div class="layui-form-item">
  41. <label class="layui-form-label reqRed">分销状态</label>
  42. <div class="layui-inline">
  43. <input type="radio" name="is_distribution" value="0" title="不参与" {if $detail.goods.is_distribution == 0}checked{/if}>
  44. <input type="radio" name="is_distribution" value="1" title="参与" {if $detail.goods.is_distribution == 1}checked{/if}>
  45. </div>
  46. </div>
  47. <div class="layui-form-item">
  48. <label class="layui-form-label reqRed">佣金规则</label>
  49. <div class="layui-inline">
  50. <input type="radio" lay-filter="default" name="rule" value="1" title="默认分销等级佣金规则" {if isset($detail.goods.rule) && $detail.goods.rule == 1}checked{/if}>
  51. <input type="radio" lay-filter="customize" name="rule" value="2" title="单独设置" {if isset($detail.goods.rule) && $detail.goods.rule == 2}checked{/if}>
  52. </div>
  53. </div>
  54. <div class="layui-form-item">
  55. <label class="layui-form-label"></label>
  56. <div class="layui-inline">
  57. <table class="layui-table {if $detail.goods.rule == 1}layui-hide{/if}">
  58. <colgroup>
  59. <col width="200">
  60. <col width="200">
  61. <col width="200">
  62. <col width="200">
  63. <col>
  64. </colgroup>
  65. <thead>
  66. <tr>
  67. <th>分销等级</th>
  68. <th>商品规格</th>
  69. <th>价格</th>
  70. <th class="reqRed">一级佣金比例(%)</th>
  71. <th class="reqRed">二级佣金比例(%)</th>
  72. </tr>
  73. </thead>
  74. <tbody>
  75. {foreach $detail.ratio as $item }
  76. <input type="hidden" name="items[]" value="{$item['item_id']}">
  77. <input type="hidden" name="levels[]" value="{$item['level_id']}">
  78. <tr>
  79. <td>{$item.level_name}</td>
  80. <td>{$item.spec_value_str}</td>
  81. <td>{$item.price}</td>
  82. <td>
  83. <input type="number" min="0" name="first_ratio[]" value="{$item.first_ratio}" class="layui-input" />
  84. </td>
  85. <td>
  86. <input type="number" min="0" name="second_ratio[]" value="{$item.second_ratio}" class="layui-input" />
  87. </td>
  88. </tr>
  89. {/foreach}
  90. </tbody>
  91. </table>
  92. </div>
  93. </div>
  94. <div class="layui-form-item">
  95. <div class="layui-input-block layui-hide">
  96. <button class="layui-btn" lay-submit lay-filter="setSubmit" id="setSubmit">立即提交</button>
  97. </div>
  98. </div>
  99. </form>
  100. <script>
  101. layui.config({
  102. version: "{$front_version}",
  103. base: '/static/lib/'
  104. }).use(['element', 'form'], function () {
  105. var $ = layui.$
  106. , form = layui.form
  107. , layer = layui.layer;
  108. form.on('radio(default)', function(data){
  109. $('.layui-table').addClass('layui-hide');
  110. });
  111. form.on('radio(customize)', function(data){
  112. $('.layui-table').removeClass('layui-hide');
  113. });
  114. });
  115. </script>