更新个人中心

This commit is contained in:
songyang 2023-12-05 09:43:57 +08:00
parent d62ef9084e
commit dcbe6c4037
6 changed files with 82 additions and 30 deletions

4
env/.env.dev vendored
View File

@ -5,7 +5,7 @@ VITE_BUILD_MODE = 'dev'
VITE_API_URL = '/proxyApi' VITE_API_URL = '/proxyApi'
# 开发环境接口地址 # 开发环境接口地址
VITE_proxyTarget = 'http://10.40.92.66:9205' #盛旭 # VITE_proxyTarget = 'http://10.40.92.66:9205' #盛旭
# VITE_proxyTarget = 'http://10.40.92.185:9200' # 赵福海 VITE_proxyTarget = 'http://10.40.92.185:9200' # 赵福海

View File

@ -23,7 +23,7 @@ export const useStore = defineStore('main', {
{ {
// 自定义存储的 key默认是 store.$id // 自定义存储的 key默认是 store.$id
key: 'main', key: 'main',
storage: localStorage, //缓存模式 可选 localStorage sessionStorage storage: sessionStorage, //缓存模式 可选 localStorage sessionStorage
// state 中的字段名,按组打包储存 // state 中的字段名,按组打包储存
paths: ['token'] //需要缓存的字段 与 state中相关联 paths: ['token'] //需要缓存的字段 与 state中相关联
} }

View File

@ -11,16 +11,16 @@
}) })
const handlerLogin = async () => { const handlerLogin = async () => {
// const res: any = await loginApi(loginForm.value) const res: any = await loginApi(loginForm.value)
// console.log(res, '**') console.log(res, '登录成功**')
// if (res.code === 200) { if (res.code === 200) {
// ElMessage({ ElMessage({
// showClose: true, showClose: true,
// message: '', message: '登录成功',
// type: 'success' type: 'success'
// }) })
// } }
// userStore.setToken(res.data.access_token) userStore.setToken(res.data.access_token)
// //
router.push('/') router.push('/')
} }

View File

@ -3,9 +3,7 @@
import Navmenu from 'components/Navmenu/index.vue' import Navmenu from 'components/Navmenu/index.vue'
import { useStore } from 'store/main' import { useStore } from 'store/main'
const userStore = useStore() const userStore = useStore()
onMounted(() => { onMounted(() => {})
console.log(userStore.token, '****')
})
const leftNavList = [ const leftNavList = [
{ {
@ -246,13 +244,13 @@
</div> </div>
<ul class="equip-pic"> <ul class="equip-pic">
<li> <li @click="$router.push('equipDetail/5')" style="cursor: pointer">
<EquipCard /> <EquipCard />
</li> </li>
<li> <li @click="$router.push('equipDetail/5')" style="cursor: pointer">
<EquipCard /> <EquipCard />
</li> </li>
<li> <li @click="$router.push('equipDetail/5')" style="cursor: pointer">
<EquipCard /> <EquipCard />
</li> </li>
</ul> </ul>

View File

@ -1,12 +1,25 @@
<script setup lang="ts"> <script setup lang="ts">
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
import EnterpriseCertification from '../../EnterpriseCertification.vue' import EnterpriseCertification from '../../EnterpriseCertification.vue'
import { el } from 'element-plus/es/locale'
// //
const oldPhoneNumber = ref('15336652321') const oldPhoneNumber = ref('15336652321')
// //
const editForm = ref({ const editForm = reactive({
v_phone: '13522222' v_phone: ''
}) })
const editPhoneFormRules = reactive({
v_phone: [
{
required: true,
message: '请输入新手机号码',
trigger: 'blur'
}
]
})
const editPhoneFormRef: any = ref()
// //
const editDialogTableVisible = ref(false) const editDialogTableVisible = ref(false)
@ -19,8 +32,12 @@
} }
// //
const submitEditPhone = () => { const submitEditPhone = () => {
console.log('确定修改') editPhoneFormRef.value.validate((valid: any) => {
if (valid) {
editDialogTableVisible.value = false editDialogTableVisible.value = false
} else {
}
})
} }
// //
const closeEditBtn = () => { const closeEditBtn = () => {
@ -129,15 +146,20 @@
<!-- 修改手机号码弹框 --> <!-- 修改手机号码弹框 -->
<el-dialog v-model="editDialogTableVisible" title="修改手机号码" width="30%"> <el-dialog v-model="editDialogTableVisible" title="修改手机号码" width="30%">
<el-form :model="editForm"> <el-form
<el-form-item label="原手机号码"> :model="editForm"
ref="editPhoneFormRef"
:rules="editPhoneFormRules"
status-icon
label-width="120px">
<el-form-item label="原手机号码" prop="old_phone">
<el-input <el-input
v-model="oldPhoneNumber" v-model="oldPhoneNumber"
autocomplete="off" autocomplete="off"
disabled disabled
style="width: 220px" /> style="width: 220px" />
</el-form-item> </el-form-item>
<el-form-item label="新手机号码"> <el-form-item label="新手机号码" prop="v_phone">
<el-input <el-input
v-model="editForm.v_phone" v-model="editForm.v_phone"
autocomplete="off" autocomplete="off"

View File

@ -5,6 +5,22 @@
const pageSize = 20 const pageSize = 20
const pageNumber = 1 const pageNumber = 1
const total: any = 20 const total: any = 20
const addSubAccountForm = reactive({
subAccount: ''
})
const addSubAccountFormRef: any = ref()
const addSubAccountFormRules: any = reactive({
subAccount: [
{
required: true,
message: '请输入子账号',
trigger: 'blur'
}
]
})
// //
const getList = () => { const getList = () => {
console.log('获取数据列表***') console.log('获取数据列表***')
@ -40,6 +56,16 @@
console.log('新增') console.log('新增')
addSubAccountdialogVisible.value = true addSubAccountdialogVisible.value = true
} }
//
const handlerSubmit = () => {
addSubAccountFormRef.value.validate((valid: any) => {
if (valid) {
addSubAccountdialogVisible.value = false
} else {
}
})
}
</script> </script>
<template> <template>
@ -78,14 +104,20 @@
<!-- 新增子账号弹框 --> <!-- 新增子账号弹框 -->
<el-dialog v-model="addSubAccountdialogVisible" title="新增子账号" width="30%"> <el-dialog v-model="addSubAccountdialogVisible" title="新增子账号" width="30%">
<el-form> <el-form
<el-form-item label="手机号"> :model="addSubAccountForm"
<el-input autocomplete="off" /> ref="addSubAccountFormRef"
:rules="addSubAccountFormRules">
<el-form-item label="手机号" prop="subAccount">
<el-input
autocomplete="off"
v-model.trim="addSubAccountForm.subAccount"
clearable />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="addSubAccountdialogVisible = false"> </el-button> <el-button @click="handlerSubmit"> </el-button>
<el-button type="primary" @click="addSubAccountdialogVisible = false"> <el-button type="primary" @click="addSubAccountdialogVisible = false">
</el-button> </el-button>