ownshop_bind_class.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. {include file="public/header" /}
  2. <div class="page">
  3. <div class="fixed-bar">
  4. <div class="item-title">
  5. <div class="subject">
  6. <h3>{$Think.lang.ds_ownshop}</h3>
  7. </div>
  8. {include file="public/admin_items" /}
  9. </div>
  10. </div>
  11. <div class="fixed-empty"></div>
  12. <div class="explanation" id="explanation">
  13. <div class="title" id="checkZoom">
  14. <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
  15. <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
  16. </div>
  17. <ul>
  18. <li>{$Think.lang.ownshop_bind_help1}</li>
  19. <li>{$Think.lang.ownshop_bind_help2}</li>
  20. </ul>
  21. </div>
  22. <table class="ds-default-table">
  23. <thead class="thead">
  24. <tr class="space">
  25. <th colspan="15">{$Think.lang.ds_store_name}:{$store_info.store_name}</th>
  26. </tr>
  27. </thead>
  28. <thead>
  29. <tr class="thead">
  30. <th></th>
  31. <th>{$Think.lang.class_1_name}</th>
  32. <th>{$Think.lang.class_2_name}</th>
  33. <th>{$Think.lang.class_3_name}</th>
  34. <th>{$Think.lang.commis_rate}</th>
  35. <th class="align-center">{$Think.lang.ds_handle}</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. {notempty name="store_bind_class_list"}
  40. {foreach name="store_bind_class_list" item="value" key="key" }
  41. <tr class="hover edit">
  42. <td><input class="checkitem" type="checkbox" value="{$value.storebindclass_id}" name="bid[]"></td>
  43. <td class="w25pre">{$value.class_1_name}</td>
  44. <td class="w25pre">{$value.class_2_name}</td>
  45. <td class="w25pre">{$value.class_3_name}</td>
  46. <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>
  47. <td class="w60 align-center"><a href="javascript:submit_delete({$value.storebindclass_id})" class="dsui-btn-del"><i class="iconfont"></i>{$Think.lang.ds_del}</a></td>
  48. </tr>
  49. {/foreach}
  50. {else /}
  51. <tr class="no_data">
  52. <td colspan="10">{$Think.lang.ds_no_record}</td>
  53. </tr>
  54. {/notempty}
  55. </tbody>
  56. <tfoot>
  57. <tr class="tfoot">
  58. <td>
  59. <input id="checkallBottom" class="checkall" type="checkbox">
  60. </td>
  61. <td colspan="15">
  62. <label for="checkallBottom">{$Think.lang.ds_select_all}</label>
  63. <a class="btn btn-small" onclick="submit_delete_batch()" href="JavaScript:void(0);">
  64. <span>{$Think.lang.ds_del}</span>
  65. </a>
  66. </td>
  67. </tr>
  68. </tfoot>
  69. </table>
  70. {$showpage|raw}
  71. <table class="ds-default-table" >
  72. <thead class="thead">
  73. <tr class="space">
  74. <th colspan="15"><span>{$Think.lang.add_bind_class}</span></th>
  75. </tr>
  76. </thead>
  77. <tbody>
  78. <tr class="noborder">
  79. <td class="required" colspan="2" >{$Think.lang.choice_class}:</td>
  80. </tr>
  81. <tr class="noborder">
  82. <td colspan="2" id="gcategory" class="vatop rowform"><select id="gcategory_class1" style="width: auto;">
  83. <option value="0">{$Think.lang.ds_common_pselect}</option>
  84. {notempty name="gc_list"}
  85. {foreach name="gc_list" item="gc"}
  86. <option value="{$gc.gc_id}" data-explain="{$gc.commis_rate}">{$gc.gc_name}</option>
  87. {/foreach}
  88. {/notempty}
  89. </select><span id="error_message" style="color:red;"></span></td>
  90. </tr>
  91. <tr>
  92. <td class="required" colspan="2" >{$Think.lang.commis_rate_tips}</td>
  93. </tr>
  94. <tr class="noborder">
  95. <td class="vatop rowform"><form id="add_form" action="{:url('Ownshop/bind_class_add')}" method="post">
  96. <input name="store_id" type="hidden" value="{$store_info.store_id}">
  97. <input id="goods_class" name="goods_class" type="hidden" value="">
  98. <input id="commis_rate" name="commis_rate" class="w60" type="text" value="0" />
  99. % <span id="error_message1" style="color:red;"></span>
  100. </form></td>
  101. <td class="vatop tips"></td>
  102. </tr>
  103. </tbody>
  104. <tfoot>
  105. <tr>
  106. <td colspan="2"><a id="btn_add_category" class="btn" href="JavaScript:void(0);" /><span>{$Think.lang.ds_confirm_submit}</span></a></td>
  107. </tr>
  108. </tfoot>
  109. </table>
  110. </div>
  111. <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js" charset="utf-8"></script>
  112. <script type="text/javascript" src="{$Think.ADMIN_SITE_ROOT}/js/jquery.edit.js" charset="utf-8"></script>
  113. <script type="text/javascript">
  114. function submit_delete(ids_str){
  115. _uri = ADMINSITEURL+"/Ownshop/bind_class_del.html?bid=" + ids_str;
  116. dsLayerConfirm(_uri,'{$Think.lang.confirm_bind_class_del}');
  117. }
  118. $(function(){
  119. gcategoryInit("gcategory");
  120. // 提交新添加的类目
  121. $('#btn_add_category').on('click', function() {
  122. $('#error_message').hide();
  123. $('#error_message1').hide();
  124. var category_id = '';
  125. var validation = true;
  126. $('#gcategory').find('select').each(function() {
  127. if(parseInt($(this).val(), 10) > 0) {
  128. category_id += $(this).val() + ',';
  129. }
  130. });
  131. if (parseInt($('#gcategory').find('select').eq(0).val()) == 0) {
  132. validation = false;
  133. }
  134. if(!validation) {
  135. $('#error_message').text('{$Think.lang.choice_class}');
  136. $('#error_message').show();
  137. return false;
  138. }
  139. var commis_rate = parseInt($('#commis_rate').val(), 10);
  140. if(isNaN(commis_rate) || commis_rate < 0 || commis_rate > 100) {
  141. $('#error_message1').text('{$Think.lang.commis_rate_error}');
  142. $('#error_message1').show();
  143. return false;
  144. }
  145. $('#goods_class').val(category_id);
  146. $('#add_form').submit();
  147. });
  148. $('#gcategory select').on('change', function() {
  149. var cr = $(this).children(':selected').attr('data-explain');
  150. $('#commis_rate').val(parseInt(cr) || 0);
  151. });
  152. // 修改分佣比例
  153. $('span[ds_type="commis_rate"]').inline_edit({controller: 'ownshop',action: 'bind_class_update'});
  154. });
  155. </script>