|
|
|
@ -1,22 +1,27 @@
|
|
|
|
|
|
|
|
|
|
<!-- 个人中心 -->
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html>
|
|
|
|
|
|
|
|
|
|
<head>
|
|
|
|
|
<!-- 设置页面字符编码为UTF-8,确保支持中文及特殊字符正确显示 -->
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<!-- 配置视口参数,使页面适配不同设备屏幕尺寸,禁止用户缩放以保持布局一致性 -->
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
|
|
|
<!-- 定义页面标题,显示在浏览器标签栏 -->
|
|
|
|
|
<title>个人中心</title>
|
|
|
|
|
<!-- 引入layui框架基础样式,提供组件化UI支持(如表单、导航、按钮等) -->
|
|
|
|
|
<link rel="stylesheet" href="../../layui/css/layui.css">
|
|
|
|
|
<!-- 引入element样式 -->
|
|
|
|
|
<!-- 引入element-ui组件库样式,用于扩展表单选择框等组件的样式 -->
|
|
|
|
|
<link rel="stylesheet" href="../../xznstatic/css/element.min.css">
|
|
|
|
|
<!-- 样式 -->
|
|
|
|
|
<!-- 引入自定义全局样式文件,包含页面整体布局和通用样式规则 -->
|
|
|
|
|
<link rel="stylesheet" href="../../css/style.css" />
|
|
|
|
|
<!-- 主题(主要颜色设置) -->
|
|
|
|
|
<!-- 引入主题样式文件,定义品牌色、背景色等主题相关样式 -->
|
|
|
|
|
<link rel="stylesheet" href="../../css/theme.css" />
|
|
|
|
|
<!-- 通用的css -->
|
|
|
|
|
<!-- 引入公共样式文件,包含多个页面共享的基础样式(如字体、边距等) -->
|
|
|
|
|
<link rel="stylesheet" href="../../css/common.css" />
|
|
|
|
|
</head>
|
|
|
|
|
<!-- 页面自定义样式区域,覆盖或补充第三方样式库的样式 -->
|
|
|
|
|
<style>
|
|
|
|
|
/* 设置页面全屏背景伪元素,固定定位并居中显示背景图,z-index确保在内容层下方 */
|
|
|
|
|
html::after {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
@ -25,521 +30,591 @@
|
|
|
|
|
bottom: 0;
|
|
|
|
|
content: '';
|
|
|
|
|
display: block;
|
|
|
|
|
background-attachment: fixed;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
background-position: center;
|
|
|
|
|
z-index: -1;
|
|
|
|
|
background-attachment: fixed; /* 背景图固定不随滚动条移动 */
|
|
|
|
|
background-size: cover; /* 背景图等比缩放覆盖整个容器 */
|
|
|
|
|
background-position: center; /* 背景图居中显示 */
|
|
|
|
|
z-index: -1; /* 层级低于页面内容 */
|
|
|
|
|
}
|
|
|
|
|
/* 轮播图容器样式,溢出隐藏以实现图片滑动切换效果 */
|
|
|
|
|
#swiper {
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
/* 轮播图未激活状态指示器样式,定义非当前页点的外观 */
|
|
|
|
|
#swiper .layui-carousel-ind li {
|
|
|
|
|
width: 20px;
|
|
|
|
|
height: 10px;
|
|
|
|
|
border-width: 0;
|
|
|
|
|
border-style: solid;
|
|
|
|
|
border-color: rgba(0,0,0,.3);
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
background-color: #f7f7f7;
|
|
|
|
|
box-shadow: 0 0 6px rgba(255,0,0,.8);
|
|
|
|
|
width: 20px; /* 指示器宽度 */
|
|
|
|
|
height: 10px; /* 指示器高度 */
|
|
|
|
|
border: 0 solid rgba(0, 0, 0, .3); /* 透明边框 */
|
|
|
|
|
border-radius: 6px; /* 圆角处理 */
|
|
|
|
|
background-color: #f7f7f7; /* 背景色 */
|
|
|
|
|
box-shadow: 0 0 6px rgba(255, 0, 0, .8); /* 红色阴影效果 */
|
|
|
|
|
}
|
|
|
|
|
/* 轮播图激活状态指示器样式,通过宽度变化突出当前页 */
|
|
|
|
|
#swiper .layui-carousel-ind li.layui-this {
|
|
|
|
|
width: 30px;
|
|
|
|
|
width: 30px; /* 当前页指示器宽度略宽 */
|
|
|
|
|
height: 10px;
|
|
|
|
|
border-width: 0;
|
|
|
|
|
border-style: solid;
|
|
|
|
|
border-color: rgba(0,0,0,.3);
|
|
|
|
|
border: 0 solid rgba(0, 0, 0, .3);
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 页面标题容器样式,使用flex布局实现垂直居中排列 */
|
|
|
|
|
.index-title {
|
|
|
|
|
text-align: center;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
width: 980px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
text-align: center; /* 文本居中 */
|
|
|
|
|
box-sizing: border-box; /* 盒模型包含内边距和边框 */
|
|
|
|
|
width: 980px; /* 固定宽度 */
|
|
|
|
|
display: flex; /* 弹性布局 */
|
|
|
|
|
justify-content: center; /* 水平居中 */
|
|
|
|
|
align-items: center; /* 垂直居中 */
|
|
|
|
|
flex-direction: column; /* 子元素垂直排列 */
|
|
|
|
|
}
|
|
|
|
|
/* 标题内span元素样式,控制文字间距和行高 */
|
|
|
|
|
.index-title span {
|
|
|
|
|
padding: 0 10px;
|
|
|
|
|
line-height: 1.4;
|
|
|
|
|
padding: 0 10px; /* 左右内边距 */
|
|
|
|
|
line-height: 1.4; /* 行高 */
|
|
|
|
|
}
|
|
|
|
|
/* 个人中心导航树容器样式,占满父容器宽度 */
|
|
|
|
|
.center-container .layui-nav-tree {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
/* 导航组件位置样式,继承父元素定位属性 */
|
|
|
|
|
.center-container .layui-nav {
|
|
|
|
|
position: inherit;
|
|
|
|
|
}
|
|
|
|
|
/* 导航树单项基础样式,定义高度、行高、字体、边框等 */
|
|
|
|
|
.center-container .layui-nav-tree .layui-nav-item {
|
|
|
|
|
height: 44px;
|
|
|
|
|
line-height: 44px;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
color: rgba(17, 17, 17, 1);
|
|
|
|
|
border-width: 0px 0px 1px 0px;
|
|
|
|
|
border-style: solid;
|
|
|
|
|
border-radius: 0;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
text-align: center;
|
|
|
|
|
height: 44px; /* 导航项高度 */
|
|
|
|
|
line-height: 44px; /* 行高等于高度实现垂直居中 */
|
|
|
|
|
font-size: 16px; /* 字体大小 */
|
|
|
|
|
color: rgba(17, 17, 17, 1); /* 文字颜色 */
|
|
|
|
|
border-bottom: 1px solid rgba(0, 0, 0, .3); /* 底部边框 */
|
|
|
|
|
border-radius: 0; /* 直角 */
|
|
|
|
|
background-color: #fff; /* 背景色 */
|
|
|
|
|
text-align: center; /* 文本居中 */
|
|
|
|
|
}
|
|
|
|
|
/* 导航树激活状态样式,隐藏导航条并保持文字颜色一致 */
|
|
|
|
|
.center-container .layui-nav-tree .layui-nav-bar {
|
|
|
|
|
height: 44px !important;
|
|
|
|
|
opacity: 0 !important;
|
|
|
|
|
height: 44px !important; /* 强制设置高度 */
|
|
|
|
|
opacity: 0 !important; /* 完全透明 */
|
|
|
|
|
}
|
|
|
|
|
/* 导航树当前选中项样式,突出显示但不改变基础样式 */
|
|
|
|
|
.center-container .layui-nav-tree .layui-nav-item.layui-this {
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
color: rgba(17, 17, 17, 1);
|
|
|
|
|
border-width: 0;
|
|
|
|
|
border-style: solid;
|
|
|
|
|
border-radius: 0;
|
|
|
|
|
border: 0;
|
|
|
|
|
}
|
|
|
|
|
/* 导航树悬停样式,缩小字体并改变文字颜色增强交互反馈 */
|
|
|
|
|
.center-container .layui-nav-tree .layui-nav-item:hover {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: #fff;
|
|
|
|
|
border-width: 0;
|
|
|
|
|
border-style: solid;
|
|
|
|
|
border-radius: 0;
|
|
|
|
|
font-size: 14px; /* 悬停时字体缩小 */
|
|
|
|
|
color: #fff; /* 白色文字 */
|
|
|
|
|
border: 0;
|
|
|
|
|
}
|
|
|
|
|
/* 导航链接样式,去除默认装饰并继承父级样式 */
|
|
|
|
|
.center-container .layui-nav-tree .layui-nav-item a {
|
|
|
|
|
line-height: inherit;
|
|
|
|
|
height: auto;
|
|
|
|
|
background-color: inherit;
|
|
|
|
|
color: inherit;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
line-height: inherit; /* 继承父级行高 */
|
|
|
|
|
height: auto; /* 自动高度 */
|
|
|
|
|
background: inherit; /* 继承背景色 */
|
|
|
|
|
color: inherit; /* 继承文字颜色 */
|
|
|
|
|
text-decoration: none; /* 去除下划线 */
|
|
|
|
|
}
|
|
|
|
|
/* 右侧内容容器样式,相对定位用于子元素绝对定位参考 */
|
|
|
|
|
.right-container {
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 表单行样式,使用flex布局使标签和输入框垂直居中对齐 */
|
|
|
|
|
.right-container .layui-form-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
/* 输入块样式,占据剩余空间实现弹性布局 */
|
|
|
|
|
.right-container .layui-input-block {
|
|
|
|
|
margin: 0;
|
|
|
|
|
flex: 1;
|
|
|
|
|
flex: 1; /* 弹性增长 */
|
|
|
|
|
}
|
|
|
|
|
/* 输入框基础样式,定义内边距、高度、边框等 */
|
|
|
|
|
.right-container .input .layui-input {
|
|
|
|
|
padding: 0 12px;
|
|
|
|
|
height: 40px;
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
border-width: 1px;
|
|
|
|
|
border-style: solid;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
text-align: left;
|
|
|
|
|
padding: 0 12px; /* 左右内边距 */
|
|
|
|
|
height: 40px; /* 固定高度 */
|
|
|
|
|
font-size: 15px; /* 字体大小 */
|
|
|
|
|
border: 1px solid #e0e0e0; /* 细边框 */
|
|
|
|
|
border-radius: 4px; /* 圆角 */
|
|
|
|
|
background-color: #fff; /* 白色背景 */
|
|
|
|
|
text-align: left; /* 文本左对齐 */
|
|
|
|
|
}
|
|
|
|
|
/* 选择框样式,与输入框保持一致外观 */
|
|
|
|
|
.right-container .select .layui-input {
|
|
|
|
|
padding: 0 12px;
|
|
|
|
|
height: 40px;
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
border: 1px solid #e0e0e0;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
border-width: 1px;
|
|
|
|
|
border-style: solid;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
|
|
|
|
/* 日期输入框样式,通过颜色区分功能类型 */
|
|
|
|
|
.right-container .date .layui-input {
|
|
|
|
|
padding: 0 12px;
|
|
|
|
|
height: 40px;
|
|
|
|
|
font-size: 15px;
|
|
|
|
|
color: rgba(160, 67, 26, 1);
|
|
|
|
|
color: rgba(160, 67, 26, 1); /* 特殊颜色标识日期字段 */
|
|
|
|
|
border: 1px solid #e0e0e0;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
border-width: 1px;
|
|
|
|
|
border-style: solid;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
box-shadow: 0 0 0px rgba(255,0,0,.8);
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.header {animation-name: fadeInUp; padding-bottom: 26px;padding-top: 70px;position:relative;border-bottom:1px solid rgba(0,0,0,0.1);margin-bottom:40px;}
|
|
|
|
|
#plheader{ top: 48px;padding-bottom: 40px;width: 220px;position: relative;height: 70px;border-radius: 3px 3px 0px 0px;padding-top: 40px !important;}
|
|
|
|
|
.header p.title {color: #fff;font-size: 25px;margin-bottom: 8px;text-align: left;white-space: nowrap;overflow: hidden;margin-left: 31px;font-weight: bold; padding-bottom: 8px;margin-top: 0px;width: 158px;border-bottom: 1px solid rgba(255, 255, 255, 0.16);letter-spacing:1px;}
|
|
|
|
|
#category {padding-top: 136px;margin-left: 0px;padding-bottom: 30px;width: 205px;float: left;padding-left: 15px;text-align: left;margin-top: -120px;background-color: var(--publicMainColor);border-radius: 0px 0px 3px 3px;}
|
|
|
|
|
.header p.subtitle {font-family:HELVETICANEUELTPRO-THEX, "微软雅黑";letter-spacing: 1px;font-size: 15px;display: inline-block;padding-top: 0px;color: #ffffff; margin-top: 0px; margin-right:31px;float: right;overflow: hidden;width: 156px;text-align: left;}
|
|
|
|
|
#category a.active::before {display: none;}
|
|
|
|
|
#category a.active::after {display:none;}
|
|
|
|
|
#category a.active, #category a:hover {background: var(--publicSubColor);color: #FFFFFF;border-color: #838383;transition: 0.3s; transform-origin: bottom;}
|
|
|
|
|
#category li {height:auto;position:relative;float:none; display:block;margin-top:1px;margin-bottom:1px;line-height:43px;border-bottom: 1px solid rgba(255, 255, 255, 0.05);padding-left: 15px;margin-right:16px;transition: all 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;}
|
|
|
|
|
#category li:last-child { border-bottom:none;}
|
|
|
|
|
#category a { border:0px; background:none; color:#CFDCF9; font-size:14px; position:relative; padding:0;line-height: 42px;height: 42px;}
|
|
|
|
|
#category a::before { content:''; position:absolute; content: '';position: absolute;width: 190px;background-color: #AEAEAF;height: 42px;background: transparent;left: -16px;position: absolute;transition: all 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) 0s; }
|
|
|
|
|
#category a.active::before {display: none;}
|
|
|
|
|
#category li:hover {padding-left:30px;background-color: var(--publicSubColor);transition: all 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;}
|
|
|
|
|
#category .bbbb, #category li .aaaa {padding-left:30px;background-color: var(--publicSubColor);transition: all 0.6s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;background: var(--publicSubColor);color: #FFFFFF; transition: 0.3s; transform-origin: bottom;}
|
|
|
|
|
#category li:hover ul li{width: 136px;}
|
|
|
|
|
#category li:hover ul li a{color: rgba(255, 255, 255, 0.45);width: 136px;overflow: hidden; background-color: rgb(34, 73, 160); padding-left:0px;}
|
|
|
|
|
#category li ul li:hover a{ padding-left:0px; margin-left: 0px;}
|
|
|
|
|
#category li:hover a{color:#fff}
|
|
|
|
|
/* 头部区域样式,添加淡入向上动画和底部边框 */
|
|
|
|
|
.header {
|
|
|
|
|
animation: fadeInUp 0.5s ease-out; /* 动画效果 */
|
|
|
|
|
padding: 70px 0 26px; /* 上下内边距 */
|
|
|
|
|
position: relative; /* 相对定位 */
|
|
|
|
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1); /* 底部浅灰色边框 */
|
|
|
|
|
margin-bottom: 40px; /* 底部外边距 */
|
|
|
|
|
}
|
|
|
|
|
/* 头部标题容器样式,固定定位并设置圆角 */
|
|
|
|
|
#plheader {
|
|
|
|
|
top: 48px; /* 距离顶部位置 */
|
|
|
|
|
padding: 40px 0 40px; /* 上下内边距 */
|
|
|
|
|
width: 220px; /* 固定宽度 */
|
|
|
|
|
height: 70px; /* 固定高度 */
|
|
|
|
|
border-radius: 3px 3px 0 0; /* 顶部圆角 */
|
|
|
|
|
}
|
|
|
|
|
/* 头部主标题样式,白色粗体文字,底部带分隔线 */
|
|
|
|
|
.header p.title {
|
|
|
|
|
color: #fff; /* 白色文字 */
|
|
|
|
|
font-size: 25px; /* 较大字体 */
|
|
|
|
|
font-weight: bold; /* 加粗 */
|
|
|
|
|
margin: 0 0 8px 31px; /* 外边距 */
|
|
|
|
|
white-space: nowrap; /* 不换行 */
|
|
|
|
|
overflow: hidden; /* 溢出隐藏 */
|
|
|
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.16); /* 底部半透明边框 */
|
|
|
|
|
}
|
|
|
|
|
/* 分类导航容器样式,浮动布局实现左侧导航 */
|
|
|
|
|
#category {
|
|
|
|
|
padding: 136px 0 30px 15px; /* 内边距 */
|
|
|
|
|
width: 205px; /* 固定宽度 */
|
|
|
|
|
float: left; /* 左浮动 */
|
|
|
|
|
background-color: var(--publicMainColor); /* 主题背景色 */
|
|
|
|
|
border-radius: 0 0 3px 3px; /* 底部圆角 */
|
|
|
|
|
}
|
|
|
|
|
/* 头部副标题样式,右侧浮动显示,限制宽度 */
|
|
|
|
|
.header p.subtitle {
|
|
|
|
|
font-family: HELVETICANEUELTPRO-THEX, "微软雅黑"; /* 字体 */
|
|
|
|
|
letter-spacing: 1px; /* 字母间距 */
|
|
|
|
|
font-size: 15px; /* 字体大小 */
|
|
|
|
|
color: #fff; /* 白色文字 */
|
|
|
|
|
float: right; /* 右浮动 */
|
|
|
|
|
width: 156px; /* 固定宽度 */
|
|
|
|
|
overflow: hidden; /* 溢出隐藏 */
|
|
|
|
|
}
|
|
|
|
|
/* 分类链接激活状态伪元素隐藏,避免视觉干扰 */
|
|
|
|
|
#category a.active::before,
|
|
|
|
|
#category a.active::after {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
/* 分类链接激活及悬停样式,渐变背景和颜色变化 */
|
|
|
|
|
#category a.active,
|
|
|
|
|
#category a:hover {
|
|
|
|
|
background: var(--publicSubColor); /* 主题强调色 */
|
|
|
|
|
color: #FFFFFF; /* 白色文字 */
|
|
|
|
|
border-color: #838383; /* 深灰边框 */
|
|
|
|
|
transition: all 0.3s ease; /* 过渡效果 */
|
|
|
|
|
}
|
|
|
|
|
/* 分类列表项基础样式,带底部细边框和过渡动画 */
|
|
|
|
|
#category li {
|
|
|
|
|
height: 43px; /* 固定高度 */
|
|
|
|
|
line-height: 43px; /* 垂直居中 */
|
|
|
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* 底部半透明边框 */
|
|
|
|
|
padding-left: 15px; /* 左内边距 */
|
|
|
|
|
transition: all 0.6s cubic-bezier(0.215, 0.61, 0.355, 1); /* 缓动动画 */
|
|
|
|
|
}
|
|
|
|
|
/* 最后一个分类项去除底部边框,保持列表完整性 */
|
|
|
|
|
#category li:last-child {
|
|
|
|
|
border-bottom: none;
|
|
|
|
|
}
|
|
|
|
|
/* 分类链接基础样式,透明背景和灰色文字 */
|
|
|
|
|
#category a {
|
|
|
|
|
border: 0;
|
|
|
|
|
background: none;
|
|
|
|
|
color: #CFDCF9; /* 浅灰蓝色文字 */
|
|
|
|
|
font-size: 14px; /* 较小字体 */
|
|
|
|
|
display: block; /* 块级元素 */
|
|
|
|
|
height: 42px; /* 固定高度 */
|
|
|
|
|
}
|
|
|
|
|
/* 分类链接伪元素样式,用于悬停时的背景效果 */
|
|
|
|
|
#category a::before {
|
|
|
|
|
content: '';
|
|
|
|
|
position: absolute; /* 绝对定位 */
|
|
|
|
|
left: -16px; /* 左侧偏移 */
|
|
|
|
|
width: 190px; /* 伪元素宽度 */
|
|
|
|
|
height: 42px; /* 伪元素高度 */
|
|
|
|
|
transition: all 0.6s cubic-bezier(0.215, 0.61, 0.355, 1); /* 过渡效果 */
|
|
|
|
|
}
|
|
|
|
|
/* 分类项悬停时左内边距增大,显示强调背景 */
|
|
|
|
|
#category li:hover {
|
|
|
|
|
padding-left: 30px; /* 增大左内边距 */
|
|
|
|
|
background-color: var(--publicSubColor); /* 强调背景色 */
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
<!-- Vue根容器,绑定整个页面的Vue实例 -->
|
|
|
|
|
<div id="app">
|
|
|
|
|
<!-- 轮播图 -->
|
|
|
|
|
<div class="layui-carousel" id="swiper" :style='{"boxShadow":"0 0 0px rgba(255,0,0,.8)","margin":"0 auto","borderColor":"rgba(0,0,0,.3)","borderRadius":"0px","borderWidth":"0","width":"100%","borderStyle":"solid"}'>
|
|
|
|
|
<!-- 轮播图容器,使用layui的carousel组件,动态绑定样式属性 -->
|
|
|
|
|
<div class="layui-carousel" id="swiper" :style='{
|
|
|
|
|
"boxShadow": "0 0 0px rgba(255,0,0,.8)",
|
|
|
|
|
"margin": "0 auto",
|
|
|
|
|
"borderColor": "rgba(0,0,0,.3)",
|
|
|
|
|
"borderRadius": "0px",
|
|
|
|
|
"borderWidth": "0",
|
|
|
|
|
"width": "100%",
|
|
|
|
|
"borderStyle": "solid"
|
|
|
|
|
}'>
|
|
|
|
|
<div carousel-item>
|
|
|
|
|
<!-- 轮播图内容项,通过v-for循环渲染图片数组 -->
|
|
|
|
|
<div v-for="(item, index) in swiperList" :key="index">
|
|
|
|
|
<img style="width: 100%;height: 100%;object-fit:cover;" :src="item.img" />
|
|
|
|
|
<img
|
|
|
|
|
style="width: 100%; height: 100%; object-fit: cover;"
|
|
|
|
|
:src="item.img"
|
|
|
|
|
alt="轮播图图片"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 轮播图 -->
|
|
|
|
|
|
|
|
|
|
<!-- 标题 -->
|
|
|
|
|
<!-- <h2 style="margin-top: 20px;" class="index-title">USER / CENTER</h2>
|
|
|
|
|
<div class="line-container">
|
|
|
|
|
<p class="line" style="background: #EEEEEE;"> 个人中心 </p>
|
|
|
|
|
</div> -->
|
|
|
|
|
|
|
|
|
|
<!-- 标题 -->
|
|
|
|
|
|
|
|
|
|
<!-- 个人中心主体容器,包含导航菜单和表单内容 -->
|
|
|
|
|
<div class="center-container">
|
|
|
|
|
<!-- 个人中心菜单 config.js-->
|
|
|
|
|
<!-- 导航菜单容器,负边距调整位置 -->
|
|
|
|
|
<div style="width: auto; margin: -70px 10px 0px auto">
|
|
|
|
|
<!-- 菜单头部,显示标题和副标题 -->
|
|
|
|
|
<div class="header" id="plheader">
|
|
|
|
|
<p class="title">个人中心</p>
|
|
|
|
|
<p class="subtitle">USER / CENTER</p>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 菜单列表,通过v-for生成导航项 -->
|
|
|
|
|
<ul id="category">
|
|
|
|
|
<li v-for="(item,index) in centerMenu" v-bind:key="index" :class="index==0?'bbbb':''">
|
|
|
|
|
<a :href="'javascript:jump(\''+item.url+'\')'" style="color:#FFFFFF;" :class="index==0?'aaaa':''">{{item.name}}</a>
|
|
|
|
|
<li
|
|
|
|
|
v-for="(item, index) in centerMenu"
|
|
|
|
|
:key="index"
|
|
|
|
|
:class="index === 0 ? 'bbbb' : ''"
|
|
|
|
|
>
|
|
|
|
|
<!-- 菜单链接,点击时调用jump函数跳转页面 -->
|
|
|
|
|
<a
|
|
|
|
|
:href="'javascript:jump(\'' + item.url + '\')'"
|
|
|
|
|
style="color: #FFFFFF;"
|
|
|
|
|
:class="index === 0 ? 'aaaa' : ''"
|
|
|
|
|
>
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div> <!-- 个人中心菜单 -->
|
|
|
|
|
<!-- 个人中心 -->
|
|
|
|
|
<div class="right-container sub_borderColor" :style='{"padding":"20px","boxShadow":"0px rgba(255,0,0,.8)","margin":"0","backgroundColor":"#fff","borderRadius":"0","borderWidth":"1px","borderStyle":"solid"}'>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 右侧表单容器,包含用户信息输入区域 -->
|
|
|
|
|
<div class="right-container sub_borderColor" :style='{
|
|
|
|
|
"padding": "20px",
|
|
|
|
|
"boxShadow": "0px rgba(255,0,0,.8)",
|
|
|
|
|
"margin": "0",
|
|
|
|
|
"backgroundColor": "#fff",
|
|
|
|
|
"borderRadius": "0",
|
|
|
|
|
"borderWidth": "1px",
|
|
|
|
|
"borderStyle": "solid"
|
|
|
|
|
}'>
|
|
|
|
|
<form class="layui-form">
|
|
|
|
|
<!-- 主键 -->
|
|
|
|
|
<!-- 隐藏域存储用户ID,用于表单提交时传递主键 -->
|
|
|
|
|
<input type="hidden" v-model="detail.id" name="id" id="id" />
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{"padding":"10px","boxShadow":"0 0 0px rgba(255,0,0,.8)","margin":"0 0 10px 0","backgroundColor":"#fff","borderRadius":"1px","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
|
|
|
|
|
<label :style='{"width":"110px","padding":"0 12px 0 0","fontSize":"15px","color":"#333","textAlign":"left"}' class="layui-form-label">
|
|
|
|
|
|
|
|
|
|
<!-- 账户输入项,带必填校验 -->
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{
|
|
|
|
|
"padding": "10px",
|
|
|
|
|
"boxShadow": "0 0 0px rgba(255,0,0,.8)",
|
|
|
|
|
"margin": "0 0 10px 0",
|
|
|
|
|
"backgroundColor": "#fff",
|
|
|
|
|
"borderRadius": "1px",
|
|
|
|
|
"borderWidth": "0 0 1px 0",
|
|
|
|
|
"borderStyle": "solid"
|
|
|
|
|
}'>
|
|
|
|
|
<label
|
|
|
|
|
:style='{
|
|
|
|
|
"width": "110px",
|
|
|
|
|
"padding": "0 12px 0 0",
|
|
|
|
|
"fontSize": "15px",
|
|
|
|
|
"color": "#333",
|
|
|
|
|
"textAlign": "left"
|
|
|
|
|
}'
|
|
|
|
|
class="layui-form-label"
|
|
|
|
|
>
|
|
|
|
|
账户
|
|
|
|
|
</label>
|
|
|
|
|
<div class="layui-input-block input">
|
|
|
|
|
<input type="text" v-model="detail.username" name="username" id="username" lay-verify="required" placeholder="账户" autocomplete="off" class="layui-input">
|
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
v-model="detail.username"
|
|
|
|
|
name="username"
|
|
|
|
|
id="username"
|
|
|
|
|
lay-verify="required"
|
|
|
|
|
placeholder="账户"
|
|
|
|
|
autocomplete="off"
|
|
|
|
|
class="layui-input"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{"padding":"10px","boxShadow":"0 0 0px rgba(255,0,0,.8)","margin":"0 0 10px 0","backgroundColor":"#fff","borderRadius":"1px","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
|
|
|
|
|
<label :style='{"width":"110px","padding":"0 12px 0 0","fontSize":"15px","color":"#333","textAlign":"left"}' class="layui-form-label">
|
|
|
|
|
用户姓名
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<!-- 用户姓名输入项,带必填校验 -->
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{...}'>
|
|
|
|
|
<label ...>用户姓名</label>
|
|
|
|
|
<div class="layui-input-block input">
|
|
|
|
|
<input type="text" v-model="detail.yonghuName" name="yonghuName" id="yonghuName" lay-verify="required" placeholder="用户姓名" autocomplete="off" class="layui-input">
|
|
|
|
|
<input ... v-model="detail.yonghuName" lay-verify="required" ... />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{"padding":"10px","boxShadow":"0 0 0px rgba(255,0,0,.8)","margin":"0 0 10px 0","backgroundColor":"#fff","borderRadius":"1px","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
|
|
|
|
|
<label :style='{"width":"110px","padding":"0 12px 0 0","fontSize":"15px","color":"#333","textAlign":"left"}' style="opacity: 0;" class="layui-form-label">
|
|
|
|
|
头像
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<!-- 头像显示区域,隐藏标签并显示图片预览 -->
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{...}'>
|
|
|
|
|
<label style="opacity: 0;">头像</label>
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
|
<img id="yonghuPhotoImg" style="width: 100px;height: 100px;border-radius: 50%;border: 2px solid #EEEEEE;" :style='{"boxShadow":"0 0 3px rgba(160, 67, 26, 1)","borderColor":"rgba(135, 206, 250, 1)","backgroundColor":"#fff","borderRadius":"10px","borderWidth":"1px","width":"80px","borderStyle":"solid","height":"80px"}' :src="detail.yonghuPhoto">
|
|
|
|
|
<img
|
|
|
|
|
id="yonghuPhotoImg"
|
|
|
|
|
:style='{
|
|
|
|
|
"width": "80px",
|
|
|
|
|
"height": "80px",
|
|
|
|
|
"borderRadius": "10px",
|
|
|
|
|
"borderWidth": "1px",
|
|
|
|
|
"borderStyle": "solid",
|
|
|
|
|
"boxShadow": "0 0 3px rgba(160, 67, 26, 1)"
|
|
|
|
|
}'
|
|
|
|
|
:src="detail.yonghuPhoto"
|
|
|
|
|
/>
|
|
|
|
|
<input type="hidden" v-model="detail.yonghuPhoto" id="yonghuPhoto" name="yonghuPhoto" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{"padding":"10px","boxShadow":"0 0 0px rgba(255,0,0,.8)","margin":"0 0 10px 0","backgroundColor":"#fff","borderRadius":"1px","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
|
|
|
|
|
<label :style='{"width":"110px","padding":"0 12px 0 0","fontSize":"15px","color":"#333","textAlign":"left"}' style="opacity: 0;" class="layui-form-label">
|
|
|
|
|
头像
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<!-- 头像上传按钮,隐藏标签并绑定上传事件 -->
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{...}'>
|
|
|
|
|
<label style="opacity: 0;">头像</label>
|
|
|
|
|
<div class="layui-input-block">
|
|
|
|
|
<button class="main_backgroundColor" :style='{"padding":"0 10px","boxShadow":"0 0 0px rgba(255,0,0,.5)","margin":"0 10px 0 0","borderColor":"#ccc","color":"#fff","borderRadius":"8px","borderWidth":"0","width":"auto","fontSize":"14px","borderStyle":"solid","height":"44px"}' type="button" class="layui-btn btn-theme"
|
|
|
|
|
id="yonghuPhotoUpload">
|
|
|
|
|
<i v-if="true" :style='{"color":"#fff","show":true,"fontSize":"14px"}' class="layui-icon"></i>上传头像
|
|
|
|
|
<button
|
|
|
|
|
:style='{
|
|
|
|
|
"padding": "0 10px",
|
|
|
|
|
"boxShadow": "0 0 0px rgba(255,0,0,.5)",
|
|
|
|
|
"margin": "0 10px 0 0",
|
|
|
|
|
"borderRadius": "8px",
|
|
|
|
|
"backgroundColor": "var(--publicMainColor)",
|
|
|
|
|
"color": "#fff"
|
|
|
|
|
}'
|
|
|
|
|
type="button"
|
|
|
|
|
class="layui-btn btn-theme"
|
|
|
|
|
id="yonghuPhotoUpload"
|
|
|
|
|
>
|
|
|
|
|
<i class="layui-icon"></i>上传头像
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{"padding":"10px","boxShadow":"0 0 0px rgba(255,0,0,.8)","margin":"0 0 10px 0","backgroundColor":"#fff","borderRadius":"1px","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
|
|
|
|
|
<label :style='{"width":"110px","padding":"0 12px 0 0","fontSize":"15px","color":"#333","textAlign":"left"}' class="layui-form-label">
|
|
|
|
|
用户手机号
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<!-- 手机号输入项,带必填和手机号格式校验 -->
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{...}'>
|
|
|
|
|
<label ...>用户手机号</label>
|
|
|
|
|
<div class="layui-input-block input">
|
|
|
|
|
<input type="text" v-model="detail.yonghuPhone" name="yonghuPhone" id="yonghuPhone" lay-verify="required|phone" placeholder="用户手机号" autocomplete="off" class="layui-input">
|
|
|
|
|
<input ... v-model="detail.yonghuPhone" lay-verify="required|phone" ... />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{"padding":"10px","boxShadow":"0 0 0px rgba(255,0,0,.8)","margin":"0 0 10px 0","backgroundColor":"#fff","borderRadius":"1px","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
|
|
|
|
|
<label :style='{"width":"110px","padding":"0 12px 0 0","fontSize":"15px","color":"#333","textAlign":"left"}' class="layui-form-label">
|
|
|
|
|
用户身份证号
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<!-- 身份证号输入项,带必填和身份证格式校验 -->
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{...}'>
|
|
|
|
|
<label ...>用户身份证号</label>
|
|
|
|
|
<div class="layui-input-block input">
|
|
|
|
|
<input type="text" v-model="detail.yonghuIdNumber" name="yonghuIdNumber" id="yonghuIdNumber" lay-verify="required|identity" placeholder="用户身份证号" autocomplete="off" class="layui-input">
|
|
|
|
|
<input ... v-model="detail.yonghuIdNumber" lay-verify="required|identity" ... />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{"padding":"10px","boxShadow":"0 0 0px rgba(255,0,0,.8)","margin":"0 0 10px 0","backgroundColor":"#fff","borderRadius":"1px","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
|
|
|
|
|
<label :style='{"width":"110px","padding":"0 12px 0 0","fontSize":"15px","color":"#333","textAlign":"left"}' class="layui-form-label">
|
|
|
|
|
邮箱
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<!-- 邮箱输入项,带必填和邮箱格式校验 -->
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{...}'>
|
|
|
|
|
<label ...>邮箱</label>
|
|
|
|
|
<div class="layui-input-block input">
|
|
|
|
|
<input type="text" v-model="detail.yonghuEmail" name="yonghuEmail" id="yonghuEmail" lay-verify="required|email" placeholder="邮箱" autocomplete="off" class="layui-input">
|
|
|
|
|
<input ... v-model="detail.yonghuEmail" lay-verify="required|email" ... />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{"padding":"10px","boxShadow":"0 0 0px rgba(255,0,0,.8)","margin":"0 0 10px 0","backgroundColor":"#fff","borderRadius":"1px","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
|
|
|
|
|
<label :style='{"width":"110px","padding":"0 12px 0 0","fontSize":"15px","color":"#333","textAlign":"left"}' class="layui-form-label">
|
|
|
|
|
性别
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<!-- 性别选择框,使用element-ui的select组件 -->
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{...}'>
|
|
|
|
|
<label ...>性别</label>
|
|
|
|
|
<div class="layui-input-block select">
|
|
|
|
|
<el-select v-model="detail.sexTypes" filterable placeholder="请选择性别 Search111 " style="border-color: var(--publicMainColor, #808080);" name="sexTypes" id="sexTypes">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="detail.sexTypes"
|
|
|
|
|
filterable
|
|
|
|
|
placeholder="请选择性别 Search111"
|
|
|
|
|
:style='{ "borderColor": "var(--publicMainColor)" }'
|
|
|
|
|
name="sexTypes"
|
|
|
|
|
id="sexTypes"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="(item, index) in sexTypesList"
|
|
|
|
|
v-bind:key="item.codeIndex"
|
|
|
|
|
:key="item.codeIndex"
|
|
|
|
|
:label="item.indexName"
|
|
|
|
|
:value="item.codeIndex">
|
|
|
|
|
</el-option>
|
|
|
|
|
:value="item.codeIndex"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{"padding":"10px","boxShadow":"0 0 0px rgba(255,0,0,.8)","margin":"0 0 10px 0","backgroundColor":"#fff","borderRadius":"1px","borderWidth":"0 0 1px 0","borderStyle":"solid"}'>
|
|
|
|
|
<label :style='{"width":"110px","padding":"0 12px 0 0","fontSize":"15px","color":"#333","textAlign":"left"}' class="layui-form-label">余额</label>
|
|
|
|
|
|
|
|
|
|
<!-- 余额显示项,带充值链接 -->
|
|
|
|
|
<div class="layui-form-item main_borderColor" :style='{...}'>
|
|
|
|
|
<label ...>余额</label>
|
|
|
|
|
<div class="layui-input-inline input">
|
|
|
|
|
<input type="number" v-model="detail.newMoney" name="newMoney" id="newMoney" placeholder="余额" autocomplete="off" class="layui-input" disabled="disabled">
|
|
|
|
|
<input type="number" v-model="detail.newMoney" disabled placeholder="余额" class="layui-input" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-form-mid layui-word-aux">
|
|
|
|
|
<i class="layui-icon" style="font-size: 20px;color: red;"></i>
|
|
|
|
|
<i class="layui-icon" style="color: red;"></i>
|
|
|
|
|
<a id="btn-recharge" href="javascript:void(0)">点我充值</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 表单操作按钮,更新信息和退出登录 -->
|
|
|
|
|
<div class="layui-form-item">
|
|
|
|
|
<div class="layui-input-block" style="display: flex; flex-wrap: wrap;">
|
|
|
|
|
<button class="main_backgroundColor" :style='{"padding":"0 10px","boxShadow":"0 0 0px rgba(255,0,0,.5)","margin":"10px auto 0","borderColor":"#ccc","color":"#fff","borderRadius":"8px","borderWidth":"0","width":"30%","fontSize":"15px","borderStyle":"solid","height":"44px"}' class="layui-btn btn-submit btn-theme" lay-submit lay-filter="*">更新信息</button>
|
|
|
|
|
<button :style='{"padding":"0 10px","boxShadow":"0 0 0px rgba(255,0,0,.5)","margin":"10px auto","borderColor":"#ccc","backgroundColor":"rgba(255, 0, 0, 1)","color":"rgba(255, 255, 255, 1)","borderRadius":"8px","borderWidth":"0","width":"30%","fontSize":"14px","borderStyle":"solid","height":"44px"}' @click="logout" class="layui-btn btn-submit">退出登录</button>
|
|
|
|
|
<button
|
|
|
|
|
:style='{...}'
|
|
|
|
|
class="layui-btn btn-submit btn-theme"
|
|
|
|
|
lay-submit lay-filter="*"
|
|
|
|
|
>
|
|
|
|
|
更新信息
|
|
|
|
|
</button>
|
|
|
|
|
<button
|
|
|
|
|
:style='{
|
|
|
|
|
"backgroundColor": "rgba(255, 0, 0, 1)",
|
|
|
|
|
"color": "#fff"
|
|
|
|
|
}'
|
|
|
|
|
@click="logout"
|
|
|
|
|
class="layui-btn btn-submit"
|
|
|
|
|
>
|
|
|
|
|
退出登录
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 个人中心 -->
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- layui -->
|
|
|
|
|
<script src="../../layui/layui.js"></script>
|
|
|
|
|
<!-- vue -->
|
|
|
|
|
<script src="../../js/vue.js"></script>
|
|
|
|
|
<!-- 引入element组件库 -->
|
|
|
|
|
<script src="../../xznstatic/js/element.min.js"></script>
|
|
|
|
|
<!-- 组件配置信息 -->
|
|
|
|
|
<script src="../../js/config.js"></script>
|
|
|
|
|
<!-- 扩展插件配置信息 -->
|
|
|
|
|
<script src="../../modules/config.js"></script>
|
|
|
|
|
<!-- 工具方法 -->
|
|
|
|
|
<script src="../../js/utils.js"></script>
|
|
|
|
|
<!-- 校验格式工具类 -->
|
|
|
|
|
<script src="../../js/validate.js"></script>
|
|
|
|
|
<!-- 引入第三方库脚本,顺序影响初始化逻辑 -->
|
|
|
|
|
<script src="../../layui/layui.js"></script> <!-- layui核心库 -->
|
|
|
|
|
<script src="../../js/vue.js"></script> <!-- Vue框架 -->
|
|
|
|
|
<script src="../../xznstatic/js/element.min.js"></script> <!-- element-ui组件库 -->
|
|
|
|
|
<script src="../../js/config.js"></script> <!-- 项目配置文件 -->
|
|
|
|
|
<script src="../../modules/config.js"></script> <!-- 模块配置文件 -->
|
|
|
|
|
<script src="../../js/utils.js"></script> <!-- 工具方法库 -->
|
|
|
|
|
<script src="../../js/validate.js"></script> <!-- 表单校验库 -->
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
// 初始化Vue实例,绑定页面根容器
|
|
|
|
|
var vue = new Vue({
|
|
|
|
|
el: '#app',
|
|
|
|
|
el: '#app', // 绑定DOM元素
|
|
|
|
|
data: {
|
|
|
|
|
// 轮播图
|
|
|
|
|
swiperList: [],
|
|
|
|
|
swiperList: [], // 轮播图图片数组
|
|
|
|
|
detail: {
|
|
|
|
|
// 用户详情数据对象,包含所有表单字段
|
|
|
|
|
username: '',
|
|
|
|
|
password: '',
|
|
|
|
|
yonghuName: '',
|
|
|
|
|
yonghuPhoto: '',
|
|
|
|
|
yonghuPhone: '',
|
|
|
|
|
yonghuIdNumber: '',
|
|
|
|
|
yonghuEmail: '',
|
|
|
|
|
sexTypes: '',//数字
|
|
|
|
|
sexValue: '',//数字对应的值
|
|
|
|
|
newMoney: '',
|
|
|
|
|
yonghuDelete: '',
|
|
|
|
|
createTime: '',
|
|
|
|
|
},
|
|
|
|
|
sexTypesList: [],
|
|
|
|
|
centerMenu: centerMenu
|
|
|
|
|
sexTypes: '',
|
|
|
|
|
newMoney: ''
|
|
|
|
|
},
|
|
|
|
|
updated: function() {
|
|
|
|
|
// layui.form.render(null, 'myForm');
|
|
|
|
|
sexTypesList: [], // 性别选项列表
|
|
|
|
|
centerMenu: centerMenu // 导航菜单数据(从外部引入)
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 页面跳转方法,接收URL参数
|
|
|
|
|
jump(url) {
|
|
|
|
|
jump(url)
|
|
|
|
|
window.location.href = url; // 跳转至指定URL
|
|
|
|
|
},
|
|
|
|
|
// 退出登录方法,清除本地存储并返回登录页
|
|
|
|
|
logout() {
|
|
|
|
|
// 清除所有登录相关本地存储
|
|
|
|
|
localStorage.removeItem('Token');
|
|
|
|
|
localStorage.removeItem('role');
|
|
|
|
|
localStorage.removeItem('sessionTable');
|
|
|
|
|
localStorage.removeItem('adminName');
|
|
|
|
|
localStorage.removeItem('userid');
|
|
|
|
|
localStorage.removeItem('userTable');
|
|
|
|
|
localStorage.removeItem('iframeUrl');
|
|
|
|
|
window.parent.location.href = '../login/login.html';
|
|
|
|
|
window.parent.location.href = '../login/login.html'; // 跳转登录页
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
updated() {
|
|
|
|
|
// 表单更新后重新渲染layui组件(如下拉框)
|
|
|
|
|
layui.form.render();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
layui.use(['layer', 'element', 'carousel', 'http', 'jquery', 'laydate', 'form', 'upload'], function() {
|
|
|
|
|
var layer = layui.layer;
|
|
|
|
|
var element = layui.element;
|
|
|
|
|
var carousel = layui.carousel;
|
|
|
|
|
var http = layui.http;
|
|
|
|
|
var jquery = layui.jquery;
|
|
|
|
|
var form = layui.form;
|
|
|
|
|
var upload = layui.upload;
|
|
|
|
|
// 初始化layui模块,按需加载所需组件
|
|
|
|
|
layui.use(['layer', 'http', 'form', 'upload', 'carousel'], function() {
|
|
|
|
|
var layer = layui.layer; // 弹出层组件
|
|
|
|
|
var http = layui.http; // 封装的HTTP请求工具
|
|
|
|
|
var form = layui.form; // 表单组件
|
|
|
|
|
var upload = layui.upload; // 文件上传组件
|
|
|
|
|
var carousel = layui.carousel; // 轮播图组件
|
|
|
|
|
|
|
|
|
|
// 充值
|
|
|
|
|
jquery('#btn-recharge').click(function(e) {
|
|
|
|
|
// 充值按钮点击事件,打开充值弹窗
|
|
|
|
|
$('#btn-recharge').click(function() {
|
|
|
|
|
layer.open({
|
|
|
|
|
type: 2,
|
|
|
|
|
title: '用户充值',
|
|
|
|
|
area: ['900px', '600px'],
|
|
|
|
|
content: '../recharge/recharge.html'
|
|
|
|
|
type: 2, // 弹出层类型(iframe)
|
|
|
|
|
title: '用户充值', // 弹窗标题
|
|
|
|
|
area: ['900px', '600px'], // 弹窗尺寸
|
|
|
|
|
content: '../recharge/recharge.html' // 弹窗内容页
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 获取轮播图 数据
|
|
|
|
|
http.request('config/list', 'get', {
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 5
|
|
|
|
|
}, function(res) {
|
|
|
|
|
// 获取轮播图数据并初始化轮播组件
|
|
|
|
|
http.request('config/list', 'get', { page: 1, limit: 5 }, function(res) {
|
|
|
|
|
if (res.data.list.length > 0) {
|
|
|
|
|
let swiperList = [];
|
|
|
|
|
res.data.list.forEach(element => {
|
|
|
|
|
if (element.value != null) {
|
|
|
|
|
swiperList.push({
|
|
|
|
|
img: element.value
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
vue.swiperList = swiperList;
|
|
|
|
|
// 轮播图
|
|
|
|
|
vue.swiperList = res.data.list.map(item => ({ img: item.value }));
|
|
|
|
|
// DOM更新后初始化轮播图
|
|
|
|
|
vue.$nextTick(() => {
|
|
|
|
|
carousel.render({
|
|
|
|
|
elem: '#swiper',
|
|
|
|
|
elem: '#swiper', // 绑定轮播图容器
|
|
|
|
|
width: '100%',
|
|
|
|
|
height: '450px',
|
|
|
|
|
arrow: 'hover',
|
|
|
|
|
anim: 'default',
|
|
|
|
|
autoplay: 'true',
|
|
|
|
|
interval: '3000',
|
|
|
|
|
indicator: 'inside'
|
|
|
|
|
autoplay: 'true', // 自动播放
|
|
|
|
|
interval: 3000 // 切换间隔
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询字典表相关
|
|
|
|
|
// 性别的查询和初始化
|
|
|
|
|
sexTypesSelect();
|
|
|
|
|
// 日期效验规则及格式
|
|
|
|
|
dateTimePick();
|
|
|
|
|
// 表单效验规则
|
|
|
|
|
form.verify({
|
|
|
|
|
// 正整数效验规则
|
|
|
|
|
integer: [
|
|
|
|
|
/^[1-9][0-9]*$/
|
|
|
|
|
,'必须是正整数'
|
|
|
|
|
]
|
|
|
|
|
// 小数效验规则
|
|
|
|
|
,double: [
|
|
|
|
|
/^[0-9]{0,6}(\.[0-9]{1,2})?$/
|
|
|
|
|
,'最大整数位为6为,小数最大两位'
|
|
|
|
|
]
|
|
|
|
|
// 加载性别选项数据,填充下拉框
|
|
|
|
|
function sexTypesSelect() {
|
|
|
|
|
http.request('dictionary/page', 'get', { dicCode: 'sex_types' }, function(res) {
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
vue.sexTypesList = res.data.list; // 更新Vue数据
|
|
|
|
|
form.render('select'); // 重新渲染下拉框
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 上传 文件/图片
|
|
|
|
|
// 头像的文件上传
|
|
|
|
|
var yonghuPhotoUpload = upload.render({
|
|
|
|
|
//绑定元素
|
|
|
|
|
elem: '#yonghuPhotoUpload',
|
|
|
|
|
//上传接口
|
|
|
|
|
url: http.baseurl + 'file/upload',
|
|
|
|
|
// 请求头
|
|
|
|
|
headers: {
|
|
|
|
|
Token: localStorage.getItem('Token')
|
|
|
|
|
},
|
|
|
|
|
// 允许上传时校验的文件类型
|
|
|
|
|
accept: 'images',
|
|
|
|
|
before: function() {
|
|
|
|
|
//loading层
|
|
|
|
|
var index = layer.load(1, {
|
|
|
|
|
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 上传成功
|
|
|
|
|
// 初始化头像上传组件
|
|
|
|
|
upload.render({
|
|
|
|
|
elem: '#yonghuPhotoUpload', // 绑定上传按钮
|
|
|
|
|
url: http.baseurl + 'file/upload', // 上传接口
|
|
|
|
|
headers: { Token: localStorage.getItem('Token') }, // 请求头携带Token
|
|
|
|
|
accept: 'images', // 仅允许图片上传
|
|
|
|
|
done: function(res) {
|
|
|
|
|
console.log(res);
|
|
|
|
|
layer.closeAll();
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
layer.msg("上传成功", {
|
|
|
|
|
time: 2000,
|
|
|
|
|
icon: 6
|
|
|
|
|
})
|
|
|
|
|
var url = http.baseurl + 'upload/' + res.file;
|
|
|
|
|
vue.detail.yonghuPhoto = url;
|
|
|
|
|
// 上传成功处理
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
layer.msg('上传成功', { icon: 6 });
|
|
|
|
|
vue.detail.yonghuPhoto = http.baseurl + 'upload/' + res.file; // 更新头像路径
|
|
|
|
|
} else {
|
|
|
|
|
layer.msg(res.msg, {
|
|
|
|
|
time: 2000,
|
|
|
|
|
icon: 5
|
|
|
|
|
})
|
|
|
|
|
layer.msg(res.msg, { icon: 5 });
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//请求异常回调
|
|
|
|
|
error: function() {
|
|
|
|
|
layer.closeAll();
|
|
|
|
|
layer.msg("请求接口异常", {
|
|
|
|
|
time: 2000,
|
|
|
|
|
icon: 5
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// 查询用户信息
|
|
|
|
|
let table = localStorage.getItem("userTable");
|
|
|
|
|
|
|
|
|
|
if(!table){
|
|
|
|
|
layer.msg('请先登录', {
|
|
|
|
|
time: 2000,
|
|
|
|
|
icon: 5
|
|
|
|
|
}, function() {
|
|
|
|
|
window.parent.location.href = '../login/login.html';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
http.request(`yonghu/session`, 'get', {}, function(data) {
|
|
|
|
|
// 表单赋值
|
|
|
|
|
// form.val("myForm", data.data);
|
|
|
|
|
vue.detail = data.data
|
|
|
|
|
// 图片赋值
|
|
|
|
|
//jquery("#yonghuPhotoImg").attr("src", data.data.yonghuPhoto);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 提交表单
|
|
|
|
|
// 表单提交事件处理
|
|
|
|
|
form.on('submit(*)', function(data) {
|
|
|
|
|
data = vue.detail;
|
|
|
|
|
data['createTime']=jquery("#createTime").val();
|
|
|
|
|
http.requestJson(table + '/update', 'post', data, function(res) {
|
|
|
|
|
layer.msg('修改成功', {
|
|
|
|
|
time: 2000,
|
|
|
|
|
icon: 6
|
|
|
|
|
}, function() {
|
|
|
|
|
window.location.reload();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
return false
|
|
|
|
|
// 合并用户详情数据并提交更新
|
|
|
|
|
http.requestJson('yonghu/update', 'post', { ...vue.detail }, function(res) {
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
layer.msg('修改成功', { icon: 6 }, () => window.location.reload()); // 刷新页面
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return false; // 阻止表单默认提交
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 日期框初始化
|
|
|
|
|
function dateTimePick(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//性别的查询
|
|
|
|
|
function sexTypesSelect() {
|
|
|
|
|
//填充下拉框选项
|
|
|
|
|
layui.http.request("dictionary/page?page=1&limit=100&sort=&order=&dicCode=sex_types", "GET", {}, (res) => {
|
|
|
|
|
if(res.code == 0){
|
|
|
|
|
vue.sexTypesList = res.data.list;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|