admin
2020-11-10 e130e13ef0cc4a827aa2c8d9e47d619a4cea40d0
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
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <title>自动提现预览</title>
        <link rel="stylesheet" type="text/css" href="../../css/doui.min.css"/>
        <link rel="stylesheet" type="text/css" href="../../layui/css/layui.css"/>
        
        <script src="../../js/doui.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../layui/layui.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/requestHost.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript">
            doui.importLoad({
                importArray: [
                    // 雷打不动
                    getHostPath() + "js/jquery.min.js",
                    getHostPath() + "js/vue.min.js",
                    // 字体图标
                    getHostPath() + "fontAdmin/iconfont.css",
                    getHostPath() + "font/iconfont.css",
                    // dom模板
                    getHostPath() + "css/admin-all.css",
                    getHostPath() + "js/admin-creat.js",
                ],
            });
        </script>
    </head>
    <body class="fontPC">
        <div class="winSizeBox">
            
            <!-- =============================================================== 搜索筛选(顶部) -->
            <div id="thisHeader" style="width:7.5rem;"></div>
            
            <!-- =============================================================== 表格 -->
            <div id="thisTable" class="admin-main-overHeader"></div>
            
        </div>
    </body>
</html>
 
<script type="text/javascript">
    
    // ==================================================================================== 页面数据
    // 轮播图id
    var bannerId = null;
    var vm = null;
    // doui准备完毕
    doui.onReady({
        success: function ()
        {
            // ----------------------------------------------------- 顶部
            // 生成顶部筛选项dom
            adminDom.header.creat({ el: "#thisHeader" });
            // 输入搜索
            adminDom.header.input({ placeholder: "暂不能搜索", })
            
            
            /*
            adminDom.header.change: function (){
                alert("执行down");
                doui.showToast("执行down");
            }*/
            
            // ----------------------------------------------------- 表格
            // 表格dom创建
            adminDom.table.creat({
                el: "#thisTable",
                // 搜索触发
                touchSearch: function (optC) 
                {
                    doui.showLoading({ content: "加载列表" });
                    doui.request({
                        type: "jsonp",
                        url: gethttp() + "/admin/new/api/v1/extract/preAutoUser",
                        data: {
                            pageIndex: optC.table.page, // 页码
                            pageSize: optC.table.pageSize, // 每页数量
                        },
                        success: function (res)
                        {
                            doui.hideLoading();
                            if (res.code != 0) { doui.showToast({ content: res.msg }); }
                            else 
                            {
                                // 申明 表格内容数据
                                var mo_tr = []; // tr组
                                for (var i = 0, mo = res.data.result_list; i < mo.length; i++)
                                {
                                    // 当前行
                                    var thatTr = {
                                        check: false,
                                        td: [
                                            { title: "状态", key: mo[i].state, value: mo[i].state },
                                            { title: "ID", key: mo[i].id, value: mo[i].id },
                                            { title: "昵称", key: mo[i].nickName, value: mo[i].nickName },
                                            { title: "头像", key: mo[i].portrait, value: mo[i].portrait, dataType: "img" },
                                            { title: "余额", key: mo[i].myHongBao, value: mo[i].myHongBao },
                                            { title: "wxOpenId", key: mo[i].wxOpenId, value: mo[i].wxOpenId },
                                            { title: "wxUnionId", key: mo[i].wxUnionId, value: mo[i].wxUnionId },
                                        ]
                                    };
                                    
                                    // 状态分析
                                    if (thatTr.td[0].key == 0) { 
                                        thatTr.td[0].value = "有效"; thatTr.td[0]["class"] = "font-green"; 
                                    } else {
                                        thatTr.td[0].value = "无效"; thatTr.td[0]["class"] = "font-red"; 
                                    }
                                    
                                    // 将当前行放入tr组
                                    mo_tr.push(thatTr);
                                }
                                // 更新表格的数据
                                adminDom.table.opt({ pageMax: res.data.pe.totalPage }); // 最大页码
                                adminDom.table.tbody({ tr: mo_tr }); // 内容数据
                            }
                        }
                    });
                },
            });
            // 表格设置
            adminDom.table.opt({ pageSize: 20, });
            // 表格头排
            adminDom.table.thead({
                th: [
                    { title: "状态", width: "", orderUp: "", orderDown: "" },
                    { title: "ID", width: "", orderUp: "", orderDown: "" },
                    { title: "昵称", width: "", orderUp: "", orderDown: "",},
                    { title: "头像", width: "", orderUp: "", orderDown: "",},
                    { title: "余额", width: "", orderUp: "", orderDown: "",},
                    { title: "wxOpenId", width: "", orderUp: "", orderDown: "",},
                    { title: "wxUnionId", width: "", orderUp: "", orderDown: "",}
                ]
            });
            // 模拟搜索点击
            vm_table.search();
 
            // 工具栏
            adminDom.table.tools({
                show: true,
                list: [
                    { "title": "下载发红包", "name": "add", "icon": "admin adminjinru1" }, 
                ],
                touch: function (back)
                {
                    // 新建
                    if (back.toolName == "add")
                    {
                        // 下载txt文档
                        window.open(gethttp() + "/admin/new/api/v1/extract/downAutoExtractTxt");
                        
                        layui.use('layer', function(){
                            layer.confirm('是否进行刷新', {
                              btn: ['是','否'] //按钮
                            }, function(){
                              layer.msg('正在刷新..', {icon: 1});
                              vm_table.search();
                            }, function(){
                              
                            });
                        });
                    }
                    
                }
            });
        
        }
    });
    
</script>