Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
9cda4ee5
提交
9cda4ee5
authored
5月 29, 2023
作者:
18928357778
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
ssh://git.mmcuav.cn:8222/root/sharefly-web-nextjs
into caoyun
上级
6350f629
e6f01a89
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
383 行增加
和
191 行删除
+383
-191
index.tsx
api/index.tsx
+43
-8
request.ts
api/request.ts
+24
-7
index.tsx
components/NavHeader/index.tsx
+59
-29
index.tsx
components/loginModal/index.tsx
+60
-12
hooks.ts
lib/hooks.ts
+14
-9
userProvider.tsx
lib/userProvider.tsx
+57
-0
next.config.js
next.config.js
+1
-0
index.page.tsx
pages/JoinPolicy/index.page.tsx
+1
-1
_app.page.tsx
pages/_app.page.tsx
+4
-1
index.page.tsx
pages/certification/index.page.tsx
+5
-2
index.tsx
...ervice/examination/components/brushQuestionZone/index.tsx
+93
-97
index.tsx
...yingHandService/examination/components/mockExam/index.tsx
+20
-23
index.page.tsx
...lFlowBody/components/map/moreServicePoints/index.page.tsx
+0
-0
index.tsx
pages/projectInfo/components/news/index.tsx
+2
-1
type.d.ts
typings/type.d.ts
+0
-1
没有找到文件。
api/index.tsx
浏览文件 @
9cda4ee5
...
@@ -8,11 +8,6 @@ export interface RegionResp {
...
@@ -8,11 +8,6 @@ export interface RegionResp {
name
:
string
;
name
:
string
;
pid
:
number
;
pid
:
number
;
}
}
export
interface
UserInfoParams
{
userAccountId
:
number
;
}
export
interface
UserInfoResp
{
export
interface
UserInfoResp
{
id
:
number
;
id
:
number
;
accountType
:
number
;
accountType
:
number
;
...
@@ -28,6 +23,17 @@ export interface UserInfoResp {
...
@@ -28,6 +23,17 @@ export interface UserInfoResp {
remark
:
string
;
remark
:
string
;
portType
:
number
;
portType
:
number
;
createTime
:
string
;
createTime
:
string
;
companyAuthStatus
:
number
;
token
:
string
;
}
export
interface
TestAppletLoginResp
{
userAccountId
:
number
;
token
:
string
;
uid
:
string
;
phoneNum
?:
string
;
nickName
:
string
;
sessionKey
?:
any
;
}
}
export
default
{
export
default
{
...
@@ -35,12 +41,41 @@ export default {
...
@@ -35,12 +41,41 @@ export default {
region
:
():
Promise
<
Response
<
Array
<
RegionResp
>>>
=>
{
region
:
():
Promise
<
Response
<
Array
<
RegionResp
>>>
=>
{
return
request
(
"/pms/webDevice/getSecondDistrictInfo"
);
return
request
(
"/pms/webDevice/getSecondDistrictInfo"
);
},
},
//测试-小程序unionId登录-注册
testAppletLogin
:
():
Promise
<
Response
<
TestAppletLoginResp
>>
=>
{
let
params
=
new
URLSearchParams
();
params
.
append
(
"unionId"
,
"oQZEd5hy0Qrwaj10BGtP8xq8vH--s88888"
);
return
request
(
"/userapp/auth/testAppletLogin"
,
"post"
,
{},
{
headers
:
{
"Content-Type"
:
"application/x-www-form-urlencoded"
,
},
body
:
params
,
}
);
},
//生成小程序码
getAppletQRCode
:
(
params
:
{
randomLoginCode
:
string
})
=>
{
return
request
(
"/userapp/wx/getAppletQRCode"
,
"get"
,
{
page
:
"page-identity/identity-empower/index"
,
scene
:
"randomLoginCode="
+
params
.
randomLoginCode
,
});
},
//查询登录信息
getLoginInfo
:
(
params
:
{
randomLoginCode
:
string
})
=>
{
return
request
(
"/userapp/temp-auth/getLoginInfo"
,
"get"
,
params
,
{
hideError
:
true
//隐藏错误提示
});
},
//获取用户基本信息
//获取用户基本信息
userInfo
:
(
params
:
UserInfoParams
):
Promise
<
Response
<
UserInfoResp
>>
=>
{
userInfo
:
():
Promise
<
Response
<
UserInfoResp
>>
=>
{
return
request
(
"/userapp/user-account/info"
,
"get"
,
params
,
{}
);
return
request
(
"/userapp/user-account/info"
,
"get"
);
},
},
//图片上传地址
//图片上传地址
imgOss
:
()
=>
{
imgOss
:
()
=>
{
return
config
.
baseUrl
+
"/pms/upload/imgOss"
;
return
config
.
baseUrl
+
"/pms/upload/imgOss"
;
}
}
,
};
};
api/request.ts
浏览文件 @
9cda4ee5
...
@@ -8,8 +8,14 @@ import config from './config';
...
@@ -8,8 +8,14 @@ import config from './config';
* @param options 额外参数
* @param options 额外参数
* @returns Promise<Response>
* @returns Promise<Response>
*/
*/
export
default
function
request
(
url
:
string
,
method
:
String
=
'get'
,
data
?:
any
,
options
=
{}):
Promise
<
Response
<
any
>>
{
export
default
function
request
(
url
:
string
,
method
:
String
=
'get'
,
data
?:
any
,
options
:
any
&
{
hideError
?:
boolean
,
headers
?:
{
token
?:
string
}
}
=
{}):
Promise
<
Response
<
any
>>
{
let
token
=
localStorage
.
getItem
(
'token'
)
||
''
;
options
=
{
headers
:
{
token
},
...
options
,
}
switch
(
method
.
toLowerCase
())
{
switch
(
method
.
toLowerCase
())
{
case
'get'
:
case
'get'
:
let
params
=
new
URLSearchParams
();
let
params
=
new
URLSearchParams
();
...
@@ -24,16 +30,22 @@ export default function request(url: string, method: String = 'get', data?: any,
...
@@ -24,16 +30,22 @@ export default function request(url: string, method: String = 'get', data?: any,
case
'post'
:
case
'post'
:
options
=
{
options
=
{
...
options
,
method
:
'POST'
,
method
:
'POST'
,
headers
:
{
headers
:
{
'Content-Type'
:
'application/json'
'Content-Type'
:
'application/json'
},
},
body
:
JSON
.
stringify
(
data
)
body
:
JSON
.
stringify
(
data
),
...
options
,
}
}
break
;
break
;
}
}
function
errMsg
(
msg
:
string
)
{
if
(
!
options
.
hideError
)
{
errMsg
(
msg
);
}
}
return
fetch
(
config
.
baseUrl
+
url
,
options
)
return
fetch
(
config
.
baseUrl
+
url
,
options
)
.
then
((
r
)
=>
{
.
then
((
r
)
=>
{
try
{
try
{
...
@@ -50,12 +62,12 @@ export default function request(url: string, method: String = 'get', data?: any,
...
@@ -50,12 +62,12 @@ export default function request(url: string, method: String = 'get', data?: any,
.
then
((
data
)
=>
{
.
then
((
data
)
=>
{
if
(
data
.
errors
)
{
if
(
data
.
errors
)
{
//全局消息提示
//全局消息提示
window
.
messageApi
.
error
(
'请求出错'
)
errMsg
(
'请求出错'
)
if
(
Array
.
isArray
(
data
.
errors
))
{
if
(
Array
.
isArray
(
data
.
errors
))
{
data
.
errors
.
forEach
((
item
:
any
)
=>
{
data
.
errors
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
defaultMessage
){
if
(
item
.
defaultMessage
)
{
window
.
messageApi
.
error
(
item
.
defaultMessage
)
errMsg
(
item
.
defaultMessage
)
}
}
})
})
}
}
...
@@ -66,6 +78,11 @@ export default function request(url: string, method: String = 'get', data?: any,
...
@@ -66,6 +78,11 @@ export default function request(url: string, method: String = 'get', data?: any,
result
:
null
result
:
null
}
}
}
}
if
(
data
.
code
!==
'200'
)
{
errMsg
(
data
.
message
||
'请求出错'
);
}
return
data
;
return
data
;
})
})
.
catch
(
error
=>
{
.
catch
(
error
=>
{
...
...
components/NavHeader/index.tsx
浏览文件 @
9cda4ee5
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
React
,
{
use
Context
,
use
Effect
,
useState
}
from
"react"
;
import
{
Avatar
,
Button
,
Space
,
Tabs
}
from
"antd"
;
import
{
Avatar
,
Button
,
Dropdown
,
Space
,
Tabs
}
from
"antd"
;
import
type
{
TabsProps
}
from
"antd"
;
import
type
{
TabsProps
}
from
"antd"
;
import
styles
from
"./index.module.scss"
;
import
styles
from
"./index.module.scss"
;
import
{
useRouter
}
from
"next/router"
;
import
{
useRouter
}
from
"next/router"
;
...
@@ -7,6 +7,7 @@ import LoginModal from "~/components/loginModal";
...
@@ -7,6 +7,7 @@ import LoginModal from "~/components/loginModal";
import
{
useUser
}
from
"~/lib/hooks"
;
import
{
useUser
}
from
"~/lib/hooks"
;
import
PublishModal
from
"./publishModal"
;
import
PublishModal
from
"./publishModal"
;
import
JoinModal
from
"./joinModal"
;
import
JoinModal
from
"./joinModal"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
const
items
:
TabsProps
[
"items"
]
=
[
const
items
:
TabsProps
[
"items"
]
=
[
{
{
...
@@ -42,30 +43,55 @@ const items: TabsProps["items"] = [
...
@@ -42,30 +43,55 @@ const items: TabsProps["items"] = [
export
default
function
NavHeader
()
{
export
default
function
NavHeader
()
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
[
currentPath
,
setCurrentPath
]
=
useState
(
""
);
const
[
currentPath
,
setCurrentPath
]
=
useState
(
""
);
const
user
=
useUser
(
);
const
{
userInfo
,
testLogin
,
logout
}
=
useContext
(
UserContext
);
useEffect
(()
=>
{
useEffect
(()
=>
{
setCurrentPath
(
router
.
route
);
setCurrentPath
(
router
.
route
);
console
.
log
(
"currentHash"
,
currentPath
);
console
.
log
(
"currentHash"
,
currentPath
);
},
[
router
.
route
]);
},
[
router
.
route
]);
//导航更改
const
onChange
=
(
key
:
string
)
=>
{
const
onChange
=
(
key
:
string
)
=>
{
router
.
push
(
key
);
router
.
push
(
key
);
};
};
const
[
openLoginModal
,
setPpenLoginModal
]
=
useState
(
false
);
//登录modal
//退出登录
const
[
openPublishModal
,
setOpenPublishModal
]
=
useState
(
false
);
//发布modal
const
onLogout
=
()
=>
{
logout
();
const
showModal
=
()
=>
{
setPpenLoginModal
(
true
);
};
const
handleCancel
=
()
=>
{
setPpenLoginModal
(
false
);
};
};
const
[
openLoginModal
,
setOpenLoginModal
]
=
useState
(
false
);
//登录modal
const
[
openPublishModal
,
setOpenPublishModal
]
=
useState
(
false
);
//发布modal
const
[
openJoinModal
,
setOpenJoinModal
]
=
useState
(
false
);
//加盟modal
const
[
openJoinModal
,
setOpenJoinModal
]
=
useState
(
false
);
//加盟modal
//发布按钮事件
function
onPublish
()
{
//登录判断
if
(
!
userInfo
)
{
setOpenLoginModal
(
true
);
}
else
{
if
(
userInfo
.
companyAuthStatus
)
{
setOpenPublishModal
(
true
);
}
else
{
router
.
push
(
"/certification"
);
}
}
}
//加盟按钮事件
function
onJoin
()
{
//登录判断
if
(
!
userInfo
)
{
setOpenLoginModal
(
true
);
}
else
{
if
(
userInfo
.
companyAuthStatus
)
{
setOpenJoinModal
(
true
);
}
else
{
router
.
push
(
"/certification"
);
}
}
}
return
(
return
(
<
div
className=
{
styles
.
navHeader
}
>
<
div
className=
{
styles
.
navHeader
}
>
<
div
className=
{
styles
.
nav
}
>
<
div
className=
{
styles
.
nav
}
>
...
@@ -77,39 +103,43 @@ export default function NavHeader() {
...
@@ -77,39 +103,43 @@ export default function NavHeader() {
onChange=
{
onChange
}
onChange=
{
onChange
}
/>
/>
<
Space
size=
{
16
}
className=
{
styles
.
btns
}
>
<
Space
size=
{
16
}
className=
{
styles
.
btns
}
>
<
Button
<
Button
type=
"primary"
className=
{
styles
.
btn1
}
onClick=
{
onPublish
}
>
type=
"primary"
className=
{
styles
.
btn1
}
onClick=
{
()
=>
setOpenPublishModal
(
true
)
}
>
+ 发布需求
+ 发布需求
</
Button
>
</
Button
>
<
Button
<
Button
className=
{
styles
.
btn2
}
onClick=
{
onJoin
}
>
className=
{
styles
.
btn2
}
onClick=
{
()
=>
setOpenJoinModal
(
true
)
}
>
加盟入驻
加盟入驻
</
Button
>
</
Button
>
</
Space
>
</
Space
>
{
user
?
(
{
user
Info
?
(
<
div
className=
{
styles
.
haedImg
}
>
<
div
className=
{
styles
.
haedImg
}
>
<
Avatar
<
Dropdown
size=
{
36
}
menu=
{
{
style=
{
{
background
:
"#bdbdbd"
}
}
items
:
[
src=
{
user
.
userImg
}
{
key
:
"1"
,
label
:
<
div
onClick=
{
onLogout
}
>
退出登录
</
div
>
},
></
Avatar
>
],
}
}
>
<
Avatar
size=
{
36
}
style=
{
{
background
:
"#bdbdbd"
}
}
src=
{
userInfo
.
userImg
}
></
Avatar
>
</
Dropdown
>
</
div
>
</
div
>
)
:
(
)
:
(
<
Button
<
Button
type=
"text"
type=
"text"
onClick=
{
showModal
}
onClick=
{
()
=>
testLogin
()
}
style=
{
{
fontWeight
:
"bold"
,
fontSize
:
16
}
}
style=
{
{
fontWeight
:
"bold"
,
fontSize
:
16
}
}
>
>
登录
登录
</
Button
>
</
Button
>
)
}
)
}
</
div
>
</
div
>
<
LoginModal
open=
{
openLoginModal
}
onCancel=
{
handleCancel
}
></
LoginModal
>
<
LoginModal
open=
{
openLoginModal
}
onCancel=
{
()
=>
setOpenLoginModal
(
false
)
}
></
LoginModal
>
<
PublishModal
<
PublishModal
open=
{
openPublishModal
}
open=
{
openPublishModal
}
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
...
...
components/loginModal/index.tsx
浏览文件 @
9cda4ee5
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
React
,
{
useContext
,
useEffect
,
useState
}
from
"react"
;
import
{
AutoComplete
,
Modal
}
from
"antd"
;
import
{
Modal
,
Image
}
from
"antd"
;
import
Image
from
"next/image"
;
import
api
from
"~/api"
;
import
api
from
"~/api"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
type
Props
=
{
type
Props
=
{
open
:
boolean
;
open
:
boolean
;
...
@@ -9,9 +9,13 @@ type Props = {
...
@@ -9,9 +9,13 @@ type Props = {
};
};
export
default
function
LoginModal
(
props
:
Props
)
{
export
default
function
LoginModal
(
props
:
Props
)
{
const
[
qrCode
,
setQrCode
]
=
useState
(
""
);
const
[
randomLoginCode
,
setRandomLoginCode
]
=
useState
(
""
);
const
{
userInfo
,
setUserInfo
}
=
useContext
(
UserContext
);
const
[
timeHandle
,
setTimeHandle
]
=
useState
<
NodeJS
.
Timer
|
null
>
(
null
);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
props
.
open
)
{
/*
if (props.open) {
var
obj
=
new
window
.
WxLogin
({
new window.WxLogin({
self_redirect: true,
self_redirect: true,
id: "login_container",
id: "login_container",
appid: "wx18b7883acd204278",
appid: "wx18b7883acd204278",
...
@@ -21,11 +25,56 @@ export default function LoginModal(props: Props) {
...
@@ -21,11 +25,56 @@ export default function LoginModal(props: Props) {
style: "",
style: "",
href: "",
href: "",
});
});
} */
window
.
setUserId
(
1
);
if
(
!
props
.
open
)
{
return
;
}
}
setRandomLoginCode
(
String
(
Date
.
now
()));
api
.
getAppletQRCode
({
randomLoginCode
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
"200"
)
{
setQrCode
(
"data:image/png;base64,"
+
res
.
result
||
""
);
}
});
},
[
props
.
open
]);
},
[
props
.
open
]);
useEffect
(()
=>
{
if
(
randomLoginCode
&&
!
userInfo
)
{
if
(
timeHandle
)
{
clearTimeout
(
timeHandle
);
}
const
handle
=
setInterval
(()
=>
{
api
.
getLoginInfo
({
randomLoginCode
:
randomLoginCode
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
===
"200"
)
{
setUserInfo
({
...
res
.
result
,
id
:
res
.
result
?.
userAccountId
,
});
window
.
messageApi
.
success
(
"登录成功"
);
clearInterval
(
handle
);
setTimeHandle
(
null
);
props
.
onCancel
();
}
});
},
1000
);
setTimeHandle
(
handle
);
}
},
[
randomLoginCode
]);
useEffect
(()
=>
{
if
(
!
props
.
open
&&
timeHandle
)
{
clearTimeout
(
timeHandle
);
}
},
[
timeHandle
,
props
.
open
]);
return
(
return
(
<>
<>
<
Modal
<
Modal
...
@@ -47,13 +96,12 @@ export default function LoginModal(props: Props) {
...
@@ -47,13 +96,12 @@ export default function LoginModal(props: Props) {
>
>
欢迎来到云享飞
欢迎来到云享飞
</
div
>
</
div
>
<
div
<
div
id=
"login_container"
style=
{
{
margin
:
"auto"
,
display
:
"table"
}
}
>
id=
"login_container"
<
Image
src=
{
qrCode
}
width=
{
150
}
height=
{
150
}
></
Image
>
style=
{
{
margin
:
"auto"
,
display
:
"table"
}
}
</
div
>
></
div
>
<
div
<
div
style=
{
{
style=
{
{
marginTop
:
-
120
,
//
marginTop: -120,
marginBottom
:
52
,
marginBottom
:
52
,
fontSize
:
14
,
fontSize
:
14
,
fontFamily
:
"MicrosoftYaHei"
,
fontFamily
:
"MicrosoftYaHei"
,
...
...
lib/hooks.ts
浏览文件 @
9cda4ee5
...
@@ -14,10 +14,6 @@ export function useUser() {
...
@@ -14,10 +14,6 @@ export function useUser() {
useEffect
(()
=>
{
useEffect
(()
=>
{
setUserAccountId
(
Number
(
window
.
localStorage
.
getItem
(
'userId'
)));
setUserAccountId
(
Number
(
window
.
localStorage
.
getItem
(
'userId'
)));
window
.
setUserId
=
(
id
)
=>
{
setUserAccountId
(
id
);
window
.
localStorage
.
setItem
(
'userId'
,
id
);
};
try
{
try
{
let
userInfo
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'userInfo'
)
||
''
)
||
null
;
let
userInfo
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'userInfo'
)
||
''
)
||
null
;
...
@@ -26,16 +22,25 @@ export function useUser() {
...
@@ -26,16 +22,25 @@ export function useUser() {
},
[])
},
[])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
user
&&
userAccountId
)
{
if
(
!
user
)
{
api
api
.
userInfo
({
.
userInfo
()
userAccountId
:
userAccountId
,
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
setUser
(
res
.
result
||
null
);
if
(
res
.
code
==
'200'
){
setUser
(
res
.
result
||
null
);
}
else
{
setUserAccountId
(
''
);
}
window
.
localStorage
.
setItem
(
'userInfo'
,
JSON
.
stringify
(
res
.
result
||
''
));
window
.
localStorage
.
setItem
(
'userInfo'
,
JSON
.
stringify
(
res
.
result
||
''
));
});
});
}
}
//退出登录
if
(
userAccountId
===
''
){
setUser
(
null
);
window
.
localStorage
.
setItem
(
'userInfo'
,
''
);
}
},
[
userAccountId
]);
},
[
userAccountId
]);
return
user
;
return
user
;
...
...
lib/userProvider.tsx
0 → 100644
浏览文件 @
9cda4ee5
import
React
,
{
createContext
,
Dispatch
,
SetStateAction
,
useEffect
,
useState
}
from
"react"
;
import
api
,
{
UserInfoResp
}
from
"~/api"
;
export
const
UserContext
=
createContext
<
{
testLogin
:
()
=>
void
;
logout
:
()
=>
void
;
userInfo
:
UserInfoResp
|
null
;
setUserInfo
:
Dispatch
<
SetStateAction
<
UserInfoResp
|
null
>>
;
}
>
({
testLogin
()
{},
logout
()
{},
userInfo
:
null
,
setUserInfo
()
{},
});
type
Props
=
{
children
:
React
.
ReactNode
;
};
const
UserProvider
=
({
children
}:
Props
)
=>
{
const
[
userInfo
,
setUserInfo
]
=
useState
<
UserInfoResp
|
null
>
(
null
);
useEffect
(()
=>
{
try
{
setUserInfo
(
JSON
.
parse
(
window
.
localStorage
.
getItem
(
"userInfo"
)
||
""
));
}
catch
(
e
)
{}
},
[]);
useEffect
(()
=>
{
localStorage
.
setItem
(
"userInfo"
,
JSON
.
stringify
(
userInfo
||
""
));
},
[
userInfo
]);
//测试登录
function
testLogin
()
{
api
.
testAppletLogin
().
then
((
res
)
=>
{
if
(
res
.
code
==
"200"
)
{
window
.
localStorage
.
setItem
(
"token"
,
res
.
result
?.
token
||
""
);
api
.
userInfo
().
then
((
res
)
=>
{
setUserInfo
(
res
.
result
||
null
);
});
}
});
}
//登出
function
logout
()
{
localStorage
.
setItem
(
"token"
,
""
);
setUserInfo
(
null
);
}
return
(
<
UserContext
.
Provider
value=
{
{
userInfo
,
setUserInfo
,
testLogin
,
logout
}
}
>
{
children
}
</
UserContext
.
Provider
>
);
};
export
default
UserProvider
;
next.config.js
浏览文件 @
9cda4ee5
...
@@ -27,6 +27,7 @@ const nextConfig = {
...
@@ -27,6 +27,7 @@ const nextConfig = {
{
{
source
:
"/local/:path*"
,
source
:
"/local/:path*"
,
destination
:
"https://iuav.mmcuav.cn/:path*"
,
destination
:
"https://iuav.mmcuav.cn/:path*"
,
destination
:
"https://test.iuav.mmcuav.cn/:path*"
,
},
},
];
];
},
},
...
...
pages/JoinPolicy/index.page.tsx
浏览文件 @
9cda4ee5
...
@@ -45,7 +45,7 @@ export default function JoinPolicy() {
...
@@ -45,7 +45,7 @@ export default function JoinPolicy() {
className=
{
styles
.
font1
}
className=
{
styles
.
font1
}
style=
{
{
textAlign
:
"center"
,
paddingTop
:
40
,
paddingBottom
:
30
}
}
style=
{
{
textAlign
:
"center"
,
paddingTop
:
40
,
paddingBottom
:
30
}
}
>
>
加盟入驻
政策
加盟入驻
福利
</
div
>
</
div
>
<
div
<
div
className=
{
styles
.
font2
}
className=
{
styles
.
font2
}
...
...
pages/_app.page.tsx
浏览文件 @
9cda4ee5
...
@@ -6,6 +6,7 @@ import { message } from 'antd';
...
@@ -6,6 +6,7 @@ import { message } from 'antd';
import
{
useEffect
}
from
'react'
;
import
{
useEffect
}
from
'react'
;
import
Head
from
"next/head"
;
import
Head
from
"next/head"
;
import
Script
from
'next/script'
;
import
Script
from
'next/script'
;
import
UserProvider
,
{
UserContext
}
from
"~/lib/userProvider"
;
export
default
function
App
({
Component
,
pageProps
}:
AppProps
)
{
export
default
function
App
({
Component
,
pageProps
}:
AppProps
)
{
const
[
messageApi
,
contextHolder
]
=
message
.
useMessage
();
const
[
messageApi
,
contextHolder
]
=
message
.
useMessage
();
...
@@ -24,7 +25,9 @@ export default function App({ Component, pageProps }: AppProps) {
...
@@ -24,7 +25,9 @@ export default function App({ Component, pageProps }: AppProps) {
</
Head
>
</
Head
>
<
Script
src=
"https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"
></
Script
>
<
Script
src=
"https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"
></
Script
>
{
contextHolder
}
{
contextHolder
}
<
Component
{
...
pageProps
}
/>
<
UserProvider
>
<
Component
{
...
pageProps
}
/>
</
UserProvider
>
</>
</>
);
);
}
}
pages/certification/index.page.tsx
浏览文件 @
9cda4ee5
...
@@ -8,6 +8,7 @@ import Layout from "~/components/layout";
...
@@ -8,6 +8,7 @@ import Layout from "~/components/layout";
import
api
from
"./api"
;
import
api
from
"./api"
;
import
styles
from
"./index.module.scss"
;
import
styles
from
"./index.module.scss"
;
import
gApi
from
'~/api'
;
import
gApi
from
'~/api'
;
import
Router
from
"next/router"
;
const
beforeUpload
=
(
file
:
RcFile
)
=>
{
const
beforeUpload
=
(
file
:
RcFile
)
=>
{
const
isJpgOrPng
=
file
.
type
===
"image/jpeg"
||
file
.
type
===
"image/png"
;
const
isJpgOrPng
=
file
.
type
===
"image/jpeg"
||
file
.
type
===
"image/png"
;
...
@@ -57,12 +58,14 @@ export default function Certification() {
...
@@ -57,12 +58,14 @@ export default function Certification() {
.
companyAuth
({
.
companyAuth
({
...
values
,
...
values
,
licenseImg
:
imageUrl
,
licenseImg
:
imageUrl
,
userAccountId
:
1
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
'提交结果'
,
res
);
console
.
log
(
'提交结果'
,
res
);
if
(
res
.
result
===
'已通过
'
){
if
(
res
.
code
===
'200
'
){
window
.
messageApi
.
success
(
res
.
result
);
window
.
messageApi
.
success
(
res
.
result
);
setTimeout
(()
=>
{
Router
.
push
(
'/'
);
},
1000
)
}
}
});
});
};
};
...
...
pages/flyingHandService/examination/components/brushQuestionZone/index.tsx
浏览文件 @
9cda4ee5
...
@@ -6,106 +6,102 @@ import api, { Flying, SkillsType, RegionResp } from "../../../api";
...
@@ -6,106 +6,102 @@ import api, { Flying, SkillsType, RegionResp } from "../../../api";
interface
BrushQuestionZoneType
{
interface
BrushQuestionZoneType
{
}
}
export
default
function
index
()
{
export
default
function
BrushQuestionZone
()
{
const
[
secondDistrictInfo
,
setSecondDistrictInfo
]
=
useState
(
const
[
secondDistrictInfo
,
setSecondDistrictInfo
]
=
useState
(
Array
<
RegionResp
>
Array
<
RegionResp
>
);
);
const
[
skills
,
setSkills
]
=
useState
(
const
[
skills
,
setSkills
]
=
useState
(
Array
<
RegionResp
>
);
Array
<
RegionResp
>
const
[
flightSkillsList
,
setFlightSkillsList
]
=
useState
(
Array
<
SkillsType
>
);
);
const
[
flightSkillsList
,
setFlightSkillsList
]
=
useState
(
Array
<
SkillsType
>
);
const
[
list
,
setList
]
=
useState
<
Array
<
BrushQuestionZoneType
>>
()
const
[
list
,
setList
]
=
useState
<
Array
<
BrushQuestionZoneType
>>
();
const
handleChange
=
(
value
:
string
)
=>
{
const
handleChange
=
(
value
:
string
)
=>
{
console
.
log
(
`selected
${
value
}
`
);
console
.
log
(
`selected
${
value
}
`
);
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
setList
([{},{},{},{},{},{}])
setList
([{},
{},
{},
{},
{},
{}]);
api
.
region
().
then
((
res
)
=>
{
api
.
region
().
then
((
res
)
=>
{
setSecondDistrictInfo
(
res
.
result
||
[]);
setSecondDistrictInfo
(
res
.
result
||
[]);
});
});
api
.
PilotLicense
().
then
((
res
)
=>
{
api
.
PilotLicense
().
then
((
res
)
=>
{
setSkills
(
res
.
result
||
[]);
setSkills
(
res
.
result
||
[]);
});
});
api
.
IndustryFlightSkills
().
then
((
res
)
=>
{
api
.
IndustryFlightSkills
().
then
((
res
)
=>
{
const
list
=
res
.
result
?.
map
((
item
)
=>
{
const
list
=
res
.
result
?.
map
((
item
)
=>
{
item
.
label
=
item
.
skillsName
item
.
label
=
item
.
skillsName
;
item
.
value
=
item
.
id
item
.
value
=
item
.
id
;
return
item
return
item
;
})
});
setFlightSkillsList
(
list
||
[]);
setFlightSkillsList
(
list
||
[]);
});
});
},
[]);
},
[]);
return
(
return
(
<
Box
>
<
Box
>
<
div
className=
"title"
>
<
div
className=
"title"
>
<
Cascader
<
Cascader
allowClear
allowClear
placeholder=
"地域"
placeholder=
"地域"
className=
"selectItem"
className=
"selectItem"
size=
"large"
size=
"large"
fieldNames=
{
{
fieldNames=
{
{
label
:
"name"
,
label
:
"name"
,
value
:
"id"
,
value
:
"id"
,
children
:
"childInfo"
,
children
:
"childInfo"
,
}
}
}
}
options=
{
secondDistrictInfo
}
options=
{
secondDistrictInfo
}
// onChange={onChange}
// onChange={onChange}
changeOnSelect
changeOnSelect
/>
/>
<
Cascader
<
Cascader
allowClear
allowClear
placeholder=
"考证"
placeholder=
"考证"
className=
"selectItem"
className=
"selectItem"
size=
"large"
size=
"large"
fieldNames=
{
{
fieldNames=
{
{
label
:
"licenseType"
,
label
:
"licenseType"
,
value
:
"id"
,
value
:
"id"
,
children
:
"childLicenses"
,
children
:
"childLicenses"
,
}
}
}
}
options=
{
skills
}
options=
{
skills
}
// onChange={onChange}
// onChange={onChange}
changeOnSelect
changeOnSelect
/>
/>
<
Select
<
Select
className=
"selectItem"
className=
"selectItem"
popupMatchSelectWidth=
{
false
}
popupMatchSelectWidth=
{
false
}
placeholder=
"技能"
placeholder=
"技能"
size=
"large"
size=
"large"
// onChange={(value) => onProvinceChange(value, "技能")}
// onChange={(value) => onProvinceChange(value, "技能")}
options=
{
flightSkillsList
}
options=
{
flightSkillsList
}
fieldNames=
{
{
value
:
"id"
,
label
:
"skillsName"
}
}
fieldNames=
{
{
value
:
"id"
,
label
:
"skillsName"
}
}
allowClear
allowClear
/>
/>
<
Cascader
<
Cascader
allowClear
allowClear
placeholder=
"选择课程"
placeholder=
"选择课程"
className=
"selectItem"
className=
"selectItem"
style=
{
{
width
:
200
}
}
style=
{
{
width
:
200
}
}
size=
"large"
size=
"large"
fieldNames=
{
{
fieldNames=
{
{
label
:
"name"
,
label
:
"name"
,
value
:
"id"
,
value
:
"id"
,
children
:
"childInfo"
,
children
:
"childInfo"
,
}
}
}
}
options=
{
secondDistrictInfo
}
options=
{
secondDistrictInfo
}
// onChange={onChange}
// onChange={onChange}
changeOnSelect
changeOnSelect
/>
/>
</
div
>
</
div
>
<
div
className=
"content"
>
<
div
className=
"content"
>
{
{
list
?.
map
((
item
,
i
)
=>
(
list
?.
map
(
item
=>
(
<
div
key=
{
i
}
className=
"item"
>
<
div
className=
'item'
>
<
div
className=
"img-box"
></
div
>
<
div
className=
'img-box'
></
div
>
<
div
className=
"item-content"
>
<
div
className=
'item-content'
>
第一章 第1节 习题练习习题练习习题练习
第一章 第1节 习题练习习题练习习题练习
</
div
>
</
div
>
</
div
>
</
div
>
))
}
))
</
div
>
}
</
div
>
</
Box
>
</
Box
>
)
)
;
}
}
pages/flyingHandService/examination/components/mockExam/index.tsx
浏览文件 @
9cda4ee5
...
@@ -5,31 +5,28 @@ interface MockExamType {
...
@@ -5,31 +5,28 @@ interface MockExamType {
}
}
export
default
function
index
()
{
export
default
function
MockExam
()
{
const
[
list
,
setList
]
=
useState
<
Array
<
MockExamType
>>
();
const
[
list
,
setList
]
=
useState
<
Array
<
MockExamType
>>
()
useEffect
(()
=>
{
setList
([{},
{},
{},
{},
{},
{}]);
useEffect
(()
=>
{
},
[]);
setList
([{},{},{},{},{},{}])
},[])
return
(
return
(
<
Box
>
<
Box
>
<
div
className=
"content"
>
<
div
className=
"content"
>
{
{
list
?.
map
((
item
,
i
)
=>
(
list
?.
map
(
item
=>
(
<
div
key=
{
i
}
className=
"item"
>
<
div
className=
'item'
>
<
div
className=
"img-box"
></
div
>
<
div
className=
'img-box'
></
div
>
<
div
className=
"item-content"
>
<
div
className=
'item-content'
>
<
div
className=
"top"
>
云飞手行业认证考核
</
div
>
<
div
className=
"top"
>
云飞手行业认证考核
</
div
>
<
div
className=
"bottom"
>
<
div
className=
"bottom"
>
<
div
className=
"user-img"
></
div
>
<
div
className=
"user-img"
></
div
>
<
div
className=
"application"
>
77人报名
</
div
>
<
div
className=
"application"
>
77人报名
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
))
}
))
</
div
>
}
</
div
>
</
Box
>
</
Box
>
)
)
;
}
}
pages/home/waterfallFlowBody/components/map/moreServicePoints/index.page.tsx
浏览文件 @
9cda4ee5
差异被折叠。
点击展开。
pages/projectInfo/components/news/index.tsx
浏览文件 @
9cda4ee5
...
@@ -96,8 +96,9 @@ export default function News(props: Props) {
...
@@ -96,8 +96,9 @@ export default function News(props: Props) {
);
);
})
}
})
}
</
Col
>
</
Col
>
{
list
.
length
===
0
&&
<
Empty
style=
{
{
margin
:
"0 auto"
}
}
></
Empty
>
}
</
Row
>
</
Row
>
{
list
.
length
===
0
&&
<
Empty
></
Empty
>
}
<
Pagination
<
Pagination
current=
{
pageParams
.
pageNo
}
current=
{
pageParams
.
pageNo
}
defaultPageSize=
{
pageParams
.
pageSize
}
defaultPageSize=
{
pageParams
.
pageSize
}
...
...
typings/type.d.ts
浏览文件 @
9cda4ee5
...
@@ -4,7 +4,6 @@ declare global {
...
@@ -4,7 +4,6 @@ declare global {
interface
Window
{
interface
Window
{
messageApi
:
MessageInstance
;
//全局消息提示api
messageApi
:
MessageInstance
;
//全局消息提示api
WxLogin
:
any
;
//微信登录对象
WxLogin
:
any
;
//微信登录对象
setUserId
:
(
number
)
=>
void
;
//获取用户信息需要的userId
_AMapSecurityConfig
:
{
securityJsCode
:
string
};
//高德地图api密钥配置
_AMapSecurityConfig
:
{
securityJsCode
:
string
};
//高德地图api密钥配置
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论