feat: 本次提交更新内容如下
这个样式很漂亮
This commit is contained in:
@@ -1,70 +1,260 @@
|
||||
.home-page {
|
||||
padding: 12px;
|
||||
background: #f5f5f5;
|
||||
background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.home-cards {
|
||||
// 导航栏样式
|
||||
.nav-title {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
> :global(.adm-card) {
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.nav-text {
|
||||
color: var(--primary-color);
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
text-shadow: 0 2px 4px rgba(24, 142, 238, 0.2);
|
||||
}
|
||||
|
||||
// 统计卡片网格
|
||||
.stats-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 8px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 12px 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.home-section {
|
||||
margin-bottom: 12px;
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.03);
|
||||
}
|
||||
|
||||
.home-section-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.home-scene-stats {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 0 8px 8px 8px;
|
||||
}
|
||||
.home-scene-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.home-scene-icon {
|
||||
margin: 0 auto 4px auto;
|
||||
}
|
||||
.home-scene-value {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #1677ff;
|
||||
}
|
||||
.home-scene-label {
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.home-today-item {
|
||||
text-align: center;
|
||||
padding: 8px 0;
|
||||
background: #f7f8fa;
|
||||
.stat-icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.home-today-value {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #1677ff;
|
||||
}
|
||||
.home-today-label {
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
background: rgba(24, 142, 238, 0.1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.home-chart {
|
||||
margin-top: 8px;
|
||||
.stat-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: var(--primary-color);
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 11px;
|
||||
color: #666;
|
||||
margin-top: 2px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
// 通用区域样式
|
||||
.section {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 16px;
|
||||
margin-bottom: 12px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
position: relative;
|
||||
padding-left: 8px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 3px;
|
||||
height: 14px;
|
||||
background: var(--primary-gradient);
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
// 场景统计网格
|
||||
.scene-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.scene-item {
|
||||
text-align: center;
|
||||
padding: 8px 4px;
|
||||
}
|
||||
|
||||
.scene-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 auto 6px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.scene-value {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
margin-bottom: 2px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.scene-label {
|
||||
font-size: 10px;
|
||||
color: #666;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
// 今日数据网格
|
||||
.today-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.today-item {
|
||||
text-align: center;
|
||||
padding: 8px 4px;
|
||||
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.today-icon {
|
||||
margin-bottom: 4px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.today-value {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 2px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.today-label {
|
||||
font-size: 10px;
|
||||
color: #666;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
// 图表容器
|
||||
.chart-container {
|
||||
width: 100%;
|
||||
min-height: 100px;
|
||||
min-height: 160px;
|
||||
border-radius: 8px;
|
||||
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
// 响应式设计
|
||||
@media (max-width: 375px) {
|
||||
.home-page {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.stats-grid {
|
||||
gap: 6px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
padding: 10px 6px;
|
||||
}
|
||||
|
||||
.stat-icon {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.section {
|
||||
padding: 12px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.scene-grid,
|
||||
.today-grid {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.scene-icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.scene-value {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.scene-label {
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
.today-value {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.today-label {
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
.chart-container {
|
||||
min-height: 140px;
|
||||
padding: 8px;
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,12 @@ import { Card, NavBar, TabBar, Grid } from "antd-mobile";
|
||||
import {
|
||||
AppOutline,
|
||||
UserOutline,
|
||||
PieOutline, // 替换 BarChartOutline
|
||||
PieOutline,
|
||||
ShopbagOutline,
|
||||
FileOutline,
|
||||
StarOutline,
|
||||
StopOutline,
|
||||
TeamOutline,
|
||||
} from "antd-mobile-icons";
|
||||
import MeauMobile from "@/components/MeauMobile/MeauMoible";
|
||||
import Layout from "@/components/Layout/Layout";
|
||||
@@ -14,32 +18,56 @@ import { getPlanStats } from "./api";
|
||||
|
||||
const sceneStats = [
|
||||
{
|
||||
label: "公众号获客",
|
||||
label: "公众号",
|
||||
value: 234,
|
||||
icon: <ShopbagOutline style={{ fontSize: 28, color: "#4caf50" }} />,
|
||||
icon: <ShopbagOutline style={{ fontSize: 20, color: "white" }} />,
|
||||
gradient: "linear-gradient(135deg, #4caf50 0%, #45a049 100%)",
|
||||
},
|
||||
{
|
||||
label: "海报获客",
|
||||
label: "海报",
|
||||
value: 167,
|
||||
icon: <AppOutline style={{ fontSize: 28, color: "#ff9800" }} />,
|
||||
icon: <AppOutline style={{ fontSize: 20, color: "white" }} />,
|
||||
gradient: "linear-gradient(135deg, #ff9800 0%, #f57c00 100%)",
|
||||
},
|
||||
{
|
||||
label: "抖音获客",
|
||||
label: "抖音",
|
||||
value: 156,
|
||||
icon: <PieOutline style={{ fontSize: 28, color: "#2196f3" }} />,
|
||||
icon: <PieOutline style={{ fontSize: 20, color: "white" }} />,
|
||||
gradient: "linear-gradient(135deg, #2196f3 0%, #1976d2 100%)",
|
||||
},
|
||||
{
|
||||
label: "小红书获客",
|
||||
label: "小红书",
|
||||
value: 89,
|
||||
icon: <UserOutline style={{ fontSize: 28, color: "#e91e63" }} />,
|
||||
icon: <UserOutline style={{ fontSize: 20, color: "white" }} />,
|
||||
gradient: "linear-gradient(135deg, #e91e63 0%, #c2185b 100%)",
|
||||
},
|
||||
];
|
||||
|
||||
const todayStats = [
|
||||
{ label: "朋友圈同步", value: 12 },
|
||||
{ label: "群发任务", value: 8 },
|
||||
{ label: "获客转化", value: "85%" },
|
||||
{ label: "系统活跃度", value: "98%" },
|
||||
{
|
||||
label: "朋友圈",
|
||||
value: 12,
|
||||
icon: <FileOutline style={{ fontSize: 16, color: "#ff6b35" }} />,
|
||||
color: "#ff6b35",
|
||||
},
|
||||
{
|
||||
label: "群发",
|
||||
value: 8,
|
||||
icon: <StarOutline style={{ fontSize: 16, color: "#ffd700" }} />,
|
||||
color: "#ffd700",
|
||||
},
|
||||
{
|
||||
label: "转化率",
|
||||
value: "85%",
|
||||
icon: <StopOutline style={{ fontSize: 16, color: "#4caf50" }} />,
|
||||
color: "#4caf50",
|
||||
},
|
||||
{
|
||||
label: "活跃度",
|
||||
value: "98%",
|
||||
icon: <TeamOutline style={{ fontSize: 16, color: "#2196f3" }} />,
|
||||
color: "#2196f3",
|
||||
},
|
||||
];
|
||||
|
||||
const Home: React.FC = () => {
|
||||
@@ -52,68 +80,106 @@ const Home: React.FC = () => {
|
||||
return (
|
||||
<Layout
|
||||
header={
|
||||
<NavBar back={null} style={{ background: "#fff" }}>
|
||||
<span style={{ color: "#1677ff", fontWeight: 700 }}>存客宝</span>
|
||||
<NavBar back={null} style={{ background: "transparent" }}>
|
||||
<div className={style["nav-title"]}>
|
||||
<span className={style["nav-text"]}>存客宝</span>
|
||||
</div>
|
||||
</NavBar>
|
||||
}
|
||||
footer={<MeauMobile />}
|
||||
>
|
||||
<div className={style["home-page"]}>
|
||||
{/* 统计卡片 */}
|
||||
<div className={style["home-cards"]}>
|
||||
<Card className={style["home-card"]}>
|
||||
<div className={style["home-card-title"]}>设备数量</div>
|
||||
<div className={style["home-card-value"]}>0</div>
|
||||
</Card>
|
||||
<Card className={style["home-card"]}>
|
||||
<div className={style["home-card-title"]}>微信号数量</div>
|
||||
<div className={style["home-card-value"]}>0</div>
|
||||
</Card>
|
||||
<Card className={style["home-card"]}>
|
||||
<div className={style["home-card-title"]}>在线微信号</div>
|
||||
<div className={style["home-card-value"]}>0</div>
|
||||
</Card>
|
||||
{/* 顶部统计卡片 */}
|
||||
<div className={style["stats-grid"]}>
|
||||
<div className={style["stat-card"]}>
|
||||
<div className={style["stat-icon"]}>
|
||||
<AppOutline
|
||||
style={{ fontSize: 18, color: "var(--primary-color)" }}
|
||||
/>
|
||||
</div>
|
||||
<div className={style["stat-content"]}>
|
||||
<div className={style["stat-value"]}>0</div>
|
||||
<div className={style["stat-label"]}>设备数量</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={style["stat-card"]}>
|
||||
<div className={style["stat-icon"]}>
|
||||
<UserOutline
|
||||
style={{ fontSize: 18, color: "var(--primary-color)" }}
|
||||
/>
|
||||
</div>
|
||||
<div className={style["stat-content"]}>
|
||||
<div className={style["stat-value"]}>0</div>
|
||||
<div className={style["stat-label"]}>微信号</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={style["stat-card"]}>
|
||||
<div className={style["stat-icon"]}>
|
||||
<TeamOutline
|
||||
style={{ fontSize: 18, color: "var(--primary-color)" }}
|
||||
/>
|
||||
</div>
|
||||
<div className={style["stat-content"]}>
|
||||
<div className={style["stat-value"]}>0</div>
|
||||
<div className={style["stat-label"]}>在线</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 场景获客统计 */}
|
||||
<Card className={style["home-section"]}>
|
||||
<div className={style["home-section-title"]}>场景获客统计</div>
|
||||
<div className={style["home-scene-stats"]}>
|
||||
<div className={style["section"]}>
|
||||
<div className={style["section-header"]}>
|
||||
<span className={style["section-title"]}>获客统计</span>
|
||||
</div>
|
||||
<div className={style["scene-grid"]}>
|
||||
{sceneStats.map((item) => (
|
||||
<div key={item.label} className={style["home-scene-item"]}>
|
||||
<div className={style["home-scene-icon"]}>{item.icon}</div>
|
||||
<div className={style["home-scene-value"]}>{item.value}</div>
|
||||
<div className={style["home-scene-label"]}>{item.label}</div>
|
||||
<div key={item.label} className={style["scene-item"]}>
|
||||
<div
|
||||
className={style["scene-icon"]}
|
||||
style={{ background: item.gradient }}
|
||||
>
|
||||
{item.icon}
|
||||
</div>
|
||||
<div className={style["scene-value"]}>{item.value}</div>
|
||||
<div className={style["scene-label"]}>{item.label}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
{/* 今日数据 */}
|
||||
<Card className={style["home-section"]}>
|
||||
<div className={style["home-section-title"]}>今日数据</div>
|
||||
<Grid columns={2} gap={12}>
|
||||
<div className={style["section"]}>
|
||||
<div className={style["section-header"]}>
|
||||
<span className={style["section-title"]}>今日数据</span>
|
||||
</div>
|
||||
<div className={style["today-grid"]}>
|
||||
{todayStats.map((item) => (
|
||||
<Grid.Item key={item.label}>
|
||||
<div className={style["home-today-item"]}>
|
||||
<div className={style["home-today-value"]}>{item.value}</div>
|
||||
<div className={style["home-today-label"]}>{item.label}</div>
|
||||
<div key={item.label} className={style["today-item"]}>
|
||||
<div className={style["today-icon"]}>{item.icon}</div>
|
||||
<div
|
||||
className={style["today-value"]}
|
||||
style={{ color: item.color }}
|
||||
>
|
||||
{item.value}
|
||||
</div>
|
||||
</Grid.Item>
|
||||
<div className={style["today-label"]}>{item.label}</div>
|
||||
</div>
|
||||
))}
|
||||
</Grid>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 每日获客趋势(静态图表占位) */}
|
||||
<Card className={style["home-section"]}>
|
||||
<div className={style["home-section-title"]}>每日获客趋势</div>
|
||||
<div className={style["home-chart"]}>
|
||||
{/* 趋势图表 */}
|
||||
<div className={style["section"]}>
|
||||
<div className={style["section-header"]}>
|
||||
<span className={style["section-title"]}>获客趋势</span>
|
||||
</div>
|
||||
<div className={style["chart-container"]}>
|
||||
<LineChart
|
||||
xData={["周一", "周二", "周三", "周四", "周五", "周六", "周日"]}
|
||||
yData={[120, 150, 180, 200, 230, 210, 190]}
|
||||
/>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user