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
{yun:}include file="$wapstyle/member/header.htm"{/yun} 
<div id="yunvue" class="none">
<div class="m_cardbox">
    <div class="m_cardbg" v-for="(item, lkey) in list" :key="lkey">
    
        
        <div class="sx_new_tit">管理员</div>
        <div class="sx_new_cont">
        
                
                            <span v-for="(content, ckey) in item.content_arr" :key="ckey">
                                <span v-if="content.url">
                                    <a href="javascript:void(0)" @click="pageTo(content.url)" class="sys_a">{{content.n}}</a>
                                </span>
                                <span v-else>
                                    {{content.n}}
                                </span>
                            </span>
                        
        
        
        </div><div class="sx_new_bot">
    <div class="sx_new_data">{{item.ctime_n}}    </div>
         <div class="sx_new_icon" @click="delsx(item.id,lkey)">
            <img src="{yun:}$wap_style{/yun}/images/resume_del.png" class="    " />
            
        </div></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 class="wap_member_no" v-show="count==0">
        暂无记录!
      </div>
</div>
</div>
 
<script>  
  var currentPage = parseInt('{yun:}$smarty.get.page{/yun}');       
      new Vue({
        el: '#yunvue',
        data: {
          list: [],
          limit:20,              
          total:0,
          page: currentPage ? currentPage : 1,          
        },
        computed: {
          count(){
            if(this.total > this.limit){
              return 2;
            }else if(this.list.length==0){
              return 0;
            }else{
                return 1;
            }
          }
        },
        created() {   
         this.getsixin();
        },
        methods:{          
          getsixin:function(){
            showLoading();
            var that = this;
            var paramer = {};
                paramer['page'] = that.page;
                paramer['type'] = 'wap';
                paramer['limit'] = that.limit;   
            $.post('{yun:}url d=wxapp h=user m=msg c=sxnews{/yun}',paramer,function(res){
                hideLoading();      
                that.list = res.data;
                that.total = res.total;
                that.page = currentPage ? currentPage : 1;
              
               $("#yunvue").css('display', 'block');
            },'json');            
          },
          delsx:function(id,key){
            var that = this;
            var paramer = {
                id: id,                
            };
            showConfirm("确定删除?",function(){
                showLoading('删除中...');
                $.post('{yun:}url d=wxapp h=user m=msg c=delsxnews{/yun}',paramer,function(data){
                    hideLoading();      
                    
                    if (data.error == 1) {
                        showToast('删除成功',2, function() {
                            that.list.splice(key, 1);
                            
                        });
                    } else {
                       showToast('删除失败');
                    }
                },'json');  
            })
          },          
          pageChange:function(e){
          
            location.href = 'index.php?c=sxnews&chat=1&page='+e;
          },
          pageTo:function(url){
              window.location.href = url;
          }
        } 
      });
</script>
</body>
</html>