diff --git a/src/App.vue b/src/App.vue index 55e3905..293e203 100644 --- a/src/App.vue +++ b/src/App.vue @@ -95,6 +95,14 @@ const tabbar: TabbarItem[] = [ selectedIconPath: "/static/tabbar/my-select.png", launchParam: ["canteen", "selfMerchant"], auth: ["user",], + }, + { + pagePath: "pages/integrated/visitor/verify", + text: "访客核销", + iconPath: "/static/tabbar/my.png", + selectedIconPath: "/static/tabbar/my-select.png", + launchParam: ["canteen", "selfMerchant"], + auth: ["user",], }, { pagePath: "pages/tabbar/my", diff --git a/src/pages.json b/src/pages.json index df12b47..1bd9629 100644 --- a/src/pages.json +++ b/src/pages.json @@ -9,67 +9,47 @@ } }, "pages": [ -// { -// "path": "pages/tabbar/canteen", -// "style": { -// "navigationBarTitleText": "食堂", -// "disableScroll": true -// } -// }, -// { -// "path": "pages/tabbar/selfMerchant", -// "style": { -// "navigationBarTitleText": "自营商家", -// "disableScroll": true -// } -// }, -// { -// "path": "pages/tabbar/coopMerchant", -// "style": { -// "navigationBarTitleText": "合作商家", -// "disableScroll": true -// } -// }, -// { -// "path": "pages/tabbar/order", -// "style": { -// "navigationBarTitleText": "订单", -// "disableScroll": true -// } -// }, -// { -// "path": "pages/tabbar/flowStatistics", -// "style": { -// "navigationBarTitleText": "流水统计", -// "disableScroll": true -// } -// }, -// { -// "path": "pages/tabbar/individualOrder", -// "style": { -// "navigationBarTitleText": "订单", -// "disableScroll": true -// } -// }, -// { -// "path": "pages/integrated/visitor/myvisitor", -// "style": { -// "navigationBarTitleText": "访客", -// "disableScroll": true -// } -// }, { - "path": "pages/tabbar/my", + "path": "pages/integrated/visitor/index", "style": { - "navigationBarTitleText": "我的", - "disableScroll": true + "navigationBarTitleText": "访客申请", + "navigationStyle": "custom" + } + }, + { + "path": "pages/integrated/visitor/myvisitor", + "style": { + "navigationBarTitleText": "申请记录", + "navigationStyle": "custom" + } + }, + { + "path": "pages/integrated/visitor/myyyvisitor", + "style": { + "navigationBarTitleText": "访客邀约", + "navigationStyle": "custom" + } + }, + { + "path": "pages/integrated/visitor/myyyvisitorlist", + "style": { + "navigationBarTitleText": "邀约记录", + "navigationStyle": "custom" } }, { "path": "pages/integrated/visitor/verify", "style": { + "navigationBarTitleText": "访客核销", "navigationStyle": "custom" } + }, + { + "path": "pages/tabbar/my", + "style": { + "navigationBarTitleText": "我的", + "disableScroll": true + } } ], "subPackages": [ @@ -371,7 +351,7 @@ { "path": "visitor/myyyvisitor", "style": { - "navigationBarTitleText": "邀约访客" + "navigationBarTitleText": "访客邀约" } } ] @@ -412,118 +392,39 @@ { "pagePath": "pages/integrated/visitor/index", "text": "访客申请", - "iconPath": "", - "selectedIconPath": "" + "iconPath": "static/tabbar/visitor-apply.png", + "selectedIconPath": "static/tabbar/visitor-apply-select.png" }, { "pagePath": "pages/integrated/visitor/myvisitor", "text": "申请记录", - "iconPath": "", - "selectedIconPath": "" + "iconPath": "static/tabbar/visitor-record.png", + "selectedIconPath": "static/tabbar/visitor-record-select.png" }, { "pagePath": "pages/integrated/visitor/myyyvisitor", "text": "访客邀约", - "iconPath": "", - "selectedIconPath": "" + "iconPath": "static/tabbar/visitor-invite.png", + "selectedIconPath": "static/tabbar/visitor-invite-select.png" }, { "pagePath": "pages/integrated/visitor/myyyvisitorlist", "text": "邀约记录", - "iconPath": "", - "selectedIconPath": "" + "iconPath": "static/tabbar/visitor-invited.png", + "selectedIconPath": "static/tabbar/visitor-invited-select.png" }, { "pagePath": "pages/integrated/visitor/verify", - "text": "核销", - "iconPath": "", - "selectedIconPath": "" + "text": "访客核销", + "iconPath": "static/tabbar/visitor-verify.png", + "selectedIconPath": "static/tabbar/visitor-verify-select.png" }, -// { -// "pagePath": "pages/tabbar/canteen", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// }, -// { -// "pagePath": "pages/tabbar/selfMerchant", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// }, -// { -// "pagePath": "pages/tabbar/coopMerchant", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// }, -// { -// "pagePath": "pages/tabbar/order", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// }, -// { -// "pagePath": "pages/tabbar/flowStatistics", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// }, -// { -// "pagePath": "pages/tabbar/individualOrder", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// }, -// { -// "pagePath": "pages/tabbar/my", -// "text": "", -// "iconPath": "", -// "selectedIconPath": "" -// } - // { - // "pagePath": "pages/tabbar/canteen", - // "text": "食堂", - // "iconPath": "static/tabbar/canteen.png", - // "selectedIconPath": "static/tabbar/canteen-select.png" - // }, - // { - // "pagePath": "pages/tabbar/selfMerchant", - // "text": "自营商家", - // "iconPath": "static/tabbar/selfMerchant.png", - // "selectedIconPath": "static/tabbar/selfMerchant-select.png" - // }, - // { - // pagePath: "pages/tabbar/coopMerchant", - // text: "合作商家", - // iconPath: "static/tabbar/coopMerchant.png", - // selectedIconPath: "static/tabbar/coopMerchant-select.png", - // }, - // { - // "pagePath": "pages/tabbar/order", - // "text": "订单", - // "iconPath": "static/tabbar/order.png", - // "selectedIconPath": "static/tabbar/order-select.png" - // }, - // { - // "pagePath": "pages/tabbar/flowStatistics", - // "text": "流水统计", - // "iconPath": "static/tabbar/order.png", - // "selectedIconPath": "static/tabbar/order-select.png" - // }, - // { - // "pagePath": "pages/tabbar/individualOrder", - // "text": "订单", - // "iconPath": "static/tabbar/order.png", - // "selectedIconPath": "static/tabbar/order-select.png" - // }, - { - "pagePath": "pages/tabbar/my", - "text": "我的", - "iconPath": "static/tabbar/my.png", - "selectedIconPath": "static/tabbar/my-select.png" - } - + { + "pagePath": "pages/tabbar/my", + "text": "我的", + "iconPath": "static/tabbar/my.png", + "selectedIconPath": "static/tabbar/my-select.png" + } ] } } diff --git a/src/pages/integrated/visitor/myyyvisitorlist.vue b/src/pages/integrated/visitor/myyyvisitorlist.vue index 5c100bf..0332231 100644 --- a/src/pages/integrated/visitor/myyyvisitorlist.vue +++ b/src/pages/integrated/visitor/myyyvisitorlist.vue @@ -69,30 +69,6 @@ 暂无数据 - - - - - - 访客申请 - - - - 申请记录 - - - - 主动邀约 - - - - 邀约记录 - - - - 我的 - - @@ -362,7 +338,7 @@ defineExpose({ .page-container { min-height: 100vh; background-color: #f5f5f5; - padding-bottom: 120rpx; // 为底部导航留出空间 + padding-bottom: 20rpx; // 修改底部间距 } .status-tabs { @@ -506,40 +482,4 @@ defineExpose({ color: #999; font-size: 26rpx; } - -.bottom-nav { - position: fixed; - bottom: 0; - left: 0; - right: 0; - height: 100rpx; - background-color: #fff; - display: flex; - justify-content: space-around; - align-items: center; - border-top: 1rpx solid #eee; - padding-bottom: env(safe-area-inset-bottom); // 适配iPhone底部安全区 - - .nav-item { - display: flex; - flex-direction: column; - align-items: center; - padding: 10rpx 0; - - .nav-icon { - width: 44rpx; - height: 44rpx; - margin-bottom: 4rpx; - } - - .nav-text { - font-size: 20rpx; - color: #999; - - &.active { - color: #1777FF; - } - } - } -} diff --git a/src/pages/tabbar/my.vue b/src/pages/tabbar/my.vue index ca6598d..8313fa5 100644 --- a/src/pages/tabbar/my.vue +++ b/src/pages/tabbar/my.vue @@ -16,7 +16,7 @@ ID {{ state.userInfo?.sysUser?.userId }} - + 请先登录 @@ -42,6 +42,40 @@ 切换角色 + + + + + + + 账号密码登录 + × + + + + + + + + + + + + + + @@ -80,7 +114,7 @@ const state = reactive<{ // { text: "访客记录", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/myvisitor" }, // { text: "访客邀约", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/myyyvisitor" }, // { text: "邀约记录", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/myyyvisitorlist" }, - // { text: "访客核销", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/verify" }, + { text: "访客核销", icon: "/static/icon/service_5.png", router: "/pages/integrated/visitor/verify" }, // { text: "意见反馈", icon: "/static/icon/service_5.png", router: "/pages/integrated/feedback/index" } ], @@ -125,6 +159,59 @@ const storage = { }, } +// 添加登录相关的状态 +const showLogin = ref(false) +const loginForm = reactive({ + username: '', + password: '' +}) + +// 显示登录弹窗 +const showLoginPopup = () => { + showLogin.value = true +} + +// 关闭登录弹窗 +const closeLoginPopup = () => { + showLogin.value = false + loginForm.username = '' + loginForm.password = '' +} + +// 处理账号密码登录 +const handleLogin = async () => { + if (!loginForm.username || !loginForm.password) { + uni.showToast({ + title: '请输入账号和密码', + icon: 'none' + }) + return + } + + try { + uni.showLoading({ title: '登录中...', mask: true }) + const response = await userApi.login({ + username: loginForm.username, + password: loginForm.password + }) + + if (response.code === 0) { + storage.saveToken({ accessToken: response.data.accessToken }) + const { data: userData } = await userApi.userInfo() + storage.saveUserInfo(userData) + closeLoginPopup() + uni.showToast({ title: '登录成功', icon: 'none' }) + } else { + uni.showToast({ title: response.msg || '登录失败', icon: 'none' }) + } + } catch (error) { + console.error('登录失败:', error) + uni.showToast({ title: '登录失败', icon: 'none' }) + } finally { + uni.hideLoading() + } +} + const login = { // 检查应用环境并登录 checkAppInfo: async () => { @@ -137,7 +224,8 @@ const login = { const zhengdingResult = login.zhengdingLogin() if (zhengdingResult) return - uni.showToast({ title: "当前登录环境未知", icon: "none" }) + // 如果都不是,显示账号密码登录弹窗 + showLoginPopup() } catch (error) { console.error("登录失败:", error) uni.showToast({ title: "登录失败", icon: "none" }) @@ -393,4 +481,93 @@ onShow(() => { border-bottom: 1px solid #fafafa; margin-bottom: 40rpx; } + +// 添加登录弹窗样式 +.login-popup { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 100; + + .popup-mask { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.4); + } + + .popup-content { + position: absolute; + left: 0; + right: 0; + bottom: 0; + background: #fff; + border-radius: 24rpx 24rpx 0 0; + } + + .popup-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 32rpx; + border-bottom: 1rpx solid #f5f5f5; + + .popup-title { + font-size: 32rpx; + color: #323233; + font-weight: 500; + } + + .popup-close { + font-size: 40rpx; + color: #969799; + padding: 10rpx; + } + } + + .popup-body { + padding: 32rpx; + } + + .input-item { + margin-bottom: 24rpx; + + .input { + width: 100%; + height: 88rpx; + background: #F7F8FA; + border-radius: 8rpx; + padding: 0 24rpx; + font-size: 30rpx; + color: #323233; + } + + .placeholder { + color: #969799; + } + } + + .popup-footer { + padding: 24rpx 32rpx; + background: #fff; + border-top: 1rpx solid #f5f5f5; + + .login-btn { + width: 100%; + height: 88rpx; + background: #1989FA; + border-radius: 44rpx; + display: flex; + align-items: center; + justify-content: center; + color: #fff; + font-size: 32rpx; + font-weight: 500; + } + } +}