From a0a181af570bcd99888d0bf9d88f1b265db58353 Mon Sep 17 00:00:00 2001 From: fuenmao <980740792@qq.com> Date: Tue, 15 Sep 2026 15:38:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E8=81=8C=E6=A0=B7=E5=BC=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + src/PublicApp.vue | 6 +- src/api/modules/open/onboarding.ts | 3 +- src/main.ts | 2 + src/public-main.ts | 5 + src/styles/mobile-feedback.scss | 403 ++++++++++++++++++++++++++++ src/views/onboarding/fill/index.vue | 360 +++++++++++++++++++++---- 7 files changed, 721 insertions(+), 59 deletions(-) create mode 100644 src/styles/mobile-feedback.scss diff --git a/.gitignore b/.gitignore index 9246b90..f9d59f6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ lerna-debug.log* node_modules dist +dist-* dist-ssr stats.html *.local diff --git a/src/PublicApp.vue b/src/PublicApp.vue index 3e07928..2fdf1b1 100644 --- a/src/PublicApp.vue +++ b/src/PublicApp.vue @@ -5,9 +5,13 @@ diff --git a/src/api/modules/open/onboarding.ts b/src/api/modules/open/onboarding.ts index 8917d45..ad994cb 100644 --- a/src/api/modules/open/onboarding.ts +++ b/src/api/modules/open/onboarding.ts @@ -24,7 +24,8 @@ export const onboardingPublicApi = { }, saveEmployeeInfo(params: Record) { - return publicPost("save-employee-info", params); + // “下一步”需要将业务校验结果作为阻断弹窗展示,由页面统一提示一次。 + return publicPost("save-employee-info", params, { notifyError: false }); }, confirmContract(params: { token: string; taskContractId: number }) { diff --git a/src/main.ts b/src/main.ts index 8311fd1..a26ff6c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,6 +18,8 @@ import "element-plus/theme-chalk/dark/css-vars.css"; import "@/styles/element-dark.scss"; // custom element css import "@/styles/element.scss"; +// custom mobile feedback (Message / MessageBox / Dialog on mobile screens) +import "@/styles/mobile-feedback.scss"; // svg icons import "virtual:svg-icons-register"; // element plus diff --git a/src/public-main.ts b/src/public-main.ts index 1b738df..b413600 100644 --- a/src/public-main.ts +++ b/src/public-main.ts @@ -27,9 +27,14 @@ import errorHandler from "@/utils/errorHandler"; import "@/styles/reset.scss"; import "@/styles/common.scss"; import "element-plus/dist/index.css"; +import "@/styles/mobile-feedback.scss"; import "virtual:uno.css"; import "default-passive-events"; +if (typeof document !== "undefined") { + document.documentElement.classList.add("is-public-app"); +} + const app = createApp(PublicApp); const publicIcons = { Briefcase, diff --git a/src/styles/mobile-feedback.scss b/src/styles/mobile-feedback.scss new file mode 100644 index 0000000..f419175 --- /dev/null +++ b/src/styles/mobile-feedback.scss @@ -0,0 +1,403 @@ +/** + * 移动端专属提示与弹窗交互体系 + * 1. 在屏幕宽度 <= 768px 时对全局生效(手机端体验极致优化) + * 2. 在员工公开入职端 (html.is-public-app) 全面生效(无论手机真机或 PC 浏览器预览入职均享有一致的精致体验) + * 3. 严格隔离 PC 端后台管理系统,保证 PC 管理端在桌面大屏下 100% 保持标准桌面交互规范。 + */ + +@mixin mobile-feedback-rules { + /* ========================================================================== + 1. ElMessage 移动端悬浮胶囊 Toast + ========================================================================== */ + .el-message { + min-width: unset !important; + width: max-content !important; + max-width: calc(100vw - 32px) !important; + padding: 10px 18px !important; + border-radius: 9999px !important; + box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.05) !important; + backdrop-filter: blur(14px) !important; + -webkit-backdrop-filter: blur(14px) !important; + display: inline-flex !important; + align-items: center !important; + justify-content: center !important; + box-sizing: border-box !important; + left: 50% !important; + transform: translateX(-50%) !important; + /* 适配刘海屏及微信导航栏安全区 */ + margin-top: env(safe-area-inset-top, 14px) !important; + transition: top 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease, transform 0.25s ease !important; + pointer-events: auto !important; + + .el-message__icon { + margin-right: 8px !important; + font-size: 18px !important; + flex-shrink: 0 !important; + } + + .el-message__content { + font-size: 14px !important; + line-height: 1.45 !important; + font-weight: 500 !important; + word-break: break-word !important; + text-align: center !important; + padding: 0 !important; + } + + .el-message__closeBtn { + margin-left: 10px !important; + font-size: 14px !important; + flex-shrink: 0 !important; + } + + /* 品牌成功绿 (Emerald) */ + &.el-message--success { + background: rgba(240, 253, 244, 0.96) !important; + border: 1px solid #86efac !important; + + .el-message__icon { + color: #059669 !important; + } + + .el-message__content { + color: #064e3b !important; + font-weight: 600 !important; + } + + .el-message__closeBtn { + color: #059669 !important; + } + } + + /* 品牌暖琥珀黄 (Amber) */ + &.el-message--warning { + background: rgba(254, 252, 232, 0.96) !important; + border: 1px solid #fde047 !important; + + .el-message__icon { + color: #d97706 !important; + } + + .el-message__content { + color: #78350f !important; + font-weight: 600 !important; + } + + .el-message__closeBtn { + color: #d97706 !important; + } + } + + /* 柔和玫瑰红 (Rose) */ + &.el-message--error { + background: rgba(255, 241, 242, 0.96) !important; + border: 1px solid #fca5a5 !important; + + .el-message__icon { + color: #e11d48 !important; + } + + .el-message__content { + color: #881337 !important; + font-weight: 600 !important; + } + + .el-message__closeBtn { + color: #e11d48 !important; + } + } + + /* 晨雾优雅蓝灰 (Slate) */ + &.el-message--info { + background: rgba(248, 250, 252, 0.96) !important; + border: 1px solid #cbd5e1 !important; + + .el-message__icon { + color: #059669 !important; + } + + .el-message__content { + color: #1e293b !important; + font-weight: 600 !important; + } + + .el-message__closeBtn { + color: #64748b !important; + } + } + } + + /* ========================================================================== + 2. ElMessageBox 移动端原生卡片弹框 (Confirm / Alert) + ========================================================================== */ + .el-overlay.is-message-box { + background-color: rgba(15, 23, 42, 0.52) !important; + backdrop-filter: blur(5px) !important; + -webkit-backdrop-filter: blur(5px) !important; + + .el-overlay-message-box { + display: flex !important; + align-items: center !important; + justify-content: center !important; + padding: 16px !important; + box-sizing: border-box !important; + + /* 清除 PC 端 inline-block + vertical-align 伪类居中 */ + &::after { + display: none !important; + } + } + } + + .el-message-box { + display: flex !important; + flex-direction: column !important; + width: min(calc(100vw - 36px), 336px) !important; + max-width: 336px !important; + padding: 24px 20px 20px !important; + border-radius: 20px !important; + border: 1px solid rgba(255, 255, 255, 0.9) !important; + background: #ffffff !important; + box-shadow: 0 20px 45px -10px rgba(6, 78, 59, 0.18), 0 10px 20px -5px rgba(0, 0, 0, 0.08) !important; + text-align: center !important; + overflow: hidden !important; + box-sizing: border-box !important; + animation: mobileBoxPop 0.26s cubic-bezier(0.34, 1.56, 0.64, 1) !important; + + /* 弹框头部 */ + .el-message-box__header { + padding: 0 0 10px !important; + position: relative !important; + border-bottom: none !important; + + .el-message-box__title { + justify-content: center !important; + text-align: center !important; + + span { + font-size: 18px !important; + font-weight: 700 !important; + color: #064e3b !important; + letter-spacing: 0.3px !important; + } + } + + /* 隐藏 PC 端右上角极小叉号,避免手机端误触 */ + .el-message-box__headerbtn { + display: none !important; + } + } + + /* 弹框内容区 */ + .el-message-box__content { + padding: 6px 4px 20px !important; + text-align: center !important; + } + + .el-message-box__container { + display: flex !important; + flex-direction: column !important; + align-items: center !important; + justify-content: center !important; + gap: 12px !important; + } + + /* 拟物状态大徽标 */ + .el-message-box__status { + position: static !important; + transform: none !important; + margin: 0 auto 4px !important; + font-size: 30px !important; + width: 52px !important; + height: 52px !important; + border-radius: 50% !important; + display: flex !important; + align-items: center !important; + justify-content: center !important; + + &.el-message-box-icon--success { + color: #059669 !important; + background: #ecfdf5 !important; + border: 2px solid #a7f3d0 !important; + } + + &.el-message-box-icon--warning { + color: #d97706 !important; + background: #fffbeb !important; + border: 2px solid #fde68a !important; + } + + &.el-message-box-icon--error { + color: #e11d48 !important; + background: #fff1f2 !important; + border: 2px solid #fecdd3 !important; + } + + &.el-message-box-icon--info { + color: #059669 !important; + background: #f0fdf7 !important; + border: 2px solid #d1fae5 !important; + } + } + + .el-message-box__message { + padding: 0 !important; + text-align: center !important; + + p { + margin: 0 !important; + font-size: 14px !important; + line-height: 1.65 !important; + color: #475569 !important; + word-break: break-word !important; + } + } + + /* 按钮操作区 (44pt 移动端人机工效大按钮) */ + .el-message-box__btns { + display: flex !important; + flex-direction: row !important; + gap: 10px !important; + padding: 0 !important; + justify-content: center !important; + + .el-button { + flex: 1 1 0 !important; + min-width: 0 !important; + margin: 0 !important; + height: 44px !important; + min-height: 44px !important; + border-radius: 12px !important; + font-size: 15px !important; + font-weight: 600 !important; + box-sizing: border-box !important; + transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important; + cursor: pointer !important; + + /* 点击微触觉缩放反馈 */ + &:active { + transform: scale(0.97) !important; + } + } + + /* 次要/取消按钮 ("再检查一下"、"取消") */ + .el-button:not(.el-button--primary) { + background: #f1f5f9 !important; + border: 1px solid #e2e8f0 !important; + color: #475569 !important; + + &:active { + background: #e2e8f0 !important; + color: #1e293b !important; + } + } + + /* 主要/确认按钮 ("确认提交"、"我知道了") */ + .el-button--primary { + background: linear-gradient(135deg, #059669 0%, #047857 100%) !important; + border: none !important; + color: #ffffff !important; + box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3) !important; + + &:active { + background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important; + box-shadow: 0 2px 6px rgba(5, 150, 105, 0.2) !important; + } + } + } + } + + /* ========================================================================== + 3. ElAlert 移动端微卡片优化 + ========================================================================== */ + .el-alert { + border-radius: 12px !important; + padding: 10px 14px !important; + box-sizing: border-box !important; + + .el-alert__title { + font-size: 13px !important; + line-height: 1.5 !important; + } + + .el-alert__description { + font-size: 12px !important; + line-height: 1.55 !important; + margin-top: 4px !important; + } + + &.el-alert--info { + background-color: #f0fdf4 !important; + border: 1px solid #bbf7d0 !important; + color: #166534 !important; + + .el-alert__icon { + color: #059669 !important; + } + } + + &.el-alert--success { + background-color: #ecfdf5 !important; + border: 1px solid #a7f3d0 !important; + color: #065f46 !important; + + .el-alert__icon { + color: #059669 !important; + } + } + + &.el-alert--warning { + background-color: #fffbeb !important; + border: 1px solid #fde68a !important; + color: #92400e !important; + + .el-alert__icon { + color: #d97706 !important; + } + } + + &.el-alert--error { + background-color: #fff1f2 !important; + border: 1px solid #fecdd3 !important; + color: #9f1239 !important; + + .el-alert__icon { + color: #e11d48 !important; + } + } + } + + /* ========================================================================== + 4. ElDialog 移动端通用轻量圆角抽屉/卡片 + ========================================================================== */ + .el-dialog { + width: min(calc(100vw - 32px), 520px) !important; + max-width: calc(100vw - 32px) !important; + margin: 20px auto !important; + border-radius: 18px !important; + overflow: hidden !important; + box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15) !important; + } +} + +/* 屏幕宽度 <= 768px(手机、垂直平板)生效 */ +@media screen and (max-width: 768px) { + @include mobile-feedback-rules; +} + +/* 员工入职前端(无论手机真机或 PC 浏览器预览均享有该高级样式) */ +html.is-public-app { + @include mobile-feedback-rules; +} + +/* 移动端弹窗弹出平滑缩放进入动画 */ +@keyframes mobileBoxPop { + 0% { + opacity: 0; + transform: scale(0.92); + } + 100% { + opacity: 1; + transform: scale(1); + } +} diff --git a/src/views/onboarding/fill/index.vue b/src/views/onboarding/fill/index.vue index 40e70ed..fc20c66 100644 --- a/src/views/onboarding/fill/index.vue +++ b/src/views/onboarding/fill/index.vue @@ -1,28 +1,36 @@