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
cec72db5
Commit
cec72db5
authored
Jul 24, 2025
by
王炽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口对接
parent
91abda20
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
444 additions
and
181 deletions
+444
-181
request.js
api/request.js
+10
-7
shengzhangTestResult.vue
pages/shengzhangTestResult/shengzhangTestResult.vue
+415
-167
shengzhangTools.vue
pages/shengzhangTools/shengzhangTools.vue
+19
-7
.DS_Store
static/.DS_Store
+0
-0
No files found.
api/request.js
View file @
cec72db5
...
...
@@ -17,7 +17,7 @@ const {
// 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.224.178:7777/pmall";
// const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
cons
t
baseUrl
=
"https://momclub.feihe.com/pmall"
;
//生产环境
le
t
baseUrl
=
"https://momclub.feihe.com/pmall"
;
//生产环境
// const baseUrl = "https://docs.dui88.com/mock/1956/api";//mock
const
request
=
(
options
=
{})
=>
{
...
...
@@ -26,9 +26,9 @@ const request = (options = {}) => {
options
.
header
=
{
"Content-Type"
:
"application/x-www-form-urlencoded"
}
if
(
options
.
url
==
'/c/ai/chat/query'
){
baseUrl
=
"https://docs.dui88.com/mock/1956
/api
"
;
}
//
if(options.url == '/c/ai/chat/query'){
baseUrl
=
"https://docs.dui88.com/mock/1956"
;
//
}
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
...
...
@@ -42,7 +42,7 @@ const request = (options = {}) => {
},
})
.
then
((
data
)
=>
{
// console.log('request data
===>', data);
console
.
log
(
'request data6666666
===>'
,
data
);
if
(
data
.
statusCode
!==
HTTP_STATUS
.
SUCCESS
)
{
uni
.
showToast
({
title
:
data
.
errMsg
,
...
...
@@ -50,14 +50,16 @@ const request = (options = {}) => {
});
reject
(
data
);
globalStore
.
setIsShowLoading
(
false
);
}
else
if
(
!
data
.
data
?.
ok
)
{
}
else
if
(
!
data
.
data
?.
ok
)
{
uni
.
showToast
({
title
:
data
.
data
?.
message
,
icon
:
'none'
});
reject
(
data
.
data
);
globalStore
.
setIsShowLoading
(
false
);
}
else
{
}
else
{
resolve
(
data
.
data
);
}
})
...
...
@@ -76,6 +78,7 @@ const get = (url, data, options = {}) => {
};
const
post
=
(
url
,
data
,
options
=
{})
=>
{
options
.
type
=
"POST"
;
options
.
data
=
data
;
options
.
url
=
url
;
...
...
pages/shengzhangTestResult/shengzhangTestResult.vue
View file @
cec72db5
...
...
@@ -29,6 +29,8 @@
</view>
-->
</view>
<!-- 最新内容容器 -->
<view
class=
"latest-content"
:class=
"
{ 'active': activeTab === 'latest' }">
<!-- 宝宝信息卡片 -->
<view
class=
"baby-info-card"
>
<view
class=
"card-header"
>
...
...
@@ -205,13 +207,62 @@
</view>
</view>
</view>
<!-- 历史内容容器 -->
<view
class=
"history-content"
:class=
"
{ 'active': activeTab === 'history' }">
<view
class=
"history-list"
>
<view
class=
"history-item"
v-for=
"(item, index) in historyList"
:key=
"index"
@
click=
"selectHistoryItem(item)"
>
<view
class=
"history-card"
>
<view
class=
"card-header"
>
<image
class=
"name-icon"
src=
"/static/shengzhangTestResult/nameIcon.png"
mode=
"aspectFit"
></image>
<text
class=
"card-title"
>
宝宝名称
</text>
</view>
<view
class=
"baby-basic-info"
>
<text
class=
"gender"
>
{{
item
.
gender
}}
</text>
<text
class=
"age"
>
{{
item
.
age
}}
</text>
<text
class=
"test-date"
>
测评于
{{
item
.
testDate
}}
</text>
</view>
<view
class=
"measurement-summary"
>
<view
class=
"values-row"
>
<text
class=
"measurement-value"
>
{{
item
.
height
}}
cm
</text>
<text
class=
"measurement-value"
>
{{
item
.
weight
}}
kg
</text>
<text
class=
"measurement-value"
>
{{
item
.
head
}}
cm
</text>
<text
class=
"measurement-value"
>
{{
item
.
bmi
}}
</text>
</view>
<view
class=
"labels-row"
>
<view
class=
"measurement-item"
>
<text
class=
"measurement-label"
>
身高
</text>
<text
class=
"measurement-status normal"
>
正常
</text>
</view>
<view
class=
"measurement-item"
>
<text
class=
"measurement-label"
>
体重
</text>
<text
class=
"measurement-status normal"
>
正常
</text>
</view>
<view
class=
"measurement-item"
>
<text
class=
"measurement-label"
>
头围
</text>
<text
class=
"measurement-status normal"
>
正常
</text>
</view>
<view
class=
"measurement-item"
>
<text
class=
"measurement-label"
>
BMI
</text>
<text
class=
"measurement-status normal"
>
正常
</text>
</view>
</view>
</view>
<view
class=
"growth-evaluation"
>
<text
class=
"evaluation-text"
>
{{
item
.
evaluation
}}
</text>
</view>
</view>
</view>
</view>
</view>
</view>
</
template
>
<
script
setup
>
import
{
ref
,
onMounted
}
from
'vue'
// 导航标签状态
const
activeTab
=
ref
(
'latest'
)
const
activeTab
=
ref
(
'latest'
)
// 默认显示最新内容
// 生长曲线标签状态
const
activeCurveTab
=
ref
(
'height'
)
...
...
@@ -220,6 +271,40 @@ const activeCurveTab = ref('height')
const
scrollLeft
=
ref
(
0
)
const
totalWidth
=
ref
(
1080
)
// 36个月 * 10px
// 历史数据列表
const
historyList
=
ref
([
{
gender
:
'男'
,
age
:
'2月21天'
,
testDate
:
'2025年06月06日'
,
height
:
'60.6'
,
weight
:
'5.8'
,
head
:
'39.0'
,
bmi
:
'16.0'
,
evaluation
:
'宝宝发育的非常棒,身高、体重和头围都处于正常的发育水平。TA与大多数宝宝一样,正在健康苗壮地成长。建议定期观察和记录宝宝的体格发育数据,这样有利于评估宝宝的生长发育情况,能够及时发现宝宝生长发育过程中的存在的问题和异常。'
},
{
gender
:
'男'
,
age
:
'1月15天'
,
testDate
:
'2025年05月01日'
,
height
:
'55.2'
,
weight
:
'4.5'
,
head
:
'36.8'
,
bmi
:
'14.8'
,
evaluation
:
'宝宝发育良好,各项指标都在正常范围内。建议继续保持良好的喂养习惯,定期进行生长发育监测。'
},
{
gender
:
'男'
,
age
:
'3月05天'
,
testDate
:
'2025年07月20日'
,
height
:
'62.1'
,
weight
:
'6.2'
,
head
:
'40.5'
,
bmi
:
'16.1'
,
evaluation
:
'宝宝生长发育稳定,身高、体重增长符合预期。头围发育正常,整体健康状况良好。'
}
])
// 生长曲线数据
...
...
@@ -275,6 +360,19 @@ const switchTab = (tab) => {
console
.
log
(
'切换到标签:'
,
tab
)
}
// 选择历史记录项
/**
* @param {Object} item - 选中的历史记录项
*/
const
selectHistoryItem
=
(
item
)
=>
{
console
.
log
(
'选择历史记录:'
,
item
)
// 这里可以添加跳转到详情页或更新当前显示数据的逻辑
uni
.
showToast
({
title
:
'已选择历史记录'
,
icon
:
'success'
})
}
// 切换生长曲线标签
/**
* @param {string} tab - 要切换的曲线类型('height'|'weight'|'head')
...
...
@@ -721,6 +819,156 @@ const onScroll = (e) => {
padding-right: 30rpx;
}
// 最新内容容器
.latest-content {
display: none;
&.active {
display: block;
}
}
// 历史内容容器
.history-content {
padding-left: 30rpx;
padding-right: 30rpx;
display: none;
&.active {
display: block;
}
.history-list {
margin-top: 46rpx;
}
.history-item {
margin-bottom: 30rpx;
}
.history-card {
background-color: #fff;
border-radius: 24rpx;
padding: 50rpx 35rpx 35rpx 35rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
position: relative;
transition: all 0.3s ease;
&:active {
transform: scale(0.98);
opacity: 0.8;
}
.card-header {
display: flex;
align-items: center;
margin-bottom: 20rpx;
.name-icon,
.status-icon {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
}
.card-title {
font-size: 32rpx;
color: #333;
font-weight: bold;
}
}
.baby-basic-info {
display: flex;
align-items: center;
margin-bottom: 30rpx;
.gender {
font-size: 24rpx;
color: #000;
margin-right: 20rpx;
}
.age {
font-size: 24rpx;
color: #000;
margin-right: 20rpx;
}
.test-date {
font-size: 24rpx;
color: #000;
}
}
.measurement-summary {
display: flex;
flex-direction: column;
margin-bottom: 30rpx;
.values-row {
display: flex;
justify-content: space-between;
margin-bottom: 15rpx;
.measurement-value {
font-size: 32rpx;
color: #333;
font-weight: bold;
flex: 1;
text-align: center;
}
}
.labels-row {
display: flex;
justify-content: space-between;
.measurement-item {
display: flex;
flex-direction: row;
align-items: center;
flex: 1;
justify-content: center;
.measurement-label {
font-size: 24rpx;
color: #666;
margin-right: 8rpx;
}
.measurement-status {
font-size: 22rpx;
color: #52c41a;
display: flex;
align-items: center;
&.normal {
&::before {
content: "";
width: 16rpx;
height: 16rpx;
background-image: url('/static/shengzhangTestResult/duihaoIcon.png');
background-size: contain;
background-repeat: no-repeat;
margin-right: 6rpx;
}
}
}
}
}
}
.growth-evaluation {
.evaluation-text {
font-size: 26rpx;
color: #666;
line-height: 1.6;
}
}
}
}
// 返回按钮
.back-btn {
position: absolute;
...
...
pages/shengzhangTools/shengzhangTools.vue
View file @
cec72db5
...
...
@@ -25,19 +25,19 @@
<!-- 顶部宝宝信息区域 -->
<view
class=
"baby-info-section"
>
<view
class=
"baby-avatar"
>
<image
class=
"avatar-img"
src=
"/static/shengzhangTool/avatar.png
"
mode=
"aspectFill"
></image>
<image
class=
"avatar-img"
:src=
"babyAvatar
"
mode=
"aspectFill"
></image>
</view>
<view
class=
"baby-details"
>
<view
class=
"baby-name-row"
>
<text
class=
"baby-name"
>
宝宝名称
</text>
<text
class=
"baby-name"
>
{{
babyName
}}
</text>
<image
class=
"change-baby-btn"
@
click=
"changeBaby"
src=
"/static/shengzhangTool/changeBaby.png"
mode=
"aspectFit"
></image>
</view>
<view
class=
"baby-info-row"
>
<view
class=
"gender-age"
>
<image
class=
"gender-icon"
src=
"/static/shengzhangTool/sex1.png
"
mode=
"aspectFit"
></image>
<text
class=
"age-text"
>
8月龄
</text>
<image
class=
"gender-icon"
:src=
"babyGender == 'M' ? '/static/shengzhangTool/sex1.png' : '/static/shengzhangTool/sex0.png'
"
mode=
"aspectFit"
></image>
<text
class=
"age-text"
>
{{
babyAge
}}
</text>
</view>
<text
class=
"birth-date"
>
2024-10-20
</text>
<text
class=
"birth-date"
>
{{
babyBirthday
}}
</text>
</view>
</view>
<view
class=
"record-btn"
@
click=
"viewRecords"
>
...
...
@@ -223,6 +223,12 @@ const swiperData = ref([
{
bannerImg
:
'/static/shengzhangTool/banner3.png'
}
])
const
babyName
=
ref
(
'宝宝名称'
)
const
babyAge
=
ref
(
'8月龄'
)
const
babyBirthday
=
ref
(
'2024-10-20'
)
const
babyGender
=
ref
(
'M'
)
const
babyAvatar
=
ref
(
'/static/shengzhangTool/avatar.png'
)
const
bannerHandler
=
(
item
)
=>
{
console
.
log
(
item
)
}
...
...
@@ -463,8 +469,14 @@ const guideHandler = () => {
}
onMounted
(
async
()
=>
{
// const {data} = await growthHome();
// console.log('data666666=', data);
const
{
data
}
=
await
growthHome
();
console
.
log
(
'data666666='
,
data
);
// const data = {"babyId":1234,"babyName":"小强","gender":"M","monthAge":3,"avatar":"https://momclub.feihe.com/pmall/momclub-picture/integral/1009/yuerBtn.png","birthDate":"2018-10-28 14:06:45","guideFlag":false};
babyName
.
value
=
data
.
data
.
babyName
babyAge
.
value
=
data
.
monthAge
+
'月龄'
babyBirthday
.
value
=
data
.
birthDate
babyGender
.
value
=
data
.
gender
babyAvatar
.
value
=
data
.
avatar
})
</
script
>
...
...
static/.DS_Store
View file @
cec72db5
No preview for this file type
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