Compare commits

..

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

21283
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,15 +81,6 @@ const literalMap = {
} }
function applyTabBarLanguage() { function applyTabBarLanguage() {
try {
const pages = getCurrentPages()
if (!pages || pages.length === 0) return
const currentPage = pages[pages.length - 1]
if (!currentPage) return
const route = currentPage.route || ''
const tabBarPages = ['pages/index', 'pages/report', 'pages/work', 'pages/mine']
if (!tabBarPages.includes(route)) return
const labels = [ const labels = [
i18n.global.t('tab.home'), i18n.global.t('tab.home'),
i18n.global.t('tab.report'), i18n.global.t('tab.report'),
@ -100,13 +88,14 @@ function applyTabBarLanguage() {
i18n.global.t('tab.mine') i18n.global.t('tab.mine')
] ]
labels.forEach((text, index) => { labels.forEach((text, index) => {
try {
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">
<image :src="globalConfig.appInfo.logo" mode="aspectFit" class="logo-img"></image>
</view>
</view> </view>
<!-- 顶部装饰背景 --> <view class="login-form-content">
<view class="background-decoration"> <view class="input-item flex align-center">
<view class="wave-bg"></view> <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="login-content"> <view class="iconfont icon-password icon"></view>
<!-- 欢迎文案 --> <input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
<view class="welcome-section">
<text class="welcome-title">欢迎来到必硕数字化平台</text>
<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>
<view v-if="captchaEnabled" class="input-item flex align-center" style="width: 60%;margin: 0px;">
<!-- 登录按钮 --> <view class="iconfont icon-code icon"></view>
<view class="login-btn-wrapper"> <input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
<button @click="handleLogin" class="login-btn">登录</button> <view class="login-code">
<image :src="codeUrl" @click="getCode" class="login-code-img"></image>
</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> </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 {
.background-decoration { border-radius: 4px;
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 {
.welcome-section { margin: 20px auto;
text-align: left; background-color: #f5f6f7;
margin-top: 10rpx; height: 45px;
border-radius: 20px;
.welcome-title { .icon {
font-size: 44rpx; font-size: 38rpx;
font-weight: 600; margin-left: 10px;
color: #333333; color: #999;
display: block;
} }
.welcome-subtitle { .input {
font-size: 28rpx; width: 100%;
color: #999999; font-size: 14px;
margin-top: 16rpx; line-height: 20px;
display: block; text-align: left;
} padding-left: 15px;
} }
/* 表单区域 */
.form-section {
margin-top: 80rpx;
.form-input {
margin-bottom: 32rpx;
&.password-input {
margin-bottom: 24rpx;
}
} }
/* 忘记密码 */ .login-btn {
.forgot-password { margin-top: 40px;
text-align: right; height: 45px;
margin-bottom: 48rpx;
.forgot-link {
font-size: 26rpx;
color: #666666;
} }
.xieyi {
color: #333;
margin-top: 20px;
} }
/* 登录按钮 */ .login-code {
.login-btn-wrapper { height: 38px;
margin-bottom: 60rpx; float: right;
.login-btn { .login-code-img {
width: 100%; height: 38px;
height: 88rpx; position: absolute;
background: linear-gradient(135deg, #1a3a5c 0%, #2d5a87 100%); margin-left: 10px;
border-radius: 20rpx; width: 200rpx;
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