diff --git a/static/html/dashboard.html b/static/html/dashboard.html index 13488de..995abce 100644 --- a/static/html/dashboard.html +++ b/static/html/dashboard.html @@ -21,6 +21,7 @@ } $(function () { + // 监听modal窗口事件 $('#exampleModal').on('show.bs.modal', function (event) { console.log(qr_websocket) console.log('打开'); @@ -30,11 +31,29 @@ } qr_websocket.websocket = ws }); - $('#exampleModal').on('hidden.bs.modal', function (event) { console.log('关闭'); qr_websocket.websocket.close() }); + + // 点击注册控件 + $('#register_a').click(function () { + $('.log-in-group').hide(); + $('.register-group').show(); + set_modal_title('注册'); + }) + + // 点击登录 + $('#log-in_a').click(function () { + $('.log-in-group').show(); + $('.register-group').hide(); + set_modal_title('扫码登录'); + }) + + // 设置窗口名称 + function set_modal_title(title) { + $('#exampleModal .modal-title').html(title); + } }) @@ -51,10 +70,34 @@ -