Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new_taobao
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
new_taobao
Commits
71fc9f37
Commit
71fc9f37
authored
Oct 12, 2020
by
Edwise
🍷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
校验emoji
parent
68b47ae8
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24209 additions
and
4 deletions
+24209
-4
comcatname.js
taobao_mini/client/components/comcatname/comcatname.js
+9
-4
debug.log
taobao_mini/debug.log
+24200
-0
No files found.
taobao_mini/client/components/comcatname/comcatname.js
View file @
71fc9f37
...
...
@@ -62,7 +62,7 @@ Component({
/**随机名字,需要根据运营数据可配置 */
randomName
()
{
console
.
log
(
"随即名字"
)
let
index
=
Math
.
floor
(
Math
.
random
()
*
nameArr
.
length
)
let
index
=
Math
.
floor
(
Math
.
random
()
*
nameArr
.
length
)
let
name
=
nameArr
[
index
];
this
.
setData
({
catNameText
:
name
...
...
@@ -92,15 +92,20 @@ Component({
}
},
/**检测空格 */
isSqure
(
str
){
isSqure
(
str
)
{
var
regu
=
"^[ ]+$"
;
var
re
=
new
RegExp
(
regu
);
return
re
.
test
(
str
);
},
/**检测emoji */
haveEmoji
(
str
)
{
var
regRule
=
/
\u
D83C
[\u
DF00-
\u
DFFF
]
|
\u
D83D
[\u
DC00-
\u
DE4F
]
/g
;
return
str
.
match
(
regRule
)
},
/**确认领养 */
async
catNameSure
()
{
let
name
=
this
.
props
.
catName
;
if
(
this
.
isSqure
(
name
))
{
if
(
this
.
isSqure
(
name
)
||
this
.
haveEmoji
(
name
))
{
my
.
showToast
({
content
:
"您输入的昵称不可用"
,
});
...
...
@@ -116,7 +121,7 @@ Component({
my
.
showToast
({
content
:
"您输入的昵称不可用"
,
});
}
else
if
(
regEn
.
test
(
name
)
||
regCn
.
test
(
name
))
{
}
else
if
(
regEn
.
test
(
name
)
||
regCn
.
test
(
name
))
{
my
.
showToast
({
content
:
"您输入的昵称不可用"
,
});
...
...
taobao_mini/debug.log
View file @
71fc9f37
This diff is collapsed.
Click to expand it.
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