| | |
| | | <view class="login-container"> |
| | | <view class="header"> |
| | | <image src="/static/avatar/logo.png" class="logo" /> |
| | | <text class="hospital-name">青岛OPO</text> |
| | | <text class="hospital-name">青附院OPO管理平台</text> |
| | | </view> |
| | | |
| | | <view class="form-container"> |
| | |
| | | const redirect = ref("/pages/index/index"); // 默认跳转首页 |
| | | |
| | | onLoad((options) => { |
| | | // 格式化当前日期为 YYYYMMDD |
| | | const getCurrentDate = () => { |
| | | const now = new Date(); |
| | | const year = now.getFullYear(); |
| | | const month = String(now.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(now.getDate()).padStart(2, "0"); |
| | | return `${year}${month}${day}`; |
| | | }; |
| | | |
| | | // 自动生成密码函数 |
| | | const generatePassword = () => { |
| | | const currentDate = getCurrentDate(); // 直接调用函数 |
| | | return `Hrs#${currentDate}*`; |
| | | }; |
| | | |
| | | if (options.redirect) { |
| | | redirect.value = decodeURIComponent(options.redirect); |
| | | } |
| | | password.value = generatePassword(); // 直接调用函数 |
| | | username.value = "admin"; |
| | | // 检测是否鸿蒙系统 |
| | | // #ifdef HARMONY |
| | | isHarmonyOS.value = true; |
| | | |
| | | // #endif |
| | | }); |
| | | |
| | |
| | | const redirects = redirect.value || "/pages/index/index"; |
| | | |
| | | // 判断是否为tabBar页面 |
| | | const tabBarPages = ["/pages/index/index", "/pages/appointment/index", "/pages/consultation/index", "/pages/my/index"]; |
| | | const tabBarPages = [ |
| | | "/pages/index/index", |
| | | "/pages/appointment/index", |
| | | "/pages/consultation/index", |
| | | "/pages/my/index", |
| | | ]; |
| | | if (tabBarPages.includes(redirects)) { |
| | | console.log(redirects,'预路由1'); |
| | | console.log(redirects, "预路由1"); |
| | | uni.switchTab({ url: redirects }); |
| | | } else { |
| | | console.log(redirects,'预路由2'); |
| | | console.log(redirects, "预路由2"); |
| | | uni.redirectTo({ url: redirects }); |
| | | } |
| | | } catch (err) { |