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
85c42be1
Commit
85c42be1
authored
Jul 25, 2025
by
王炽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交接口处理
parent
21ec5c3f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
39 deletions
+71
-39
DatePickerPopup.vue
components/DatePickerPopup.vue
+1
-1
shengzhangTools.vue
pages/shengzhangTools/shengzhangTools.vue
+56
-34
loadingActImg.png
static/shengzhangTool/loadingActImg.png
+0
-0
maskTest.png
static/shengzhangTool/maskTest.png
+0
-0
user.js
stores/user.js
+1
-0
My.vue
views/My.vue
+13
-4
No files found.
components/DatePickerPopup.vue
View file @
85c42be1
...
...
@@ -239,7 +239,7 @@ const closePopup = () => {
// 发送事件通知主页面
emit
(
'change'
,
formattedDate
)
emit
(
'update:selectedDate'
,
formattedDate
);
//
emit('update:visible', false)
emit
(
'update:visible'
,
false
)
}
</
script
>
...
...
pages/shengzhangTools/shengzhangTools.vue
View file @
85c42be1
...
...
@@ -37,7 +37,7 @@
<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"
>
{{
babyBirthday
}}
</text>
<text
class=
"birth-date"
>
{{
formatDate
(
babyBirthday
)
}}
</text>
</view>
</view>
<view
class=
"record-btn"
@
click=
"viewRecords"
>
...
...
@@ -218,6 +218,7 @@ import DatePickerPopup from '@/components/DatePickerPopup.vue'
import
BabyTestTipsPopup
from
'@/components/BabyTestTipsPopup.vue'
import
{
growthHome
,
guideCompleted
,
assessmentSave
}
from
'../../api/shengzhangTools'
import
{
onLoad
}
from
"@dcloudio/uni-app"
;
import
{
throttleTap
}
from
'../../utils/index.js'
;
const
swiperData
=
ref
([
{
bannerImg
:
'/static/shengzhangTool/banner1.png'
},
...
...
@@ -351,15 +352,27 @@ const viewRecords = () => {
console
.
log
(
'查看测评记录'
)
}
const
submitData
=
async
()
=>
{
const
convertFeedingType
=
(
type
)
=>
{
if
(
type
==
'纯母乳'
){
return
'BREAST_MILK'
}
else
if
(
type
==
'母乳+奶粉混合喂养'
){
return
'MIXED'
}
else
if
(
type
==
'奶粉'
){
return
'FORMULA'
}
else
if
(
type
==
'母乳+辅食'
){
return
'BREAST_MILK_CF'
}
else
if
(
type
==
'奶粉+辅食'
){
return
'FORMULA_CF'
}
}
const
submitData
=
throttleTap
(
async
()
=>
{
const
submitData
=
{
babyId
:
babyId
.
value
,
height
:
height
.
value
,
weight
:
weight
.
value
,
headCircumference
:
headCircumference
.
value
,
assessmentDate
:
assessmentDate
.
value
,
feedingType
:
selectedFeedText
.
value
feedingType
:
convertFeedingType
(
selectedFeedText
.
value
)
};
console
.
log
(
'提交数据'
,
submitData
);
...
...
@@ -371,7 +384,7 @@ const submitData = async () => {
icon
:
'success'
})
}
}
}
,
1000
)
// 添加以下数据
const
showBabySwitchPopup
=
ref
(
false
)
...
...
@@ -487,22 +500,19 @@ const guideHandler = async () => {
guideIndex
.
value
++
if
(
guideIndex
.
value
>
2
)
{
//
const data = await guideCompleted();
//
if(data.success){
//
guideFlag.value = true;
//
guideIndex.value = -1;
//
}else{
//
//引导页完成失败,提示用户
//
}
const
data
=
await
guideCompleted
();
if
(
data
.
success
){
guideFlag
.
value
=
true
;
guideIndex
.
value
=
-
1
;
}
else
{
//引导页完成失败,提示用户
}
}
}
// 获取页面参数
onLoad
((
options
)
=>
{
console
.
log
(
'页面参数:'
,
options
.
toString
())
console
.
log
(
'options.babyId='
,
options
.
babyId
);
if
(
options
.
babyId
)
{
babyId
.
value
=
parseInt
(
options
.
babyId
)
console
.
log
(
'获取到的babyId:'
,
babyId
.
value
)
...
...
@@ -510,28 +520,40 @@ onLoad((options) => {
})
onMounted
(
async
()
=>
{
const
{
data
}
=
await
growthHome
();
console
.
log
(
'data666666='
,
data
);
const
{
data
}
=
await
growthHome
(
babyId
.
value
);
// 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.babyName
// babyAge.value = data.monthAge + '月龄'
// babyBirthday.value = data.birthDate
// babyGender.value = data.gender
// console.log('data.avatar=', data.avatar)
;
//
babyAvatar.value = data.avatar
//
assessmentDate.value = selectedDate.value;
//
feedingType.value = selectedFeedText.value;
//
guideFlag.value = data.guideFlag;
//
if (guideFlag.value) {
//
guideIndex.value = -1;
//
}else{
//
guideIndex.value = 0;
//
}
babyName
.
value
=
data
.
babyName
babyAge
.
value
=
data
.
monthAge
+
'月龄'
babyBirthday
.
value
=
data
.
birthDate
babyGender
.
value
=
data
.
gender
;
babyAvatar
.
value
=
data
.
avatar
assessmentDate
.
value
=
selectedDate
.
value
;
feedingType
.
value
=
selectedFeedText
.
value
;
guideFlag
.
value
=
data
.
guideFlag
;
if
(
guideFlag
.
value
)
{
guideIndex
.
value
=
-
1
;
}
else
{
guideIndex
.
value
=
0
;
}
})
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/shengzhangTool/loadingActImg.png
0 → 100644
View file @
85c42be1
123 KB
static/shengzhangTool/maskTest.png
0 → 100644
View file @
85c42be1
126 KB
stores/user.js
View file @
85c42be1
...
...
@@ -21,6 +21,7 @@ export const useUserStore = defineStore("userInfo", {
babyInfo
:
null
,
memberInfo
:
null
,
babyNickCache
:
[],
cepingjieguoInfo
:
null
,
};
},
actions
:
{
...
...
views/My.vue
View file @
85c42be1
...
...
@@ -302,7 +302,13 @@ const handleToolClick = async (item) => {
},
});
}
else
{
jump
({
type
:
item
.
link
.
type
,
url
:
item
.
link
.
url
});
const
extra
=
item
.
link
.
extra
;
if
(
extra
&&
extra
.
babyId
){
jump
({
type
:
item
.
link
.
type
,
url
:
item
.
link
.
url
+
'?babyId='
+
extra
.
babyId
});
}
else
{
jump
({
type
:
item
.
link
.
type
,
url
:
item
.
link
.
url
});
}
}
};
...
...
@@ -326,9 +332,8 @@ const handleEditProfile = (e) => {
md
.
sensorLog
(
e
);
const
type
=
userStore
.
babyInfo
?.
allBabyBaseInfo
?.
length
==
0
?
"add"
:
"edit"
;
babyId
.
value
=
userStore
.
babyInfo
?.
allBabyBaseInfo
.
find
(
const
type
=
userStore
.
babyInfo
?.
allBabyBaseInfo
?.
length
==
0
?
"add"
:
"edit"
;
babyId
.
value
=
userStore
.
babyInfo
?.
allBabyBaseInfo
.
find
(
(
item
)
=>
item
.
selected
)?.
id
;
...
...
@@ -440,6 +445,10 @@ onMounted(async () => {
initData
();
hideLoading
();
babyId
.
value
=
userStore
.
babyInfo
?.
allBabyBaseInfo
.
find
(
(
item
)
=>
item
.
selected
)?.
id
;
console
.
log
(
'babyIdsdfsdfsdfsdfsdfsdfdsfsdf='
,
babyId
.
value
);
const
a
=
{
"bgUrl"
:
"my/babytest.png"
,
...
...
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