-
欢迎企业端用户扫码添加微信获取邀请码
+
欢迎扫码添加微信获取邀请码
@@ -80,6 +81,36 @@ export function getInvitationModalStyles(): string {
animation: modalSlideIn 0.3s ease-out;
}
+ .invitation-close-btn {
+ position: absolute;
+ top: 12px;
+ right: 12px;
+ width: 28px;
+ height: 28px;
+ border: none;
+ background: transparent;
+ color: var(--vscode-foreground);
+ font-size: 24px;
+ line-height: 1;
+ cursor: pointer;
+ border-radius: 4px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ transition: all 0.2s;
+ opacity: 0.6;
+ z-index: 1;
+ }
+
+ .invitation-close-btn:hover {
+ opacity: 1;
+ background: var(--vscode-toolbar-hoverBackground);
+ }
+
+ .invitation-close-btn:active {
+ transform: scale(0.95);
+ }
+
@keyframes modalSlideIn {
from {
opacity: 0;
@@ -216,6 +247,7 @@ export function getInvitationModalScript(): string {
const modal = document.getElementById('invitationModal');
const input = document.getElementById('invitationCodeInput');
const submitBtn = document.getElementById('invitationSubmitBtn');
+ const closeBtn = document.getElementById('invitationCloseBtn');
const errorDiv = document.getElementById('invitationError');
// 显示邀请码弹窗
@@ -270,6 +302,11 @@ export function getInvitationModalScript(): string {
// 点击提交按钮
submitBtn.addEventListener('click', submitInvitationCode);
+ // 点击关闭按钮
+ closeBtn.addEventListener('click', function() {
+ hideInvitationModal();
+ });
+
// 回车键提交
input.addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
@@ -277,6 +314,11 @@ export function getInvitationModalScript(): string {
}
});
+ // 点击遮罩层关闭弹窗
+ document.querySelector('.invitation-modal-overlay').addEventListener('click', function() {
+ hideInvitationModal();
+ });
+
// 阻止点击弹窗内容时关闭
document.querySelector('.invitation-modal-content').addEventListener('click', function(e) {
e.stopPropagation();