chengkun
2025-04-18 1bb985f32f2efe0f9dd69f3cf29a1c809b1cf96d
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{yun:}include file="$wapstyle/member/header.htm"{/yun} 
<div id="yunvue" class="none">
<div class="blacklist_tip">被屏蔽的企业将无法查看你的简历</div>
<div class="blacklist_box" style="position:relative">
    <div class="sw_list">
    
        <div class="blacklist_p" v-for="(item, blkey) in blinfo" :key="blkey">
            <div @click="pageTo(item.wapcom_url)">{{item.com_name}}</div>
            <div @click="del(item.id,blkey)" class="blacklist_pdel"> <img src="{yun:}$wap_style{/yun}/images/resume_del.png" alt="" width="100%" height="100%"></div>                
        </div>
        <div v-if="count" class="blacklist_tip_bth"><span @click="pageTo('index.php?c=blacklistadd')" class="blacklist_tip_bth_a_tj">添加屏蔽</span>
            <div class="blacklist_tip_qkbox"  @click="delAll">清空所有屏蔽企业</div>    
        </div>
 
        <div v-if="count==2">
        <van-pagination v-model="page" :total-items="total" :items-per-page="limit" force-ellipses @change="pageChange" /> 
        </div>
        
    
    </div>
 
    
 
 
  <div class="blacklist_tip_bth" v-if="count==0" @click="pageTo('index.php?c=blacklistadd')">
      <span class="blacklist_tip_bth_a_tj">添加企业</span></div>
 
</div>
</div>
<script type="text/javascript">    
    var currentPage = parseInt('{yun:}$smarty.get.page{/yun}');   
    var yunvue =  new Vue({
        el: '#yunvue',
        data() {
            return {
                blinfo: [],
                page: currentPage ? currentPage : 1,
                showview: null,
                limit: 10,
                total:0,                
            };
        },
        computed: {
            count(){
                if(this.total > this.limit){
                  return 2;
                }else if(this.blinfo.length==0){
                  return 0;
                }else{
                    return 1;
                }
            }
        },
        created() {
            this.getBlacklist();
        },
        methods:{
            getBlacklist: function(){
                showLoading();
                var that = this;
                var paramer = {};
                paramer['page'] = that.page;
                paramer['limit'] = that.limit;
                $.post('{yun:}url d=wxapp h=user m=privacy c=blacklist{/yun}', paramer, function(data){
                    hideLoading();                
                    if (data.error == 1) {
                        let list = data.data;
                        that.blinfo = list;
                        that.total = data.total;
                          that.page = currentPage ? currentPage : 1;
                        that.showview = true;
                    } else {
                        that.showview = false;
                    }
                    $("#yunvue").css('display', 'block');
                },'json');
            },
            pageTo:function(url){
                window.location.href=url;
            },
            del:function(id,key){
                var that = this;
                var paramer = {
                    id:id,                    
                };
 
                showConfirm('确定删除?', function(){
                    showLoading('删除中...');
                    $.post('{yun:}url d=wxapp h=user m=privacy c=del{/yun}', paramer, function(data){
                        hideLoading();                    
                        let k = key;
                        if (data.error == 1) {
                            showToast('删除成功',2, function() {
                                that.blinfo.splice(k, 1);
                            });
                        } else {
                            showToast('删除失败');
                        }
                    },'json');
                });
            },
            delAll:function(){
                var that = this;
                showConfirm('确定清空?', function(){
                    showLoading('清空中...');
                    $.post('{yun:}url d=wxapp h=user m=privacy c=delall{/yun}', {rand:Math.random()}, function(data){
                        hideLoading();                    
                        if (data.error == 1) {
                            showToast('清空成功',2, function() {
                                that.blinfo = [];
                                that.showview = false;
                            });
                        } else {
                            showToast('清空失败');
                        }
                    },'json');
                })
            },
            pageChange:function(e){
                window.location.href='index.php?c=blacklist&page='+e;
            },
        },
    });
</script>  
</body>
</html>