wxw
2025-05-12 c7c2f7aa20427204944ba80a2704232b2f281582
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
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" />
    <!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=2.0, user-scalable=no" /> -->
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Boxline PDA</title>
    
    <link rel="stylesheet" href="../layui/css/layui.css" />
    <link rel="stylesheet" href="../css/style.css" />
    <script src="../js/adaptive.js"></script>
    <link rel="stylesheet" href="../css/my.css" />
    <style type="text/css">
        .main {
            width: 86%;
            /* background-color: #FFF9EC; */
            margin: auto;
        }
        .logo {
            /* background-color: #00F7DE; */
            margin-top: 30px;
            text-align: center;
        }
        .logo img {
            width: 68%;
            /* height: 107px; */
        }
        .layui-input-block {
            margin-left: 8%;
            width: 92%;
        }
        .layui-input-block .layui-input {
            border: none;
            padding-left: 8px;
            font-size: 16px;
            /* line-height: 16px; */
            height: 35px;
        }
        .my-form-item {
            margin-top: 10px;
            /* background-color: #009E94; */
            height: 35px;
        }
        .little-icon {
            width: 8%;
            float: left;
            text-align: center;
            line-height: 32px;
            /* background-color: #93D1FF; */
        }
        .btn-login {
            width: 100%;
            /* background-color: #00FF00; */
            text-align: center;
            height: 46px;
            margin-top: 30px;
        }
        .btn-login input {
            border: none; 
            color: #FFFFFF;
            background-color: #0a93e3;
            background-size: 100% 100%;
            width: 96%;
            height: 100%;
            font-size: 20px;
            border-radius: 5px;
        }
        .btn-login input:active {
            opacity: 0.8;
        }
        .dropdown-lang {
            width: 92%;
            margin-left: 8%;
            position: relative;
        }
        .dropdown-lang .layui-edge {
            display: none;
        }
        .dropdown-lang input {
            border: 0;
            font-size: 16px;
        }
        .dropdown-lang img {
            position: absolute;
            right: 18px;
            top: 18px;
            z-index: 5;
        }
        .dropdown-lang dl {
            line-height: 50px;
            padding: 0;
            margin-top: 13px;
            left: 0;
            width: 100%;
        }
        .dropdown-lang dl dd {
            line-height: 50px;
            padding: 0;
            padding-left: 8px;
            font-size: 16px;
        }
    </style>
    <link rel="stylesheet" href="../css/adapter.css" />
</head>
<body>
    <div class="main-content">
        <div id="" class="logo">
            <img src="../assets/logo.png" >
        </div>
        <form class="layui-form login_form">
            <div class="layui-form-item my-form-item">
                <div id="" class="little-icon">
                    <img src="../assets/user.png" >
                </div>
                <div class="layui-input-block">
                    <input type="text" lang lay-verify="required" langholder value="" id="username" lay-reqText="Please input username" placeholder="请输入用户名" class="layui-input" >
                </div>
                <hr style="margin-top: 0;background-color: #cfcfcf;">
            </div>
            <div class="layui-form-item my-form-item" >
                <div id="" class="little-icon">
                    <img src="../assets/pwd.png" >
                </div>
                <div class="layui-input-block">
                    <input type="password" lang langholder lay-verify="required" value="" id="userpwd" lay-reqText="Please input password" placeholder="请输入密码" class="layui-input">
                </div>
                <hr style="margin-top: 0;background-color: #cfcfcf;">
            </div>
            <div class="layui-form-item my-form-item" style="display: none;">
                <div id="" class="little-icon">
                    <img src="../assets/language.png" >
                </div>
                <div id="" class="dropdown-lang">
                    <select id="languages" lay-filter="chooseLang">
                        <option value="zh">简体中文</option>
                        <!-- <option value="en">English</option> -->
                    </select>
                    <img src="../assets/down_arraw.png" >
                </div>
                <hr style="margin-top: 0;background-color: #cfcfcf;">
            </div>
            <div class="btn-login">
                <a><input type="button" lay-submit lay-filter="formDemo" lang value="登录"></a>
            </div>
        </form>
    </div>
    <script src="../js/jquery-3.5.1.min.js"></script>
    <script src="../layui/layui.js"></script>
    <script src="../js/public.js"></script>
    <script src="../js/language.js"></script>
    <script src="../js/jquery.cookie.js"></script>
    <script src="../js/jquery.md5.js"></script>
    <script>
        layui.use(['form'], function () {
            clearLangData()
            initLanguage()
            var form = layui.form;
            
            if($.cookie("lang")==""){
                $.cookie("lang", "zh")
            }
            
            // $("select[name=languages]").value = "en"
            // $("#languages").find("option[value='en']").attr("selected", true)
            // $("#languages").val("Engish")
            //console.log("999999999999")
            $("#languages").val($.cookie("lang"))
            form.render('select')
            
            setLanguage()
            
            form.on('select(chooseLang)', function(data) {
                //console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~select 被点击")
                $.cookie("lang", data.value)
                
                setLanguage()
                // alert(data.value)
                // $("#barMask").show()
            });
            
            $.cookie('userId', '');
            form.on('submit(formDemo)', function(data){
                //console.log('登录');
                var param = {
                    "LoginName": $("#username").val(),
                    "LoginPwd":$.md5($("#userpwd").val()) 
                }
                //console.log('密码:'+$.md5($("#userpwd").val()))
                sendData(IP + "/WeatherForecast/Login", param, 'post', function (res) {
                    //console.log(res);
                    if(res.code==200){//成功
                        layer.msg('登陆成功', {
                            icon: 1,
                            time: 500 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            $.cookie('token', res.ToKen.TokenStr);
                            //回调
                            location.href="/View/index.html";
                        });
                    }else{//不成功
                        layer.msg(res.ErrorMsg, {
                            icon: 2,
                            time: 2000 //2秒关闭(如果不配置,默认是3秒)
                        }, function () {
                            //回调
                        });
                    }
                });
                return false;
            });
            
        })
    </script>
</body>
</html>