wlzboy
2025-07-09 ab0742bf945b5de8554761de6fa4ecda29f640e0
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>  
<!--#include virtual="/inc/odbc.asp"-->
<!--#include virtual="/inc/function.asp"-->
<!--#include virtual="/inc/core.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%
n    = Request("n")
s    = Request("s")
u    = Request("u")
l    = Request("l")    '注册用户/登录
 
' 如果没有传递任何参数,显示登录码输入页面
If n="" And s="" And u="" And l="" Then
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录码输入</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }
        .container {
            background: white;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            text-align: center;
            max-width: 400px;
            width: 100%;
        }
        .title {
            font-size: 24px;
            color: #333;
            margin-bottom: 30px;
        }
        .input-group {
            margin-bottom: 20px;
        }
        .input-group label {
            display: block;
            text-align: left;
            margin-bottom: 8px;
            color: #555;
            font-weight: bold;
        }
        .input-group input {
            width: 100%;
            padding: 12px;
            border: 2px solid #ddd;
            border-radius: 5px;
            font-size: 16px;
            box-sizing: border-box;
        }
        .input-group input:focus {
            outline: none;
            border-color: #007bff;
        }
        .btn {
            background-color: #007bff;
            color: white;
            padding: 12px 30px;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            margin: 5px;
            transition: background-color 0.3s;
        }
        .btn:hover {
            background-color: #0056b3;
        }
        .btn:disabled {
            background-color: #ccc;
            cursor: not-allowed;
        }
        .tip {
            color: #666;
            font-size: 14px;
            margin-top: 20px;
            line-height: 1.5;
        }
        .error {
            color: #dc3545;
            font-size: 14px;
            margin-top: 10px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="title">广东民航医疗快线 支付登录</div>
        <form id="loginForm">
            <div class="input-group">
                <label for="loginCode">登录码:</label>
                <input type="text" id="loginCode" name="loginCode" maxlength="6" placeholder="请输入6位登录码" autocomplete="off">
            </div>
            <div class="input-group">
                <button type="button" id="payBtn" class="btn" disabled>去支付</button>
            </div>
            <div class="tip">请输入支付短信中发送的登录码</div>
            <div id="errorMsg" class="error" style="display: none;"></div>
        </form>
    </div>
 
    <script>
        const loginCodeInput = document.getElementById('loginCode');
        const payBtn = document.getElementById('payBtn');
        const errorMsg = document.getElementById('errorMsg');
        let autoRedirectTimer = null;
 
        function validateLoginCode(code) {
            return /^[A-Za-z0-9]{6}$/.test(code);
        }
 
        function redirectToLogin(code) {
            const currentUrl = window.location.href.split('?')[0];
            window.location.href = currentUrl + '?n=' + encodeURIComponent(code);
        }
 
        function updateButtonState() {
            const code = loginCodeInput.value.trim();
            const isValid = validateLoginCode(code);
            payBtn.disabled = !isValid;
            
            if (isValid) {
                errorMsg.style.display = 'none';
                // 清除之前的定时器
                if (autoRedirectTimer) {
                    clearTimeout(autoRedirectTimer);
                }
                // 设置自动跳转定时器(2秒后自动跳转)
                autoRedirectTimer = setTimeout(() => {
                    redirectToLogin(code);
                }, 2000);
            } else {
                if (autoRedirectTimer) {
                    clearTimeout(autoRedirectTimer);
                    autoRedirectTimer = null;
                }
            }
        }
 
        function showError(message) {
            errorMsg.textContent = message;
            errorMsg.style.display = 'block';
        }
 
        function hideError() {
            errorMsg.style.display = 'none';
        }
 
        // 输入框事件监听
        loginCodeInput.addEventListener('input', function() {
            const code = this.value.trim();
            
            // 只允许输入数字和字母
            this.value = code.replace(/[^A-Za-z0-9]/g, '');
            
            updateButtonState();
            hideError();
        });
 
        // 支付按钮点击事件
        payBtn.addEventListener('click', function() {
            const code = loginCodeInput.value.trim();
            if (validateLoginCode(code)) {
                redirectToLogin(code);
            } else {
                showError('请输入正确的6位登录码');
            }
        });
 
        // 回车键提交
        loginCodeInput.addEventListener('keypress', function(e) {
            if (e.key === 'Enter') {
                const code = this.value.trim();
                if (validateLoginCode(code)) {
                    redirectToLogin(code);
                } else {
                    showError('请输入正确的6位登录码');
                }
            }
        });
 
        // 页面加载时聚焦到输入框
        window.addEventListener('load', function() {
            loginCodeInput.focus();
        });
    </script>
</body>
</html>
<%
Response.End
End If
 
Response.Cookies("n")=n
Response.Cookies("n").Expires=DateAdd("n",30,now())
Response.Cookies("s")=s
Response.Cookies("s").Expires=DateAdd("s",30,now())
Set rs = Server.CreateObject("ADODB.Recordset")
If n<>"" Then
    sql="select id,URL from dwzURL where dateadd(day,15,nTime)>=getdate() and n='"&n&"' order by id desc"
    rs.open Sql,objConn,1,1
    If not rs.Eof Then
        URL=rs("URL")
        If InStr(URL,"MyOrder.php")>=1 Then
            DispatchOrdID=Mid(URL,InStr(URL,"DispatchOrdID")+14,10)
            Sign1=Md5Sign(DispatchOrdID,GPSKey,"utf-8")
        ElseIf InStr(URL,"GuestOrder.php")>=1 Then
            DispatchOrdID=Mid(URL,InStr(URL,"DispatchOrdID")+14,10)
            Sign1=Md5Sign(DispatchOrdID,GPSKey,"utf-8")
            If InStr(request.ServerVariables("HTTP_USER_AGENT"),"MicroMessenger")>=1 Then
                URL=Replace(URL,"GuestOrder.php","MyOrder.php")
            End If
        else
            Sign1=SignArgs(URL)
        End if
        Response.Redirect URL&"&sign="&Sign1
    Else
        Response.Redirect "/OrdEvaluateError.asp"
    End If
    rs.close()
ElseIf u<>"" Then
    sql="select id,vtext,vOrder from dictionary where vtitle='URL' and vType>=1 and vID="&u
    rs.open Sql,objConn,1,1
    If not rs.Eof Then
        id=rs("id")
        URL=rs("vtext")
        sql="update dictionary set vOrder=vOrder+1 where id="&id
        objConn.Execute sql
        Response.Redirect URL
    Else
        Response.Redirect "/OrdEvaluateError.asp"
    End If
    rs.close()
 
ElseIf l="1" Then    '注册用户/登录(手机)
    LoginType    = Request("t")
    UserPhone    = Request("p")
    If LoginType="" Then LoginType=1
    If Len(UserPhone)=11 And IsNumeric(UserPhone) Then
        %><!--#include virtual="/inc/JsonAPI.asp"--><%
        LoginSign="APPID"&APPID&"LoginType1UnixTime"&ToUnixTime(now(), +8)&"UserPhone"&UserPhone&"methodUser_Login"
        Sign1=Md5Sign(LoginSign,APPKey,"utf-8")
        appUrl="https://api.966120.com.cn/user/"
        args1="method=User_Login&LoginType=1&UserPhone="&UserPhone&"&APPID="&APPID&"&UnixTime="&ToUnixTime(now(), +8)&"&Sign="&Sign1
        
        HTMLCODE= GetBody(appUrl,args1)
        'Response.Write HTMLCODE &"<br><br>"
        'Response.end
        json=HTMLCODE
        %>
        <script language="jscript" runat="server">
        Array.prototype.get = function(i)
        {
         return this[i]; 
        };
        function getjson(str){
         try{
          eval("var jsonStr = (" + str + ")");
         }catch(ex){
          var jsonStr = null;
         }
         return jsonStr;
        }
        </script>
        <%
        str=json
        'str=right(str,len(str)-instr(str,"?{")+1)
        'str=left(str,InstrRev(str,"}"))
        dim obj
        set obj = getjson(str)
        str0=""
        result=obj.result
        If result=1 Then
            UserID=obj.UserID
        End If
        Sign1=Md5Sign(UserID,GPSKey,"utf-8")
        Response.Redirect "/index.html#/?UserID="&UserID&"&s="&s&"&Sign="&Sign1
        'Response.Write UserID&"<br>"&LoginURL
        'Response.end
    Else
        Response.Redirect "/index.html"
    End If
Else
    Response.Redirect "/index.html"
End If
%>