bhq@iemsoft.cn
2018-11-27 e2b48dac099e43f4b3243cdf19a7522e4b5eccbe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!-- $Id: goods_search.htm 16790 2009-11-10 08:56:15Z  $ -->
<script type="text/javascript" src="../js/jquery.js"></script>
<div class="form-div">
  <form action="javascript:searchGoods()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    {if $smarty.get.act neq "trash"}
    <!-- 商圈 -->
    <select name="city" onchange="selectCity()">
      <option value="">城市</option>
    {foreach from=$city item=city}
    {if $selectKey.city eq $city.city}
     <option value="{$city.city}" selected="selected">{$city.region_name}</option>
    {else}
    <option value="{$city.city}">{$city.region_name}</option>
    {/if}
    {/foreach}     
    </select>
    <select name="county" onchange="selectCounty()">
      <option value="">区县</option>
    </select>
    <select name="district">
      <option value="">商圈</option>
    </select>
    <!-- 分类 -->
    <!--<select name="cat_id"><option value="0">{$lang.goods_cat}</option>{$cat_list}</select>-->
 
    <!-- 推荐 -->
   <!-- <select name="intro_type"><option value="0">{$lang.intro_type}</option>{html_options options=$intro_list selected=$smarty.get.intro_type}</select>-->
     
      <!-- 上架 -->
      <select name="is_on_sale"><option value=''>上架状态</option><option value="1">{$lang.on_sale}</option><option value="0">{$lang.not_on_sale}</option></select>
    <select name="supplier_status"><option value=''>审核状态</option><option value="0">未审核</option><option value="1">已通过</option><option value="2">未通过</option></select>
      {/if}
    <!-- 关键字 -->
    {$lang.keyword} <input type="text" name="keyword" size="15" />
    <input type="submit" value="{$lang.button_search}" class="button" />
  </form>
</div>
 
{literal}
<script language="JavaScript">
    function searchGoods()
    {
{/literal}
        {if $smarty.get.act neq "trash"}
       // listTable.filter['cat_id'] = document.forms['searchForm'].elements['cat_id'].value;
        
       // listTable.filter['brand_id'] = document.forms['searchForm'].elements['brand_id'].value;
        listTable.filter['supplier_status'] = document.forms['searchForm'].elements['supplier_status'].value;
       // listTable.filter['intro_type'] = document.forms['searchForm'].elements['intro_type'].value;
        listTable.filter['city'] = document.forms['searchForm'].elements['city'].value;
        listTable.filter['county'] = document.forms['searchForm'].elements['county'].value;
        listTable.filter['district_id'] = document.forms['searchForm'].elements['district'].value;
          {if $suppliers_exists eq 1}
         //listTable.filter['suppliers_id'] = document.forms['searchForm'].elements['supplier_id'].value;
          {/if}
        listTable.filter['is_on_sale'] = document.forms['searchForm'].elements['is_on_sale'].value;
        {/if}
{literal}
        listTable.filter['keyword'] = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
        listTable.filter['page'] = 1;
 
        listTable.loadList();
    }
    
function selectCity(){
    var city = $("select[name='city']").val();
            $.ajax({url:'virtual_goods.php?act=selectCounty',
            dataType: 'json', 
            data:{city:city},
            success: function(data){
            $('select[name="county"]').empty();
            $('select[name="county"]').append('<option value="">区县</option>');  
            $('select[name="district"]').empty();
            $('select[name="district"]').append('<option value="">商圈</option>');  
            $.each(data, function(i, item) {
            $('select[name="county"]').append('<option value="'+item.county+'">'+item.region_name+'</option>');  
        })
      }
    });
}
 
function selectCounty(){
    var county = $("select[name='county']").val();
            $.ajax({url:'virtual_goods.php?act=selectDistrict',
            dataType: 'json', 
            data:{county:county},
            success: function(data){
               
            $('select[name="district"]').empty();
            $('select[name="district"]').append('<option value="">商圈</option>');  
            $.each(data, function(i, item) {
            $('select[name="district"]').append('<option value="'+item.district_id+'">'+item.district_name+'</option>');  
        })
      }
    });
}
</script>
{/literal}