diff --git a/components.d.ts b/components.d.ts index 3a50709..752d737 100644 --- a/components.d.ts +++ b/components.d.ts @@ -21,6 +21,7 @@ declare module 'vue' { WdCard: typeof import('wot-design-uni/components/wd-card/wd-card.vue')['default'] WdCell: typeof import('wot-design-uni/components/wd-cell/wd-cell.vue')['default'] WdCellGroup: typeof import('wot-design-uni/components/wd-cell-group/wd-cell-group.vue')['default'] + WdCheckbox: typeof import('wot-design-uni/components/wd-checkbox/wd-checkbox.vue')['default'] WdCollapse: typeof import('wot-design-uni/components/wd-collapse/wd-collapse.vue')['default'] WdCollapseItem: typeof import('wot-design-uni/components/wd-collapse-item/wd-collapse-item.vue')['default'] WdConfigProvider: typeof import('wot-design-uni/components/wd-config-provider/wd-config-provider.vue')['default'] diff --git a/src/composables/useTabbar.ts b/src/composables/useTabbar.ts index e01b0a2..11b7aa4 100644 --- a/src/composables/useTabbar.ts +++ b/src/composables/useTabbar.ts @@ -8,7 +8,7 @@ export interface TabbarItem { const tabbarItems = ref([ { name: "home", value: null, active: true, title: "首页", icon: "home" }, - { name: "work", value: null, active: false, title: "工作台", icon: "apps" }, + { name: "work", value: null, active: false, title: "工作台", icon: "laptop" }, { name: "mine", value: null, active: false, title: "我的", icon: "user" }, ]); diff --git a/src/pages.json b/src/pages.json index 8b29041..1b62b71 100644 --- a/src/pages.json +++ b/src/pages.json @@ -33,9 +33,7 @@ "style": { "navigationBarTitleText": "工作台" }, - "meta": { - "requireAuth": true - } + "layout": "tabbar" }, { "path": "pages/mine/about/index", @@ -72,6 +70,46 @@ "navigationBarTitleText": "设置" } }, + { + "path": "pages/work/config/index", + "type": "page", + "name": "config", + "style": { + "navigationBarTitleText": "系统配置" + } + }, + { + "path": "pages/work/log/index", + "type": "page", + "name": "log", + "style": { + "navigationBarTitleText": "系统日志" + } + }, + { + "path": "pages/work/notice/index", + "type": "page", + "name": "notice", + "style": { + "navigationBarTitleText": "通知公告" + } + }, + { + "path": "pages/work/role/index", + "type": "page", + "name": "role", + "style": { + "navigationBarTitleText": "角色管理" + } + }, + { + "path": "pages/work/user/index", + "type": "page", + "name": "user", + "style": { + "navigationBarTitleText": "用户管理" + } + }, { "path": "pages/mine/settings/account/index", "type": "page" @@ -88,6 +126,14 @@ "path": "pages/mine/settings/network/index", "type": "page" }, + { + "path": "pages/mine/settings/privacy/index", + "type": "page", + "name": "privacy", + "style": { + "navigationBarTitleText": "隐私政策" + } + }, { "path": "pages/mine/settings/theme/index", "type": "page", @@ -123,6 +169,9 @@ { "pagePath": "pages/index/index" }, + { + "pagePath": "pages/work/index" + }, { "pagePath": "pages/mine/index" } diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index d007672..64ccc9f 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -94,10 +94,16 @@ - - - - + + + @@ -125,6 +131,7 @@ const loading = ref(false); const userStore = useUserStore(); const showPassword = ref(false); const loginType = ref<"account" | "phone">("account"); +const isAgreePolicy = ref(false); // 是否同意隐私协议 const { authState, getLoginCode, getPhoneNumber } = useWechat(); // 登录表单数据 @@ -142,21 +149,16 @@ onLoad((options) => { } }); -// 强制清除输入框背景色 -onMounted(() => { - setTimeout(() => { - const inputs = document.querySelectorAll("input"); - inputs.forEach((input) => { - input.style.backgroundColor = "transparent"; - input.style.boxShadow = "none"; - }); - }, 100); -}); - // 账号密码登录处理 const handleAccountLogin = () => { if (loading.value) return; + // 检查是否同意隐私协议 + if (!isAgreePolicy.value) { + toast.error("请先阅读并同意用户协议和隐私政策"); + return; + } + // 表单验证 if (!loginFormData.value.username) { toast.error("请输入用户名"); @@ -193,6 +195,13 @@ const handleAccountLogin = () => { // 微信一键登录(通过手机号) const handleWechatPhoneLogin = async (e: any) => { if (loading.value || authState.value.isLogining) return; + + // 检查是否同意隐私协议 + if (!isAgreePolicy.value) { + toast.error("请先阅读并同意用户协议和隐私政策"); + return; + } + loading.value = true; try { @@ -234,6 +243,13 @@ const handleWechatPhoneLogin = async (e: any) => { // 微信授权登录处理 const handleWechatLogin = async () => { if (loading.value) return; + + // 检查是否同意隐私协议 + if (!isAgreePolicy.value) { + toast.error("请先阅读并同意用户协议和隐私政策"); + return; + } + loading.value = true; try { @@ -313,8 +329,8 @@ const navigateToPrivacy = () => { .login-card { position: relative; z-index: 2; - width: 80%; - max-width: 600rpx; // 限制最大宽度 + width: 85%; // 移动端保持两边边距 + max-width: 420px; // 桌面端最大宽度 padding: 50rpx 40rpx; background-color: var(--wot-color-bg); border: 1rpx solid var(--wot-color-border); @@ -452,16 +468,29 @@ const navigateToPrivacy = () => { // 登录协议 .login-agreement { display: flex; + align-items: flex-start; justify-content: center; margin-top: 60rpx; font-size: 24rpx; + :deep(.wd-checkbox) { + align-items: flex-start; + } + + &__content { + display: inline-flex; + flex-wrap: wrap; + align-items: center; + line-height: 1.6; + } + &__text { color: var(--wot-color-text-secondary); } &__link { color: var(--wot-color-theme); + text-decoration: underline; } } diff --git a/src/pages/mine/settings/privacy/index.vue b/src/pages/mine/settings/privacy/index.vue new file mode 100644 index 0000000..d789c5e --- /dev/null +++ b/src/pages/mine/settings/privacy/index.vue @@ -0,0 +1,94 @@ + + + + + +{ + "name": "privacy", + "style": { + "navigationBarTitleText": "隐私政策" + } +} + + + diff --git a/src/pages/work/index.vue b/src/pages/work/index.vue index 3ab3d7f..387ee2a 100644 --- a/src/pages/work/index.vue +++ b/src/pages/work/index.vue @@ -1,11 +1,11 @@