123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <extend name="Public:base" />
- <block name="content">
-
- <div class="row">
- <div class="col-xs-12">
- <h3 class="header smaller lighter blue">已授权经营类目</h3>
- <div class="table-responsive">
- <table class="table table-striped table-bordered table-hover">
- <thead>
- <tr>
- <th>ID</th>
- <th>一级分类</th>
- <th>佣金比例</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <volist name="list" id="m" empty="$empty">
- <tr>
- <td>{$m.bid}</td>
- <td>{$m.cate1_name}</td>
- <td>{$m.commis_rate}%</td>
- <td>
- <a class="btn btn-xs btn-danger" href="javascript:;" rel='{:U("SellerManage/delstorebind",array("bid"=>$m["bid"],"id" =>$seller_id ))}'>
- <i class="icon-trash bigger-120"></i>
- </a>
- </td>
- </tr>
- </volist>
- <tr>
- <td colspan="20" class="page">{$page}</td>
- </tr>
- </tbody>
-
- </table>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-xs-12">
- <h3 class="header smaller lighter blue">添加经营类目</h3>
- <form class="form-horizontal" id="validation-form" method="post" action='{:U("SellerManage/add_store_bind_class")}'>
-
- <div class="form-group required">
- <label class="col-sm-2 control-label">选择分类:</label>
- <div class="col-sm-8" id="cateclass">
- <select id="class_1" class="checkbox-inline" name="class_1" rel="1">
- <option value="0">请选择类目</option>
- <volist name="cate_data" id="cate" empty="$empty">
- <option value="{$cate.id}">{$cate.name}</option>
- </volist>
- </select>
-
- </div>
- </div>
- <div class="form-group required">
- <label class="col-sm-2 control-label">分佣比例:</label>
- <div class="col-sm-4">
- <input class="form-control col-xs-10 col-sm-5" type="text" placeholder="" name="commis_rate" value="" />
-
-
- </div>
- <span class="help-inline col-sm-6">
- <span class="middle">%(必须为0-100的整数)</span>
- </span>
- </div>
- <div class="form-group">
- <label class="col-sm-1 control-label no-padding-left"> </label>
- <div class="col-sm-11">
-
- <input type="hidden" name="seller_id" value="{$seller_id}" />
- <input name="send" type="submit" value="提交" class="btn btn-primary" />
- </div>
- </div>
- </form>
- </div>
- </div>
- </block>
- <block name="javascript">
- <script>
- $(function(){
- $('.btn-danger').click(function(){
- if(confirm("确认删除吗?"))
- {
- location.href = $(this).attr('rel');
- return false;
- }else {
- return false;
- }
- })
- })
- $(document).delegate('#cateclass select', 'change', function(e) {
- return false;
- e.preventDefault();
- var thisobj =$(this);
- var pid =thisobj.val();
- thisobj.nextAll().remove();
- var cur_rel =parseInt( thisobj.attr('rel'))+1;
- if(pid ==0)
- return ;
-
- $.ajax({
- url:"{:U(SellerManage/get_json_category_tree)}",
- type:'get',
- data:{pid:pid,is_ajax:1},
- dataType:'json',
- success:function(result){
-
- if(result.code == 1)
- {
- var after_html = '<select name="class_'+cur_rel+'" class="checkbox-inline" rel="'+cur_rel+'">';
-
- after_html += '<option value="0">请选择类目</option>';
- for(var i in result.list)
- {
- after_html += '<option value="'+result.list[i].id+'">'+result.list[i].name+'</option>'
- }
- after_html += '</select>';
- thisobj.after(after_html)
- }
- }
- })
-
-
-
- });
- $(function(){
-
- $("#search").click(function () {
- var url = $(this).attr('url');
- var query = $('.search-form').find('input,select').serialize();
- query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
- query = query.replace(/^&/g, '');
- if (url.indexOf('?') > 0) {
- url += '&' + query;
- } else {
- url += '?' + query;
- }
- window.location.href = url;
- });
-
-
- });
- </script>
- </block>
|