Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/develop/3.2.2' into develop/3.2.2

# Conflicts:
#	index.html
Damon 9 mesi fa
parent
commit
a63a9b5e17

+ 3 - 0
.vscode/settings.json

@@ -0,0 +1,3 @@
+{
+    "livePreview.defaultPreviewPath": "/index.html"
+}

+ 93 - 17
resource/css/app.css

@@ -1,26 +1,102 @@
 /* Write your styles */
 
 /* 登陆logo */
-.myapp-login-logo { font-size: 130px; color: #ff6a4c;}
+.myapp-login-logo {
+    font-size: 130px;
+    color: #ff6a4c;
+}
 
-// 输入框
+/*  输入框 */
 .myapp-login-form {}
-.am-form-set { margin-bottom: 10px;}
-.myapp-login-form .myapp-login-input-text { font-size: 14px!important; padding-left: 48px!important; line-height: 1.8!important; border-radius: 30px!important; margin-top: 8px;}
-.myapp-login-form .myapp-login-input-text:focus { border-color: #ff6a4c!important; -webkit-box-shadow: inset 0 1px 1px rgba(225,86,86,.075),0 0 5px rgba(225,86,86,.3)!important;box-shadow: inset 0 1px 1px rgba(225,86,86,.075),0 0 5px rgba(225,86,86,.3)!important; }
-.am-form-set>input:first-child {border-radius: 30px!important;}
-.myapp-login-form .am-form-icon i {color: #ccc; padding-left: 15px;}
-.myapp-login-form-submit { background: #ff6a4c; border-radius: 30px; border-color: #ff6a4c;}
-.myapp-login-form-submit:hover { background: #ff8e77;border-color: #ff8e77;}
-.myapp-login-form-shortcut { position: relative; height: 30px; line-height: 30px; margin-top: 30px; padding: 0; width: 88%;  overflow: hidden;box-sizing: border-box;-webkit-box-sizing: border-box; }
-.myapp-login-form-shortcut .myapp-login-form-hr { background: #ccc;  position: absolute; top:50%; left:0; right:0;display: block;  width: 100%; z-index: 1;}
-.myapp-login-form-shortcut .myapp-login-form-hr-font { display: inline-block; padding: 0 16px; background: #fff; position: relative; font-size: 12px; color: #ccc; z-index: 2;}
-.myapp-login-form-listico { padding-top: 30px;}
-.myapp-login-form-listico .am-icon-btn { width: 60px; height: 60px; line-height: 60px; font-size: 30px;}
-.myapp-login-form-listico .am-icon-btn:hover { opacity: .9;}
+
+.am-form-set {
+    margin-bottom: 10px;
+}
+
+.myapp-login-form .myapp-login-input-text {
+    font-size: 14px !important;
+    padding-left: 48px !important;
+    line-height: 1.8 !important;
+    border-radius: 30px !important;
+    margin-top: 8px;
+}
+
+.myapp-login-form .myapp-login-input-text:focus {
+    border-color: #ff6a4c !important;
+    -webkit-box-shadow: inset 0 1px 1px rgba(225, 86, 86, .075), 0 0 5px rgba(225, 86, 86, .3) !important;
+    box-shadow: inset 0 1px 1px rgba(225, 86, 86, .075), 0 0 5px rgba(225, 86, 86, .3) !important;
+}
+
+.am-form-set>input:first-child {
+    border-radius: 30px !important;
+}
+
+.myapp-login-form .am-form-icon i {
+    color: #ccc;
+    padding-left: 15px;
+}
+
+.myapp-login-form-submit {
+    background: #ff6a4c;
+    border-radius: 30px;
+    border-color: #ff6a4c;
+}
+
+.myapp-login-form-submit:hover {
+    background: #ff8e77;
+    border-color: #ff8e77;
+}
+
+.myapp-login-form-shortcut {
+    position: relative;
+    height: 30px;
+    line-height: 30px;
+    margin-top: 30px;
+    padding: 0;
+    width: 88%;
+    overflow: hidden;
+    box-sizing: border-box;
+    -webkit-box-sizing: border-box;
+}
+
+.myapp-login-form-shortcut .myapp-login-form-hr {
+    background: #ccc;
+    position: absolute;
+    top: 50%;
+    left: 0;
+    right: 0;
+    display: block;
+    width: 100%;
+    z-index: 1;
+}
+
+.myapp-login-form-shortcut .myapp-login-form-hr-font {
+    display: inline-block;
+    padding: 0 16px;
+    background: #fff;
+    position: relative;
+    font-size: 12px;
+    color: #ccc;
+    z-index: 2;
+}
+
+.myapp-login-form-listico {
+    padding-top: 30px;
+}
+
+.myapp-login-form-listico .am-icon-btn {
+    width: 60px;
+    height: 60px;
+    line-height: 60px;
+    font-size: 30px;
+}
+
+.myapp-login-form-listico .am-icon-btn:hover {
+    opacity: .9;
+}
 
 .title {
-    font-size:27px;
+    font-size: 27px;
 }
 
 .wi-fi-front {
@@ -51,4 +127,4 @@
 
 .toggle-pwd i:hover {
     color: #333;
-}
+}

File diff suppressed because it is too large
+ 963 - 1
resource/css/layer.css


File diff suppressed because it is too large
+ 6484 - 8
resource/js/amazeui.min.js


+ 84 - 60
resource/js/app.js

@@ -1,62 +1,86 @@
-$(document).ready(function() {
-    $('#toggleEye').click(function() {
-      var pwdInput = $('#WiFiPwd');
-      var pwdType = pwdInput.attr('type');
-
-      if (pwdType === 'password' && $(this).hasClass('am-icon-eye-slash')) {
-        pwdInput.attr('type', 'text');
-        $(this).removeClass('am-icon-eye-slash').addClass('am-icon-eye');
-      } else {
-        pwdInput.attr('type', 'password');
-        $(this).removeClass('am-icon-eye').addClass('am-icon-eye-slash');
-      }
-    });
-    $('#confirm').click(function(event) {
-      event.preventDefault()
-      $(this).prop("disabled", true);
-      setTimeout(function() {
-        $("#confirm").prop("disabled", false);
-      }, 1000);
-      var wifiName = $('#WiFiName').val();
-      if (wifiName.trim().length === 0){
-        layer.msg('必须输入Wi-Fi账号✅');
-        return
-      }
-      var wifiPwd = $('#WiFiPwd').val();
-      if (wifiPwd.trim().length < 8){
-        layer.msg('必须输入正确的Wi-Fi密码✅');
-        return
-      }
-      var uuId = $('#UUId').val();
-      if (uuId.trim().length === 0){
-        layer.msg('必须传UUId✅');
-        return
+$(document).ready(function () {
+  $('#toggleEye').click(function () {
+    var pwdInput = $('#WiFiPwd');
+    var pwdType = pwdInput.attr('type');
+
+    if (pwdType === 'password' && $(this).hasClass('am-icon-eye-slash')) {
+      pwdInput.attr('type', 'text');
+      $(this).removeClass('am-icon-eye-slash').addClass('am-icon-eye');
+    } else {
+      pwdInput.attr('type', 'password');
+      $(this).removeClass('am-icon-eye').addClass('am-icon-eye-slash');
+    }
+  });
+
+  window.onload = function () {
+    // 从URL中获取UUID参数  
+    const uuidFromUrl = getQueryParam('uuid');
+    // 获取 HTML 元素  
+    var uuidElement = document.getElementById('UUID');
+    // 使用 JavaScript 替换占位符  
+    uuidElement.textContent = "UUID: " + uuidFromUrl;
+    // uuidElement.textContent = uuidElement.textContent.replace('{{.uuid}}', uuidFromUrl);
+  };
+
+  // 函数:从URL中获取查询参数的值  
+  function getQueryParam(param) {
+    const urlParams = new URLSearchParams(window.location.search);
+    return urlParams.get(param);
+  }
+
+  // 确定
+  $('#confirm').click(function (event) {
+    event.preventDefault()
+    $(this).prop("disabled", true);
+
+    setTimeout(function () {
+      $("#confirm").prop("disabled", false);
+    }, 1000);
+
+    var wifiName = $('#WiFiName').val();
+    if (wifiName.trim().length === 0) {
+      layer.msg('必须输入Wi-Fi账号✅');
+      return
+    }
+
+    var wifiPwd = $('#WiFiPwd').val();
+    if (wifiPwd.trim().length < 8) {
+      layer.msg('必须输入正确的Wi-Fi密码✅');
+      return
+    }
+    var uuId = $('#UUId').val();
+    if (uuId.trim().length === 0) {
+      layer.msg('必须传UUId✅');
+      return
+    }
+
+    // 网络请求
+    $.ajax({
+      url: 'http://ptt.radio1964.com/v1/device/set-wifi', // 替换为后台接口的实际URL
+      method: 'POST', // 替换为后台接口的实际请求方法
+      data: {
+        wifiName: wifiName,
+        wifiPwd: wifiPwd,
+        UUId: uuId,
+      },
+      success: function (response) {
+        layer.msg('✅ 设置成功', {
+          icon: 1
+        }, function () {
+          var ua = navigator.userAgent.toLowerCase();
+          if (ua.match(/MicroMessenger/i) == "micromessenger") {
+            WeixinJSBridge.call('closeWindow');
+          } else if (ua.indexOf("alipay") != -1) {
+            AlipayJSBridge.call('closeWebview');
+          } else if (ua.indexOf("baidu") != -1) {
+            BLightApp.closeWindow();
+          }
+          window.location.reload();
+        });
+      },
+      error: function (error) {
+        layer.msg('💤 请稍后再试');
       }
-      $.ajax({
-        url: 'http://ptt.radio1964.com/v1/device/set-wifi', // 替换为后台接口的实际URL
-        method: 'POST', // 替换为后台接口的实际请求方法
-        data: {
-          wifiName: wifiName,
-          wifiPwd: wifiPwd,
-          UUId: uuId,
-        },
-        success: function(response) {
-          layer.msg( '✅ 设置成功'
-          ,{icon:1},function(){
-                var ua = navigator.userAgent.toLowerCase();
-                if(ua.match(/MicroMessenger/i)=="micromessenger") {
-                  WeixinJSBridge.call('closeWindow');
-                } else if(ua.indexOf("alipay")!=-1){
-                  AlipayJSBridge.call('closeWebview');
-                }else if(ua.indexOf("baidu")!=-1){
-                  BLightApp.closeWindow();
-                }
-            window.location.reload();
-          });
-        },
-        error: function(error) {
-          layer.msg('💤 请稍后再试');
-        }
-      });
     });
-  });
+  });
+});

File diff suppressed because it is too large
+ 3182 - 2
resource/js/jquery-3.7.1.min.js


File diff suppressed because it is too large
+ 651 - 2
resource/js/layer.js