From d96a0425f79120967440f8ba04ed61429ee36379 Mon Sep 17 00:00:00 2001 From: zhangjiming Date: Thu, 20 Mar 2025 18:30:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=93=9D=E7=89=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 2 +- src/assets/icon_arr_down.svg | 1 + src/assets/icon_bluetooth.svg | 1 + src/components/CustomNavBar.scss | 21 +++++++++++++++++++++ src/components/CustomNavBar.tsx | 34 ++++++++++++++++++++++++++++++++++ src/pages/Measure.tsx | 25 ++++++++++++++++++------- 6 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 src/assets/icon_arr_down.svg create mode 100644 src/assets/icon_bluetooth.svg create mode 100644 src/components/CustomNavBar.scss create mode 100644 src/components/CustomNavBar.tsx diff --git a/src/App.tsx b/src/App.tsx index 9143dbd..e8c02d7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -68,7 +68,7 @@ function App() {
-
+
diff --git a/src/assets/icon_arr_down.svg b/src/assets/icon_arr_down.svg new file mode 100644 index 0000000..5f89df1 --- /dev/null +++ b/src/assets/icon_arr_down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icon_bluetooth.svg b/src/assets/icon_bluetooth.svg new file mode 100644 index 0000000..a8b6c42 --- /dev/null +++ b/src/assets/icon_bluetooth.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/CustomNavBar.scss b/src/components/CustomNavBar.scss new file mode 100644 index 0000000..c0aed03 --- /dev/null +++ b/src/components/CustomNavBar.scss @@ -0,0 +1,21 @@ +.bluetooth-battery { + position: relative; + font-size: 12px; + height: 16px; + padding-left: 2px; + padding-right: 2px; + color: var(--primaryColor); + border: solid 1px var(--primaryColor); + border-radius: 2px; + &::after { + content: " "; + position: absolute; + width: 4px; + height: 8px; + background-color: var(--primaryColor); + right: -4px; + top: 3px; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + } +} \ No newline at end of file diff --git a/src/components/CustomNavBar.tsx b/src/components/CustomNavBar.tsx new file mode 100644 index 0000000..6d3391b --- /dev/null +++ b/src/components/CustomNavBar.tsx @@ -0,0 +1,34 @@ +import icon_bluetooth from '../assets/icon_bluetooth.svg'; +import icon_arr_d from '../assets/icon_arr_down.svg'; +import './CustomNavBar.scss'; +import { useState } from 'react'; + +export default function CustomNavBar({ title }: { title: string }) { + const [showDetail, setShowDetail] = useState(false); + + return ( +
+ {/** 温度,水平仪 */} +
+ 温度: 31.2°C + X轴倾斜: -0.496 + Y轴倾斜: 3.005 +
+ {/** 导航栏 */} +
+

{title}

+
setShowDetail(!showDetail)}> +
78%
+ icon + 设备已连接 + arr +
+
+
+ ); +} diff --git a/src/pages/Measure.tsx b/src/pages/Measure.tsx index bbd562b..2a16dfe 100644 --- a/src/pages/Measure.tsx +++ b/src/pages/Measure.tsx @@ -1,13 +1,20 @@ import { NavBar } from 'antd-mobile'; import StepItem from '../components/StepItem'; -import { Link } from 'react-router-dom'; +import { Link, useNavigate } from 'react-router-dom'; +import CustomNavBar from '../components/CustomNavBar'; export default function Measure() { + const navigate = useNavigate(); + + const onSaveClick = () => { + navigate('/measure/save'); + }; return ( -
- - 测量 - +
+
+ +
+
@@ -15,12 +22,16 @@ export default function Measure() {

北京铁路局 /客运段/京沪线/左侧

- 修改 + + 修改 +
开始测量
-
保存
+
+ 保存 +