Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
3ff1f62f
提交
3ff1f62f
authored
5月 30, 2023
作者:
18928357778
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
改-飞手培训-自适应样式修改
改-飞手培训-报名学习课程-手机号验证,城市数据提交为最后一级
上级
dad69e86
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
55 行增加
和
3 行删除
+55
-3
index.tsx
components/NavHeader/publishModal/index.tsx
+5
-1
validateUtils.ts
lib/validateUtils.ts
+43
-0
index.page.tsx
pages/flyingHandService/index.page.tsx
+6
-2
styled.tsx
pages/flyingHandService/styled.tsx
+1
-0
没有找到文件。
components/NavHeader/publishModal/index.tsx
浏览文件 @
3ff1f62f
...
@@ -3,6 +3,7 @@ import { useEffect, useState } from "react";
...
@@ -3,6 +3,7 @@ import { useEffect, useState } from "react";
import
{
useGeolocation
}
from
"~/lib/hooks"
;
import
{
useGeolocation
}
from
"~/lib/hooks"
;
import
api
,
{
PublishParams
,
TypeResp
}
from
"./api"
;
import
api
,
{
PublishParams
,
TypeResp
}
from
"./api"
;
import
styles
from
"./index.module.scss"
;
import
styles
from
"./index.module.scss"
;
import
{
phoneNumber
}
from
'~/lib/validateUtils'
type
Props
=
{
type
Props
=
{
open
?:
boolean
;
open
?:
boolean
;
...
@@ -80,7 +81,10 @@ export default function PublishModal(props: Props) {
...
@@ -80,7 +81,10 @@ export default function PublishModal(props: Props) {
name=
"publishPhone"
name=
"publishPhone"
rules=
{
[{
required
:
true
,
message
:
"请输入手机号!"
}]
}
rules=
{
[{
required
:
true
,
message
:
"请输入手机号!"
}]
}
>
>
<
Input
placeholder=
"输入手机号"
></
Input
>
<
Input
onInput=
{
phoneNumber
}
maxLength=
{
11
}
allowClear
placeholder=
"输入手机号"
></
Input
>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
label=
"需求类型"
label=
"需求类型"
...
...
lib/validateUtils.ts
0 → 100644
浏览文件 @
3ff1f62f
// 不能输入数字,其他可惜输入
export
const
exceptNumber
=
(
val
:
any
)
=>
{
val
.
target
.
value
=
val
.
target
.
value
.
replace
(
/1
?(\d
|
([
1-9
]\d
+
))(
.
\d
+
)?
$/g
,
""
)
.
replace
(
/
\s
/g
,
""
);
};
// 只能输入正整数
export
const
onlyNumberPositive
=
(
val
:
any
)
=>
{
// eslint-disable-next-line eqeqeq
if
(
val
.
target
.
value
==
0
)
{
val
.
target
.
value
=
val
.
target
.
value
.
replace
(
/0/g
,
""
);
}
val
.
target
.
value
=
val
.
target
.
value
.
replace
(
/
\D
/g
,
""
);
};
// 不能输入汉字,其他可输入
export
const
exceptChinese
=
(
val
:
any
)
=>
{
val
.
target
.
value
=
val
.
target
.
value
.
replace
(
/
[\u
4E00-
\u
9FA5
]
|
[\u
FE30-
\u
FFA0
]
/g
,
""
)
.
replace
(
/
\s
/g
,
""
);
};
// 只能输入字母和中文,不能输入数字和符号
export
const
onlyCharacter
=
(
val
:
any
)
=>
{
val
.
target
.
value
=
val
.
target
.
value
.
replace
(
/
[^
a-zA-Z
\u
4E00-
\u
9FA5
]
/g
,
""
)
.
replace
(
/
\s
/g
,
""
);
};
// 手机号输入,限制11位
export
const
phoneNumber
=
(
val
:
any
)
=>
{
if
(
val
.
target
.
value
.
length
>
11
)
{
val
.
target
.
value
=
val
.
target
.
value
.
slice
(
0
,
11
);
}
else
{
val
.
target
.
value
=
val
.
target
.
value
.
replace
(
/
\D
/g
,
""
);
}
};
// 开头不能输入空格
export
const
noSpaceFront
=
(
val
:
any
)
=>
{
val
.
target
.
value
=
val
.
target
.
value
.
replace
(
/^
\s
/g
,
""
);
};
pages/flyingHandService/index.page.tsx
浏览文件 @
3ff1f62f
...
@@ -8,6 +8,7 @@ import ContentBox from "~/components/contentBox";
...
@@ -8,6 +8,7 @@ import ContentBox from "~/components/contentBox";
import
api
,
{
Flying
,
SkillsType
,
RegionResp
}
from
"./api"
;
import
api
,
{
Flying
,
SkillsType
,
RegionResp
}
from
"./api"
;
import
{
useRouter
}
from
"next/router"
;
import
{
useRouter
}
from
"next/router"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
import
{
phoneNumber
}
from
'~/lib/validateUtils'
interface
FilterInfoParams
{
interface
FilterInfoParams
{
regionId
?:
number
;
regionId
?:
number
;
flightSkillsId
?:
number
;
flightSkillsId
?:
number
;
...
@@ -239,7 +240,10 @@ export default function FlyingHandService() {
...
@@ -239,7 +240,10 @@ export default function FlyingHandService() {
.
then
(
async
(
values
)
=>
{
.
then
(
async
(
values
)
=>
{
setLoading
(
true
);
setLoading
(
true
);
try
{
try
{
const
res
=
await
api
.
PilotRegistrations
(
values
)
const
res
=
await
api
.
PilotRegistrations
({
...
values
,
city
:
values
.
city
[
values
.
city
.
length
-
1
]
||
null
})
if
(
res
.
code
===
"200"
)
{
if
(
res
.
code
===
"200"
)
{
setLoading
(
false
);
setLoading
(
false
);
setIsModalOpen
(
false
);
setIsModalOpen
(
false
);
...
@@ -363,7 +367,7 @@ export default function FlyingHandService() {
...
@@ -363,7 +367,7 @@ export default function FlyingHandService() {
<
Input
placeholder=
"姓名"
/>
<
Input
placeholder=
"姓名"
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
style=
{
{
flex
:
1
}
}
name=
"telephone"
rules=
{
[{
required
:
true
,
message
:
'请输入手机号!'
}]
}
>
<
Form
.
Item
style=
{
{
flex
:
1
}
}
name=
"telephone"
rules=
{
[{
required
:
true
,
message
:
'请输入手机号!'
}]
}
>
<
Input
placeholder=
"手机号"
/>
<
Input
onInput=
{
phoneNumber
}
allowClear
maxLength=
{
11
}
placeholder=
"手机号"
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
div
>
</
div
>
<
Form
.
Item
<
Form
.
Item
...
...
pages/flyingHandService/styled.tsx
浏览文件 @
3ff1f62f
...
@@ -54,6 +54,7 @@ export const Box = styled.div`
...
@@ -54,6 +54,7 @@ export const Box = styled.div`
position: relative;
position: relative;
}
}
&-bottom {
&-bottom {
width: 220px;
padding: 9px 12px 12px;
padding: 9px 12px 12px;
border-radius: 0px 0px 6px 6px;
border-radius: 0px 0px 6px 6px;
background-color: #fff;
background-color: #fff;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论