Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
web-ci-test
Commits
6c721b77
提交
6c721b77
authored
5月 31, 2023
作者:
翁进城
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/caoyun'
上级
0ea9cb69
d1600848
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
83 行增加
和
14 行删除
+83
-14
index.tsx
components/NavHeader/publishModal/index.tsx
+5
-1
hooks.ts
lib/hooks.ts
+2
-2
validateUtils.ts
lib/validateUtils.ts
+43
-0
index.page.tsx
pages/flyingHandService/index.page.tsx
+9
-5
styled.tsx
pages/flyingHandService/styled.tsx
+1
-0
index.tsx
pages/home/waterfallFlowBody/components/map/index.tsx
+6
-1
index.page.tsx
...lFlowBody/components/map/moreServicePoints/index.page.tsx
+16
-5
type.d.ts
typings/type.d.ts
+1
-0
没有找到文件。
components/NavHeader/publishModal/index.tsx
浏览文件 @
6c721b77
...
...
@@ -4,6 +4,7 @@ import { CommonContext } from "~/lib/commonProvider";
import
{
useGeolocation
}
from
"~/lib/hooks"
;
import
api
,
{
PublishParams
,
TypeResp
}
from
"./api"
;
import
styles
from
"./index.module.scss"
;
import
{
phoneNumber
}
from
'~/lib/validateUtils'
type
Props
=
{
open
?:
boolean
;
...
...
@@ -84,7 +85,10 @@ export default function PublishModal(props: Props) {
name=
"publishPhone"
rules=
{
[{
required
:
true
,
message
:
"请输入手机号!"
}]
}
>
<
Input
placeholder=
"输入手机号"
></
Input
>
<
Input
onInput=
{
phoneNumber
}
maxLength=
{
11
}
allowClear
placeholder=
"输入手机号"
></
Input
>
</
Form
.
Item
>
<
Form
.
Item
label=
"需求类型"
...
...
lib/hooks.ts
浏览文件 @
6c721b77
...
...
@@ -9,10 +9,10 @@ export function useGeolocation() {
useEffect
(()
=>
{
const
AMapLoader
=
require
(
"@amap/amap-jsapi-loader"
);
window
.
_AMapSecurityConfig
=
{
securityJsCode
:
'
b00440e4bf3989bb2481297acaa05908
'
,
securityJsCode
:
'
d7492300c43c8d3737909b77f2b2c387
'
,
}
AMapLoader
.
load
({
key
:
"8
26769d41d66ebd005ffa0b3e001378
1"
,
// 申请好的Web端开发者Key,首次调用 load 时必填
key
:
"8
7b424e68754efc3ba9d11ae0747509
1"
,
// 申请好的Web端开发者Key,首次调用 load 时必填
version
:
"2.0"
,
// 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
plugins
:
[
'AMap.Geolocation'
,
"AMap.Geocoder"
],
// 需要使用的的插件列表,如比例尺'AMap.Scale'等
})
...
...
lib/validateUtils.ts
0 → 100644
浏览文件 @
6c721b77
// 不能输入数字,其他可惜输入
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
浏览文件 @
6c721b77
...
...
@@ -8,6 +8,7 @@ import ContentBox from "~/components/contentBox";
import
api
,
{
Flying
,
SkillsType
,
RegionResp
}
from
"./api"
;
import
{
useRouter
}
from
"next/router"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
import
{
phoneNumber
}
from
'~/lib/validateUtils'
interface
FilterInfoParams
{
regionId
?:
number
;
flightSkillsId
?:
number
;
...
...
@@ -43,13 +44,13 @@ export default function FlyingHandService() {
className=
"item"
key=
{
item
.
id
}
onClick=
{
()
=>
{
router
.
push
({
userInfo
?
router
.
push
({
pathname
:
`/flyingHandService/detail/${item.id}`
,
query
:
{
videoUrl
:
item
.
videoUrl
,
curriculumName
:
item
.
curriculumName
},
})
})
:
setNeedLogin
(
true
)
}
}
>
<
div
className=
"item-top"
>
...
...
@@ -239,7 +240,10 @@ export default function FlyingHandService() {
.
then
(
async
(
values
)
=>
{
setLoading
(
true
);
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"
)
{
setLoading
(
false
);
setIsModalOpen
(
false
);
...
...
@@ -326,7 +330,7 @@ export default function FlyingHandService() {
<
Button
type=
"primary"
className=
"btn"
onClick=
{
()
=>
userInfo
?
setIsModalOpen
(
true
)
:
setNeedLogin
(
true
)
}
onClick=
{
()
=>
userInfo
?
setIsModalOpen
(
true
)
:
setNeedLogin
(
true
)
}
>
报名学习课程
</
Button
>
...
...
@@ -363,7 +367,7 @@ export default function FlyingHandService() {
<
Input
placeholder=
"姓名"
/>
</
Form
.
Item
>
<
Form
.
Item
style=
{
{
flex
:
1
}
}
name=
"telephone"
rules=
{
[{
required
:
true
,
message
:
'请输入手机号!'
}]
}
>
<
Input
placeholder=
"手机号"
/>
<
Input
onInput=
{
phoneNumber
}
allowClear
maxLength=
{
11
}
placeholder=
"手机号"
/>
</
Form
.
Item
>
</
div
>
<
Form
.
Item
...
...
pages/flyingHandService/styled.tsx
浏览文件 @
6c721b77
...
...
@@ -54,6 +54,7 @@ export const Box = styled.div`
position: relative;
}
&-bottom {
width: 220px;
padding: 9px 12px 12px;
border-radius: 0px 0px 6px 6px;
background-color: #fff;
...
...
pages/home/waterfallFlowBody/components/map/index.tsx
浏览文件 @
6c721b77
...
...
@@ -95,6 +95,8 @@ export default function MapComponent() {
});
if
(
markerList
.
length
)
MAP
?.
add
(
markerList
);
setMarkerCol
([...
markerList
]);
}
//自适应显示多个点位
MAP
?.
setFitView
();
}
const
showFlyerBitmap
=
async
(
index
:
number
,
data
?:
UserInfoType
,
pageSize
?:
number
)
=>
{
const
res
=
await
api
.
listFlyerBitmap
({
...
...
@@ -112,6 +114,8 @@ export default function MapComponent() {
});
if
(
markerList
.
length
)
MAP
?.
add
(
markerList
);
setMarkerCol
(
markerList
)
}
//自适应显示多个点位
MAP
?.
setFitView
();
}
const
showUavBitmap
=
async
(
index
:
number
,
data
?:
UserInfoType
)
=>
{
const
res
=
await
api
.
listUavBitmap
({
...
...
@@ -129,11 +133,12 @@ export default function MapComponent() {
});
if
(
markerList
.
length
)
MAP
?.
add
(
markerList
);
setMarkerCol
(
markerList
)
}
//自适应显示多个点位
MAP
?.
setFitView
();
}
//添加点位
const
mapEntiy
=
async
(
index
:
number
,
data
?:
UserInfoType
)
=>
{
MAP
?.
remove
(
markerCol
);
if
(
index
===
0
)
{
showPositioningInfo
(
index
,
data
)
}
else
if
(
index
===
1
)
{
...
...
pages/home/waterfallFlowBody/components/map/moreServicePoints/index.page.tsx
浏览文件 @
6c721b77
...
...
@@ -102,6 +102,8 @@ export default function MoreServicePoints() {
if
(
markerList
.
length
)
MAP
?.
add
(
markerList
);
setMarkerCol
([...
markerList
]);
}
//自适应显示多个点位
MAP
?.
setFitView
();
};
const
showFlyerBitmap
=
async
(
index
:
number
,
...
...
@@ -125,6 +127,8 @@ export default function MoreServicePoints() {
if
(
markerList
.
length
)
MAP
?.
add
(
markerList
);
setMarkerCol
(
markerList
);
}
//自适应显示多个点位
MAP
?.
setFitView
();
};
const
showUavBitmap
=
async
(
index
:
number
,
data
?:
UserInfoType
)
=>
{
const
res
=
await
api
.
listUavBitmap
({
...
...
@@ -144,6 +148,8 @@ export default function MoreServicePoints() {
if
(
markerList
.
length
)
MAP
?.
add
(
markerList
);
setMarkerCol
(
markerList
);
}
//自适应显示多个点位
MAP
?.
setFitView
();
};
//添加点位
const
mapEntiy
=
async
(
index
:
number
,
data
?:
UserInfoType
)
=>
{
...
...
@@ -180,9 +186,14 @@ export default function MoreServicePoints() {
return
marker
;
};
const
moveTo
=
(
item
:
any
)
=>
{
console
.
log
(
markerCol
);
const
moveTo
=
(
item
:
any
,
index
:
number
)
=>
{
// const p = markerCol[index].getPosition()
// var infoWindow = new Amap.InfoWindow({
// position: p,
// offset: new Amap.Pixel(20, -10),
// content: item.dizhi
// });
// infoWindow.open(MAP);
if
(
item
.
dizhi
)
{
return
MAP
?.
setCenter
([
item
.
jd
,
item
.
wd
]);
}
else
if
(
item
.
flyerName
||
item
.
uavName
)
{
...
...
@@ -231,10 +242,10 @@ export default function MoreServicePoints() {
<
div
className=
"left"
>
<
div
className=
"left-title"
>
服务网点
</
div
>
<
div
className=
"left-content"
>
{
servicePoints
.
map
((
item
:
any
)
=>
(
{
servicePoints
.
map
((
item
:
any
,
index
:
number
)
=>
(
<
div
key=
{
item
.
id
}
onClick=
{
()
=>
moveTo
(
item
)
}
onClick=
{
()
=>
moveTo
(
item
,
index
)
}
className=
"left-content-item"
title=
{
item
.
dizhi
||
item
.
flyerName
||
item
.
uavName
}
>
...
...
typings/type.d.ts
浏览文件 @
6c721b77
...
...
@@ -5,5 +5,6 @@ declare global {
messageApi
:
MessageInstance
;
//全局消息提示api
WxLogin
:
any
;
//微信登录对象
_AMapSecurityConfig
:
{
securityJsCode
:
string
};
//高德地图api密钥配置
AMap
:
any
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论