Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
6ed1201b
Commit
6ed1201b
authored
Jul 27, 2025
by
王炽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口对接
parent
30cf6679
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
44 deletions
+117
-44
shengzhangTestResult.vue
pages/shengzhangTestResult/shengzhangTestResult.vue
+102
-31
shengzhangTools.vue
pages/shengzhangTools/shengzhangTools.vue
+2
-13
.DS_Store
static/.DS_Store
+0
-0
index.js
utils/index.js
+13
-0
No files found.
pages/shengzhangTestResult/shengzhangTestResult.vue
View file @
6ed1201b
...
...
@@ -35,41 +35,41 @@
<view
class=
"baby-info-card"
>
<view
class=
"card-header"
>
<image
class=
"name-icon"
src=
"/static/shengzhangTestResult/nameIcon.png"
mode=
"aspectFit"
></image>
<text
class=
"card-title"
>
宝宝名称
</text>
<text
class=
"card-title"
>
{{
babyInfo
.
babyName
}}
</text>
</view>
<view
class=
"baby-basic-info"
>
<text
class=
"gender"
>
男
</text>
<text
class=
"age"
>
2月21天
</text>
<text
class=
"test-date"
>
测评于
2025年06月06日
</text>
<text
class=
"gender"
>
{{
babyInfo
.
gender
==
'M'
?
'男'
:
'女'
}}
</text>
<text
class=
"age"
>
{{
babyInfo
.
monthAge
}}
月
</text>
<text
class=
"test-date"
>
测评于
{{
babyInfo
.
assessmentDate
}}
</text>
</view>
<view
class=
"measurement-summary"
>
<view
class=
"values-row"
>
<text
class=
"measurement-value"
>
60.6
cm
</text>
<text
class=
"measurement-value"
>
5.8
kg
</text>
<text
class=
"measurement-value"
>
39.0
cm
</text>
<text
class=
"measurement-value"
>
16.0
</text>
<text
class=
"measurement-value"
>
{{
assessmentData
.
height
}}
cm
</text>
<text
class=
"measurement-value"
>
{{
assessmentData
.
weight
}}
kg
</text>
<text
class=
"measurement-value"
>
{{
assessmentData
.
headCircumference
}}
cm
</text>
<text
class=
"measurement-value"
>
{{
assessmentData
.
bmi
}}
</text>
</view>
<view
class=
"labels-row"
>
<view
class=
"measurement-item"
>
<text
class=
"measurement-label"
>
身高
</text>
<text
class=
"measurement-status normal"
>
正常
</text>
<text
class=
"measurement-status normal"
>
{{
statusMap
[
analysisData
.
heightStatus
]
}}
</text>
</view>
<view
class=
"measurement-item"
>
<text
class=
"measurement-label"
>
体重
</text>
<text
class=
"measurement-status normal"
>
正常
</text>
<text
class=
"measurement-status normal"
>
{{
statusMap
[
analysisData
.
weightStatus
]
}}
</text>
</view>
<view
class=
"measurement-item"
>
<text
class=
"measurement-label"
>
头围
</text>
<text
class=
"measurement-status normal"
>
正常
</text>
<text
class=
"measurement-status normal"
>
{{
statusMap
[
analysisData
.
headStatus
]
}}
</text>
</view>
<view
class=
"measurement-item"
>
<text
class=
"measurement-label"
>
BMI
</text>
<text
class=
"measurement-status normal"
>
正常
</text>
<text
class=
"measurement-status normal"
>
{{
statusMap
[
analysisData
.
bmiStatus
]
}}
</text>
</view>
</view>
</view>
<view
class=
"growth-evaluation"
>
<text
class=
"evaluation-text"
>
宝宝发育的非常棒,身高、体重和头围都处于正常的发育水平。TA与大多数宝宝一样,正在健康苗壮地成长。建议定期观察和记录宝宝的体格发育数据,这样有利于评估宝宝的生长发育情况,能够及时发现宝宝生长发育过程中的存在的问题和异常。
</text>
<text
class=
"evaluation-text"
>
{{
contentText
.
evaluation
}}
</text>
</view>
</view>
...
...
@@ -102,48 +102,48 @@
</view>
</view>
<view
class=
"measurement-bars"
>
<view
class=
"bar-item"
>
<view
class=
"value-triangle-container"
>
<text
class=
"bar-value"
>
60.6cm 正常
</text>
<view
class=
"bar-item"
>
<view
class=
"value-triangle-container"
:style=
"
{marginLeft: statusBarPercentileMap[analysisData.heightStatus] + 'rpx'}"
>
<text
class=
"bar-value"
>
{{
assessmentData
.
height
}}
cm
{{
statusMap
[
analysisData
.
heightStatus
]
}}
</text>
<image
class=
"triangle"
src=
"/static/shengzhangTestResult/triangle.png"
mode=
"aspectFit"
></image>
</view>
<view
class=
"bar-row"
>
<text
class=
"measurement-label"
>
身高
</text>
<image
class=
"value-bar"
src=
"/static/shengzhangTestResult/valueBar.png"
mode=
"aspectFit"
></image>
<text
class=
"bar-percentage"
>
超过
25
%同龄宝宝
</text>
<text
class=
"bar-percentage"
>
超过
{{
analysisData
.
heightPercentile
}}
%同龄宝宝
</text>
</view>
</view>
<view
class=
"bar-item"
>
<view
class=
"value-triangle-container"
>
<text
class=
"bar-value"
>
5.75kg 正常
</text>
<view
class=
"value-triangle-container"
:style=
"
{marginLeft: statusBarPercentileMap[analysisData.weightStatus] + 'rpx'}"
>
<text
class=
"bar-value"
>
{{
assessmentData
.
weight
}}
kg
{{
statusMap
[
analysisData
.
weightStatus
]
}}
</text>
<image
class=
"triangle"
src=
"/static/shengzhangTestResult/triangle.png"
mode=
"aspectFit"
></image>
</view>
<view
class=
"bar-row"
>
<text
class=
"measurement-label"
>
体重
</text>
<image
class=
"value-bar"
src=
"/static/shengzhangTestResult/valueBar.png"
mode=
"aspectFit"
></image>
<text
class=
"bar-percentage"
>
超过
25
%同龄宝宝
</text>
<text
class=
"bar-percentage"
>
超过
{{
analysisData
.
weightPercentile
}}
%同龄宝宝
</text>
</view>
</view>
<view
class=
"bar-item"
>
<view
class=
"value-triangle-container"
>
<text
class=
"bar-value"
>
39.0cm 正常
</text>
<view
class=
"value-triangle-container"
:style=
"
{marginLeft: statusBarPercentileMap[analysisData.headStatus] + 'rpx'}"
>
<text
class=
"bar-value"
>
{{
assessmentData
.
headCircumference
}}
cm
{{
statusMap
[
analysisData
.
headStatus
]
}}
</text>
<image
class=
"triangle"
src=
"/static/shengzhangTestResult/triangle.png"
mode=
"aspectFit"
></image>
</view>
<view
class=
"bar-row"
>
<text
class=
"measurement-label"
>
头围
</text>
<image
class=
"value-bar"
src=
"/static/shengzhangTestResult/valueBar.png"
mode=
"aspectFit"
></image>
<text
class=
"bar-percentage"
>
超过
25
%同龄宝宝
</text>
<text
class=
"bar-percentage"
>
超过
{{
analysisData
.
headPercentile
}}
%同龄宝宝
</text>
</view>
</view>
<view
class=
"bar-item"
>
<view
class=
"value-triangle-container"
>
<text
class=
"bar-value"
>
15.0 正常
</text>
<view
class=
"value-triangle-container"
:style=
"
{marginLeft: statusBarPercentileMap[analysisData.bmiStatus] + 'rpx'}"
>
<text
class=
"bar-value"
>
{{
assessmentData
.
bmi
}}
{{
statusMap
[
analysisData
.
bmiStatus
]
}}
</text>
<image
class=
"triangle"
src=
"/static/shengzhangTestResult/triangle.png"
mode=
"aspectFit"
></image>
</view>
<view
class=
"bar-row"
>
<text
class=
"measurement-label"
>
BMI
</text>
<image
class=
"value-bar"
src=
"/static/shengzhangTestResult/valueBar.png"
mode=
"aspectFit"
></image>
<text
class=
"bar-percentage"
>
超过
25
%同龄宝宝
</text>
<text
class=
"bar-percentage"
>
超过
{{
analysisData
.
bmiPercentile
}}
%同龄宝宝
</text>
</view>
</view>
</view>
...
...
@@ -201,10 +201,7 @@
<view
class=
"curve-tips"
@
click=
"showCurveTips"
>
<image
class=
"tips-icon"
src=
"/static/shengzhangTestResult/shengzhangTips.png"
mode=
"aspectFit"
></image>
</view>
<!-- 专家咨询按钮 -->
<view
class=
"expert-consult-btn"
@
click=
"consultExpert"
>
<image
class=
"consult-bg"
src=
"/static/shengzhangTestResult/zhuanjiazixunBtn.png"
mode=
"aspectFit"
></image>
</view>
</view>
</view>
...
...
@@ -255,11 +252,18 @@
</view>
</view>
</view>
<!-- 专家咨询按钮 -->
<view
class=
"expert-consult-btn"
@
click=
"consultExpert"
>
<image
class=
"consult-bg"
src=
"/static/shengzhangTestResult/zhuanjiazixunBtn.png"
mode=
"aspectFit"
></image>
</view>
</view>
</
template
>
<
script
setup
>
import
{
ref
,
onMounted
}
from
'vue'
import
{
useShengzhangStore
}
from
'../../stores/shengzhangResult.js'
;
import
{
formatDate
}
from
'../../utils/index.js'
;
// 导航标签状态
const
activeTab
=
ref
(
'latest'
)
// 默认显示最新内容
...
...
@@ -270,6 +274,47 @@ const activeCurveTab = ref('height')
// 滑动相关状态
const
scrollLeft
=
ref
(
0
)
const
totalWidth
=
ref
(
1080
)
// 36个月 * 10px
const
babyInfo
=
ref
({
babyName
:
'宝宝名称'
,
gender
:
'M'
,
monthAge
:
'12'
,
avatar
:
''
,
assessmentDate
:
'1749139200000'
,
})
const
analysisData
=
ref
({
bmiPercentile
:
0
,
bmiStatus
:
"LOW"
,
headPercentile
:
0
,
headStatus
:
"LOW"
,
heightPercentile
:
0
,
heightStatus
:
"LOW"
,
weightPercentile
:
0
,
weightStatus
:
"LOW"
})
const
assessmentData
=
ref
({
bmi
:
13.12
,
feedingType
:
"MIXED"
,
headCircumference
:
34.5
,
height
:
50.3
,
weight
:
3.32
})
const
contentText
=
ref
({
evaluation
:
"描述"
,
shareText
:
"描述"
,
summary
:
"描述"
});
const
statusBarPercentileMap
=
{
NORMAL
:
177
,
SLIGHT_LOW
:
110
,
SLIGHT_HIGH
:
247
,
LOW
:
43
,
HIGH
:
314
}
// 历史数据列表
const
historyList
=
ref
([
...
...
@@ -351,6 +396,14 @@ const standardCurves = ref({
}
})
const
statusMap
=
{
NORMAL
:
'正常'
,
SLIGHT_LOW
:
'略低'
,
SLIGHT_HIGH
:
'略高'
,
LOW
:
'偏低'
,
HIGH
:
'偏高'
}
// 切换导航标签
/**
* @param {string} tab - 要切换的标签名称('latest'|'history')
...
...
@@ -489,6 +542,18 @@ onMounted(() => {
setTimeout
(()
=>
{
drawGrowthCurve
()
},
100
)
const
shengzhangStore
=
useShengzhangStore
();
const
data
=
{...
shengzhangStore
.
shengzhangInfo
.
babyInfo
};
data
.
assessmentDate
=
formatDate
(
shengzhangStore
.
shengzhangInfo
.
assessmentDate
);
babyInfo
.
value
=
data
;
analysisData
.
value
=
shengzhangStore
.
shengzhangInfo
.
analysis
;
assessmentData
.
value
=
shengzhangStore
.
shengzhangInfo
.
assessmentData
;
contentText
.
value
=
shengzhangStore
.
shengzhangInfo
.
content
;
})
// 绘制生长曲线
...
...
@@ -1239,6 +1304,7 @@ const onScroll = (e) => {
.value-triangle-container {
display: flex;
flex-direction: column;
width: 150rpx;
align-items: center;
.bar-value {
...
...
@@ -1247,9 +1313,12 @@ const onScroll = (e) => {
}
.triangle {
// position: relative;
top:8rpx;
// margin-left: 20rpx;
width: 20rpx;
height: 20rpx;
// align-self: center;
}
}
...
...
@@ -1436,7 +1505,9 @@ const onScroll = (e) => {
}
// 专家咨询按钮
.expert-consult-btn {
position: relative;
position: fixed;
bottom: 60rpx;
left: 0;
width: 100%;
height: 100rpx;
display: flex;
...
...
pages/shengzhangTools/shengzhangTools.vue
View file @
6ed1201b
...
...
@@ -229,7 +229,7 @@ import DatePickerPopup from '@/components/DatePickerPopup.vue'
import
BabyTestTipsPopup
from
'@/components/BabyTestTipsPopup.vue'
import
{
growthHome
,
guideCompleted
}
from
'../../api/shengzhangTools'
import
{
onLoad
}
from
"@dcloudio/uni-app"
;
import
{
throttleTap
,
jump
,
JumpType
}
from
'../../utils/index.js'
;
import
{
throttleTap
,
jump
,
JumpType
,
formatDate
}
from
'../../utils/index.js'
;
import
{
useShengzhangStore
}
from
'../../stores/shengzhangResult.js'
;
const
swiperData
=
ref
([
...
...
@@ -558,18 +558,7 @@ onMounted(async () => {
})
const
formatDate
=
(
timestamp
)
=>
{
const
date
=
new
Date
(
timestamp
);
if
(
isNaN
(
date
.
getTime
()))
{
console
.
error
(
'无效的时间戳:'
,
timestamp
);
return
''
;
}
const
year
=
date
.
getFullYear
()
const
month
=
String
(
date
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
const
day
=
String
(
date
.
getDate
()).
padStart
(
2
,
'0'
)
return
`
${
year
}
-
${
month
}
-
${
day
}
`
}
</
script
>
<
style
lang=
"less"
scoped
>
...
...
static/.DS_Store
View file @
6ed1201b
No preview for this file type
utils/index.js
View file @
6ed1201b
...
...
@@ -54,6 +54,19 @@ export function jump({ type, url, extra = {} }) {
}
}
export
function
formatDate
(
timestamp
){
const
date
=
new
Date
(
timestamp
);
if
(
isNaN
(
date
.
getTime
()))
{
console
.
error
(
'无效的时间戳:'
,
timestamp
);
return
''
;
}
const
year
=
date
.
getFullYear
()
const
month
=
String
(
date
.
getMonth
()
+
1
).
padStart
(
2
,
'0'
)
const
day
=
String
(
date
.
getDate
()).
padStart
(
2
,
'0'
)
return
`
${
year
}
-
${
month
}
-
${
day
}
`
}
/**
* 防连点函数
* @param {Function} fn 需要防连点的函数
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment