Commit 87ac4430 by liimin

feat(UI): 优化用户头像和切换按钮的交互效果

- 将用户信息显示字段从name改为userName
- 增强用户头像的视觉效果,添加光晕和动画效果
- 重构切换接待类型按钮为圆形悬浮设计,增加呼吸动画和流光效果
1 parent 45cb1311
......@@ -4,7 +4,7 @@
<view class="user-info flex">
<view :class="['user-avatar', 'sprite-icon', 'icon-avatar', tabIndex == 99 ? 'user-active' : '']"></view>
<view class="user-name">
<view class="user-name-text">{{ userInfo.name }}</view>
<view class="user-name-text">{{ userInfo.userName }}</view>
</view>
</view>
</view>
......@@ -222,7 +222,7 @@ export default {
color: #3773f8;
.icon-box {
animation: arc-move 0.15s forwards;
animation: arc-move 0.05s forwards;
}
}
......@@ -268,11 +268,38 @@ export default {
.user-avatar {
width: toRpx(100);
height: toRpx(100);
border: toRpx(2) solid #ffffff;
box-shadow: 0 toRpx(4) toRpx(8) 0 #0000001a;
border: toRpx(4) solid rgba(255, 255, 255, 0.9);
box-shadow: 0 toRpx(8) toRpx(24) rgba(0, 0, 0, 0.15),
inset 0 0 toRpx(12) rgba(255, 255, 255, 0.5);
border-radius: 100%;
position: relative;
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
/* 增加一个外层光晕容器,通过伪元素实现 */
&::before {
content: '';
position: absolute;
top: toRpx(-8);
left: toRpx(-8);
right: toRpx(-8);
bottom: toRpx(-8);
border-radius: 50%;
background: linear-gradient(135deg, rgba(55, 115, 248, 0.2) 0%, rgba(138, 110, 245, 0.2) 100%);
z-index: -1;
transform: scale(0.8);
opacity: 0;
transition: all 0.3s ease;
}
&.user-active {
border: toRpx(2) solid rgb(55, 115, 248);
border-color: #3773f8;
box-shadow: 0 0 0 toRpx(4) rgba(55, 115, 248, 0.2),
0 toRpx(8) toRpx(20) rgba(55, 115, 248, 0.4);
&::before {
transform: scale(1);
opacity: 1;
}
}
}
......
......@@ -13,7 +13,10 @@
<view class="content-left">
<view class="module-box box-class">
<view class="common-title"> {{ currentType.typeName }}产品介绍
<view class="select-type" @click="changeType">切换接待类型</view>
<view class="select-type" @click="changeType">
<text class="text">切换接待类型</text>
<view class="icon-arrow"></view>
</view>
</view>
<view class="content-box">
<template>
......@@ -399,13 +402,81 @@ export default {
margin-bottom: toRpx(48);
}
.select-type {
padding: toRpx(20) toRpx(40);
font-size: toRpx(32);
color: #fff;
background-color: #6187e7;
border-radius: toRpx(20);
margin-left: auto;
margin-right: toRpx(48);
position: absolute; /* 改为绝对定位,悬浮 */
right: toRpx(48);
top: 68%; /* 向下调整,避免顶部遮挡 */
transform: translateY(-50%);
width: toRpx(128); /* 加大尺寸 */
height: toRpx(128);
border-radius: 50%;
background: linear-gradient(135deg, #6187e7 0%, #8a6ef5 100%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-shadow: 0 toRpx(8) toRpx(20) rgba(97, 135, 231, 0.5);
z-index: 10;
animation: breathe 3s infinite ease-in-out; /* 呼吸效果 */
.text {
font-size: toRpx(22);
color: #fff;
font-weight: 600;
line-height: 1.2;
text-align: center;
width: toRpx(80);
text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.icon-arrow {
display: none; /* 圆形按钮不需要箭头 */
}
/* 流光圆环 */
&::before {
content: '';
position: absolute;
top: toRpx(-8);
left: toRpx(-8);
right: toRpx(-8);
bottom: toRpx(-8);
border-radius: 50%;
border: toRpx(4) solid transparent;
border-top-color: #ffffff;
border-right-color: rgba(255, 255, 255, 0.6);
border-bottom-color: rgba(138, 110, 245, 0.4);
/* 光影辉光效果 */
box-shadow: 0 0 toRpx(16) rgba(97, 135, 231, 0.6), inset 0 0 toRpx(10) rgba(255, 255, 255, 0.2);
filter: drop-shadow(0 0 toRpx(6) rgba(255, 255, 255, 0.8));
animation: rotate-ring 4s linear infinite;
}
/* 内部高光 */
&::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 50%;
background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5) 0%, transparent 60%);
}
&:active {
transform: translateY(-50%) scale(0.9);
box-shadow: 0 toRpx(4) toRpx(10) rgba(97, 135, 231, 0.5);
}
}
@keyframes breathe {
0%, 100% { transform: translateY(-50%) scale(1); box-shadow: 0 toRpx(8) toRpx(20) rgba(97, 135, 231, 0.5); }
50% { transform: translateY(-50%) scale(1.05); box-shadow: 0 toRpx(12) toRpx(30) rgba(97, 135, 231, 0.7); }
}
@keyframes rotate-ring {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.tool-box {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!