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
0dea122a
Commit
0dea122a
authored
Aug 08, 2025
by
weishengfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(person): 动态修改宝宝出生日期/预产日期
- 新增 getlabelFn 函数,根据宝宝阶段动态修改表单标签 - 优化宝宝出生日期/预产日期的显示逻辑 - 移除多余的控制台日志输出
parent
9ab4906c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
person.vue
pages/person/person.vue
+12
-3
No files found.
pages/person/person.vue
View file @
0dea122a
...
...
@@ -82,7 +82,8 @@
}"
>
<text
class=
"form-label"
>
{{
item
.
label
}}
{{
getlabelFn
(
item
)
}}
<!--
{{
item
.
label
}}
-->
<text
v-if=
"item.required"
class=
"required"
>
*
</text>
</text>
<!-- 输入框类型 -->
...
...
@@ -673,7 +674,15 @@ function onDateStatusChange(status) {
}
return
true
;
}
const
getlabelFn
=
(
item
)
=>
{
console
.
log
(
formData
.
value
,
item
,
'66666666666666666666666666'
)
if
(
item
.
name
===
"babyBirthday"
)
{
item
.
label
=
formData
.
value
.
babyStage
==
1
?
'预产日期'
:
'宝宝出生日期'
}
return
item
.
label
}
// getLabelByValue 支持所有映射字段
const
getLabelByValue
=
(
item
,
value
)
=>
{
...
...
@@ -692,7 +701,7 @@ const getLabelByValue = (item, value) => {
// // 添加根据切换状态修改文案
if
(
item
.
name
===
"babyBirthday"
)
{
console
.
log
(
"🚀 ~ getLabelByValue ~ formData:"
,
formData
.
value
,
item
)
//
console.log("🚀 ~ getLabelByValue ~ formData:", formData.value, item)
item
.
placeholder
=
formData
.
value
.
babyBirthday
?
formData
.
value
.
babyBirthday
:
formData
.
value
.
babyStage
==
1
?
'请选择预产日期'
:
'请选择出生日期'
return
item
.
placeholder
}
...
...
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