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
250f1c9c
Commit
250f1c9c
authored
Jun 10, 2025
by
tao.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复问题
parent
6b9263a2
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
306 additions
and
207 deletions
+306
-207
user.js
api/user.js
+2
-0
cfg.js
cfg.js
+0
-84
BabySwitcher.vue
components/BabySwitcher.vue
+1
-1
PickerCustom.vue
components/PickerCustom.vue
+2
-2
TabBar.vue
components/TabBar.vue
+10
-14
my.js
mock/my.js
+165
-0
index.vue
pages/index/index.vue
+32
-10
person.vue
pages/person/person.vue
+42
-14
webview.vue
pages/webview/webview.vue
+10
-3
global.js
stores/global.js
+11
-3
pageCfg.js
stores/pageCfg.js
+19
-69
My.vue
views/My.vue
+12
-7
No files found.
api/user.js
View file @
250f1c9c
...
@@ -45,3 +45,5 @@ export const fetchMemberInfo = () => api.get('/c/user/memberInfo');
...
@@ -45,3 +45,5 @@ export const fetchMemberInfo = () => api.get('/c/user/memberInfo');
* @returns
* @returns
*/
*/
export
const
updateBabyInfo
=
(
data
)
=>
api
.
post
(
'/c/user/saveBaby'
,
data
);
export
const
updateBabyInfo
=
(
data
)
=>
api
.
post
(
'/c/user/saveBaby'
,
data
);
export
const
fetchUserJSON
=
()
=>
api
.
get
(
'/c/front/content'
,{
type
:
'my'
});
\ No newline at end of file
cfg.js
deleted
100644 → 0
View file @
6b9263a2
export
const
PRIVACY_URL
=
"https://secret.feihe.com/secret.html"
;
export
const
MEMBER_URL
=
"https://secret.feihe.com/index.html"
;
export
const
WHEEL_OPTIONS_YL
=
[
{
label
:
"1月龄"
,
desc
:
"宝宝开始对外界产生兴趣,会追视物体"
},
{
label
:
"2月龄"
,
desc
:
"能发出咿咿呀呀的声音,会对妈妈微笑"
},
{
label
:
"3月龄"
,
desc
:
"抬头能力增强,喜欢玩自己的小手"
},
{
label
:
"4月龄"
,
desc
:
"会翻身了,对周围事物充满好奇"
},
{
label
:
"5月龄"
,
desc
:
"手眼协调能力提升,喜欢抓取玩具"
},
{
label
:
"6月龄"
,
desc
:
"可以独自坐立,开始尝试固体食物"
},
{
label
:
"7月龄"
,
desc
:
"会爬行了,语言能力逐渐发展"
},
{
label
:
"8月龄"
,
desc
:
"能扶物站立,认知能力显著提升"
},
{
label
:
"9月龄"
,
desc
:
"开始学步,能说简单的词语"
},
{
label
:
"10月龄"
,
desc
:
"独立行走能力增强,喜欢模仿大人"
},
{
label
:
"11月龄"
,
desc
:
"语言理解能力提高,会简单互动"
},
{
label
:
"12月龄"
,
desc
:
"基本能独立行走,表达欲望增强"
},
{
label
:
"13月龄"
,
desc
:
"动作更加协调,喜欢探索新事物"
},
{
label
:
"14月龄"
,
desc
:
"语言表达更丰富,独立意识增强"
},
{
label
:
"15月龄"
,
desc
:
"手部精细动作发展,创造力萌芽"
},
{
label
:
"16月龄"
,
desc
:
"记忆力提升,开始学习分类概念"
},
{
label
:
"17月龄"
,
desc
:
"想象力丰富,喜欢角色扮演游戏"
},
{
label
:
"18月龄"
,
desc
:
"语言交流更流畅,社交能力发展"
},
{
label
:
"19月龄"
,
desc
:
"运动技能全面发展,好奇心旺盛"
},
{
label
:
"20月龄"
,
desc
:
"逻辑思维初步形成,会简单推理"
},
{
label
:
"21月龄"
,
desc
:
"情感表达更丰富,记忆力增强"
},
{
label
:
"22月龄"
,
desc
:
"独立性增强,生活技能提升"
},
{
label
:
"23月龄"
,
desc
:
"语言组织能力提高,喜欢提问"
},
{
label
:
"24月龄"
,
desc
:
"社交圈子扩大,懂得分享"
},
{
label
:
"25月龄"
,
desc
:
"创造性思维发展,喜欢音乐"
},
{
label
:
"26月龄"
,
desc
:
"注意力更集中,会完成简单任务"
},
{
label
:
"27月龄"
,
desc
:
"空间认知能力提升,喜欢拼图"
},
{
label
:
"28月龄"
,
desc
:
"语言表达更准确,理解能力增强"
},
{
label
:
"29月龄"
,
desc
:
"自我意识增强,情绪管理提升"
},
{
label
:
"30月龄"
,
desc
:
"逻辑思维更成熟,会简单计数"
},
{
label
:
"31月龄"
,
desc
:
"艺术创造力发展,喜欢绘画"
},
{
label
:
"32月龄"
,
desc
:
"记忆力显著提升,会讲简单故事"
},
{
label
:
"33月龄"
,
desc
:
"运动协调性好,喜欢户外活动"
},
{
label
:
"34月龄"
,
desc
:
"社交技能成熟,懂得合作"
},
{
label
:
"35月龄"
,
desc
:
"思维更加灵活,解决问题能力增强"
},
{
label
:
"36月龄"
,
desc
:
"全面发展,准备进入幼儿园阶段"
},
];
export
const
WHEEL_OPTIONS_YZ
=
[
{
label
:
"孕1周"
,
desc
:
"胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化"
},
{
label
:
"孕2周"
,
desc
:
"胎盘开始形成,为胎儿提供营养"
},
{
label
:
"孕3周"
,
desc
:
"胎儿心脏开始跳动,神经系统发育"
},
{
label
:
"孕4周"
,
desc
:
"胎儿大小如花生,开始形成四肢"
},
{
label
:
"孕5周"
,
desc
:
"胎儿面部开始发育,可见眼睛雏形"
},
{
label
:
"孕6周"
,
desc
:
"胎儿开始运动,脊椎继续发育"
},
{
label
:
"孕7周"
,
desc
:
"胎儿手指脚趾形成,大脑发育加快"
},
{
label
:
"孕8周"
,
desc
:
"胎儿所有器官雏形完成,开始生长"
},
{
label
:
"孕9周"
,
desc
:
"胎儿开始吞咽羊水,肌肉发育"
},
{
label
:
"孕10周"
,
desc
:
"胎儿指甲开始生长,性别特征显现"
},
{
label
:
"孕11周"
,
desc
:
"胎儿可以做出简单动作,头部变圆"
},
{
label
:
"孕12周"
,
desc
:
"胎儿开始产生尿液,骨骼继续钙化"
},
{
label
:
"孕13周"
,
desc
:
"胎儿vocal cords形成,可发声"
},
{
label
:
"孕14周"
,
desc
:
"胎儿开始产生胎动,母体可感知"
},
{
label
:
"孕15周"
,
desc
:
"胎儿皮下脂肪开始形成,体型增大"
},
{
label
:
"孕16周"
,
desc
:
"胎儿听力开始发育,对声音敏感"
},
{
label
:
"孕17周"
,
desc
:
"胎儿免疫系统开始发育,产生抗体"
},
{
label
:
"孕18周"
,
desc
:
"胎儿睡眠周期形成,活动规律"
},
{
label
:
"孕19周"
,
desc
:
"胎儿肺部发育,为呼吸做准备"
},
{
label
:
"孕20周"
,
desc
:
"胎儿听力继续发育,对外界声音反应"
},
{
label
:
"孕21周"
,
desc
:
"胎儿眉毛睫毛生长,面部特征明显"
},
{
label
:
"孕22周"
,
desc
:
"胎儿皮肤变厚,开始长出胎毛"
},
{
label
:
"孕23周"
,
desc
:
"胎儿体重快速增长,运动更频繁"
},
{
label
:
"孕24周"
,
desc
:
"胎儿肺部继续发育,产生肺表面活性物质"
},
{
label
:
"孕25周"
,
desc
:
"胎儿脂肪积累加快,体型继续增大"
},
{
label
:
"孕26周"
,
desc
:
"胎儿眼睛可以睁开,对光有反应"
},
{
label
:
"孕27周"
,
desc
:
"胎儿大脑快速发育,神经系统成熟"
},
{
label
:
"孕28周"
,
desc
:
"胎儿各器官功能逐渐完善"
},
{
label
:
"孕29周"
,
desc
:
"胎儿骨骼继续钙化,头部下降"
},
{
label
:
"孕30周"
,
desc
:
"胎儿体重持续增加,活动空间减少"
},
{
label
:
"孕31周"
,
desc
:
"胎儿消化系统发育成熟,可消化羊水"
},
{
label
:
"孕32周"
,
desc
:
"胎儿皮下脂肪继续积累,体温调节能力增强"
},
{
label
:
"孕33周"
,
desc
:
"胎儿免疫系统继续发育,获得母体抗体"
},
{
label
:
"孕34周"
,
desc
:
"胎儿肺部发育接近成熟,准备独立呼吸"
},
{
label
:
"孕35周"
,
desc
:
"胎儿体重快速增加,为出生做准备"
},
{
label
:
"孕36周"
,
desc
:
"胎儿头部继续下降,为分娩做准备"
},
{
label
:
"孕37周"
,
desc
:
"胎儿各器官发育完善,可以安全出生"
},
{
label
:
"孕38周"
,
desc
:
"胎儿继续增重,准备出生"
},
{
label
:
"孕39周"
,
desc
:
"胎儿位置固定,随时可能出生"
},
{
label
:
"孕40周"
,
desc
:
"胎儿发育完全成熟,即将出生"
},
];
components/BabySwitcher.vue
View file @
250f1c9c
...
@@ -85,7 +85,7 @@ function onAdd() {
...
@@ -85,7 +85,7 @@ function onAdd() {
&:nth-child(3) {
&:nth-child(3) {
border-bottom: none;
border-bottom: none;
}
}
.
text {
text {
white-space: nowrap;
white-space: nowrap;
}
}
}
}
...
...
components/PickerCustom.vue
View file @
250f1c9c
...
@@ -79,11 +79,11 @@ const props = defineProps({
...
@@ -79,11 +79,11 @@ const props = defineProps({
default
:
"custom"
,
// 'date' | 'custom'
default
:
"custom"
,
// 'date' | 'custom'
}
,
}
,
range
:
{
range
:
{
type
:
Array
,
type
:
[
Array
,
Object
]
,
default
:
()
=>
[],
default
:
()
=>
[],
}
,
}
,
value
:
{
value
:
{
type
:
[
Number
,
Array
],
type
:
[
Number
,
Array
,
String
],
default
:
0
,
default
:
0
,
}
,
}
,
onPickerChange
:
{
onPickerChange
:
{
...
...
components/TabBar.vue
View file @
250f1c9c
...
@@ -19,8 +19,11 @@
...
@@ -19,8 +19,11 @@
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
ref
,
getCurrentInstance
,
onMounted
}
from
"vue"
;
import
{
ref
,
getCurrentInstance
,
onMounted
,
computed
}
from
"vue"
;
import
{
useUserStore
}
from
'@/stores/user.js'
;
import
{
useUserStore
}
from
"@/stores/user.js"
;
import
{
useGlobalStore
}
from
"@/stores/global.js"
;
const
globalStore
=
useGlobalStore
();
const
userStore
=
useUserStore
();
const
userStore
=
useUserStore
();
const
{
proxy
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
...
@@ -49,29 +52,22 @@ const tabList = ref([
...
@@ -49,29 +52,22 @@ const tabList = ref([
},
},
]);
]);
const
props
=
defineProps
({
curTabIndex
:
{
type
:
Number
,
default
:
0
,
},
});
const
emit
=
defineEmits
([
"tabClick"
]);
const
emit
=
defineEmits
([
"tabClick"
]);
const
currentIndex
=
ref
(
props
.
curTabIndex
);
const
currentIndex
=
computed
(()
=>
globalStore
.
curTabIndex
);
const
handleTabClick
=
(
index
,
item
)
=>
{
const
handleTabClick
=
(
index
,
item
)
=>
{
currentIndex
.
value
=
index
;
globalStore
.
setCurTabIndex
(
index
)
;
emit
(
"tabClick"
,
{
index
,
item
});
emit
(
"tabClick"
,
{
index
,
item
});
};
};
onMounted
(()
=>
{
onMounted
(()
=>
{
userStore
.
wxAutoLogin
();
userStore
.
wxAutoLogin
();
})
})
;
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
@import
'@/common.less'
;
@import
"@/common.less"
;
.tab-bar {
.tab-bar {
position: fixed;
position: fixed;
...
...
mock/my.js
0 → 100644
View file @
250f1c9c
export
const
myObj
=
{
toolList
:
[
{
bgUrl
:
"my/literature.png"
,
title
:
"育儿百科"
,
desc
:
""
,
link
:
{
type
:
3
,
url
:
"https://www.baidu.com"
,
extra
:
{},
},
},
{
bgUrl
:
"my/suyuan.png"
,
title
:
"产品溯源"
,
desc
:
""
,
link
:
{
type
:
3
,
url
:
"https://www.baidu.com"
,
extra
:
{},
},
},
{
bgUrl
:
"my/book.png"
,
title
:
"奶娃宝典"
,
desc
:
""
,
link
:
{
type
:
1
,
url
:
"/pages/library/ContentLibrary"
,
extra
:
{},
},
},
{
bgUrl
:
"my/doctor.png"
,
title
:
"医生问诊"
,
desc
:
""
,
link
:
{
type
:
2
,
url
:
"/pages/partner/redirect"
,
extra
:
{},
},
},
{
bgUrl
:
"my/babytest.png"
,
title
:
"宝宝体质测试"
,
desc
:
""
,
link
:
{
type
:
3
,
url
:
"https://www.baidu.com"
,
extra
:
{},
},
},
],
conetntCfg
:
{
contentLikeOptions
:
[
"奶粉选择"
,
"奶粉成分"
,
"奶粉冲泡"
,
"宝宝奶量"
,
"生长发育"
,
"常见疾病"
,
"体检疫苗"
,
"饮食营养补充"
,
"辅食营养"
,
"亲子关系"
,
"早教游戏"
,
],
productLikeOptions
:
[
"飞鹤星飞帆"
,
"星飞帆卓睿"
,
"星飞帆卓耀"
,
"星飞帆卓初"
,
"星飞帆臻稚卓蓓"
,
"星飞帆淳芮有机"
,
],
specialAttentionOptions
:
[
"过敏"
,
"长肉"
,
"肠道"
,
"消化"
,
"脑发育"
],
channelOptions
:
[
"电商(京东/天猫)"
,
"母婴店"
],
},
wheelOptionsYL
:
[
{
label
:
"1月龄"
,
desc
:
"宝宝开始对外界产生兴趣,会追视物体"
},
{
label
:
"2月龄"
,
desc
:
"能发出咿咿呀呀的声音,会对妈妈微笑"
},
{
label
:
"3月龄"
,
desc
:
"抬头能力增强,喜欢玩自己的小手"
},
{
label
:
"4月龄"
,
desc
:
"会翻身了,对周围事物充满好奇"
},
{
label
:
"5月龄"
,
desc
:
"手眼协调能力提升,喜欢抓取玩具"
},
{
label
:
"6月龄"
,
desc
:
"可以独自坐立,开始尝试固体食物"
},
{
label
:
"7月龄"
,
desc
:
"会爬行了,语言能力逐渐发展"
},
{
label
:
"8月龄"
,
desc
:
"能扶物站立,认知能力显著提升"
},
{
label
:
"9月龄"
,
desc
:
"开始学步,能说简单的词语"
},
{
label
:
"10月龄"
,
desc
:
"独立行走能力增强,喜欢模仿大人"
},
{
label
:
"11月龄"
,
desc
:
"语言理解能力提高,会简单互动"
},
{
label
:
"12月龄"
,
desc
:
"基本能独立行走,表达欲望增强"
},
{
label
:
"13月龄"
,
desc
:
"动作更加协调,喜欢探索新事物"
},
{
label
:
"14月龄"
,
desc
:
"语言表达更丰富,独立意识增强"
},
{
label
:
"15月龄"
,
desc
:
"手部精细动作发展,创造力萌芽"
},
{
label
:
"16月龄"
,
desc
:
"记忆力提升,开始学习分类概念"
},
{
label
:
"17月龄"
,
desc
:
"想象力丰富,喜欢角色扮演游戏"
},
{
label
:
"18月龄"
,
desc
:
"语言交流更流畅,社交能力发展"
},
{
label
:
"19月龄"
,
desc
:
"运动技能全面发展,好奇心旺盛"
},
{
label
:
"20月龄"
,
desc
:
"逻辑思维初步形成,会简单推理"
},
{
label
:
"21月龄"
,
desc
:
"情感表达更丰富,记忆力增强"
},
{
label
:
"22月龄"
,
desc
:
"独立性增强,生活技能提升"
},
{
label
:
"23月龄"
,
desc
:
"语言组织能力提高,喜欢提问"
},
{
label
:
"24月龄"
,
desc
:
"社交圈子扩大,懂得分享"
},
{
label
:
"25月龄"
,
desc
:
"创造性思维发展,喜欢音乐"
},
{
label
:
"26月龄"
,
desc
:
"注意力更集中,会完成简单任务"
},
{
label
:
"27月龄"
,
desc
:
"空间认知能力提升,喜欢拼图"
},
{
label
:
"28月龄"
,
desc
:
"语言表达更准确,理解能力增强"
},
{
label
:
"29月龄"
,
desc
:
"自我意识增强,情绪管理提升"
},
{
label
:
"30月龄"
,
desc
:
"逻辑思维更成熟,会简单计数"
},
{
label
:
"31月龄"
,
desc
:
"艺术创造力发展,喜欢绘画"
},
{
label
:
"32月龄"
,
desc
:
"记忆力显著提升,会讲简单故事"
},
{
label
:
"33月龄"
,
desc
:
"运动协调性好,喜欢户外活动"
},
{
label
:
"34月龄"
,
desc
:
"社交技能成熟,懂得合作"
},
{
label
:
"35月龄"
,
desc
:
"思维更加灵活,解决问题能力增强"
},
{
label
:
"36月龄"
,
desc
:
"全面发展,准备进入幼儿园阶段"
},
],
wheelOptionsYZ
:
[
{
label
:
"孕1周"
,
desc
:
"胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化,胚胎开始着床,激素水平发生变化"
,
},
{
label
:
"孕2周"
,
desc
:
"胎盘开始形成,为胎儿提供营养"
},
{
label
:
"孕3周"
,
desc
:
"胎儿心脏开始跳动,神经系统发育"
},
{
label
:
"孕4周"
,
desc
:
"胎儿大小如花生,开始形成四肢"
},
{
label
:
"孕5周"
,
desc
:
"胎儿面部开始发育,可见眼睛雏形"
},
{
label
:
"孕6周"
,
desc
:
"胎儿开始运动,脊椎继续发育"
},
{
label
:
"孕7周"
,
desc
:
"胎儿手指脚趾形成,大脑发育加快"
},
{
label
:
"孕8周"
,
desc
:
"胎儿所有器官雏形完成,开始生长"
},
{
label
:
"孕9周"
,
desc
:
"胎儿开始吞咽羊水,肌肉发育"
},
{
label
:
"孕10周"
,
desc
:
"胎儿指甲开始生长,性别特征显现"
},
{
label
:
"孕11周"
,
desc
:
"胎儿可以做出简单动作,头部变圆"
},
{
label
:
"孕12周"
,
desc
:
"胎儿开始产生尿液,骨骼继续钙化"
},
{
label
:
"孕13周"
,
desc
:
"胎儿vocal cords形成,可发声"
},
{
label
:
"孕14周"
,
desc
:
"胎儿开始产生胎动,母体可感知"
},
{
label
:
"孕15周"
,
desc
:
"胎儿皮下脂肪开始形成,体型增大"
},
{
label
:
"孕16周"
,
desc
:
"胎儿听力开始发育,对声音敏感"
},
{
label
:
"孕17周"
,
desc
:
"胎儿免疫系统开始发育,产生抗体"
},
{
label
:
"孕18周"
,
desc
:
"胎儿睡眠周期形成,活动规律"
},
{
label
:
"孕19周"
,
desc
:
"胎儿肺部发育,为呼吸做准备"
},
{
label
:
"孕20周"
,
desc
:
"胎儿听力继续发育,对外界声音反应"
},
{
label
:
"孕21周"
,
desc
:
"胎儿眉毛睫毛生长,面部特征明显"
},
{
label
:
"孕22周"
,
desc
:
"胎儿皮肤变厚,开始长出胎毛"
},
{
label
:
"孕23周"
,
desc
:
"胎儿体重快速增长,运动更频繁"
},
{
label
:
"孕24周"
,
desc
:
"胎儿肺部继续发育,产生肺表面活性物质"
},
{
label
:
"孕25周"
,
desc
:
"胎儿脂肪积累加快,体型继续增大"
},
{
label
:
"孕26周"
,
desc
:
"胎儿眼睛可以睁开,对光有反应"
},
{
label
:
"孕27周"
,
desc
:
"胎儿大脑快速发育,神经系统成熟"
},
{
label
:
"孕28周"
,
desc
:
"胎儿各器官功能逐渐完善"
},
{
label
:
"孕29周"
,
desc
:
"胎儿骨骼继续钙化,头部下降"
},
{
label
:
"孕30周"
,
desc
:
"胎儿体重持续增加,活动空间减少"
},
{
label
:
"孕31周"
,
desc
:
"胎儿消化系统发育成熟,可消化羊水"
},
{
label
:
"孕32周"
,
desc
:
"胎儿皮下脂肪继续积累,体温调节能力增强"
},
{
label
:
"孕33周"
,
desc
:
"胎儿免疫系统继续发育,获得母体抗体"
},
{
label
:
"孕34周"
,
desc
:
"胎儿肺部发育接近成熟,准备独立呼吸"
},
{
label
:
"孕35周"
,
desc
:
"胎儿体重快速增加,为出生做准备"
},
{
label
:
"孕36周"
,
desc
:
"胎儿头部继续下降,为分娩做准备"
},
{
label
:
"孕37周"
,
desc
:
"胎儿各器官发育完善,可以安全出生"
},
{
label
:
"孕38周"
,
desc
:
"胎儿继续增重,准备出生"
},
{
label
:
"孕39周"
,
desc
:
"胎儿位置固定,随时可能出生"
},
{
label
:
"孕40周"
,
desc
:
"胎儿发育完全成熟,即将出生"
},
],
};
pages/index/index.vue
View file @
250f1c9c
<
template
>
<
template
>
<view
class=
"container"
>
<view
class=
"container"
>
<Home
v-if=
"curTabIndex == 0"
></Home>
<Home
v-if=
"
globalStore.
curTabIndex == 0"
></Home>
<Brand
v-if=
"curTabIndex == 1"
></Brand>
<Brand
v-if=
"
globalStore.
curTabIndex == 1"
></Brand>
<Integral
v-if=
"curTabIndex == 2"
></Integral>
<Integral
v-if=
"
globalStore.
curTabIndex == 2"
></Integral>
<My
v-if=
"curTabIndex == 3"
></My>
<My
v-if=
"
globalStore.
curTabIndex == 3"
></My>
<TabBar
:curTabIndex=
"curTabIndex"
@
tabClick=
"handleTabClick"
/>
<TabBar
:curTabIndex=
"
globalStore.
curTabIndex"
@
tabClick=
"handleTabClick"
/>
</view>
</view>
</
template
>
</
template
>
...
@@ -14,14 +14,36 @@
...
@@ -14,14 +14,36 @@
import
Brand
from
'@/views/Brand.vue'
;
import
Brand
from
'@/views/Brand.vue'
;
import
Integral
from
'@/views/Integral.vue'
;
import
Integral
from
'@/views/Integral.vue'
;
import
My
from
'@/views/My.vue'
;
import
My
from
'@/views/My.vue'
;
import
{
useGlobalStore
}
from
'@/stores/global.js'
;
export
default
{
export
default
{
data
()
{
setup
()
{
const
globalStore
=
useGlobalStore
();
return
{
return
{
curTabIndex
:
0
,
globalStore
};
}
},
onLoad
(
options
)
{
// 如果有页面参数,设置对应的tab页
if
(
options
.
pageType
)
{
switch
(
options
.
pageType
)
{
case
'home'
:
this
.
globalStore
.
setCurTabIndex
(
0
)
break
;
case
'brand'
:
this
.
globalStore
.
setCurTabIndex
(
1
)
break
;
case
'integral'
:
this
.
globalStore
.
setCurTabIndex
(
2
)
break
;
case
'my'
:
this
.
globalStore
.
setCurTabIndex
(
3
)
break
;
}
}
},
},
onLoad
()
{},
methods
:
{
methods
:
{
handleTabClick
({
handleTabClick
({
index
,
index
,
...
@@ -29,7 +51,7 @@
...
@@ -29,7 +51,7 @@
})
{
})
{
console
.
log
(
'Tab clicked:'
,
index
,
item
)
console
.
log
(
'Tab clicked:'
,
index
,
item
)
// 这里可以根据index或item进行相应的页面跳转或其他操作
// 这里可以根据index或item进行相应的页面跳转或其他操作
this
.
curTabIndex
=
index
this
.
globalStore
.
setCurTabIndex
(
index
)
}
}
},
},
components
:
{
components
:
{
...
...
pages/person/person.vue
View file @
250f1c9c
...
@@ -292,16 +292,17 @@ watch(
...
@@ -292,16 +292,17 @@ watch(
);
);
const
pageCfgStore
=
usePageCfgStore
();
const
pageCfgStore
=
usePageCfgStore
();
// 内容偏好选项
// 直接取store中的配置项(非响应式),后续store变化不会自动更新
const
contentLikeOptions
=
ref
([]);
const
contentLikeOptions
=
pageCfgStore
.
conetntCfg
.
contentLikeOptions
;
// 产品偏好选项
const
productLikeOptions
=
pageCfgStore
.
conetntCfg
.
productLikeOptions
;
const
productLikeOptions
=
ref
([]);
const
specialAttentionOptions
=
pageCfgStore
.
conetntCfg
.
specialAttentionOptions
;
// 特别关注选项
const
channelOptions
=
pageCfgStore
.
conetntCfg
.
channelOptions
;
const
specialAttentionOptions
=
ref
([]);
// 购买渠道选项
console
.
log
(
"contentLikeOptions"
,
contentLikeOptions
);
const
channelOptions
=
ref
([]);
const
formItems
=
[
// 表单项配置
const
formItems
=
[
{
{
label
:
"当前状态"
,
label
:
"当前状态"
,
name
:
"babyStage"
,
name
:
"babyStage"
,
...
@@ -377,7 +378,7 @@ const formItems = [
...
@@ -377,7 +378,7 @@ const formItems = [
required
:
false
,
required
:
false
,
placeholder
:
"未选择"
,
placeholder
:
"未选择"
,
type
:
"multi-picker"
,
type
:
"multi-picker"
,
range
:
contentLikeOptions
,
range
:
[]
,
mode
:
"custom"
,
mode
:
"custom"
,
},
},
{
{
...
@@ -386,7 +387,7 @@ const formItems = [
...
@@ -386,7 +387,7 @@ const formItems = [
required
:
false
,
required
:
false
,
placeholder
:
"未选择"
,
placeholder
:
"未选择"
,
type
:
"multi-picker"
,
type
:
"multi-picker"
,
range
:
productLikeOptions
,
range
:
[]
,
mode
:
"custom"
,
mode
:
"custom"
,
},
},
{
{
...
@@ -395,7 +396,7 @@ const formItems = [
...
@@ -395,7 +396,7 @@ const formItems = [
required
:
false
,
required
:
false
,
placeholder
:
"未选择"
,
placeholder
:
"未选择"
,
type
:
"multi-picker"
,
type
:
"multi-picker"
,
range
:
specialAttentionOptions
,
range
:
[]
,
mode
:
"custom"
,
mode
:
"custom"
,
},
},
{
{
...
@@ -404,7 +405,7 @@ const formItems = [
...
@@ -404,7 +405,7 @@ const formItems = [
required
:
false
,
required
:
false
,
placeholder
:
"未选择"
,
placeholder
:
"未选择"
,
type
:
"picker"
,
type
:
"picker"
,
range
:
channelOptions
,
range
:
[]
,
mode
:
"custom"
,
mode
:
"custom"
,
},
},
];
];
...
@@ -643,6 +644,33 @@ function handleMultiPickerCancel() {
...
@@ -643,6 +644,33 @@ function handleMultiPickerCancel() {
currentMultiPickerName
.
value
=
""
;
currentMultiPickerName
.
value
=
""
;
}
}
const
initData
=
()
=>
{
const
contentCfg
=
JSON
.
parse
(
JSON
.
stringify
(
pageCfgStore
.
contentCfg
));
console
.
log
(
"initData"
,
Array
.
isArray
(
contentCfg
.
contentLikeOptions
));
contentLikeOptions
.
value
=
contentCfg
.
contentLikeOptions
;
productLikeOptions
.
value
=
contentCfg
.
productLikeOptions
;
specialAttentionOptions
.
value
=
contentCfg
.
specialAttentionOptions
;
channelOptions
.
value
=
contentCfg
.
channelOptions
;
// 更新表单项的选项数据
formItems
.
forEach
(
item
=>
{
if
(
item
.
name
===
'contentPreference'
)
{
item
.
range
=
contentLikeOptions
.
value
;
}
else
if
(
item
.
name
===
'productPreference'
)
{
item
.
range
=
productLikeOptions
.
value
;
}
else
if
(
item
.
name
===
'followInfo'
)
{
item
.
range
=
specialAttentionOptions
.
value
;
}
else
if
(
item
.
name
===
'purchaseChannel'
)
{
item
.
range
=
channelOptions
.
value
;
}
});
};
onMounted
(()
=>
{
initData
();
});
onLoad
((
options
)
=>
{
onLoad
((
options
)
=>
{
pageType
.
value
=
options
.
type
||
"add"
;
pageType
.
value
=
options
.
type
||
"add"
;
babyId
.
value
=
options
.
id
||
""
;
babyId
.
value
=
options
.
id
||
""
;
...
...
pages/webview/webview.vue
View file @
250f1c9c
...
@@ -5,20 +5,27 @@
...
@@ -5,20 +5,27 @@
<
script
setup
>
<
script
setup
>
import
{
ref
}
from
"vue"
;
import
{
ref
}
from
"vue"
;
import
{
onLoad
}
from
"@dcloudio/uni-app"
;
import
{
onLoad
}
from
"@dcloudio/uni-app"
;
import
*
as
CFG
from
"@/cfg"
;
let
src
=
ref
(
""
);
let
src
=
ref
(
""
);
const
PRIVACY_URL
=
"https://secret.feihe.com/secret.html"
;
const
MEMBER_URL
=
"https://secret.feihe.com/index.html"
;
const
urlMap
=
{
PRIVACY_URL
,
MEMBER_URL
,
};
onLoad
((
options
)
=>
{
onLoad
((
options
)
=>
{
let
url
=
""
;
let
url
=
""
;
if
(
options
.
type
)
{
if
(
options
.
type
)
{
const
type
=
options
.
type
;
const
type
=
options
.
type
;
url
=
CFG
[
type
];
url
=
urlMap
[
type
];
}
else
{
}
else
{
url
=
decodeURIComponent
(
options
.
url
)
||
""
;
url
=
decodeURIComponent
(
options
.
url
)
||
""
;
}
}
src
.
value
=
url
;
src
.
value
=
url
;
});
});
</
script
>
</
script
>
\ No newline at end of file
stores/global.js
View file @
250f1c9c
import
{
import
{
defineStore
defineStore
}
from
'pinia'
;
}
from
'pinia'
;
const
cuk
=
uni
.
getStorageSync
(
'cuk'
)
const
cuk
=
uni
.
getStorageSync
(
'cuk'
)
export
const
useGlobalStore
=
defineStore
(
'global'
,
{
export
const
useGlobalStore
=
defineStore
(
'global'
,
{
state
:
()
=>
{
state
:
()
=>
{
return
{
return
{
cuk
:
cuk
,
// 用户登录后获取的凭证,调用接口时headers中携带
cuk
:
cuk
,
// 用户登录后获取的凭证,调用接口时headers中携带
curTabIndex
:
0
,
// 当前Tab索引
};
};
},
},
actions
:
{
actions
:
{
...
@@ -16,8 +17,15 @@ export const useGlobalStore = defineStore('global', {
...
@@ -16,8 +17,15 @@ export const useGlobalStore = defineStore('global', {
* @param {Object} cuk
* @param {Object} cuk
*/
*/
setCuk
(
cuk
)
{
setCuk
(
cuk
)
{
this
.
cuk
=
cuk
;
this
.
cuk
=
cuk
;
uni
.
setStorageSync
(
'cuk'
,
cuk
);
uni
.
setStorageSync
(
'cuk'
,
cuk
);
},
/**
* 设置当前Tab索引
* @param {number} index
*/
setCurTabIndex
(
index
)
{
this
.
curTabIndex
=
index
;
}
}
},
},
});
});
\ No newline at end of file
stores/pageCfg.js
View file @
250f1c9c
import
{
defineStore
}
from
"pinia"
;
import
{
defineStore
}
from
"pinia"
;
import
{
JumpType
}
from
"@/utils
"
;
import
{
myObj
}
from
"../mock/my
"
;
import
{
WHEEL_OPTIONS_YL
,
WHEEL_OPTIONS_YZ
}
from
"@/cfg
"
;
import
{
fetchUserJSON
}
from
"@/api/user
"
;
export
const
usePageCfgStore
=
defineStore
(
"pageCfg"
,
{
export
const
usePageCfgStore
=
defineStore
(
"pageCfg"
,
{
state
:
()
=>
{
state
:
()
=>
{
return
{
return
{
toolList
:
[
toolList
:
[],
{
wheelOptionsYL
:
[],
icon
:
"my/literature.png"
,
wheelOptionsYZ
:
[],
title
:
"育儿百科"
,
contentCfg
:
{
url
:
"https://secret.feihe.com/secret.html"
,
contentLikeOptions
:
[],
jumpType
:
JumpType
.
H5
,
productLikeOptions
:
[],
},
specialAttentionOptions
:
[],
{
channelOptions
:
[],
icon
:
"my/suyuan.png"
,
title
:
"产品溯源"
,
url
:
""
,
jumpType
:
JumpType
.
H5
,
},
{
icon
:
"my/book.png"
,
title
:
"奶娃宝典"
,
url
:
""
,
jumpType
:
JumpType
.
INNER
,
},
{
icon
:
"my/doctor.png"
,
title
:
"医生问诊"
,
url
:
""
,
jumpType
:
JumpType
.
MINI
,
checkRegister
:
true
,
},
{
icon
:
"my/babytest.png"
,
title
:
"宝宝体质测试"
,
url
:
""
,
jumpType
:
JumpType
.
H5
,
},
],
conetntCfg
:
{
wheelOptionsYL
:
WHEEL_OPTIONS_YL
||
[],
wheelOptionsYZ
:
WHEEL_OPTIONS_YZ
||
[],
contentLikeOptions
:
[
"奶粉选择"
,
"奶粉成分"
,
"奶粉冲泡"
,
"宝宝奶量"
,
"生长发育"
,
"常见疾病"
,
"体检疫苗"
,
"饮食营养补充"
,
"辅食营养"
,
"亲子关系"
,
"早教游戏"
,
],
productLikeOptions
:
[
"飞鹤星飞帆"
,
"星飞帆卓睿"
,
"星飞帆卓耀"
,
"星飞帆卓初"
,
"星飞帆臻稚卓蓓"
,
"星飞帆淳芮有机"
,
],
specialAttentionOptions
:
[
"过敏"
,
"长肉"
,
"肠道"
,
"消化"
,
"脑发育"
],
channelOptions
:
[
"电商(京东/天猫)"
,
"母婴店"
],
},
},
};
};
},
},
actions
:
{
actions
:
{
/**
async
fetchCfg
()
{
* 设置用户cuk
const
{
data
}
=
await
fetchUserJSON
();
* @param {Object} cuk
*/
if
(
!
data
)
return
;
setCuk
(
cuk
)
{
this
.
cuk
=
cuk
;
this
.
toolList
=
data
.
toolList
;
uni
.
setStorageSync
(
"cuk"
,
cuk
);
this
.
contentCfg
=
data
.
contentCfg
;
this
.
wheelOptionsYL
=
data
.
wheelOptionsYL
;
this
.
wheelOptionsYZ
=
data
.
wheelOptionsYZ
;
},
},
},
},
});
});
views/My.vue
View file @
250f1c9c
...
@@ -128,11 +128,11 @@
...
@@ -128,11 +128,11 @@
>
>
<image
<image
class=
"tool-icon"
class=
"tool-icon"
:src=
"$baseUrl + item.
icon
"
:src=
"$baseUrl + item.
bgUrl
"
mode=
"aspectFit"
mode=
"aspectFit"
/>
/>
<button
<button
v-if=
"item.
checkRegister
&& !cfgStatus.isRegister"
v-if=
"item.
title == '医生问诊'
&& !cfgStatus.isRegister"
class=
"tool-btn-register"
class=
"tool-btn-register"
type=
"primary"
type=
"primary"
open-type=
"getPhoneNumber"
open-type=
"getPhoneNumber"
...
@@ -161,6 +161,8 @@ import { useUserStore } from "@/stores/user";
...
@@ -161,6 +161,8 @@ import { useUserStore } from "@/stores/user";
import
{
usePageCfgStore
}
from
"@/stores/pageCfg"
;
import
{
usePageCfgStore
}
from
"@/stores/pageCfg"
;
import
{
jump
,
JumpType
}
from
"@/utils"
;
import
{
jump
,
JumpType
}
from
"@/utils"
;
import
{
getHealthField
}
from
"@/api/common"
;
import
{
getHealthField
}
from
"@/api/common"
;
import
{
hideLoading
,
showLoading
}
from
"../utils"
;
const
{
proxy
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
const
$baseUrl
=
proxy
.
$baseUrl
;
const
$baseUrl
=
proxy
.
$baseUrl
;
...
@@ -176,7 +178,7 @@ const cfgStatus = ref({
...
@@ -176,7 +178,7 @@ const cfgStatus = ref({
const
wheelOptions
=
ref
([]);
const
wheelOptions
=
ref
([]);
const
wheelSelectedIndex
=
ref
(
0
);
const
wheelSelectedIndex
=
ref
(
0
);
const
toolList
=
computed
(()
=>
pageCfgStore
?.
toolList
);
const
toolList
=
computed
(()
=>
pageCfgStore
?.
toolList
||
[]
);
const
babyInfo
=
computed
(()
=>
userStore
?.
babyInfo
||
{});
const
babyInfo
=
computed
(()
=>
userStore
?.
babyInfo
||
{});
...
@@ -242,7 +244,7 @@ const handleToolClick = async (item) => {
...
@@ -242,7 +244,7 @@ const handleToolClick = async (item) => {
},
},
});
});
}
else
{
}
else
{
jump
({
type
:
item
.
jumpType
,
url
:
item
.
url
});
jump
({
type
:
item
.
link
.
type
,
url
:
item
.
link
.
url
});
}
}
};
};
...
@@ -289,8 +291,8 @@ const initData = async () => {
...
@@ -289,8 +291,8 @@ const initData = async () => {
if
(
__showDetail
)
{
if
(
__showDetail
)
{
wheelOptions
.
value
=
wheelOptions
.
value
=
babyInfo
.
value
.
babyStage
==
2
babyInfo
.
value
.
babyStage
==
2
?
pageCfgStore
.
conetntCfg
.
wheelOptionsYL
?
pageCfgStore
.
wheelOptionsYL
:
pageCfgStore
.
conetntCfg
.
wheelOptionsYZ
;
:
pageCfgStore
.
wheelOptionsYZ
;
const
index
=
wheelOptions
.
value
.
findIndex
(
const
index
=
wheelOptions
.
value
.
findIndex
(
(
item
)
=>
item
.
label
==
babyInfo
.
value
.
babyAge
(
item
)
=>
item
.
label
==
babyInfo
.
value
.
babyAge
);
);
...
@@ -336,8 +338,11 @@ function onAddBaby() {
...
@@ -336,8 +338,11 @@ function onAddBaby() {
}
}
// 页面加载
// 页面加载
onMounted
(()
=>
{
onMounted
(
async
()
=>
{
console
.
log
(
"onMounted"
);
console
.
log
(
"onMounted"
);
showLoading
();
await
pageCfgStore
.
fetchCfg
();
hideLoading
();
initData
();
initData
();
});
});
...
...
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