Zlpt_Portal/src/layout/header.vue

1039 lines
31 KiB
Vue
Raw Normal View History

2023-12-07 17:48:36 +08:00
<script setup lang="ts">
2025-02-28 10:40:52 +08:00
import { debounce } from 'lodash'
2024-11-22 15:35:30 +08:00
import $bus from '@/utils/bus'
import { mainStore } from 'store/main'
2024-11-26 09:11:25 +08:00
import { useStore } from 'store/user'
2024-12-02 14:06:16 +08:00
import { cartStore } from 'store/cart'
2024-11-22 15:35:30 +08:00
import { ElMessage, ElMessageBox } from 'element-plus'
2025-02-28 10:40:52 +08:00
import {
getHotSearchListApi,
getBookCarDetailsApi,
getCompanyListApi,
getHotSearch,
} from 'http/api/home/index'
2024-12-09 09:38:06 +08:00
import userClass from '../hooks/userClass'
2025-01-10 13:01:05 +08:00
import {
getUserInfo, //用户信息
editMessageApi, //修改
resetPwd, // 重置密码
editPhone, // 修改手机号
} from 'http/api/personalCenter'
2024-12-09 09:38:06 +08:00
const { getCompanyList } = userClass()
2024-11-29 13:57:59 +08:00
import imgSrc from '@/assets/img/logo.png'
2025-01-21 10:55:37 +08:00
import { el } from 'element-plus/es/locale'
2024-11-22 15:35:30 +08:00
const store: any = mainStore()
2024-12-10 15:06:36 +08:00
const searchTypeName = ref('装备')
2024-11-26 09:11:25 +08:00
const userStore = useStore()
2024-12-02 14:06:16 +08:00
const cart = cartStore()
2024-12-10 15:06:36 +08:00
const isType: any = localStorage.getItem('rolesType')
2024-11-26 09:11:25 +08:00
userStore.editMenuList(1)
2024-11-22 15:35:30 +08:00
const route = useRoute()
const router = useRouter()
const isRolesSelect = ref<boolean>(false)
2024-11-27 18:22:35 +08:00
const rolesName = ref<any>('1')
2024-11-29 09:27:46 +08:00
rolesName.value = localStorage.getItem('rolesType')
2024-12-03 18:07:30 +08:00
const isAdmin = ref(false)
const roles = store.userInfo.roles
2024-12-09 09:38:06 +08:00
const activeLoginCompanyName = ref('')
2024-12-10 15:06:36 +08:00
const searchCheckVisible = ref(false)
2025-02-05 09:12:35 +08:00
import { storeToRefs } from 'pinia'
const { userInfo, token }: any = storeToRefs(store)
2025-02-07 16:27:08 +08:00
const tokenNew = localStorage.getItem('tokenNew')
2024-12-09 09:38:06 +08:00
if (roles?.length > 0) {
2024-12-03 18:07:30 +08:00
isAdmin.value = roles.some((e: any) => e.roleKey == 'admin')
}
2024-11-22 15:35:30 +08:00
// 是否显示退出登录
const isShowLogout = computed(() => {
return store.token
})
2025-02-10 10:41:46 +08:00
watch(
userInfo,
(newValue, oldCount) => {
if (newValue.companyId) {
getCompanyListApi()
.then((res: any) => {
res.data.filter((e: any) => {
if (e.companyId == newValue.companyId) {
activeLoginCompanyName.value = e.companyName
}
})
})
.catch((err: any) => {
console.log('🚀 ~ getCompanyListApi ~ err:', err)
})
}
},
{ immediate: true },
)
2025-02-07 16:27:08 +08:00
// watch(token, (newValue, oldCount) => {
// if (newValue) {
// getUserListData()
// getBookCarDetailsData()
// }
// })
// 监听 tokenNew 有值时请求用户信息
2025-02-05 09:12:35 +08:00
2024-12-09 13:10:06 +08:00
const setActiveCompanyName = () => {
2025-02-05 09:12:35 +08:00
// const companyList = userStore.companyList
// const activeCompany: any = companyList.filter(
// (e: any) => e.companyId == store.userInfo.companyId,
// )
// activeLoginCompanyName.value = activeCompany[0]?.companyName
// localStorage.setItem('currentCompanyName', activeLoginCompanyName.value)
2024-12-09 13:10:06 +08:00
}
2025-02-05 09:12:35 +08:00
// if (userStore.companyList.length === 0) {
// } else {
// setActiveCompanyName()
// }
2024-12-09 09:38:06 +08:00
const placeholderText = ref('搜索设备关键词')
2024-11-22 15:35:30 +08:00
2025-07-01 08:50:19 +08:00
//忘记密码
// 忘记密码
const handlerForget = () => {
window.location.href = 'http://sgwpdm.ah.sgcc.com.cn/iws/cas/pre-forget-password'
}
2024-11-22 15:35:30 +08:00
// 退出登录
const handlerLogout = () => {
ElMessageBox.confirm('是否确定退出登录', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
store.cleanUpToken('')
store.clearUserInfo('')
2024-12-20 17:36:14 +08:00
localStorage.clear()
sessionStorage.clear()
2024-11-22 15:35:30 +08:00
ElMessage({
type: 'success',
message: '已退出登录',
})
if (import.meta.env.VITE_API_URL == '/proxyApi') {
router.push('/login') // 公司-登录
} else {
// 宏源-登录
setTimeout(() => {
window.location.replace('http://sgwpdm.ah.sgcc.com.cn/iws/mall-view/')
}, 500)
}
2023-12-09 17:00:58 +08:00
})
2024-11-22 15:35:30 +08:00
.catch(() => {
ElMessage({
type: 'info',
message: '已取消',
2023-12-09 17:00:58 +08:00
})
2024-11-22 15:35:30 +08:00
})
}
// 搜索查询绑定值
const keywordIptValue = ref('')
// 输入框 dom
const inputRef: any = ref(null)
// 输入框下方历史搜索记录
// const searchHistoryList = computed(() => {
// return store.searchHistoryList.slice(0, 1)
// })
2024-11-23 16:31:54 +08:00
const searchHistoryList = ref<any>(['挖掘机', '塔式起重机', '挖掘机', '吊机'])
// 获取热词
const getHotSearchListData = async () => {
const { data: res }: any = await getHotSearchListApi()
searchHistoryList.value = res
console.log(res, '热词')
}
2025-02-14 18:01:24 +08:00
if (tokenNew) {
getHotSearchListData()
}
2024-11-22 18:03:09 +08:00
2024-11-22 15:35:30 +08:00
// 搜索按钮
const searchKeywordBtn = () => {
/* 去除空格 */
keywordIptValue.value = keywordIptValue.value.replace(/\s*/g, '')
store.addHistoryRecord(keywordIptValue.value)
2024-12-20 17:36:14 +08:00
2024-12-27 09:52:19 +08:00
if (route.path.includes('equipList')) {
2024-12-10 15:06:36 +08:00
if (searchTypeName.value === '装备') {
$bus.emit('search', keywordIptValue.value)
} else {
router.push({
name: 'parity',
query: { keyWord: keywordIptValue.value },
})
}
2024-12-01 16:21:35 +08:00
}
2024-12-27 09:52:19 +08:00
if (route.path.includes('parity')) {
2024-12-20 17:36:14 +08:00
if (searchTypeName.value == '需求') {
2024-12-10 15:06:36 +08:00
$bus.emit('search', keywordIptValue.value)
} else {
router.push({
name: 'equipList',
query: { keyWord: keywordIptValue.value },
})
}
2024-12-01 16:21:35 +08:00
$bus.emit('search', keywordIptValue.value)
}
2024-12-27 09:52:19 +08:00
if (route.path.includes('home')) {
2024-12-10 15:06:36 +08:00
if (searchTypeName.value === '装备') {
router.push({
name: 'equipList',
query: { keyWord: keywordIptValue.value },
})
}
if (searchTypeName.value === '需求') {
router.push({
name: 'parity',
query: { keyWord: keywordIptValue.value },
})
}
2024-11-22 15:35:30 +08:00
}
2024-12-27 09:52:19 +08:00
if (route.path.includes('enterpriseZone')) {
2024-12-20 17:36:14 +08:00
if (searchTypeName.value == '装备') {
router.push({
name: 'equipList',
query: { keyWord: keywordIptValue.value },
})
}
if (searchTypeName.value == '需求') {
router.push({
name: 'parity',
query: { keyWord: keywordIptValue.value },
})
}
}
if (route.path.includes('equipDetail')) {
if (searchTypeName.value == '装备') {
router.push({
name: 'equipList',
query: { keyWord: keywordIptValue.value },
})
}
if (searchTypeName.value == '需求') {
router.push({
name: 'parity',
query: { keyWord: keywordIptValue.value },
})
}
}
2024-11-22 15:35:30 +08:00
}
// 点击下方搜索记录时
const handleHistory = (hisValue: any) => {
keywordIptValue.value = hisValue
searchKeywordBtn()
// inputRef.value.focus()
}
//页面刷新回显模糊搜索词
$bus.on('callBackText', (val) => {
nextTick(() => {
keywordIptValue.value = val
})
})
// 角色切换按钮
const onRolesCheck = () => {
2024-12-03 18:07:30 +08:00
if (isAdmin.value) return
2024-12-13 10:20:22 +08:00
isRolesSelect.value = !isRolesSelect.value
2024-11-22 15:35:30 +08:00
}
// 选择角色
const onSelectRoles = (type: number) => {
if (type === 1) {
2024-11-29 09:27:46 +08:00
rolesName.value = '1'
2024-11-26 09:11:25 +08:00
userStore.editMenuList(1)
2024-11-27 15:16:53 +08:00
userStore.editUserMenuList(1)
2024-11-27 18:22:35 +08:00
localStorage.setItem('rolesType', '1')
2024-12-02 15:33:53 +08:00
userStore.editcurrentMenuItem('goodsManagement')
2024-12-01 16:21:35 +08:00
window.location.reload()
2024-11-22 15:35:30 +08:00
} else {
2024-11-29 09:27:46 +08:00
rolesName.value = '2'
2024-11-26 09:11:25 +08:00
userStore.editMenuList(2)
2024-11-27 15:16:53 +08:00
userStore.editUserMenuList(2)
2024-11-27 18:22:35 +08:00
localStorage.setItem('rolesType', '2')
2024-12-02 15:33:53 +08:00
userStore.editcurrentMenuItem('sourcingNeed')
2024-12-01 16:21:35 +08:00
window.location.reload()
2024-11-22 15:35:30 +08:00
}
isRolesSelect.value = false
}
2024-11-23 16:31:54 +08:00
2024-12-01 16:21:35 +08:00
const getBookCarDetailsData = async () => {
const res: any = await getBookCarDetailsApi()
2025-02-07 16:27:08 +08:00
console.log('🚀 ~ getBookCarDetailsData ~ res:', res)
2024-12-04 11:28:24 +08:00
let amountNum = 0
2025-02-07 16:27:08 +08:00
if (res.data && res.data.length > 0) {
res.data.forEach((e: any) => {
amountNum = e.devInfoVoList.length + amountNum
console.log('🚀 ~ res.data.forEach ~ amountNum:', amountNum)
})
}
2024-12-04 11:28:24 +08:00
cart.SET_CART_NUM(amountNum)
2024-12-01 16:21:35 +08:00
}
2024-12-02 14:06:16 +08:00
const cartNum = computed(() => {
return cart.cartNum
2024-12-04 11:28:24 +08:00
// let amountNum = 0
// cardList.value.forEach((e: any) => {
// amountNum = e.devInfoVoList.length + amountNum
// })
// return amountNum
2024-12-02 14:06:16 +08:00
})
2024-11-23 16:31:54 +08:00
// 查看预约车
const onCarts = () => {
console.log('跳转预约车页面')
router.push({
name: 'cart',
})
}
2024-12-03 18:07:30 +08:00
2025-02-05 09:12:35 +08:00
const nickNameNew = computed(() => {
return store.userInfo.nickName
})
2024-12-03 18:07:30 +08:00
const onJumpUser = () => {
2025-02-26 17:09:25 +08:00
router.push({ name: 'my-user' })
// const isType: any = localStorage.getItem('rolesType')
// if (isType == 3) {
// const host = window.location.origin
2025-01-21 10:55:37 +08:00
2025-02-26 17:09:25 +08:00
// if (host.indexOf('sgwpdm.ah.sgcc.com.cn') > -1) {
// window.open(`${host}/iws/glweb/login?token@${store.token}@`)
// } else {
// // window.open(`${host}/glweb/?token@${store.token}@`)
// if (import.meta.env.VITE_ENV === 'production') {
// window.open(`${host}/glweb/?token@${store.token}@`)
// } else {
// window.open(`${host}/iws/glweb/?token@${store.token}@`)
// }
// }
// } else {
// router.push({ name: 'my-user' })
// }
2024-12-03 18:07:30 +08:00
}
2024-12-25 14:24:34 +08:00
2025-02-05 09:12:35 +08:00
const onClickLogin = () => {
2025-02-10 10:41:46 +08:00
if (import.meta.env.VITE_API_URL == '/proxyApi') {
router.push('/login') // 公司-重定向登录
} else {
// 宏源-重定向登录
setTimeout(() => {
window.location.replace(
'http://sgwpdm.ah.sgcc.com.cn/iws/cas/login?appId=3874dcb953f184dc75450e33d6d6d4fa&service=http://sgwpdm.ah.sgcc.com.cn/iws/mall-view/',
)
}, 500)
}
2025-02-05 09:12:35 +08:00
}
2024-12-25 14:24:34 +08:00
// 查看消息
const onJumpMessage = () => {
router.push({
name: 'message',
})
}
2025-01-10 13:01:05 +08:00
const form: any = ref({
userId: '',
name: '',
nickName: '',
userName: '',
password: '',
phoneNumber: '',
deptId: '',
})
const dialogUserInfoVisible = ref(false)
2025-02-05 09:12:35 +08:00
// const circleUrl = ref('https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg')
const circleUrl = computed(() => {
return store.userInfo.avatar
})
2025-01-10 13:01:05 +08:00
const onAccountManage = () => {
dialogUserInfoVisible.value = true
}
const getUserListData = async () => {
2025-02-05 09:12:35 +08:00
let res: any = await getUserInfo()
2025-01-10 13:01:05 +08:00
form.value = res.data
2025-02-10 16:22:36 +08:00
console.log('🚀 ~ getUserListData ~ form.value:', form.value)
2025-01-10 13:01:05 +08:00
}
const resetPassword = async () => {
ElMessageBox.confirm('确定要重置密码吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
const params = {
password: form.value.password,
userId: form.value.userId,
}
let res: any = await resetPwd(params)
if (res.code === 200) {
ElMessage.success('重置成功')
}
})
}
const resetPhone = async () => {
ElMessageBox.confirm('确定要修改手机号吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
const params = {
userId: form.value.userId,
phoneNumber: form.value.phoneNumber,
}
let res: any = await editPhone(params)
if (res.code === 200) {
ElMessage.success('修改成功')
}
})
}
2025-02-28 10:40:52 +08:00
const hotWordList = ref<any[]>([])
// 输入框值改变
const changeInputValue = debounce(async () => {
// console.log('🚀 ~ changeInputValue ~ keywordIptValue.value:', keywordIptValue.value)
if (!keywordIptValue.value) {
hotWordList.value = []
return
}
// 这里调用接口
try {
const params = {
deviceName: keywordIptValue.value,
maStatus: 2,
}
const res: any = await getHotSearch(params)
// console.log('🚀 ~ changeInputValue ~ res:', res)
// 取前5个
const arr = res.data.rows.filter((item: any, index: number, self: any) => {
return self.findIndex((e: any) => e.deviceName === item.deviceName) === index
})
if (res.data.rows && res.data.rows.length > 5) {
// 过滤掉 deviceName 重复的数据
hotWordList.value = arr.slice(0, 5)
} else {
hotWordList.value = arr
}
// console.log('🚀 ~ changeInputValue ~ hotWordList.value:', hotWordList.value)
} catch (error) {
console.log('🚀 ~ changeInputValue ~ error:', error)
hotWordList.value = []
}
}, 500)
// 点击热词
const onHotWord = (item: any) => {
// console.log('🚀 ~ onHotWord ~ e:', item.deviceName)
keywordIptValue.value = item.deviceName
}
2025-03-12 14:51:34 +08:00
// 数据大屏
const onJumpScreen = () => {
router.push({
name: 'big-screen',
})
}
2025-02-28 10:40:52 +08:00
2025-06-01 16:33:12 +08:00
// 隐藏下拉展示
const hideDropdown = () => {
console.log("xxxxxxxxxxxxxxxxxxx")
hotWordList.value = []
searchCheckVisible.value = false
}
const homeSearchRef = ref<HTMLElement | null>(null)
// 处理全局点击事件
const handleClickOutside = (event: MouseEvent) => {
if (homeSearchRef.value && !homeSearchRef.value.contains(event.target as Node)) {
hideDropdown()
}
}
2025-02-07 16:27:08 +08:00
onMounted(() => {
2025-06-01 16:33:12 +08:00
document.addEventListener('click', handleClickOutside)
2025-02-07 16:27:08 +08:00
if (tokenNew) {
getUserListData()
getBookCarDetailsData()
}
})
2025-06-01 16:33:12 +08:00
onUnmounted(() => {
document.removeEventListener('click', handleClickOutside)
})
2023-12-07 17:48:36 +08:00
</script>
<template>
<!-- 头部个人信息 收藏夹 手机版等图标 -->
<div class="header-container">
2025-10-14 17:26:53 +08:00
<div class="header-user-info" style="display: none">
2024-12-20 17:36:14 +08:00
<div class="header-box">
2024-11-22 18:03:09 +08:00
<div class="header-item" v-if="isShowLogout">
2025-01-10 13:01:05 +08:00
<a class="user-name">
2025-02-05 09:12:35 +08:00
<span class="name"> {{ activeLoginCompanyName }} / {{ nickNameNew }} </span>
2025-01-10 13:01:05 +08:00
<el-icon style="margin-left: 4px">
<ArrowDown />
</el-icon>
2025-02-25 16:55:43 +08:00
<!-- <div class="user-center">
2025-01-10 13:01:05 +08:00
<div style="text-align: right">
2025-02-05 09:12:35 +08:00
<el-button size="small" @click="onAccountManage">
账号管理
</el-button>
2025-01-10 13:01:05 +08:00
</div>
<div class="user-container">
<el-avatar :size="50" :src="circleUrl" />
<div class="info">
<div>姓名{{ form.nickName }}</div>
<div>登录账号{{ form.userName }}</div>
</div>
</div>
2025-02-25 16:55:43 +08:00
</div> -->
2025-01-10 13:01:05 +08:00
</a>
2024-12-01 16:21:35 +08:00
<div class="line"></div>
2024-11-22 15:35:30 +08:00
</div>
2025-01-09 15:36:06 +08:00
2025-02-05 09:12:35 +08:00
<div class="header-item" v-if="isShowLogout">
2025-02-10 16:22:36 +08:00
<a @click="onJumpMessage" v-if="!form.msgNum || form.msgNum == 0">消息</a>
2025-02-28 10:40:52 +08:00
<el-badge
v-else
:value="form.msgNum ? Number(form.msgNum) : ''"
:max="99"
@click="onJumpMessage"
style="margin: 0 10px"
>消息</el-badge
>
2025-01-09 15:36:06 +08:00
<div class="line"></div>
</div>
2025-02-05 09:12:35 +08:00
<div class="header-item" v-if="isShowLogout">
2025-01-09 15:36:06 +08:00
<a @click="onJumpUser">个人中心</a>
<div class="line"></div>
</div>
2025-03-18 09:10:33 +08:00
<!-- <div class="header-item" v-if="isShowLogout">
2025-03-12 14:51:34 +08:00
<a @click="onJumpScreen">数据大屏</a>
<div class="line"></div>
2025-03-18 09:10:33 +08:00
</div> -->
2023-12-07 17:48:36 +08:00
<div class="header-item">
2025-02-05 09:12:35 +08:00
<!-- <a v-if="!isShowLogout" class="a-border-none" @click="$router.push('/login')">
登录
</a> -->
<a v-if="!isShowLogout" @click="onClickLogin"> 登录 </a>
<!-- <span v-if="!isShowLogout" style="margin: 0 3px">/</span>
2024-11-22 18:03:09 +08:00
<a
v-if="!isShowLogout"
style="padding: 0 20px 0 0"
@click="$router.push('/register')"
>
2025-02-05 09:12:35 +08:00
注册
</a> -->
2024-11-22 18:03:09 +08:00
<a v-else @click="handlerLogout">退出登录</a>
2025-07-01 08:50:19 +08:00
<a @click="handlerForget">忘记密码</a>
2023-12-07 17:48:36 +08:00
</div>
</div>
</div>
<!-- 中间logo 部分 -->
2024-12-20 17:36:14 +08:00
<div class="logo-ipt-container">
2025-10-14 17:26:53 +08:00
<div class="home-logo" @click="$router.push('/equipList')"></div>
<!-- <div class="home-logo"></div>-->
2025-06-01 16:33:12 +08:00
<div class="home-search" ref="homeSearchRef">
2024-12-10 15:06:36 +08:00
<input
:placeholder="searchTypeName === '装备' ? '搜索装备关键词' : '搜索需求关键词'"
type="text"
v-model.trim="keywordIptValue"
@keydown.enter="searchKeywordBtn"
ref="inputRef"
@focus="placeholderText = ''"
@blur="
placeholderText =
searchTypeName === '装备' ? '搜索装备关键词' : '搜索需求关键词'
"
2025-02-28 10:40:52 +08:00
@input="changeInputValue"
2024-12-10 15:06:36 +08:00
/>
<button class="search-btn" @click="searchKeywordBtn">搜索</button>
<div
class="left-check-box"
@click="
() => {
2024-12-12 15:30:21 +08:00
searchCheckVisible = !searchCheckVisible
2024-12-10 15:06:36 +08:00
}
"
>
{{ searchTypeName }}
<el-icon style="margin-left: 5px"><ArrowDownBold /></el-icon>
</div>
<div class="check-container" v-if="searchCheckVisible">
<div
style="border-top-left-radius: 6px; border-top-right-radius: 6px"
@click="
() => {
searchTypeName = '装备'
searchCheckVisible = false
}
"
>
装备
</div>
<div
@click="
() => {
searchTypeName = '需求'
searchCheckVisible = false
}
"
style="border-bottom-left-radius: 6px; border-bottom-right-radius: 6px"
>
需求
</div>
</div>
2025-02-28 10:40:52 +08:00
<!-- 热词 -->
2025-06-01 16:33:12 +08:00
<!-- <div class="hot-word">
2025-02-28 10:40:52 +08:00
<span
v-for="(item, index) in hotWordList"
:key="index"
@click="onHotWord(item)"
style="margin-right: 10px; cursor: pointer"
>
{{ item.deviceName }}
</span>
2025-06-01 16:33:12 +08:00
</div> -->
<!-- 竖着下拉展示包含相关值的数据 -->
<div v-if="hotWordList.length > 0" class="dropdown-list">
<div
v-for="(item, index) in hotWordList"
:key="index"
class="dropdown-item"
@click="onHotWord(item); hideDropdown()"
>
{{ item.deviceName }}
</div>
2025-02-28 10:40:52 +08:00
</div>
2024-12-10 15:06:36 +08:00
</div>
<div class="cart-container">
2025-01-09 15:36:06 +08:00
<div class="cart-icon" @click="onCarts">
2024-12-10 15:06:36 +08:00
<el-badge :value="cartNum">
<svg class="icon" aria-hidden="true" style="width: 30px; height: 30px">
<use xlink:href="#icon-gouwuche2"></use>
</svg>
</el-badge>
<span style="margin-left: 15px"> 预约车 </span>
</div>
</div>
2023-12-07 17:48:36 +08:00
</div>
</div>
2025-01-10 13:01:05 +08:00
<el-dialog
width="50%"
2025-02-05 09:12:35 +08:00
title="账户管理"
2025-01-10 13:01:05 +08:00
destroy-on-close
2025-02-05 09:12:35 +08:00
v-model="dialogUserInfoVisible"
2025-01-10 13:01:05 +08:00
:close-on-click-modal="false"
:before-close="
() => {
dialogUserInfoVisible = false
}
"
>
<el-form :model="form" label-width="120px">
<el-form-item label="姓名">
<el-input v-model="form.nickName" disabled></el-input>
</el-form-item>
<el-form-item label="登录账号">
<el-input v-model="form.userName" disabled></el-input>
</el-form-item>
<el-form-item label="密码">
<div style="display: flex; width: 100%">
<el-input v-model="form.password" show-password></el-input>
<el-button type="text" icon="EditPen" @click="resetPassword">
修改密码
</el-button>
</div>
</el-form-item>
<el-form-item label="联系电话">
<div style="display: flex; width: 100%">
<el-input v-model="form.phoneNumber" style="flex: 1"></el-input>
<el-button type="text" icon="EditPen" @click="resetPhone">重新绑定</el-button>
</div>
</el-form-item>
</el-form>
</el-dialog>
2023-12-07 17:48:36 +08:00
</template>
<style lang="scss" scoped>
2024-11-22 15:35:30 +08:00
.header-container {
.header-user-info {
background-color: #f5f5f5;
2024-12-20 17:36:14 +08:00
position: sticky;
top: 0;
left: 0;
z-index: 999;
2024-11-22 15:35:30 +08:00
}
2023-12-07 17:48:36 +08:00
2024-11-22 15:35:30 +08:00
/* 头部个人信息部分 */
.header-box {
2024-12-23 13:52:38 +08:00
width: 1552px;
margin: 0 auto;
2024-11-22 15:35:30 +08:00
height: 37px;
display: flex;
align-items: center;
justify-content: flex-end;
}
.header-item {
height: 37px;
display: flex;
align-items: center;
color: #6d6d6d;
cursor: pointer;
2024-12-23 13:52:38 +08:00
.lease-name {
background-color: #c9e7e5;
color: #47c4ad;
padding: 4px 6px;
font-weight: bold;
font-size: 16px;
border-radius: 4px;
}
2024-12-01 16:21:35 +08:00
.line {
width: 1px;
height: 15px;
background-color: #666655;
}
2024-11-22 15:35:30 +08:00
2025-01-10 13:01:05 +08:00
.user-name {
position: relative;
height: 100%;
display: flex;
align-items: center;
.user-center {
display: none;
width: 100%;
position: absolute;
bottom: -106px;
left: 0;
padding: 10px 20px;
background-color: #fff;
box-sizing: border-box;
border-radius: 4px;
box-shadow: 0 2px 4px #ccc;
.user-container {
display: flex;
align-items: center;
.info {
margin-left: 26px;
font-size: 18px;
letter-spacing: 2px;
div {
padding: 4px 0;
}
}
}
}
}
2024-11-22 15:35:30 +08:00
.user-name:hover {
color: #6d6d6d;
2025-01-10 13:01:05 +08:00
& .user-center {
display: block;
}
2023-12-07 17:48:36 +08:00
}
2024-11-22 15:35:30 +08:00
img {
vertical-align: middle;
2023-12-07 17:48:36 +08:00
}
2024-11-22 15:35:30 +08:00
a {
padding: 0 20px;
2024-12-01 16:21:35 +08:00
// border-right: 1px solid #666655;
2024-11-22 15:35:30 +08:00
}
2023-12-07 17:48:36 +08:00
2024-11-22 15:35:30 +08:00
a:hover {
color: #3cb4a6;
}
2023-12-07 17:48:36 +08:00
2024-11-22 15:35:30 +08:00
.a-border-none {
border: none;
padding: 0;
}
}
2023-12-07 17:48:36 +08:00
2024-11-22 15:35:30 +08:00
.roles-check {
position: relative;
}
.roles-check .select-list {
2024-12-23 13:52:38 +08:00
// height: 50px;
2024-11-22 15:35:30 +08:00
// display: none;
position: absolute;
left: 1%;
2024-12-23 13:52:38 +08:00
bottom: 0;
transform: translateY(100%);
2024-11-22 15:35:30 +08:00
width: 98%;
background-color: #fff;
border-radius: 6px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
z-index: 999;
transition: all 1s linear;
2023-12-07 17:48:36 +08:00
2024-11-22 15:35:30 +08:00
div {
2024-12-23 13:52:38 +08:00
height: 30px;
font-size: 16px;
line-height: 30px;
2024-11-22 15:35:30 +08:00
text-align: center;
letter-spacing: 1px;
}
div:hover {
color: #fff;
2024-12-03 09:16:20 +08:00
background-color: #00a288;
2023-12-07 17:48:36 +08:00
}
2024-11-22 15:35:30 +08:00
}
2023-12-07 17:48:36 +08:00
2024-11-22 15:35:30 +08:00
// .roles-check:hover .select-list {
// display: block;
// }
.last-item {
position: relative;
z-index: 998;
padding-left: 20px;
.qr-code {
position: absolute;
left: -70px;
top: -140px;
width: 140px;
height: 140px;
background-color: #fff;
visibility: hidden;
padding: 10px;
box-shadow: 0 2px 2px 2px #ccc;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: #333;
.el-image {
width: 120px;
height: 120px;
margin-bottom: 5px;
2023-12-07 17:48:36 +08:00
}
}
2024-11-22 15:35:30 +08:00
}
.last-item:hover > .qr-code {
visibility: visible;
transform: translateY(177px);
transition: all 0.6s;
}
/* 中间logo 搜索框部分 */
.logo-ipt-container {
2024-12-23 13:52:38 +08:00
width: 1552px;
margin: 0 auto;
2024-11-22 15:35:30 +08:00
position: relative;
display: flex;
2024-11-22 18:03:09 +08:00
align-items: center;
2024-11-22 15:35:30 +08:00
background-color: #eeeff6;
2024-12-23 13:52:38 +08:00
padding: 30px;
box-sizing: border-box;
// box-sizing: content-box;
2023-12-07 17:48:36 +08:00
2024-12-10 15:06:36 +08:00
// padding: 30px 0 60px 0;
.home-logo {
2024-12-23 13:52:38 +08:00
// width: 286px;
// height: 100%;
width: 240px;
height: 80px;
2025-03-06 09:41:31 +08:00
/* height: 40px; // 贵州 */
2024-12-23 13:52:38 +08:00
background-color: orange;
background: url('@/assets/img/logo.png') no-repeat;
2025-03-06 09:41:31 +08:00
/* background: url('@/assets/img/logo-gz.png') no-repeat; */ // 贵州
2024-12-23 13:52:38 +08:00
background-size: 100% 100%;
cursor: pointer;
2023-12-07 17:48:36 +08:00
}
2024-12-10 15:06:36 +08:00
.home-search {
position: relative;
2024-12-23 13:52:38 +08:00
flex: 1;
width: 100%;
margin: 0 20px;
// width: 1000px;
// margin-left: 40px;
2024-12-10 15:06:36 +08:00
2025-06-01 16:33:12 +08:00
// 下拉列表样式
.dropdown-list {
position: absolute;
// 基于输入框左侧定位,通过 padding-left 调整
left: 100px;
// 基于输入框右侧定位,通过减去按钮宽度调整
right: 105px;
top: calc(100% - 5px);
background-color: #fff;
border: 1px solid #ccc;
border-top: none;
border-radius: 0 0 27px 27px;
z-index: 999;
max-height: 200px;
overflow-y: auto;
}
// 下拉列表项样式
.dropdown-item {
padding: 10px;
cursor: pointer;
}
.dropdown-item:hover {
background-color: #f5f5f5;
}
2025-02-28 10:40:52 +08:00
.hot-word {
margin: 15px 0 0 10%;
max-width: 80%;
display: flex;
flex-wrap: wrap;
}
2024-12-10 15:06:36 +08:00
.left-check-box {
position: absolute;
left: 0;
top: 0;
height: 53px;
2024-12-23 13:52:38 +08:00
width: 100px;
2024-12-10 15:06:36 +08:00
display: flex;
align-items: center;
justify-content: center;
border-right: 1px solid #3cb4a6;
2024-12-23 13:52:38 +08:00
// font-size: 14px;
2024-12-10 15:06:36 +08:00
color: #11806f;
cursor: pointer;
}
.check-container {
position: absolute;
left: 0;
2024-12-23 13:52:38 +08:00
bottom: 0;
transform: translateY(100%);
width: 100px;
2024-12-10 15:06:36 +08:00
background-color: #fff;
border-radius: 6px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
z-index: 999;
transition: all 1s linear;
cursor: pointer;
div {
2024-12-23 13:52:38 +08:00
height: 35px;
// font-size: 14px;
line-height: 35px;
2024-12-10 15:06:36 +08:00
text-align: center;
letter-spacing: 1px;
}
div:hover {
color: #fff;
background-color: #00a288;
}
}
}
.cart-container {
2024-12-23 13:52:38 +08:00
width: 130px;
// background-color: orange;
// height: 60px;
// flex: 1;
2024-12-10 15:06:36 +08:00
}
// img {
// margin-left: 38px;
// width: 160px;
// height: 60px;
// cursor: pointer;
// }
2024-11-22 15:35:30 +08:00
input {
2024-12-10 15:06:36 +08:00
width: 100%;
2024-12-23 14:19:13 +08:00
height: 54px;
2024-12-10 15:06:36 +08:00
display: block;
2024-11-22 15:35:30 +08:00
border: 1px solid #3cb4a6;
2024-12-23 14:19:13 +08:00
border-radius: 27px;
line-height: 54px;
2024-11-22 15:35:30 +08:00
color: #333;
text-shadow: 0 0 0 #333;
2024-12-23 13:52:38 +08:00
padding-left: 110px;
2024-12-10 15:06:36 +08:00
box-sizing: border-box;
2024-11-22 15:35:30 +08:00
}
2023-12-07 17:48:36 +08:00
2024-11-22 15:35:30 +08:00
input:focus {
outline: 1px solid #3cb4a6;
}
2023-12-07 17:48:36 +08:00
2024-11-22 15:35:30 +08:00
input::-webkit-input-placeholder {
color: #949494;
}
.search-btn {
2024-12-10 15:06:36 +08:00
position: absolute;
top: 0;
right: 0;
2024-11-22 15:35:30 +08:00
width: 100px;
2024-12-10 15:06:36 +08:00
height: 43px;
2024-12-25 08:52:58 +08:00
transform: translate(-5px, 5px);
2024-12-10 15:06:36 +08:00
border-radius: 43px;
2024-11-22 15:35:30 +08:00
background: linear-gradient(132deg, #22ab9b 0%, #0d7462 100%);
box-shadow: 0px 2px 4px 0px rgba(20, 175, 255, 0.5);
border: none;
color: #fff;
cursor: pointer;
font-size: 18px;
2024-12-10 15:06:36 +08:00
box-sizing: border-box;
2024-11-22 15:35:30 +08:00
}
2023-12-07 17:48:36 +08:00
2024-11-22 15:35:30 +08:00
.ipt-down {
position: absolute;
2024-12-01 16:21:35 +08:00
bottom: 25px;
2024-11-22 15:35:30 +08:00
left: 22%;
overflow: hidden;
2023-12-07 17:48:36 +08:00
2024-11-22 15:35:30 +08:00
a {
max-width: 140px;
padding: 0 10px;
color: #727272;
font-size: 14px;
2023-12-07 17:48:36 +08:00
cursor: pointer;
overflow: hidden;
2024-11-22 15:35:30 +08:00
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
2023-12-07 17:48:36 +08:00
}
}
2024-11-23 16:31:54 +08:00
.cart-icon {
2024-12-10 15:06:36 +08:00
width: 100%;
2024-11-23 16:31:54 +08:00
display: flex;
align-items: center;
2024-12-20 17:36:14 +08:00
justify-content: center;
2024-11-23 16:31:54 +08:00
cursor: pointer;
span {
margin-left: 10px;
color: #1abc9c;
}
}
2023-12-07 17:48:36 +08:00
}
2024-11-22 15:35:30 +08:00
}
2023-12-07 17:48:36 +08:00
</style>