yujian
2019-01-22 88b54772dbcf5ecab1e2316e4e4626ac901b8908
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!DOCTYPE html>
<html lang="zh-cn">
 
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>管理-版块栏目</title>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link href="css/maincontent.css" rel="stylesheet">
        <!--[if lt IE 9]>
      <script src="js/html5shiv.js"></script>
      <script src="js/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        td{
            text-align: center;
        }
    
        td div{
            overflow: hidden;
            text-overflow:ellipsis;
            white-space: nowrap;
            width: 200px;
        }
        
        td a{
            overflow: hidden;
            text-overflow:ellipsis;
            white-space: nowrap;
            width: 200px;
        }
    </style>
    </head>
 
    <body>
        <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
        </nav>
        <div id="mainbody">
            <div id="sidebar">
                <dl>
                </dl>
            </div>
            <div id="neirong">
                <div class="erjidh">
                    <table class="table">
                        <tbody>
                            <tr>
                                <td class="xiala">
                                    <select name="select" class="form-control pushType">
                                        <option value="0">全部</option>
                                        <option value="1">商品推送</option>
                                        <option value="2">url推送</option>
                                        <option value="3">推荐详情推送</option>
                                    </select>
                                </td>
                                <td>
                                    <form class="form-inline" role="form">
                                        <div class="form-group" role="search">
                                            <input type="text" class="form-control searchText" style="width:200px;" placeholder="标题">
                                        </div>
                                        <button type="button" class="btn btn-default searchBtn">搜索</button>
                                    </form>
                                </td>
                                <td>
                                    <div class="tianjia">
                                        <a href="shezhi_tuisong.html" class="btn btn-primary" role="button">添加推送&nbsp;+</a>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="zhuti">
                    <div class="liebiao" style="box-sizing:border-box;">
                        <table class="table table-striped" style="width:100%;box-sizing:border-box;">
                            <thead>
                                <tr>
                                    <th >编号</th>
                                    <th>标题</th>
                                    <th>用戶uid</th>
                                    <th>url</th>
                                    <th>类型</th>
                                    <th >打开次数</th>
                                    <th >接收对象</th>
                                    <th >APP名称</th>
                                    <th >状态</th>
                                    <th >时间</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        <div class="bianhaoid">
                                        </div>
                                    </td>
                                    <td>
                                        <div class="bianhaoname">
                                        </div>
                                    </td>
                                    <td>
                                        <div class="bianhaouid">
                                        </div>
                                    </td>
                                    <td>
                                        <div class="durl">
                                            <a href="#" target="_blank"></a>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="dtype">
                                        </div>
                                    </td>
                                    <td >
                                        <div class="dcount">
                                        </div>
                                    </td>
                                    <td >
                                        <div class="dobj">
                                        </div>
                                    </td>
                                    <td >
                                        <div class="appName">
                                        </div>
                                    </td>
                                    <td >
                                        <div class="dstate">
                                        </div>
                                    </td>
                                    <td>
                                        <div  class="createtime">
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <hr>
                    </div>
                </div>
                <div class="bottom">
                    <div class="page">
                        <ul class="pagination">
                            <li class="disabled pre">
                                <a href="#">&laquo;</a>
                            </li>
                            <li>
                                <a href="#" class="next">&raquo;</a>
                            </li>
                        </ul>
                        <div class="form-group">
                            <div class="tzan">
                                <button type="button" class="btn btn-primary">跳转</button>
                            </div>
                            <div class="tz">
                                <input class="form-control" type="text" id="customPage" placeholder="页数">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="//cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/page.js"></script>
        <script src="js/nav.js"></script>
        <script src="layer/layer.js"></script>
        <script src="js/utli.js"></script>
        <script>
            var trHtml;
            $(function(){
                trHtml = $(".liebiao tbody").html();
                $(".liebiao tbody").empty();
                
                getRecordData(1);
                $(".searchBtn").bind("click",function(){
                    getRecordData(1);
                });
                
            });
            function getRecordData(page){
                var type = $(".pushType option:checked").val();
                var title = $(".searchText").val();
                $.post("api/v1/pushRecord/getPushRecordList",{"title":title,"type":type,"page":page},function(data){
                    if(data.code==0){
                        setRecordData(data.data);
                        fillPage(data.data.pe, function(pageindex) {
                                getRecordData(pageindex);
                            });
                    }else{
                        layer.msg("数据访问出错");
                    }
                },'json');
            }
            
            function setRecordData(data){
                $(".liebiao tbody").empty();
                var list = data.list;
                for (var ii=0;ii<list.length;ii++) {
                    $(".liebiao tbody").append(trHtml);
                    var $tr= $(".liebiao tbody tr:last-of-type");
                    var rd = list[ii];
                    $tr.find(".bianhaoid").text(rd.id);
                    $tr.find(".bianhaoname").text(rd.title);
                    $tr.find(".bianhaouid").text(rd.uid);
                    $tr.find(".durl a").text(rd.url);
                    $tr.find(".durl a").attr("href",rd.url);
                    $tr.find(".appName").text(rd.appName);
                    
                    var typeName;
                    var type = rd.type;
                    if(type==1){
                        typeName="商品推送";
                    }else if(type==2){
                        typeName="url推送";
                    }else if(type==3){
                        typeName="推荐详情推送";
                    }
                    $tr.find(".dtype").text(typeName)
                    $tr.find(".dcount").text(rd.count);
                    var state;
                    if(rd.state==1){
                        state="成功";
                    }else if(rd.state==2){
                        state="android成功";
                    }else if(rd.state==3){
                        state="IOS成功";
                    }else{
                        state="失败";
                    }
                    var account = rd.account;
                    if(account==0){
                        account="所有设备";
                    }else if(account==1){
                        account="IOS设备";
                    }else if(account==2){
                        account="Android设备";
                    }else if(account==3){
                        account="单个账号";
                    }else{
                        account="其他";
                    }
                    $tr.find(".dstate").text(state);
                    var createtime = rd.createtime;
                    var time = new Date(parseInt(createtime)).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
                    $tr.find(".createtime").text(time); 
                }
            }
        </script>
 
    </body>
 
</html>