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
9ec944e3
Commit
9ec944e3
authored
Jun 30, 2025
by
jtwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
取名功能验收优化
parent
7cf40d06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
10 deletions
+49
-10
naming.vue
pages/naming/naming.vue
+49
-10
No files found.
pages/naming/naming.vue
View file @
9ec944e3
...
...
@@ -164,8 +164,8 @@
<view
class=
"shall_be_word"
>
<view
class=
"item_top"
>
<span
class=
"title_txt"
>
必有字
</span>
<input
class=
"shall_be_input"
placeholder=
"多、浩、雨
"
v-model=
"requiredChars"
@
blur=
"e => enforceSeparator(e, 1)"
/>
<input
class=
"shall_be_input"
:placeholder=
"showPlaceholder?'示例:多、浩、雨':''
"
v-model=
"requiredChars"
@
blur=
"e => enforceSeparator(e, 1)"
@
focus=
"showPlaceholder=false"
/>
</view>
<view
class=
"item_line"
></view>
</view>
...
...
@@ -174,8 +174,8 @@
<view
class=
"taboo_word"
>
<view
class=
"item_top"
>
<span
class=
"title_txt"
>
避讳字
</span>
<input
class=
"taboo_input"
placeholder=
"然、萌
"
v-model=
"avoidChars"
@
blur=
"e => enforceSeparator(e, 2)"
/>
<input
class=
"taboo_input"
:placeholder=
"showPlaceholder2?'示例:然、萌':''
"
v-model=
"avoidChars"
@
blur=
"e => enforceSeparator(e, 2)"
@
focus=
"showPlaceholder2=false"
/>
</view>
<view
class=
"item_line"
></view>
</view>
...
...
@@ -277,9 +277,11 @@
// 性别选择
const
gender
=
ref
(
''
);
// 字数要求
const
wordCount
=
ref
(
''
);
const
wordCount
=
ref
(
''
);
const
showPlaceholder
=
ref
(
true
);
//必有字
const
requiredChars
=
ref
(
''
);
const
requiredChars
=
ref
(
''
);
const
showPlaceholder2
=
ref
(
true
);
//避讳字
const
avoidChars
=
ref
(
''
);
//期望风格
...
...
@@ -400,9 +402,11 @@
text
=
text
.
replace
(
/、/g
,
''
)
// 2. 在每个字符后插入分隔符(最后一个字符除外)
const
formatted
=
[...
text
].
join
(
'、'
)
if
(
idx
==
1
)
{
if
(
idx
==
1
)
{
showPlaceholder
.
value
=
true
;
// 获取焦点时隐藏占位符
requiredChars
.
value
=
formatted
.
slice
(
0
,
5
)
}
else
if
(
idx
==
2
)
{
}
else
if
(
idx
==
2
)
{
showPlaceholder2
.
value
=
true
;
// 获取焦点时隐藏占位符
avoidChars
.
value
=
formatted
.
slice
(
0
,
5
)
}
}
...
...
@@ -420,12 +424,47 @@
expectedStyle
:
expectedStyle
.
value
}
// console.log('开始取名::', param)
if
(
!
param
.
birthStatus
||
!
param
.
birthTime
||
!
param
.
surname
||
!
param
.
gender
||
!
param
.
wordCount
)
{
// if (!param.birthStatus || !param.birthTime || !param.surname || !param.gender || !param.wordCount) {
// uni.showToast({
// title: '还有信息没填写哦',
// icon: 'none'
// })
// return;
// }
if
(
!
param
.
birthStatus
)
{
uni
.
showToast
({
title
:
'
还有信息没填写哦
'
,
title
:
'
请选择出生状态
'
,
icon
:
'none'
})
return
;
}
if
(
!
param
.
birthTime
){
uni
.
showToast
({
title
:
'请选择出生时间'
,
icon
:
'none'
})
return
;
}
if
(
!
param
.
surname
){
uni
.
showToast
({
title
:
'请输入姓氏'
,
icon
:
'none'
})
return
;
}
if
(
!
param
.
gender
){
uni
.
showToast
({
title
:
'请选择性别'
,
icon
:
'none'
})
return
;
}
if
(
!
param
.
wordCount
){
uni
.
showToast
({
title
:
'请选择数字要求'
,
icon
:
'none'
})
return
;
}
//验证通过,调接口
...
...
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