store_bind_class.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <extend name="Public:base" />
  2. <block name="content">
  3. <div class="row">
  4. <div class="col-xs-12">
  5. <h3 class="header smaller lighter blue">已授权经营类目</h3>
  6. <div class="table-responsive">
  7. <table class="table table-striped table-bordered table-hover">
  8. <thead>
  9. <tr>
  10. <th>ID</th>
  11. <th>一级分类</th>
  12. <th>佣金比例</th>
  13. <th>操作</th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. <volist name="list" id="m" empty="$empty">
  18. <tr>
  19. <td>{$m.bid}</td>
  20. <td>{$m.cate1_name}</td>
  21. <td>{$m.commis_rate}%</td>
  22. <td>
  23. <a class="btn btn-xs btn-danger" href="javascript:;" rel='{:U("SellerManage/delstorebind",array("bid"=>$m["bid"],"id" =>$seller_id ))}'>
  24. <i class="icon-trash bigger-120"></i>
  25. </a>
  26. </td>
  27. </tr>
  28. </volist>
  29. <tr>
  30. <td colspan="20" class="page">{$page}</td>
  31. </tr>
  32. </tbody>
  33. </table>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="row">
  38. <div class="col-xs-12">
  39. <h3 class="header smaller lighter blue">添加经营类目</h3>
  40. <form class="form-horizontal" id="validation-form" method="post" action='{:U("SellerManage/add_store_bind_class")}'>
  41. <div class="form-group required">
  42. <label class="col-sm-2 control-label">选择分类:</label>
  43. <div class="col-sm-8" id="cateclass">
  44. <select id="class_1" class="checkbox-inline" name="class_1" rel="1">
  45. <option value="0">请选择类目</option>
  46. <volist name="cate_data" id="cate" empty="$empty">
  47. <option value="{$cate.id}">{$cate.name}</option>
  48. </volist>
  49. </select>
  50. </div>
  51. </div>
  52. <div class="form-group required">
  53. <label class="col-sm-2 control-label">分佣比例:</label>
  54. <div class="col-sm-4">
  55. <input class="form-control col-xs-10 col-sm-5" type="text" placeholder="" name="commis_rate" value="" />
  56. </div>
  57. <span class="help-inline col-sm-6">
  58. <span class="middle">%(必须为0-100的整数)</span>
  59. </span>
  60. </div>
  61. <div class="form-group">
  62. <label class="col-sm-1 control-label no-padding-left"> </label>
  63. <div class="col-sm-11">
  64. <input type="hidden" name="seller_id" value="{$seller_id}" />
  65. <input name="send" type="submit" value="提交" class="btn btn-primary" />
  66. </div>
  67. </div>
  68. </form>
  69. </div>
  70. </div>
  71. </block>
  72. <block name="javascript">
  73. <script>
  74. $(function(){
  75. $('.btn-danger').click(function(){
  76. if(confirm("确认删除吗?"))
  77. {
  78. location.href = $(this).attr('rel');
  79. return false;
  80. }else {
  81. return false;
  82. }
  83. })
  84. })
  85. $(document).delegate('#cateclass select', 'change', function(e) {
  86. return false;
  87. e.preventDefault();
  88. var thisobj =$(this);
  89. var pid =thisobj.val();
  90. thisobj.nextAll().remove();
  91. var cur_rel =parseInt( thisobj.attr('rel'))+1;
  92. if(pid ==0)
  93. return ;
  94. $.ajax({
  95. url:"{:U(SellerManage/get_json_category_tree)}",
  96. type:'get',
  97. data:{pid:pid,is_ajax:1},
  98. dataType:'json',
  99. success:function(result){
  100. if(result.code == 1)
  101. {
  102. var after_html = '<select name="class_'+cur_rel+'" class="checkbox-inline" rel="'+cur_rel+'">';
  103. after_html += '<option value="0">请选择类目</option>';
  104. for(var i in result.list)
  105. {
  106. after_html += '<option value="'+result.list[i].id+'">'+result.list[i].name+'</option>'
  107. }
  108. after_html += '</select>';
  109. thisobj.after(after_html)
  110. }
  111. }
  112. })
  113. });
  114. $(function(){
  115. $("#search").click(function () {
  116. var url = $(this).attr('url');
  117. var query = $('.search-form').find('input,select').serialize();
  118. query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
  119. query = query.replace(/^&/g, '');
  120. if (url.indexOf('?') > 0) {
  121. url += '&' + query;
  122. } else {
  123. url += '?' + query;
  124. }
  125. window.location.href = url;
  126. });
  127. });
  128. </script>
  129. </block>