From 241d327e57cbfe504aa806c61aa22e6205706098 Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期六, 11 四月 2026 16:59:46 +0800
Subject: [PATCH] 引用纠正
---
fzzy-igdss-web/src/main/resources/templates/wx/bind.html | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 170 insertions(+), 0 deletions(-)
diff --git a/fzzy-igdss-web/src/main/resources/templates/wx/bind.html b/fzzy-igdss-web/src/main/resources/templates/wx/bind.html
new file mode 100644
index 0000000..65571f8
--- /dev/null
+++ b/fzzy-igdss-web/src/main/resources/templates/wx/bind.html
@@ -0,0 +1,170 @@
+<!doctype html>
+<html lang="zh-cn" xmlns:th=http://www.thymeleaf.org>
+<head>
+ <meta charset="utf-8">
+ <title>鏈嶅姟缁戝畾</title>
+ <meta name="viewport"
+ content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
+ <link rel="stylesheet" th:href="@{/ajax/libs/mui/css/mui.min.css}">
+ <style>
+ .mui-content {
+ margin: 0 6px;
+ }
+ .mui-content-padded {
+ margin: 10px;
+ width: 96%;
+ margin: auto;
+ margin-top: 8px;
+ }
+ .mui-radio {
+ float: left;
+ }
+ .mui-radio.mui-left input[type=radio] {
+ left: 1px;
+ }
+ .mui-checkbox.mui-left label, .mui-radio.mui-left label {
+ padding-right: 20px;
+ padding-left: 35px;
+ }
+ .mui-btn-block {
+ width: 96%;
+ margin: auto;
+ margin-top: 10px;
+ padding: 8px 0;
+ }
+ .mui-input-row label ~ input {
+ float: left;
+ width: 50%;
+ }
+ .mui-input-row label {
+ width: 27%;
+ }
+ .btn {
+ margin-top: 4px;
+ margin-right: 2px;
+ float: right;
+ background: #EC971F;
+ color: #fff;
+ padding: 5px 5px;
+ }
+ .ts {
+ margin-top: 10px;
+ }
+ </style>
+</head>
+<body>
+<div class="mui-content">
+ <div class="mui-content-padded">
+ <form class="mui-input-group">
+ <div class="mui-input-row">
+ <label>鎵嬫満鍙�</label>
+ <input id="phone" type="text" class="mui-input-clear" placeholder="璇疯緭鍏ユ墜鏈哄彿">
+ </div>
+ <div class="mui-input-row">
+ <label>楠岃瘉鐮�</label>
+ <input id="code" style="width: 45%;" type="text" class="mui-input-clear" placeholder="5鍒嗛挓鍐呮湁鏁�">
+ <div id="count">
+ <button type="button" class="btn" onclick="getCheck()">鑾峰彇楠岃瘉鐮�</button>
+ </div>
+ </div>
+ </form>
+ </div>
+ <button class="mui-btn mui-btn-block mui-btn-success" onclick="binding()">鐐瑰嚮缁戝畾</button>
+</div>
+<script th:src="@{/js/jquery.min.js}"></script>
+<script th:src="@{/wx/wx-common.js}"></script>
+<script th:src="@{/ajax/libs/mui/js/mui.js}"></script>
+<script th:inline="javascript">
+
+ var openid = [[${openid}]]; //鐢ㄦ埛鐨刼penid
+ var c = 60; //鑾峰彇楠岃瘉鐮佸悗鐨勫�掕鏃�
+ mui.init();
+
+ //鑾峰彇楠岃瘉鐮�
+ function getCheck() {
+ var phone = document.getElementById("phone").value;
+ if (phone == null || phone.trim() == '') {
+ mui.alert("鎵嬫満鍙蜂笉鑳戒负绌猴紒", '鎻愮ず', ["纭畾"], function() {}, "div");
+ return;
+ }
+ var flag = /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(phone);
+ if (!flag) {
+ mui.alert("鎵嬫満鍙锋牸寮忎笉姝g‘锛�", '鎻愮ず', ["纭畾"], function() {}, "div");
+ return;
+ }
+ //璇锋眰鍙傛暟
+ var data = JSON.stringify({
+ "data": {
+ "openid": openid,
+ "mobile": phone
+ }
+ });
+
+ $.ajax({
+ type: "POST",
+ url: "../wx/gateway",
+ dataType: "json",
+ contentType: "application/json;charset=UTF-8",
+ data: data,
+ success: function (result) {
+ if (result.code == "0000") {
+ mui.toast("鏍¢獙鐮佸凡鍙戦�侊紒");
+ //鍊掕鏃惰鏁�
+ count();
+ } else {
+ mui.alert(result.msg, '鎻愮ず', ["纭畾"], function() {}, "div");
+ }
+ }
+ });
+ }
+
+ function count() {
+ $("#count").html('');
+ $("#count").addClass("ts");
+ var interval = setInterval(function () {//瀹氫箟瀹氭椂鍣�
+ if (c == 0) {
+ clearInterval(interval);//娓呴櫎瀹氭椂鍣�
+ $("#count").removeClass("ts");
+ $("#count").html('<button type="button" class="btn" onclick="getCheck()">鑾峰彇楠岃瘉鐮�</button>');
+ c = 60;
+ } else {
+ $("#count").html(c + 's鍚庨噸璇�');
+ c--;
+ }
+ }, 1000);
+ }
+
+ //缁戝畾鎻愪氦
+ function binding() {
+ var phone = document.getElementById("phone").value;
+ if (phone == null || phone.trim() == '') {
+ mui.alert("鎵嬫満鍙蜂笉鑳戒负绌猴紒", '鎻愮ず', ["纭畾"], function() {}, "div");
+ return;
+ }
+ var flag = /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(phone);
+ if (!flag) {
+ mui.alert("鎵嬫満鍙锋牸寮忎笉姝g‘锛�", '鎻愮ず', ["纭畾"], function() {}, "div");
+ return;
+ }
+ var code = document.getElementById("code").value;
+ // if (code == null || code.trim() == '') {
+ // mui.alert("楠岃瘉鐮佷笉鑳戒负绌猴紒", '鎻愮ず', ["纭畾"], function() {}, "div");
+ // return;
+ // }
+
+ var data = {
+ "openid": openid,
+ "mobile": phone,
+ "msgCode": code
+ };
+ wxCommon.postJson("../wx/bandOpenId", data,function (result) {
+ if (result.code == "0000") {
+ mui.toast("缁戝畾鎴愬姛锛�");
+ } else {
+ mui.alert(result.msg, '鎻愮ず', ["纭畾"], function() {}, "div");
+ }
+ });
+ }
+</script>
+</body>
+</html>
--
Gitblit v1.9.3