store_bind_class.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-empty"></div>
  4. <div class="explanation" id="explanation">
  5. <div class="title" id="checkZoom">
  6. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  7. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  8. </div>
  9. <ul>
  10. <li>{$Think.lang.store_bind_class_help1}</li>
  11. <li>{$Think.lang.store_bind_class_help2}</li>
  12. </ul>
  13. </div>
  14. <table class="ds-default-table">
  15. <thead class="thead">
  16. <tr class="space">
  17. <th colspan="15">{$Think.lang.ds_store_name}:{$store_info.store_name}</th>
  18. </tr>
  19. </thead>
  20. <thead>
  21. <tr class="thead">
  22. <th>{$Think.lang.ds_class}1</th>
  23. <th>{$Think.lang.ds_class}2</th>
  24. <th>{$Think.lang.ds_class}3</th>
  25. <th>{$Think.lang.store_class_commis_rates}</th>
  26. <th class="align-center">{$Think.lang.ds_handle}</th>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. {notempty name="store_bind_class_list"}
  31. {foreach name="store_bind_class_list" item="value"}
  32. <tr class="hover edit">
  33. <td class="w25pre">{$value.class_1_name}</td>
  34. <td class="w25pre">{$value.class_2_name}</td>
  35. <td class="w25pre">{$value.class_3_name}</td>
  36. <td class="sort"><span ds_type="commis_rate" column_id="{$value.storebindclass_id}" title="{$Think.lang.ds_editable}" class="editable " style="vertical-align: middle; margin-right: 4px;">{$value.commis_rate}</span>% </td>
  37. <td class="w60 align-center"><a href="javascript:dsLayerConfirm('{:url('Store/store_bind_class_del',['bid'=>$value.storebindclass_id])}','{$Think.lang.store_bind_class_del_confirm}')" class="dsui-btn-del"><i class="iconfont"></i>{$Think.lang.ds_del}</a></td>
  38. </tr>
  39. {/foreach}
  40. {else /}
  41. <tr class="no_data">
  42. <td colspan="10">{$Think.lang.ds_no_record}</td>
  43. </tr>
  44. {/notempty}
  45. </tbody>
  46. </table>
  47. <table class="ds-default-table" >
  48. <thead class="thead">
  49. <tr class="space">
  50. <th colspan="15"><span>{$Think.lang.store_bind_class_add}</span></th>
  51. </tr>
  52. </thead>
  53. <tbody>
  54. <tr class="noborder">
  55. <td class="required" colspan="2" >{$Think.lang.store_bind_class_select}:</td>
  56. </tr>
  57. <tr class="noborder">
  58. <td colspan="2" id="gcategory" class="vatop rowform"><select id="gcategory_class1" style="width: auto;">
  59. <option value="0">{$Think.lang.store_bind_class_all}</option>
  60. {notempty name="gc_list"}
  61. {foreach name="gc_list" item="gc"}
  62. <option value="{$gc.gc_id}" data-explain="{$gc.commis_rate}">{$gc.gc_name}</option>
  63. {/foreach}
  64. {/notempty}
  65. </select><span id="error_message" style="color:red;"></span></td>
  66. </tr>
  67. <tr>
  68. <td class="required" colspan="2" >{$Think.lang.commis_rate_tips}:</td>
  69. </tr>
  70. <tr class="noborder">
  71. <td class="vatop rowform"><form id="add_form" action="{:url('Store/store_bind_class_add')}" method="post">
  72. <input name="store_id" type="hidden" value="{$store_info.store_id}">
  73. <input id="goods_class" name="goods_class" type="hidden" value="">
  74. <input id="commis_rate" name="commis_rate" class="w60" type="text" value="" />
  75. % <span id="error_message1" style="color:red;"></span>
  76. </form></td>
  77. <td class="vatop tips"></td>
  78. </tr>
  79. </tbody>
  80. <tfoot>
  81. <tr>
  82. <td colspan="2"><a id="btn_add_category" class="btn" href="JavaScript:void(0);" /><span>{$Think.lang.ds_submit}</span></a></td>
  83. </tr>
  84. </tfoot>
  85. </table>
  86. </div>
  87. <script src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js"></script>
  88. <script type="text/javascript" src="{$Think.ADMIN_SITE_ROOT}/js/jquery.edit.js" charset="utf-8"></script>
  89. <script type="text/javascript">
  90. $(document).ready(function(){
  91. gcategoryInit("gcategory");
  92. // 提交新添加的类目
  93. $('#btn_add_category').on('click', function() {
  94. $('#error_message').hide();
  95. $('#error_message1').hide();
  96. var category_id = '';
  97. var validation = true;
  98. $('#gcategory').find('select').each(function() {
  99. if(parseInt($(this).val(), 10) > 0) {
  100. category_id += $(this).val() + ',';
  101. } else {
  102. validation = false;
  103. }
  104. });
  105. var commis_rate = parseInt($('#commis_rate').val(), 10);
  106. if(isNaN(commis_rate) || commis_rate < 0 || commis_rate > 100) {
  107. $('#error_message1').text('{$Think.lang.store_class_commis_rates_error}');
  108. $('#error_message1').show();
  109. return false;
  110. }
  111. $('#goods_class').val(category_id);
  112. $('#add_form').submit();
  113. });
  114. $('#gcategory select').on('change', function() {
  115. var cr = $(this).children(':selected').attr('data-explain');
  116. $('#commis_rate').val(parseInt(cr) || '');
  117. });
  118. // 修改分佣比例
  119. $('span[ds_type="commis_rate"]').inline_edit({controller: 'store',action: 'store_bind_class_update'});
  120. });
  121. </script>