chengkun
2025-05-26 4462855c0033970c39ac8d0da704b7dc41eabbfe
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
<div id="searchhtml" class="none">
    <!-- 头部 -->
    <div class="wap_search_header">
        <div class="wap_search_header_c">
            <div class="wap_search_headerqx" onclick="searchhtmlhide()"> </div>
            <form method="get" action="{yun:}$config_wapdomain{/yun}/index.php">
                <input type="hidden" id="type" name="c" value="{yun:}if $smarty.get.c{/yun}{yun:}$smarty.get.c{/yun}{yun:}else{/yun}job{yun:}/if{/yun}"/>
                <div class="wap_search_text">
                    <input type="text" value="" onkeyup="this.value = this.value.replace(/[,]/g,'');" id="input_search" name="keyword" class="" placeholder="请输入{yun:}if $smarty.get.c=='job' || !$smarty.get.c{/yun}职位名/公司名{yun:}elseif $smarty.get.c=='resume'{/yun}关键字{yun:}/if{/yun}">
                    
                </div><div class="wap_search_hbth"><input type="submit" value="搜索" class=""></div>
            </form>
            
        </div>
    </div>
    <!-- 主体 -->
    <div class="Search_jobs_body">
        <div class="search_history_tit">
            <span class=" ">历史搜索</span>
            <span class="search_history_qc" style="display:none" id="clearhistory"></span>
        </div>
        <div class="" id="historylist">
            <div class="search_history_no">
                暂无搜索记录~
            </div>
        </div>
    </div>
    <div class="Search_jobs_body">
        <div class="search_history_tit">热门搜索</div>
        <div class="search_history_tag_box">
 
            {yun:}if $smarty.get.c=='job' || !$smarty.get.c{/yun}
                {yun:}key limit=12 recom=1 type=3 iswap=1 item=keylist{/yun}
                    <a href="{yun:}$keylist.url{/yun}" class="search_history_tag">{yun:}$keylist.key_name{/yun}</a>
                {yun:}/key{/yun}
            {yun:}elseif $smarty.get.c=='resume'{/yun}
                {yun:}key limit=12 recom=1 type=5 iswap=1 item=key{/yun}
                    <a href="{yun:}$key.url{/yun}" class="search_history_tag">{yun:}$key.key_name{/yun}</a>
                {yun:}/key{/yun}
            {yun:}/if{/yun}
        </div>
    </div>
</div>
<script>
    function clearhis(type) {
        $.post("index.php?c=search&a=del", {
            type: type
        }, function (data) {
            if (data) {
                showToast("历史已清除!", 2, function () {
                    window.location.href = data;
                })
                return false;
            } else {
                showToast("操作失败!");
                return false;
            }
        });
    }
 
    function searchhtmlhide() {
        $("#searchhtml").addClass('none');
        $("#app").removeClass('none');
    }
 
    $(document).ready(function () {
        $(".searchnew").on('click', function () {
            setTimeout(function () {
                $("#app").addClass('none');
                $("#searchhtml").removeClass('none');
            }, 400);
        })
        var type = $("#type").val();
        $.post("index.php?c=search&a=history", {
            type: type
        }, function (data) {
 
            if (data) {
                var data = eval('(' + data + ')');
 
                if (data.hisid) {
                    $("#clearhistory").html("<a href='javascript:void(0);' onclick=\"clearhis('" + data.hisid + "')\">清除历史</a>");
                    $("#clearhistory").show();
                }
                if (data.list) {
                    var html = '';
                    $.each(data.list, function () {
                        html += "<div class=\"search_history_tag\"> <a href=\"" + this.url + "\">" + this.key_name + "</a></div>";
                    });
                    $("#historylist").html(html);
                }
            }
        });
    });
</script>