refactor(customer): 优化客户数据查询和表单字段校验
- 移除新增客户页面对手机号的必填和格式校验 - 修改手机号字段标签为“手机号/微信号”,取消必填和长度限制 - 新增判断当前用户是否为超级管理员逻辑 - 抽取并统一构建客户查询参数方法,根据权限动态设置筛选条件 - 优化客户列表数据获取逻辑,支持超级管理员查看全部客户 - 调整依赖项,更新使用了新构建的查询参数函数 - 增强状态统计接口参数构建,统一调用参数生成函数 - 优化副作用 Hook 依赖,保证数据加载时机正确
This commit is contained in:
@@ -174,7 +174,7 @@ function UserCard() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
<View className={'user-info flex flex-col px-3'}>
|
<View className={'user-info flex flex-col px-3'}>
|
||||||
<View className={'user-card__name py-1 font-bold max-w-28'}>{getDisplayName()}</View>
|
<View className={'user-card__name py-1 font-bold'}>{getDisplayName()}</View>
|
||||||
{isLoggedIn ? (
|
{isLoggedIn ? (
|
||||||
<View className={'grade text-xs py-0'}>
|
<View className={'grade text-xs py-0'}>
|
||||||
<Tag type="success">{getRoleName()}</Tag>
|
<Tag type="success">{getRoleName()}</Tag>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: '我的',
|
navigationBarTitleText: '我的'
|
||||||
navigationBarBackgroundColor: '#e9fff2'
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,19 +7,20 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding-top: 12px;
|
padding-top: 12px;
|
||||||
background:
|
background: transparent;
|
||||||
linear-gradient(90deg, rgba(34, 197, 94, 0.14) 0%, rgba(56, 189, 248, 0.12) 52%, rgba(245, 158, 11, 0.08) 100%),
|
|
||||||
linear-gradient(135deg, #e8f8ef 0%, #eef7ff 58%, #f9fafb 100%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-bg::before {
|
/* 右上角光晕点缀 */
|
||||||
|
.header-bg::after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: -40px;
|
||||||
left: 0;
|
right: -40px;
|
||||||
right: 0;
|
width: 180px;
|
||||||
height: 4px;
|
height: 180px;
|
||||||
background: linear-gradient(90deg, #22c55e 0%, #38bdf8 55%, #f59e0b 100%);
|
border-radius: 50%;
|
||||||
|
background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(96, 165, 250, 0.1) 55%, transparent 75%);
|
||||||
|
z-index: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-card-wrap {
|
.user-card-wrap {
|
||||||
@@ -29,10 +30,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.user-card {
|
.user-card {
|
||||||
border: 1px solid rgba(148, 163, 184, 0.18);
|
border: 1px solid rgba(255, 255, 255, 0.22);
|
||||||
border-radius: 18px !important;
|
border-radius: 18px !important;
|
||||||
background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 252, 255, 0.94) 100%);
|
background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 252, 255, 0.94) 100%);
|
||||||
box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
|
box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-card-header {
|
.user-card-header {
|
||||||
@@ -46,9 +47,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.user-card__name {
|
.user-card__name {
|
||||||
max-width: 150px;
|
max-width: 300px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
color: #0f172a;
|
color: #ffffff;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,27 @@ function User() {
|
|||||||
if (isAdmin()) {
|
if (isAdmin()) {
|
||||||
return <>
|
return <>
|
||||||
<div className={'user-page w-full'}>
|
<div className={'user-page w-full'}>
|
||||||
|
{/* 装饰性背景 - 深蓝色渐变 + 圆点装饰 */}
|
||||||
|
<div className={'h-64 w-full fixed top-0 z-0'}
|
||||||
|
style={{
|
||||||
|
background: 'linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e40af 100%)'
|
||||||
|
}}>
|
||||||
|
<div className="absolute w-32 h-32 rounded-full" style={{
|
||||||
|
backgroundColor: 'rgba(255, 255, 255, 0.1)',
|
||||||
|
top: '-16px',
|
||||||
|
right: '-16px'
|
||||||
|
}}></div>
|
||||||
|
<div className="absolute w-24 h-24 rounded-full" style={{
|
||||||
|
backgroundColor: 'rgba(255, 255, 255, 0.08)',
|
||||||
|
bottom: '-12px',
|
||||||
|
left: '-12px'
|
||||||
|
}}></div>
|
||||||
|
<div className="absolute w-16 h-16 rounded-full" style={{
|
||||||
|
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
||||||
|
top: '60px',
|
||||||
|
left: '120px'
|
||||||
|
}}></div>
|
||||||
|
</div>
|
||||||
<UserCard/>
|
<UserCard/>
|
||||||
{/*<UserOrder/>*/}
|
{/*<UserOrder/>*/}
|
||||||
<UserCell/>
|
<UserCell/>
|
||||||
@@ -62,6 +83,27 @@ function User() {
|
|||||||
{/* <span>我的</span>*/}
|
{/* <span>我的</span>*/}
|
||||||
{/*</NavBar>*/}
|
{/*</NavBar>*/}
|
||||||
<div className={'user-page w-full'}>
|
<div className={'user-page w-full'}>
|
||||||
|
{/* 装饰性背景 - 深蓝色渐变 + 圆点装饰 */}
|
||||||
|
<div className={'h-40 w-full fixed top-0 z-0'}
|
||||||
|
style={{
|
||||||
|
background: 'linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e40af 100%)'
|
||||||
|
}}>
|
||||||
|
<div className="absolute w-32 h-32 rounded-full" style={{
|
||||||
|
backgroundColor: 'rgba(255, 255, 255, 0.1)',
|
||||||
|
top: '-16px',
|
||||||
|
right: '-16px'
|
||||||
|
}}></div>
|
||||||
|
<div className="absolute w-24 h-24 rounded-full" style={{
|
||||||
|
backgroundColor: 'rgba(255, 255, 255, 0.08)',
|
||||||
|
bottom: '-12px',
|
||||||
|
left: '-12px'
|
||||||
|
}}></div>
|
||||||
|
<div className="absolute w-16 h-16 rounded-full" style={{
|
||||||
|
backgroundColor: 'rgba(255, 255, 255, 0.05)',
|
||||||
|
top: '60px',
|
||||||
|
left: '120px'
|
||||||
|
}}></div>
|
||||||
|
</div>
|
||||||
<UserCard/>
|
<UserCard/>
|
||||||
{/*<UserOrder/>*/}
|
{/*<UserOrder/>*/}
|
||||||
<UserCell/>
|
<UserCell/>
|
||||||
|
|||||||
Reference in New Issue
Block a user