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
2f99e2c5
Commit
2f99e2c5
authored
Sep 01, 2025
by
张九刚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: backuo
parent
cfa344ec
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
454 additions
and
380 deletions
+454
-380
request.js
api/request.js
+2
-2
BabySwitchPopup.vue
components/BabySwitchPopup.vue
+45
-63
popup-tip.vue
components/popup-tip/popup-tip.vue
+60
-18
md.js
md.js
+1
-1
feedingIndex.vue
pages/feedingIndex/feedingIndex.vue
+17
-2
postnatalCheckUp.vue
pages/postnatalCheckUp/postnatalCheckUp.vue
+23
-4
shengzhangTools.vue
pages/shengzhangTools/shengzhangTools.vue
+298
-288
user.js
stores/user.js
+6
-2
My.vue
views/My.vue
+2
-0
No files found.
api/request.js
View file @
2f99e2c5
...
...
@@ -17,9 +17,9 @@ const {
// 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.230.108:7777/pmall";
// const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
let
baseUrl
=
"https://momclub.feihe.com/pmall"
;
//生产环境
//
let baseUrl = "https://momclub.feihe.com/pmall";//生产环境
// const baseUrl = "https://docs.dui88.com/mock/1956/api";//mock
//
const baseUrl = "https://feihe.m.duibatest.com.cn/pmall"
const
baseUrl
=
"https://feihe.m.duibatest.com.cn/pmall"
const
request
=
(
options
=
{})
=>
{
// 在这里可以对请求头进行一些设置
...
...
components/BabySwitchPopup.vue
View file @
2f99e2c5
...
...
@@ -4,68 +4,45 @@
<!-- 弹窗头部 -->
<view
class=
"popup-header"
>
<text
class=
"popup-title"
>
切换宝宝
</text>
<image
class=
"close-btn"
:src=
"`$
{$baseUrl}shengzhangTool/1001/changeBaby/closeBtn.png`"
mode="aspectFit"
@click="closePopup"
/>
<image
class=
"close-btn"
:src=
"`$
{$baseUrl}shengzhangTool/1001/changeBaby/closeBtn.png`"
mode="aspectFit" @click="closePopup" />
</view>
<!-- 宝宝列表 -->
<view
class=
"baby-list"
>
<view
v-for=
"(baby, index) in babyList"
:key=
"index"
class=
"baby-item"
:class=
"
{ selected: selectIndex === index }"
@click="selectBaby(index)"
>
<view
v-for=
"(baby, index) in babyList"
:key=
"index"
class=
"baby-item"
:class=
"
{ selected: selectIndex === index }" @click="selectBaby(index)">
<!-- 选中背景 -->
<image
v-if=
"selectIndex === index"
class=
"baby-item-bg"
:src=
"`$
{$baseUrl}shengzhangTool/1001/changeBaby/babyItemBg.png`"
mode="aspectFit"
/>
<image
v-if=
"selectIndex === index"
class=
"baby-item-bg"
:src=
"`$
{$baseUrl}shengzhangTool/1001/changeBaby/babyItemBg.png`" mode="aspectFit" />
<!-- 宝宝头像 -->
<image
class=
"baby-avatar"
:src=
"baby.babyAvatar || `https://course.feihe.com/momclub-picture/common/default_avatar.png`"
mode=
"aspectFill"
/>
<image
class=
"baby-avatar"
:src=
"baby.babyAvatar || `https://course.feihe.com/momclub-picture/common/default_avatar.png`"
mode=
"aspectFill"
/>
<!-- 宝宝信息 -->
<view
class=
"baby-info"
>
<view
class=
"baby-name-row"
>
<text
class=
"baby-name"
>
{{
baby
.
babyName
}}
</text>
<image
class=
"gender-icon"
:src=
"baby.babyGender === 'M' ? `$
{$baseUrl}shengzhangTool/1001/sex1.png` : `${$baseUrl}shengzhangTool/1001/sex0.png`"
mode="aspectFit"
/>
<image
class=
"gender-icon"
:src=
"baby.babyGender === 'M' ? `$
{$baseUrl}shengzhangTool/1001/sex1.png` : `${$baseUrl}shengzhangTool/1001/sex0.png`"
mode="aspectFit" />
</view>
<text
class=
"baby-birthday"
>
宝宝生日:
{{
baby
.
babyBirthday
}}
</text>
</view>
</view>
</view>
<image
class=
"ok-btn"
:class=
"
{'ok-btn-active': isOkPressed}"
:src="`${$baseUrl}shengzhangTool/1001/changeBaby/okBtn.png`"
@touchstart="handleOkTouchStart"
@touchend="handleOkTouchEnd"
mode="aspectFit"
>
</image>
<image
class=
"ok-btn"
:class=
"
{ 'ok-btn-active': isOkPressed }"
:src="`${$baseUrl}shengzhangTool/1001/changeBaby/okBtn.png`" @touchstart="handleOkTouchStart"
@touchend="handleOkTouchEnd" mode="aspectFit">
</image>
</view>
</view>
</
template
>
<
script
setup
>
import
{
ref
,
defineEmits
,
defineProps
,
onMounted
}
from
'vue'
import
{
ref
,
defineEmits
,
defineProps
,
onMounted
,
watch
}
from
'vue'
import
{
useUserStore
}
from
"@/stores/user"
;
import
md
from
'../md.js'
...
...
@@ -91,12 +68,13 @@ const props = defineProps({
}
})
const
userStore
=
useUserStore
();
const
emit
=
defineEmits
([
'update:visible'
,
'update:selectedIndex'
,
'change'
])
const
selectHandle
=
()
=>
{
}
const
isOkPressed
=
ref
(
false
)
...
...
@@ -145,9 +123,10 @@ const selectBaby = (index) => {
}
const
babyList
=
ref
([]);
onMounted
(()
=>
{
const
initListData
=
()
=>
{
babyList
.
value
=
(
userStore
.
babyInfo
?.
allBabyBaseInfo
||
[]).
filter
(
tem
=>
tem
.
babyStage
===
2
);
if
(
babyList
.
value
===
null
)
{
if
(
babyList
.
value
===
null
)
{
babyList
.
value
=
[];
}
...
...
@@ -159,6 +138,16 @@ onMounted(() => {
toolName
:
"生长曲线"
,
popName
:
"切换宝宝弹窗"
});
}
watch
(()
=>
props
.
visible
,
(
val
,
oldVal
)
=>
{
if
(
val
&&
!
oldVal
)
{
// 打开的时候更新数据
initListData
();
}
},
{
immediate
:
true
})
onMounted
(()
=>
{
initListData
();
})
...
...
@@ -192,13 +181,13 @@ onMounted(() => {
align-items: center;
justify-content: space-between;
padding: 40rpx 30rpx 20rpx;
.popup-title {
font-size: 32rpx;
font-weight: bold;
color: #333;
}
.close-btn {
width: 40rpx;
height: 40rpx;
...
...
@@ -223,11 +212,11 @@ onMounted(() => {
height: 129rpx;
border-radius: 16rpx;
background-color: #fff;
&.selected {
background-color: transparent;
}
.baby-item-bg {
position: absolute;
top: 0;
...
...
@@ -238,7 +227,7 @@ onMounted(() => {
height: 100%;
z-index: 1;
}
.baby-avatar {
position: relative;
z-index: 2;
...
...
@@ -247,30 +236,30 @@ onMounted(() => {
border-radius: 50%;
margin-right: 20rpx;
}
.baby-info {
position: relative;
z-index: 2;
flex: 1;
.baby-name-row {
display: flex;
align-items: center;
margin-bottom: 8rpx;
.baby-name {
font-size: 28rpx;
font-weight: bold;
color: #333;
margin-right: 10rpx;
}
.gender-icon {
width: 24rpx;
height: 24rpx;
}
}
.baby-birthday {
font-size: 24rpx;
color: #666;
...
...
@@ -285,6 +274,7 @@ onMounted(() => {
height: 98rpx;
margin-left: 35rpx;
margin-top: 0rpx;
&.ok-btn-active {
transform: scale(0.95);
}
...
...
@@ -292,12 +282,4 @@ onMounted(() => {
}
}
</
style
>
\ No newline at end of file
components/popup-tip/popup-tip.vue
View file @
2f99e2c5
...
...
@@ -35,6 +35,7 @@
</
template
>
</view>
<view
class=
"form-btn"
@
click=
"onAdd"
>
<image
v-if=
"isType == '0' || isType == '2'"
:src=
"`${$baseUrl}chanjianTool/1001/icon23.png`"
></image>
<
template
v-if=
"type == '1'"
>
...
...
@@ -43,6 +44,8 @@
<
template
v-if=
"type == '2'"
>
{{
isType
==
'0'
?
'添加状态'
:
isType
==
'3'
?
'我知道了'
:
isType
==
'1'
?
'切换状态'
:
'修改状态'
}}
</
template
>
<button
v-if=
"isNotLogin"
type=
"primary"
class=
"phone-button"
open-type=
"getPhoneNumber"
@
getphonenumber=
"getRealtimePhoneNumber"
/>
</view>
</view>
</view>
...
...
@@ -53,7 +56,8 @@ import {
ref
,
onMounted
,
computed
,
defineEmits
defineEmits
,
watch
}
from
'vue'
import
{
useUserStore
}
from
"@/stores/user"
;
// 接受父组件参数
...
...
@@ -61,6 +65,10 @@ const props = defineProps({
type
:
{
type
:
String
,
default
:
'1'
,
// 1 非宝宝状态 2 非孕中状态
},
isNotLogin
:
{
type
:
Boolean
,
default
:
false
//是否未登录
}
})
// 用户信息
...
...
@@ -68,7 +76,7 @@ const userStore = useUserStore();
const
babyInfo
=
ref
(
userStore
.
babyInfo
)
// 回调函数
const
emit
=
defineEmits
([
'statusChange'
,
'close'
])
const
emit
=
defineEmits
([
'statusChange'
,
'close'
])
const
isType
=
ref
(
'0'
)
// 0 添加状态或者宝宝 1 切换状态 2 修改状态 3 宝宝已达上限
...
...
@@ -77,18 +85,18 @@ const babyBaseId = ref('')
// 产检信息
const
pregnancyStatus
=
computed
(()
=>
{
return
isType
.
value
==
'0'
?
'新增孕中'
:
isType
.
value
==
'1'
?
'切换孕中'
:
isType
.
value
==
'2'
?
'修改备孕'
:
''
;
return
isType
.
value
==
'0'
?
'新增孕中'
:
isType
.
value
==
'1'
?
'切换孕中'
:
isType
.
value
==
'2'
?
'修改备孕'
:
''
;
})
// 生长曲线和喂养记录
const
babyStatus
=
computed
(()
=>
{
return
isType
.
value
==
'0'
?
'新增宝宝'
:
isType
.
value
==
'1'
?
'切换宝宝'
:
isType
.
value
==
'2'
?
(
babyInfo
.
value
.
babyStage
==
0
?
'修改备孕'
:
babyInfo
.
value
.
babyStage
==
1
?
'修改孕中'
:
''
)
:
''
;
return
isType
.
value
==
'0'
?
'新增宝宝'
:
isType
.
value
==
'1'
?
'切换宝宝'
:
isType
.
value
==
'2'
?
(
babyInfo
.
value
.
babyStage
==
0
?
'修改备孕'
:
babyInfo
.
value
.
babyStage
==
1
?
'修改孕中'
:
''
)
:
''
;
})
// 跳转新增宝宝状态页面
const
navigateToFn
=
()
=>
{
...
...
@@ -98,12 +106,30 @@ const navigateToFn = () => {
url
:
`/pages/person/person?type=
${
type
}
`
})
}
const
getRealtimePhoneNumber
=
async
(
e
)
=>
{
console
.
log
(
"获取手机号码"
,
e
);
if
(
e
.
detail
.
errMsg
!==
"getPhoneNumber:ok"
)
{
uni
.
showToast
({
title
:
"请授权使用手机号"
,
icon
:
"none"
,
});
return
;
}
await
userStore
.
phoneCallback
(
e
.
detail
,
()
=>
{
},
()
=>
{
emit
(
'afterPhone'
)
//如果没有宝宝信息,页面中处理宝宝注册信息
});
console
.
log
(
"closeclosecloseclose"
);
emit
(
'close'
)
emit
(
'statusChange'
)
//借用这个事件,刷新下页面数据
};
// 切换状态 需要对应的宝宝id 直接请求接口
const
switchState
=
async
()
=>
{
console
.
log
(
'切换状态'
,
babyBaseId
.
value
)
await
userStore
.
changeBabySelected
(
babyBaseId
.
value
);
// 发送事件 通知主页面
// 发送事件 通知主页面
emit
(
'statusChange'
)
}
// 修改状态 需要对应备胎的id 跳转到编辑页面
...
...
@@ -117,8 +143,12 @@ const modifyState = async () => {
url
:
`/pages/person/person?type=
${
type
}
&id=
${
babyBaseId
.
value
}
`
})
}
//这里新增一下未登录的情况,点击事件直接去拉起手机号授权
// 跳转新增产检页面
const
onAdd
=
()
=>
{
if
(
props
.
isNotLogin
==
true
)
{
return
;
}
// 0 添加状态或者宝宝 1 切换状态 2 修改状态 3 宝宝已达上限
switch
(
isType
.
value
)
{
case
'0'
:
...
...
@@ -138,10 +168,14 @@ const onAdd = () => {
}
}
onMounted
(()
=>
{
onMounted
(
async
()
=>
{
if
(
props
.
isNotLogin
)
{
await
userStore
.
wxAutoLogin
();
}
// 宝宝生长测试和喂养记录
console
.
log
(
'babyInfo-获取宝宝'
,
babyInfo
.
value
)
const
babyBaseInfo
=
babyInfo
.
value
.
allBabyBaseInfo
const
babyBaseInfo
=
babyInfo
?.
value
?
.
allBabyBaseInfo
console
.
log
(
"🚀 ~ babyBaseInfo:"
,
babyBaseInfo
)
// 有宝宝状态
if
(
babyBaseInfo
)
{
...
...
@@ -168,7 +202,7 @@ onMounted(() => {
// }
babyBaseId
.
value
=
babyInfo
.
value
.
content
.
id
;
isType
.
value
=
'2'
;
}
}
// 产检提醒
...
...
@@ -205,14 +239,14 @@ onMounted(() => {
// 如果找到符合条件的 baby,取出它的 id 并赋值
babyBaseId
.
value
=
stageOneBaby
.
id
;
}
else
{
// 修改
console
.
log
(
'没有找到符合条件的 baby'
,
babyInfo
.
value
);
console
.
log
(
'没有找到符合条件的 baby'
,
babyInfo
.
value
);
// // 判断没有备孕的状态
// if (!babyBaseInfo.some(baby => baby.babyStage == 0)) {
// isType.value = '0'
// } else {
// const stageZeroBaby = babyBaseInfo.find(baby => baby.babyStage == 0);
babyBaseId
.
value
=
babyInfo
.
value
.
content
.
id
;
isType
.
value
=
'2'
;
babyBaseId
.
value
=
babyInfo
.
value
.
content
.
id
;
isType
.
value
=
'2'
;
// }
}
...
...
@@ -319,11 +353,19 @@ onMounted(() => {
align-items
:
center
;
justify-content
:
center
;
margin-top
:
55rpx
;
position
:
relative
;
image
{
width
:
42rpx
;
height
:
42rpx
;
margin-right
:
12rpx
;
}
.phone-button
{
width
:
100%
;
height
:
100%
;
position
:
absolute
;
opacity
:
0
;
}
}
</
style
>
\ No newline at end of file
md.js
View file @
2f99e2c5
...
...
@@ -6,7 +6,7 @@ const init = (SENSORS_URL) => {
sensors
.
setPara
({
name
:
"sensors"
,
server_url
:
SENSORS_URL
,
show_log
:
tru
e
,
show_log
:
fals
e
,
autoTrack
:
{
appLaunch
:
true
,
// 默认为 true,false 则关闭 $MPLaunch 事件采集
appShow
:
true
,
// 默认为 true,false 则关闭 $MPShow 事件采集
...
...
pages/feedingIndex/feedingIndex.vue
View file @
2f99e2c5
...
...
@@ -422,7 +422,7 @@
<
script
setup
>
import
{
ref
,
computed
,
onMounted
,
onUnmounted
,
getCurrentInstance
}
from
'vue'
import
{
onShow
,
onLoad
,
onHide
}
from
'@dcloudio/uni-app'
import
{
onShow
,
onLoad
,
onHide
,
onShareAppMessage
,
onShareTimeline
}
from
'@dcloudio/uni-app'
import
BabySwitchPopup
from
'@/components/BabySwitchPopup.vue'
import
popupTip
from
'../../components/popup-tip/popup-tip.vue'
import
{
fetchFeedingJSON
,
feedingHome
,
feedingRecords
,
feedingFoodsCustom
,
feedingFoodsCustomAdd
,
feedingFoodsCustomDelete
,
feedingTimerStart
,
feedingTimerStop
,
feedingVoiceUpload
,
feedingVoiceResult
}
from
'@/api/feeding.js'
...
...
@@ -2412,7 +2412,7 @@ function showAddFoodPopup(categoryName) {
pageName
:
"喂养工具首页"
,
buttonName
:
"辅食添加"
+
categoryName
,
});
// 防连点检查
if
(
foodSelectionState
.
value
.
isAddingFood
)
{
console
.
log
(
'防连点:添加辅食按钮被阻止'
)
...
...
@@ -3747,7 +3747,22 @@ function loadDefaultFoodsData() {
}
}
onShareAppMessage
(()
=>
{
return
{
title
:
"喂养记录:喂奶辅食轻松记录,喂养数据一目了然"
,
path
:
"/pages/feedingIndex/feedingIndex"
,
imageUrl
:
$baseUrl
+
"share/weiyang.png"
,
}
});
onShareTimeline
(()
=>
{
return
{
title
:
"喂养记录:喂奶辅食轻松记录,喂养数据一目了然"
,
path
:
"/pages/feedingIndex/feedingIndex"
,
imageUrl
:
$baseUrl
+
"share/weiyang.png"
,
}
});
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
pages/postnatalCheckUp/postnatalCheckUp.vue
View file @
2f99e2c5
...
...
@@ -117,8 +117,7 @@
<popup-tip
v-if=
"isTip"
type=
"2"
@
statusChange=
"onBabyChange"
@
close=
"isTip = false"
></popup-tip>
<!-- 使用封装后的日期选择器组件 -->
<DatePicker
v-model:visible=
"visible"
:default-date=
"time"
@
confirm=
"handleDateConfirm"
/>
<DatePicker
v-model:visible=
"visible"
:default-date=
"time"
@
confirm=
"handleDateConfirm"
/>
</view>
</view>
</template>
...
...
@@ -133,7 +132,9 @@ import {
}
from
'vue'
import
{
onLoad
,
onShow
onShow
,
onShareAppMessage
,
onShareTimeline
}
from
'@dcloudio/uni-app'
import
{
jump
,
...
...
@@ -354,7 +355,7 @@ const close = (type) => {
});
}
showPicker
.
value
=
false
;
}
// 选择提醒事件
const
handleChange
=
(
e
)
=>
{
...
...
@@ -589,6 +590,24 @@ onMounted(() => {
pageName
:
"产检提醒首页"
});
})
onShareAppMessage
(()
=>
{
return
{
title
:
"产检工具:孕检项目全掌握,产检日程不错过"
,
path
:
"/pages/postnatalCheckUp/postnatalCheckUp"
,
imageUrl
:
$baseUrl
+
"share/chanjian.png"
,
}
});
onShareTimeline
(()
=>
{
return
{
title
:
"产检工具:孕检项目全掌握,产检日程不错过"
,
path
:
"/pages/postnatalCheckUp/postnatalCheckUp"
,
imageUrl
:
$baseUrl
+
"share/chanjian.png"
,
}
});
</
script
>
<
style
lang=
"less"
scoped
>
...
...
pages/shengzhangTools/shengzhangTools.vue
View file @
2f99e2c5
This diff is collapsed.
Click to expand it.
stores/user.js
View file @
2f99e2c5
...
...
@@ -71,7 +71,7 @@ export const useUserStore = defineStore("userInfo", {
* @param {Object} data : {encryptedData, iv, code}
* @returns
*/
async
phoneCallback
(
data
,
onOpenRegisterFn
=
()
=>
{
})
{
async
phoneCallback
(
data
,
onOpenRegisterFn
=
()
=>
{
}
,
cb
)
{
uni
.
login
({
provider
:
"weixin"
,
success
:
async
(
res
)
=>
{
...
...
@@ -86,7 +86,11 @@ export const useUserStore = defineStore("userInfo", {
code
:
data
.
code
,
codeLogin
:
res
.
code
,
});
!
babyExistence
&&
onOpenRegisterFn
&&
onOpenRegisterFn
();
if
(
!
babyExistence
.
value
&&
cb
)
{
cb
();
}
const
homeStore
=
useHomeStore
();
await
homeStore
.
setBabyExistence
(
babyExistence
);
...
...
@@ -115,7 +119,7 @@ export const useUserStore = defineStore("userInfo", {
// 缓存用户memberId
uni
.
setStorageSync
(
'memberId'
,
data
?.
memberId
)
}
this
.
userInfo
=
data
;
this
.
userInfo
=
data
;
},
setBabyNickCache
(
id
,
name
)
{
...
...
views/My.vue
View file @
2f99e2c5
...
...
@@ -404,6 +404,8 @@ const initData = async () => {
// 已出生或孕中显示
cfgStatus
.
value
.
showDetail
=
__showDetail
;
if
(
__showDetail
)
{
wheelOptions
.
value
=
babyInfo
.
value
.
babyStage
==
2
...
...
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