Compare commits

...

2 Commits

Author SHA1 Message Date
7c8f107849 navigateTo增加 2026-03-16 12:09:15 +08:00
f11597f7b6 1203修改文件预览,登录页面 2026-03-16 12:03:48 +08:00
4 changed files with 1000 additions and 810 deletions

View File

@ -1,33 +1,35 @@
<template> <template>
<view class="normal-login-container"> <view class="normal-login-container">
<view class="logo-content align-center justify-center flex"> <view class="logo-content align-center justify-center flex">
<image :src="globalConfig.appInfo.logo" mode="widthFix" style="width: 100rpx;height: 100rpx;"> <image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
</image> </image>
<text class="title">大冢APS Ultra管理平台</text> <text class="title">大冢APS Ultra管理平台</text>
</view> </view>
<view class="login-form-content"> <view class="login-form-content">
<view class="input-item flex align-center"> <view class="input-item flex align-center">
<view class="iconfont icon-user icon"></view> <view class="iconfont icon-user icon"></view>
<input v-model="loginForm.username" class="input" maxlength="30" placeholder="请输入账号" type="text"/> <input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
</view> </view>
<view class="input-item flex align-center"> <view class="input-item flex align-center">
<view class="iconfont icon-password icon"></view> <view class="iconfont icon-password icon"></view>
<input v-model="loginForm.password" class="input" maxlength="20" placeholder="请输入密码" <input v-model="loginForm.password" :type="passwordVisible ? 'text' : 'password'" class="input" placeholder="请输入密码" maxlength="20" />
type="password"/> <view class="password-eye" @click="togglePasswordVisible">
<uni-icons :type="passwordVisible ? 'eye-slash' : 'eye'" size="20" color="#999"></uni-icons>
</view> </view>
<view v-if="captchaEnabled" class="input-item flex align-center" style="width: 60%;margin: 0px;"> </view>
<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
<view class="iconfont icon-code icon"></view> <view class="iconfont icon-code icon"></view>
<input v-model="loginForm.code" class="input" maxlength="4" placeholder="请输入验证码" type="number"/> <input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
<view class="login-code"> <view class="login-code">
<image :src="codeUrl" class="login-code-img" @click="getCode"></image> <image :src="codeUrl" @click="getCode" class="login-code-img"></image>
</view> </view>
</view> </view>
<view class="action-btn"> <view class="action-btn">
<button class="login-btn cu-btn block bg-blue lg round" @click="handleLogin">登录</button> <button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
</view> </view>
<view v-if="register" class="reg text-center"> <view class="reg text-center" v-if="register">
<text class="text-grey1">没有账号</text> <text class="text-grey1">没有账号</text>
<text class="text-blue" @click="handleUserRegister">立即注册</text> <text @click="handleUserRegister" class="text-blue">立即注册</text>
</view> </view>
</view> </view>
@ -35,33 +37,41 @@
</template> </template>
<script setup> <script setup>
import {getCurrentInstance, ref} from "vue" import { ref, getCurrentInstance } from "vue"
import {onLoad} from "@dcloudio/uni-app" import { onLoad } from "@dcloudio/uni-app"
import {getToken} from '@/utils/auth' import { getToken } from '@/utils/auth'
import {getCodeImg} from '@/api/login' import { getCodeImg } from '@/api/login'
import {useConfigStore, useUserStore} from '@/store' import { useConfigStore, useUserStore } from '@/store'
const {proxy} = getCurrentInstance() const { proxy } = getCurrentInstance()
const globalConfig = useConfigStore().config const globalConfig = useConfigStore().config
const codeUrl = ref("") const codeUrl = ref("")
// //
const captchaEnabled = ref(true) const captchaEnabled = ref(true)
// //
const register = ref(false) const register = ref(false)
const loginForm = ref({ //
const passwordVisible = ref(false)
const loginForm = ref({
username: "admin", username: "admin",
password: "admin123", password: "admin123",
code: "", code: "",
uuid: "" uuid: ""
}) })
// //
function handleUserRegister() { function togglePasswordVisible() {
passwordVisible.value = !passwordVisible.value
}
//
function handleUserRegister() {
proxy.$tab.redirectTo(`/pages/register`) proxy.$tab.redirectTo(`/pages/register`)
} }
// //
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
if (captchaEnabled.value) { if (captchaEnabled.value) {
@ -69,10 +79,10 @@ function getCode() {
loginForm.value.uuid = res.uuid loginForm.value.uuid = res.uuid
} }
}) })
} }
// //
async function handleLogin() { async function handleLogin() {
if (loginForm.value.username === "") { if (loginForm.value.username === "") {
proxy.$modal.msgError("请输入账号") proxy.$modal.msgError("请输入账号")
} else if (loginForm.value.password === "") { } else if (loginForm.value.password === "") {
@ -83,10 +93,10 @@ async function handleLogin() {
proxy.$modal.loading("登录中,请耐心等待...") proxy.$modal.loading("登录中,请耐心等待...")
pwdLogin() pwdLogin()
} }
} }
// //
async function pwdLogin() { async function pwdLogin() {
useUserStore().login(loginForm.value).then(() => { useUserStore().login(loginForm.value).then(() => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
loginSuccess() loginSuccess()
@ -95,33 +105,33 @@ async function pwdLogin() {
getCode() getCode()
} }
}) })
} }
// //
function loginSuccess(result) { function loginSuccess(result) {
// //
useUserStore().getInfo().then(res => { useUserStore().getInfo().then(res => {
proxy.$tab.reLaunch('/pages/index') proxy.$tab.reLaunch('/pages/work/index')
}) })
} }
onLoad(() => { onLoad(() => {
//#ifdef H5 //#ifdef H5
if (getToken()) { if (getToken()) {
proxy.$tab.reLaunch('/pages/index') proxy.$tab.reLaunch('/pages/index')
} }
//#endif //#endif
}) })
getCode() getCode()
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page { page {
background-color: #ffffff; background-color: #ffffff;
} }
.normal-login-container { .normal-login-container {
width: 100%; width: 100%;
.logo-content { .logo-content {
@ -150,6 +160,7 @@ page {
background-color: #f5f6f7; background-color: #f5f6f7;
height: 45px; height: 45px;
border-radius: 20px; border-radius: 20px;
position: relative;
.icon { .icon {
font-size: 38rpx; font-size: 38rpx;
@ -163,8 +174,31 @@ page {
line-height: 20px; line-height: 20px;
text-align: left; text-align: left;
padding-left: 15px; padding-left: 15px;
padding-right: 45px; /* 为眼睛图标留出更多空间 */
} }
.password-eye {
position: absolute;
right: 15px;
top: 50%;
transform: translateY(-50%);
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
/* 增加点击区域 */
&::after {
content: '';
position: absolute;
top: -10px;
left: -10px;
right: -10px;
bottom: -10px;
}
}
} }
.login-btn { .login-btn {
@ -193,5 +227,5 @@ page {
} }
} }
} }
} }
</style> </style>

View File

@ -1,5 +1,5 @@
<template> <template>
<view :style="{height: `${windowHeight}px`}" class="mine-container"> <view class="mine-container" :style="{height: `${windowHeight}px`}">
<!--顶部个人信息栏--> <!--顶部个人信息栏-->
<view class="header-section"> <view class="header-section">
<view class="flex padding justify-between"> <view class="flex padding justify-between">
@ -7,19 +7,18 @@
<view v-if="!avatar" class="cu-avatar xl round bg-white"> <view v-if="!avatar" class="cu-avatar xl round bg-white">
<view class="iconfont icon-people text-gray icon"></view> <view class="iconfont icon-people text-gray icon"></view>
</view> </view>
<image v-if="avatar" :src="avatar" class="cu-avatar xl round" mode="widthFix" <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
@click="handleToAvatar">
</image> </image>
<view v-if="!name" class="login-tip" @click="handleToLogin"> <view v-if="!name" @click="handleToLogin" class="login-tip">
点击登录 点击登录
</view> </view>
<view v-if="name" class="user-info" @click="handleToInfo"> <view v-if="name" @click="handleToInfo" class="user-info">
<view class="u_title"> <view class="u_title">
用户名{{ name }} 用户名{{ name }}
</view> </view>
</view> </view>
</view> </view>
<view class="flex align-center" @click="handleToInfo"> <view @click="handleToInfo" class="flex align-center">
<text>个人信息</text> <text>个人信息</text>
<view class="iconfont icon-right"></view> <view class="iconfont icon-right"></view>
</view> </view>
@ -27,7 +26,7 @@
</view> </view>
<view class="content-section"> <view class="content-section">
<view class="mine-actions grid col-4 text-center"> <!-- <view class="mine-actions grid col-4 text-center">
<view class="action-item" @click="handleJiaoLiuQun"> <view class="action-item" @click="handleJiaoLiuQun">
<view class="iconfont icon-friendfill text-pink icon"></view> <view class="iconfont icon-friendfill text-pink icon"></view>
<text class="text">交流群</text> <text class="text">交流群</text>
@ -44,7 +43,7 @@
<view class="iconfont icon-dianzan text-green icon"></view> <view class="iconfont icon-dianzan text-green icon"></view>
<text class="text">点赞我们</text> <text class="text">点赞我们</text>
</view> </view>
</view> </view> -->
<view class="menu-list"> <view class="menu-list">
<view class="list-cell list-cell-arrow" @click="handleToEditInfo"> <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
@ -53,7 +52,7 @@
<view>编辑资料</view> <view>编辑资料</view>
</view> </view>
</view> </view>
<view class="list-cell list-cell-arrow" @click="handleHelp"> <!-- <view class="list-cell list-cell-arrow" @click="handleHelp">
<view class="menu-item-box"> <view class="menu-item-box">
<view class="iconfont icon-help menu-icon"></view> <view class="iconfont icon-help menu-icon"></view>
<view>常见问题</view> <view>常见问题</view>
@ -64,7 +63,7 @@
<view class="iconfont icon-aixin menu-icon"></view> <view class="iconfont icon-aixin menu-icon"></view>
<view>关于我们</view> <view>关于我们</view>
</view> </view>
</view> </view> -->
<view class="list-cell list-cell-arrow" @click="handleToSetting"> <view class="list-cell list-cell-arrow" @click="handleToSetting">
<view class="menu-item-box"> <view class="menu-item-box">
<view class="iconfont icon-setting menu-icon"></view> <view class="iconfont icon-setting menu-icon"></view>
@ -78,61 +77,61 @@
</template> </template>
<script setup> <script setup>
import {useUserStore} from '@/store' import { useUserStore } from '@/store'
import {computed, getCurrentInstance} from "vue" import { computed , getCurrentInstance } from "vue"
const {proxy} = getCurrentInstance() const { proxy } = getCurrentInstance()
const name = useUserStore().name const name = useUserStore().name
const avatar = computed(() => useUserStore().avatar) const avatar = computed(() => useUserStore().avatar)
const windowHeight = computed(() => uni.getSystemInfoSync().windowHeight - 50) const windowHeight = computed(() => uni.getSystemInfoSync().windowHeight - 50)
function handleToInfo() { function handleToInfo() {
proxy.$tab.navigateTo('/pages/mine/info/index') proxy.$tab.navigateTo('/pages/mine/info/index')
} }
function handleToEditInfo() { function handleToEditInfo() {
proxy.$tab.navigateTo('/pages/mine/info/edit') proxy.$tab.navigateTo('/pages/mine/info/edit')
} }
function handleToSetting() { function handleToSetting() {
proxy.$tab.navigateTo('/pages/mine/setting/index') proxy.$tab.navigateTo('/pages/mine/setting/index')
} }
function handleToLogin() { function handleToLogin() {
proxy.$tab.reLaunch('/pages/login') proxy.$tab.reLaunch('/pages/login')
} }
function handleToAvatar() { function handleToAvatar() {
proxy.$modal.showToast('模块建设中~') proxy.$modal.showToast('模块建设中~')
// proxy.$tab.navigateTo('/pages/mine/avatar/index') // proxy.$tab.navigateTo('/pages/mine/avatar/index')
} }
function handleHelp() { function handleHelp() {
proxy.$modal.showToast('模块建设中~') proxy.$modal.showToast('模块建设中~')
// proxy.$tab.navigateTo('/pages/mine/help/index') // proxy.$tab.navigateTo('/pages/mine/help/index')
} }
function handleAbout() { function handleAbout() {
proxy.$modal.showToast('模块建设中~') proxy.$modal.showToast('模块建设中~')
// proxy.$tab.navigateTo('/pages/mine/about/index') // proxy.$tab.navigateTo('/pages/mine/about/index')
} }
function handleJiaoLiuQun() { function handleJiaoLiuQun() {
proxy.$modal.showToast('模块建设中~') proxy.$modal.showToast('模块建设中~')
// proxy.$modal.showToast('QQ133713780()146013835()189091635') // proxy.$modal.showToast('QQ133713780()146013835()189091635')
} }
function handleBuilding() { function handleBuilding() {
proxy.$modal.showToast('模块建设中~') proxy.$modal.showToast('模块建设中~')
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page { page {
background-color: #f5f6f7; background-color: #f5f6f7;
} }
.mine-container { .mine-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -188,5 +187,5 @@ page {
} }
} }
} }
} }
</style> </style>

View File

@ -2,8 +2,8 @@
<view class="container"> <view class="container">
<view class="example"> <view class="example">
<uni-forms ref="form" :model="user" labelWidth="80px"> <uni-forms ref="form" :model="user" labelWidth="80px">
<uni-forms-item label="用户昵称" name="nickName"> <uni-forms-item label="用户昵称" name="userName">
<uni-easyinput v-model="user.nickName" placeholder="请输入昵称" /> <uni-easyinput v-model="user.userName" :disabled="true" placeholder="请输入昵称" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="手机号码" name="phonenumber"> <uni-forms-item label="手机号码" name="phonenumber">
<uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" /> <uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" />
@ -28,7 +28,7 @@
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const user = ref({ const user = ref({
nickName: "", userName: "",
phonenumber: "", phonenumber: "",
email: "", email: "",
sex: "" sex: ""

File diff suppressed because it is too large Load Diff