Compare commits

..

No commits in common. 'd16f39733624d7c611e17d6890fd80dfd29bca5d' and 'bcd9a4e7349869ee1768ff777bd0979695007456' have entirely different histories.

21451
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -76,11 +76,10 @@
"@dcloudio/uni-cli-shared": "3.0.0-4020320240708001", "@dcloudio/uni-cli-shared": "3.0.0-4020320240708001",
"@dcloudio/uni-stacktracey": "3.0.0-4020320240708001", "@dcloudio/uni-stacktracey": "3.0.0-4020320240708001",
"@dcloudio/vite-plugin-uni": "3.0.0-4020320240708001", "@dcloudio/vite-plugin-uni": "3.0.0-4020320240708001",
"@types/node": "18.19.130",
"@vue/runtime-core": "^3.4.23", "@vue/runtime-core": "^3.4.23",
"@vue/tsconfig": "^0.1.3", "@vue/tsconfig": "^0.1.3",
"less": "^4.2.0", "less": "^4.2.0",
"sass": "1.56.1", "sass": "^1.77.7",
"sass-loader": "^10.1.1", "sass-loader": "^10.1.1",
"typescript": "^4.9.5", "typescript": "^4.9.5",
"vite": "5.2.8", "vite": "5.2.8",

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

@ -34,10 +34,7 @@ const i18n = createI18n({
locale: getSavedLocale(), locale: getSavedLocale(),
fallbackLocale: DEFAULT_LOCALE, fallbackLocale: DEFAULT_LOCALE,
globalInjection: true, globalInjection: true,
messages, messages
missingWarn: false,
fallbackWarn: false,
missing: (locale, key) => key
}) })
const literalMap = { const literalMap = {
@ -84,29 +81,21 @@ const literalMap = {
} }
function applyTabBarLanguage() { function applyTabBarLanguage() {
try { const labels = [
const pages = getCurrentPages() i18n.global.t('tab.home'),
if (!pages || pages.length === 0) return i18n.global.t('tab.report'),
const currentPage = pages[pages.length - 1] i18n.global.t('tab.work'),
if (!currentPage) return i18n.global.t('tab.mine')
const route = currentPage.route || '' ]
const tabBarPages = ['pages/index', 'pages/report', 'pages/work', 'pages/mine'] labels.forEach((text, index) => {
if (!tabBarPages.includes(route)) return try {
const labels = [
i18n.global.t('tab.home'),
i18n.global.t('tab.report'),
i18n.global.t('tab.work'),
i18n.global.t('tab.mine')
]
labels.forEach((text, index) => {
uni.setTabBarItem({ uni.setTabBarItem({
index, index,
text text
}) })
}) } catch (e) {
} catch (e) { }
} })
} }
export function getCurrentLocale() { export function getCurrentLocale() {
@ -117,6 +106,9 @@ export function setLocale(locale) {
const nextLocale = normalizeLocale(locale) const nextLocale = normalizeLocale(locale)
i18n.global.locale.value = nextLocale i18n.global.locale.value = nextLocale
uni.setStorageSync(LOCALE_STORAGE_KEY, nextLocale) uni.setStorageSync(LOCALE_STORAGE_KEY, nextLocale)
if (typeof uni.setLocale === 'function') {
uni.setLocale(nextLocale)
}
applyTabBarLanguage() applyTabBarLanguage()
uni.$emit(LOCALE_CHANGE_EVENT, nextLocale) uni.$emit(LOCALE_CHANGE_EVENT, nextLocale)
return nextLocale return nextLocale

@ -1,60 +1,45 @@
<template> <template>
<view class="scroll-container"> <view class="normal-login-container">
<view class="login-container"> <view class="logo-content align-center justify-center flex">
<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
<!-- Logo区域 --> </image>
<view class="logo-section"> <text class="title">数字化智能中控平台</text>
<view class="logo-wrapper"> </view>
<image :src="globalConfig.appInfo.logo" mode="aspectFit" class="logo-img"></image> <view class="login-form-content">
</view> <view class="input-item flex align-center">
<view class="iconfont icon-user icon"></view>
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
</view> </view>
<!-- 顶部装饰背景 --> <view class="input-item flex align-center">
<view class="background-decoration"> <view class="iconfont icon-password icon"></view>
<view class="wave-bg"></view> <input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
</view> </view>
<view v-if="captchaEnabled" class="input-item flex align-center" style="width: 60%;margin: 0px;">
<view class="login-content"> <view class="iconfont icon-code icon"></view>
<!-- 欢迎文案 --> <input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
<view class="welcome-section"> <view class="login-code">
<text class="welcome-title">欢迎来到必硕数字化平台</text> <image :src="codeUrl" @click="getCode" class="login-code-img"></image>
<text class="welcome-subtitle">登录以实现您的需求</text>
</view>
<!-- 登录表单 -->
<view class="form-section">
<!-- 账号输入 -->
<up-input v-model="loginForm.username" placeholder="请输入账号" :maxlength="30" border="bottom" clearable
class="form-input" />
<!-- 密码输入 -->
<up-input v-model="loginForm.password" type="password" placeholder="请输入密码" :maxlength="20" border="bottom"
clearable class="form-input password-input" />
<!-- 忘记密码 -->
<view class="forgot-password">
<text class="forgot-link">忘记密码</text>
</view>
<!-- 登录按钮 -->
<view class="login-btn-wrapper">
<button @click="handleLogin" class="login-btn">登录</button>
</view>
</view> </view>
</view> </view>
<view class="action-btn">
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
</view>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import modal from '@/plugins/modal' import modal from '@/plugins/modal'
import { getCodeImg } from '@/api/login' import { getCodeImg } from '@/api/login'
import { ref } from "vue"; import { ref } from "vue";
import config from '@/config.js' import config from '@/config.js'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { getWxCode } from '@/utils/geek';
import { wxLogin } from '@/api/oauth';
import { setToken } from '@/utils/auth';
const userStore = useUserStore() const userStore = useUserStore()
const codeUrl = ref(""); const codeUrl = ref("");
const captchaEnabled = ref(false); const captchaEnabled = ref(false); //
const globalConfig = ref(config); const globalConfig = ref(config);
const loginForm = ref({ const loginForm = ref({
@ -67,6 +52,7 @@ const loginForm = ref({
uuid: '' uuid: ''
}); });
//
function getCode() { function getCode() {
getCodeImg().then(res => { getCodeImg().then(res => {
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled
@ -76,7 +62,7 @@ function getCode() {
} }
}) })
} }
// getCode();
async function handleLogin() { async function handleLogin() {
if (loginForm.value.username === "") { if (loginForm.value.username === "") {
modal.msgError("请输入您的账号") modal.msgError("请输入您的账号")
@ -88,8 +74,8 @@ async function handleLogin() {
modal.loading("登录中,请耐心等待...") modal.loading("登录中,请耐心等待...")
pwdLogin() pwdLogin()
} }
} };
//
async function pwdLogin() { async function pwdLogin() {
userStore.login(loginForm.value).then(() => { userStore.login(loginForm.value).then(() => {
modal.closeLoading() modal.closeLoading()
@ -100,146 +86,90 @@ async function pwdLogin() {
getCode() getCode()
} }
}) })
} };
function loginSuccess(result) { function loginSuccess(result) {
//
userStore.getInfo().then(res => { userStore.getInfo().then(res => {
uni.switchTab({ uni.switchTab({
url: '/pages/index' url: '/pages/index'
}); });
}) })
} }
</script> </script>
<style lang="scss"> <style lang="scss">
page { page {
background-color: #ffffff; background-color: #ffffff;
min-height: 100vh;
} }
.scroll-container { .normal-login-container {
height: 100%;
width: 100%; width: 100%;
overflow: auto;
.login-container { .logo-content {
width: 100%; width: 100%;
min-height: 100vh; font-size: 21px;
position: relative; text-align: center;
box-sizing: border-box; padding-top: 15%;
padding: 0 50rpx;
image {
/* 顶部装饰背景 */ border-radius: 4px;
.background-decoration {
position: absolute;
top: 20rpx;
left: -9.2%;
right: -9.2%;
width: 118.4%;
height: 400rpx;
overflow: hidden;
.wave-bg {
width: 100%;
height: 100%;
background-image: url(@/assets/img/backgroundshadow1.png);
background-size: 100% 100%;
background-repeat: no-repeat;
}
} }
/* Logo区域 */ .title {
.logo-section { margin-left: 10px;
padding-top: 40rpx;
display: flex;
justify-content: center;
.logo-wrapper {
width: 160rpx;
height: 160rpx;
background: #ffffff;
border-radius: 40rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.08);
display: flex;
align-items: center;
justify-content: center;
.logo-img {
width: 80rpx;
height: 80rpx;
}
}
} }
}
/* 登录内容区 */ .login-form-content {
.login-content { text-align: center;
position: relative; margin: 20px auto;
top: 110rpx; margin-top: 15%;
width: 80%;
.input-item {
margin: 20px auto;
background-color: #f5f6f7;
height: 45px;
border-radius: 20px;
.icon {
font-size: 38rpx;
margin-left: 10px;
color: #999;
}
/* 欢迎文案 */ .input {
.welcome-section { width: 100%;
font-size: 14px;
line-height: 20px;
text-align: left; text-align: left;
margin-top: 10rpx; padding-left: 15px;
.welcome-title {
font-size: 44rpx;
font-weight: 600;
color: #333333;
display: block;
}
.welcome-subtitle {
font-size: 28rpx;
color: #999999;
margin-top: 16rpx;
display: block;
}
} }
/* 表单区域 */ }
.form-section {
margin-top: 80rpx; .login-btn {
margin-top: 40px;
.form-input { height: 45px;
margin-bottom: 32rpx; }
&.password-input { .xieyi {
margin-bottom: 24rpx; color: #333;
} margin-top: 20px;
} }
/* 忘记密码 */ .login-code {
.forgot-password { height: 38px;
text-align: right; float: right;
margin-bottom: 48rpx;
.login-code-img {
.forgot-link { height: 38px;
font-size: 26rpx; position: absolute;
color: #666666; margin-left: 10px;
} width: 200rpx;
}
/* 登录按钮 */
.login-btn-wrapper {
margin-bottom: 60rpx;
.login-btn {
width: 100%;
height: 88rpx;
background: linear-gradient(135deg, #1a3a5c 0%, #2d5a87 100%);
border-radius: 20rpx;
font-size: 30rpx;
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
border: none;
&:active {
opacity: 0.9;
}
}
}
} }
} }
} }

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save