Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
85d17ed1
提交
85d17ed1
authored
5月 30, 2023
作者:
余乾开
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into feature/chuck
上级
2845349e
01f1d24c
隐藏空白字符变更
内嵌
并排
正在显示
28 个修改的文件
包含
346 行增加
和
189 行删除
+346
-189
index.tsx
components/NavHeader/index.tsx
+13
-3
二手服务商.png
components/NavHeader/joinModal/assets/二手服务商.png
+0
-0
品牌企业.png
components/NavHeader/joinModal/assets/品牌企业.png
+0
-0
商务公关机构.png
components/NavHeader/joinModal/assets/商务公关机构.png
+0
-0
投资机构.png
components/NavHeader/joinModal/assets/投资机构.png
+0
-0
推广合作商.png
components/NavHeader/joinModal/assets/推广合作商.png
+0
-0
无人机自媒体.png
components/NavHeader/joinModal/assets/无人机自媒体.png
+0
-0
生产制造商.png
components/NavHeader/joinModal/assets/生产制造商.png
+0
-0
飞手团队.png
components/NavHeader/joinModal/assets/飞手团队.png
+0
-0
飞手培训机构.png
components/NavHeader/joinModal/assets/飞手培训机构.png
+0
-0
index.module.scss
components/NavHeader/joinModal/index.module.scss
+7
-16
index.tsx
components/NavHeader/joinModal/index.tsx
+24
-7
index.tsx
components/layout/index.tsx
+3
-7
index.tsx
components/loginModal/index.tsx
+15
-11
userProvider.tsx
lib/userProvider.tsx
+30
-8
index.page.tsx
pages/certification/index.page.tsx
+15
-7
index.page.tsx
pages/equipmentLeasing/index.page.tsx
+7
-0
styled.tsx
pages/flyingHandService/detail/styled.tsx
+0
-1
index.page.tsx
pages/flyingHandService/index.page.tsx
+26
-25
index.tsx
pages/forum/components/publishMessage/index.tsx
+35
-29
index.page.tsx
pages/forum/index.page.tsx
+45
-16
index.tsx
...home/waterfallFlowBody/components/rotationChart/index.tsx
+5
-5
index.tsx
pages/home/waterfallFlowBody/index.tsx
+1
-1
[id].page.tsx
pages/jobServices/detail/[id].page.tsx
+2
-2
index.page.tsx
pages/jobServices/index.page.tsx
+1
-1
[id].page.tsx
pages/mall/detail/[id].page.tsx
+34
-9
index.ts
pages/mall/detail/api/index.ts
+2
-2
index.tsx
pages/mall/detail/components/intentionModal/index.tsx
+81
-39
没有找到文件。
components/NavHeader/index.tsx
浏览文件 @
85d17ed1
...
@@ -4,7 +4,6 @@ import type { TabsProps } from "antd";
...
@@ -4,7 +4,6 @@ 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"
;
import
LoginModal
from
"~/components/loginModal"
;
import
LoginModal
from
"~/components/loginModal"
;
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"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
...
@@ -43,7 +42,8 @@ const items: TabsProps["items"] = [
...
@@ -43,7 +42,8 @@ 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
{
userInfo
,
testLogin
,
logout
}
=
useContext
(
UserContext
);
const
{
userInfo
,
testLogin
,
logout
,
setNeedLogin
,
needLogin
}
=
useContext
(
UserContext
);
useEffect
(()
=>
{
useEffect
(()
=>
{
setCurrentPath
(
router
.
route
);
setCurrentPath
(
router
.
route
);
...
@@ -92,6 +92,13 @@ export default function NavHeader() {
...
@@ -92,6 +92,13 @@ export default function NavHeader() {
}
}
}
}
//从其它组件通知需要登录
useEffect
(()
=>
{
if
(
needLogin
)
{
setOpenLoginModal
(
true
);
}
},
[
needLogin
]);
return
(
return
(
<
div
className=
{
styles
.
navHeader
}
>
<
div
className=
{
styles
.
navHeader
}
>
<
div
className=
{
styles
.
nav
}
>
<
div
className=
{
styles
.
nav
}
>
...
@@ -138,7 +145,10 @@ export default function NavHeader() {
...
@@ -138,7 +145,10 @@ export default function NavHeader() {
</
div
>
</
div
>
<
LoginModal
<
LoginModal
open=
{
openLoginModal
}
open=
{
openLoginModal
}
onCancel=
{
()
=>
setOpenLoginModal
(
false
)
}
onCancel=
{
()
=>
{
setOpenLoginModal
(
false
);
setNeedLogin
(
false
);
}
}
></
LoginModal
>
></
LoginModal
>
<
PublishModal
<
PublishModal
open=
{
openPublishModal
}
open=
{
openPublishModal
}
...
...
components/NavHeader/joinModal/assets/二手服务商.png
0 → 100644
浏览文件 @
85d17ed1
4.8 KB
components/NavHeader/joinModal/assets/品牌企业.png
0 → 100644
浏览文件 @
85d17ed1
4.3 KB
components/NavHeader/joinModal/assets/商务公关机构.png
0 → 100644
浏览文件 @
85d17ed1
4.9 KB
components/NavHeader/joinModal/assets/投资机构.png
0 → 100644
浏览文件 @
85d17ed1
4.5 KB
components/NavHeader/joinModal/assets/推广合作商.png
0 → 100644
浏览文件 @
85d17ed1
4.9 KB
components/NavHeader/joinModal/assets/无人机自媒体.png
0 → 100644
浏览文件 @
85d17ed1
5.3 KB
components/NavHeader/joinModal/assets/生产制造商.png
0 → 100644
浏览文件 @
85d17ed1
4.5 KB
components/NavHeader/joinModal/assets/飞手团队.png
0 → 100644
浏览文件 @
85d17ed1
5.5 KB
components/NavHeader/joinModal/assets/飞手培训机构.png
0 → 100644
浏览文件 @
85d17ed1
5.2 KB
components/NavHeader/joinModal/index.module.scss
浏览文件 @
85d17ed1
.identityBtn
{
.identityBtn
{
box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
0
5px
;
padding
:
0
5px
;
position
:
absolute
;
bottom
:
0
;
left
:
50%
;
transform
:translate
(
-50
%
,
0
)
;
min-width
:
100%
;
min-width
:
100%
;
height
:
24px
;
background
:
#e26329
;
border-radius
:
6px
;
border-radius
:
6px
;
opacity
:
0
.95
;
text-align
:
center
;
display
:
flex
;
font-size
:
14px
;
justify-content
:
center
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
align-items
:
center
;
font-weight
:
400
;
font-size
:
12px
;
color
:
#000000
;
font-family
:
PingFangSC-Medium
,
PingFang
SC
;
flex-wrap
:
nowrap
;
font-weight
:
500
;
color
:
#fff
;
white-space
:
nowrap
;
}
}
.modal
{
.modal
{
:global
.ant-modal-content
{
:global
.ant-modal-content
{
border-radius
:
6px
;
border-radius
:
6px
;
.ant-modal-title
{
.ant-modal-title
{
text-align
:
center
;
text-align
:
center
;
}
}
}
}
...
...
components/NavHeader/joinModal/index.tsx
浏览文件 @
85d17ed1
...
@@ -6,6 +6,18 @@ import { useEffect, useState } from "react";
...
@@ -6,6 +6,18 @@ import { useEffect, useState } from "react";
import
api
,
{
ListTagResp
}
from
"./api"
;
import
api
,
{
ListTagResp
}
from
"./api"
;
import
{
useRouter
}
from
"next/router"
;
import
{
useRouter
}
from
"next/router"
;
const
imgs
=
[
require
(
"./assets/生产制造商.png"
),
require
(
"./assets/品牌企业.png"
),
require
(
"./assets/商务公关机构.png"
),
require
(
"./assets/无人机自媒体.png"
),
require
(
"./assets/投资机构.png"
),
require
(
"./assets/飞手团队.png"
),
require
(
"./assets/二手服务商.png"
),
require
(
"./assets/飞手培训机构.png"
),
require
(
"./assets/推广合作商.png"
),
];
type
Props
=
{
type
Props
=
{
open
?:
boolean
;
open
?:
boolean
;
onOk
?:
()
=>
void
;
onOk
?:
()
=>
void
;
...
@@ -16,10 +28,10 @@ export default function JoinModal(props: Props) {
...
@@ -16,10 +28,10 @@ export default function JoinModal(props: Props) {
const
[
tagList
,
setTagList
]
=
useState
<
ListTagResp
[]
>
([]);
const
[
tagList
,
setTagList
]
=
useState
<
ListTagResp
[]
>
([]);
useEffect
(()
=>
{
useEffect
(()
=>
{
api
.
listTag
().
then
(
res
=>
{
api
.
listTag
().
then
(
(
res
)
=>
{
setTagList
(
res
.
result
||
[]);
setTagList
(
res
.
result
||
[]);
})
})
;
},
[])
},
[])
;
const
onClickTag
=
(
item
:
ListTagResp
)
=>
{
const
onClickTag
=
(
item
:
ListTagResp
)
=>
{
router
.
replace
(
"/JoinPolicy?tagId="
+
item
.
id
);
router
.
replace
(
"/JoinPolicy?tagId="
+
item
.
id
);
...
@@ -35,15 +47,20 @@ export default function JoinModal(props: Props) {
...
@@ -35,15 +47,20 @@ export default function JoinModal(props: Props) {
width=
{
460
}
width=
{
460
}
footer=
{
null
}
footer=
{
null
}
>
>
<
Row
style=
{
{
padding
:
"22px 16px 20px 16px"
,
gap
:
"16px 40px"
}
}
>
<
Row
style=
{
{
rowGap
:
29
,
paddingTop
:
21
,
paddingBottom
:
21
}
}
>
{
tagList
.
map
((
item
)
=>
{
{
tagList
.
map
((
item
,
i
)
=>
{
return
(
return
(
<
Col
<
Col
key=
{
item
.
id
}
key=
{
item
.
id
}
style=
{
{
cursor
:
"pointer"
,
height
:
100
,
padding
:
0
}
}
span=
{
8
}
style=
{
{
cursor
:
"pointer"
,
padding
:
0
,
textAlign
:
"center"
,
}
}
onClick=
{
()
=>
onClickTag
(
item
)
}
onClick=
{
()
=>
onClickTag
(
item
)
}
>
>
<
Image
src=
{
img
}
width=
{
100
}
height=
{
100
}
alt=
""
></
Image
>
<
Image
src=
{
img
s
[
i
]
}
width=
{
64
}
height=
{
64
}
alt=
""
></
Image
>
<
div
className=
{
styles
.
identityBtn
}
>
<
div
className=
{
styles
.
identityBtn
}
>
{
item
.
tagName
}
{
item
.
tagName
}
{
">"
}
{
">"
}
...
...
components/layout/index.tsx
浏览文件 @
85d17ed1
...
@@ -6,6 +6,8 @@ import {useRouter} from 'next/router'
...
@@ -6,6 +6,8 @@ import {useRouter} from 'next/router'
import
styles
from
'./index.module.scss'
;
import
styles
from
'./index.module.scss'
;
const
{
Header
,
Footer
,
Content
}
=
Layout
;
const
{
Header
,
Footer
,
Content
}
=
Layout
;
//底部栏固定定位
const
includesPage
=
[
"/home"
,
"/flyingHandService/detail/[id]"
]
const
homeStyle
:
React
.
CSSProperties
=
{
const
homeStyle
:
React
.
CSSProperties
=
{
position
:
'fixed'
,
position
:
'fixed'
,
...
@@ -61,13 +63,7 @@ export default function LayoutView(props: Props) {
...
@@ -61,13 +63,7 @@ export default function LayoutView(props: Props) {
</
Header
>
</
Header
>
<
Content
className=
{
styles
.
content
}
>
{
props
.
children
}
</
Content
>
<
Content
className=
{
styles
.
content
}
>
{
props
.
children
}
</
Content
>
{
!
props
.
hideFooter
&&
(
{
!
props
.
hideFooter
&&
(
<
Footer
<
Footer
style=
{
includesPage
.
includes
(
router
.
pathname
)
?
{...
footerStyle
,...
homeStyle
}
:
footerStyle
}
>
style=
{
router
.
pathname
.
includes
(
"home"
)
?
{
...
footerStyle
,
...
homeStyle
}
:
footerStyle
}
>
<
FooterView
></
FooterView
>
<
FooterView
></
FooterView
>
</
Footer
>
</
Footer
>
)
}
)
}
...
...
components/loginModal/index.tsx
浏览文件 @
85d17ed1
...
@@ -33,20 +33,24 @@ export default function LoginModal(props: Props) {
...
@@ -33,20 +33,24 @@ export default function LoginModal(props: Props) {
}
}
setRandomLoginCode
(
String
(
Date
.
now
()));
setRandomLoginCode
(
String
(
Date
.
now
()));
api
.
getAppletQRCode
({
randomLoginCode
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
"200"
)
{
setQrCode
(
"data:image/png;base64,"
+
res
.
result
||
""
);
}
else
{
window
.
messageApi
.
error
(
"获取登录二维码失败"
);
}
});
},
[
props
.
open
]);
},
[
props
.
open
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
randomLoginCode
)
{
//获取登录码
api
.
getAppletQRCode
({
randomLoginCode
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
"200"
)
{
setQrCode
(
"data:image/png;base64,"
+
res
.
result
||
""
);
}
else
{
window
.
messageApi
.
error
(
"获取登录二维码失败"
);
}
});
}
if
(
randomLoginCode
&&
!
userInfo
)
{
if
(
randomLoginCode
&&
!
userInfo
)
{
if
(
timeHandle
)
{
if
(
timeHandle
)
{
clearTimeout
(
timeHandle
);
clearTimeout
(
timeHandle
);
...
...
lib/userProvider.tsx
浏览文件 @
85d17ed1
import
React
,
{
createContext
,
Dispatch
,
SetStateAction
,
useEffect
,
useState
}
from
"react"
;
import
React
,
{
createContext
,
Dispatch
,
SetStateAction
,
useEffect
,
useState
,
}
from
"react"
;
import
api
,
{
UserInfoResp
}
from
"~/api"
;
import
api
,
{
UserInfoResp
}
from
"~/api"
;
export
const
UserContext
=
createContext
<
{
export
const
UserContext
=
createContext
<
{
testLogin
:
()
=>
void
;
testLogin
:
()
=>
void
;
logout
:
()
=>
void
;
logout
:
()
=>
void
;
userInfo
:
UserInfoResp
|
null
;
userInfo
:
UserInfoResp
|
null
|
""
;
setUserInfo
:
Dispatch
<
SetStateAction
<
UserInfoResp
|
null
>>
;
setUserInfo
:
Dispatch
<
SetStateAction
<
UserInfoResp
|
null
|
""
>>
;
needLogin
:
Boolean
;
setNeedLogin
:
Dispatch
<
SetStateAction
<
Boolean
>>
;
}
>
({
}
>
({
testLogin
()
{},
testLogin
()
{},
logout
()
{},
logout
()
{},
userInfo
:
null
,
userInfo
:
null
,
setUserInfo
()
{},
setUserInfo
()
{},
needLogin
:
false
,
setNeedLogin
()
{},
});
});
type
Props
=
{
type
Props
=
{
children
:
React
.
ReactNode
;
children
:
React
.
ReactNode
;
};
};
const
UserProvider
=
({
children
}:
Props
)
=>
{
const
UserProvider
=
({
children
}:
Props
)
=>
{
const
[
userInfo
,
setUserInfo
]
=
useState
<
UserInfoResp
|
null
>
(
null
);
const
[
userInfo
,
setUserInfo
]
=
useState
<
UserInfoResp
|
null
|
''
>
(
null
);
const
[
needLogin
,
setNeedLogin
]
=
useState
<
Boolean
>
(
false
);
//用于通知登录modal需要打开
useEffect
(()
=>
{
useEffect
(()
=>
{
try
{
try
{
...
@@ -26,7 +37,9 @@ const UserProvider = ({ children }: Props) => {
...
@@ -26,7 +37,9 @@ const UserProvider = ({ children }: Props) => {
},
[]);
},
[]);
useEffect
(()
=>
{
useEffect
(()
=>
{
localStorage
.
setItem
(
"userInfo"
,
JSON
.
stringify
(
userInfo
||
""
));
if
(
userInfo
!==
null
)
{
localStorage
.
setItem
(
"userInfo"
,
JSON
.
stringify
(
userInfo
||
""
));
}
},
[
userInfo
]);
},
[
userInfo
]);
//测试登录
//测试登录
...
@@ -35,7 +48,7 @@ const UserProvider = ({ children }: Props) => {
...
@@ -35,7 +48,7 @@ const UserProvider = ({ children }: Props) => {
if
(
res
.
code
==
"200"
)
{
if
(
res
.
code
==
"200"
)
{
window
.
localStorage
.
setItem
(
"token"
,
res
.
result
?.
token
||
""
);
window
.
localStorage
.
setItem
(
"token"
,
res
.
result
?.
token
||
""
);
api
.
userInfo
().
then
((
res
)
=>
{
api
.
userInfo
().
then
((
res
)
=>
{
setUserInfo
(
res
.
result
||
null
);
setUserInfo
(
res
.
result
||
''
);
});
});
}
}
});
});
...
@@ -44,11 +57,20 @@ const UserProvider = ({ children }: Props) => {
...
@@ -44,11 +57,20 @@ const UserProvider = ({ children }: Props) => {
//登出
//登出
function
logout
()
{
function
logout
()
{
localStorage
.
setItem
(
"token"
,
""
);
localStorage
.
setItem
(
"token"
,
""
);
setUserInfo
(
null
);
setUserInfo
(
''
);
}
}
return
(
return
(
<
UserContext
.
Provider
value=
{
{
userInfo
,
setUserInfo
,
testLogin
,
logout
}
}
>
<
UserContext
.
Provider
value=
{
{
userInfo
,
setUserInfo
,
testLogin
,
logout
,
needLogin
,
setNeedLogin
,
}
}
>
{
children
}
{
children
}
</
UserContext
.
Provider
>
</
UserContext
.
Provider
>
);
);
...
...
pages/certification/index.page.tsx
浏览文件 @
85d17ed1
...
@@ -2,13 +2,14 @@ import { LoadingOutlined, PlusOutlined } from "@ant-design/icons";
...
@@ -2,13 +2,14 @@ import { LoadingOutlined, PlusOutlined } from "@ant-design/icons";
import
{
Col
,
Form
,
Input
,
Row
,
Upload
,
message
,
Button
,
Image
}
from
"antd"
;
import
{
Col
,
Form
,
Input
,
Row
,
Upload
,
message
,
Button
,
Image
}
from
"antd"
;
import
type
{
UploadChangeParam
}
from
"antd/es/upload"
;
import
type
{
UploadChangeParam
}
from
"antd/es/upload"
;
import
type
{
RcFile
,
UploadFile
,
UploadProps
}
from
"antd/es/upload/interface"
;
import
type
{
RcFile
,
UploadFile
,
UploadProps
}
from
"antd/es/upload/interface"
;
import
{
useState
}
from
"react"
;
import
{
use
Context
,
use
State
}
from
"react"
;
import
config
from
"~/api/config"
;
import
config
from
"~/api/config"
;
import
Layout
from
"~/components/layout"
;
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"
;
import
Router
from
"next/router"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
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"
;
...
@@ -34,6 +35,7 @@ const normFile = (e: any) => {
...
@@ -34,6 +35,7 @@ const normFile = (e: any) => {
export
default
function
Certification
()
{
export
default
function
Certification
()
{
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
imageUrl
,
setImageUrl
]
=
useState
<
string
>
();
const
[
imageUrl
,
setImageUrl
]
=
useState
<
string
>
();
const
{
userInfo
,
setUserInfo
}
=
useContext
(
UserContext
);
//上传change事件
//上传change事件
const
handleChange
:
UploadProps
[
"onChange"
]
=
(
const
handleChange
:
UploadProps
[
"onChange"
]
=
(
...
@@ -60,12 +62,18 @@ export default function Certification() {
...
@@ -60,12 +62,18 @@ export default function Certification() {
licenseImg
:
imageUrl
,
licenseImg
:
imageUrl
,
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
'提交结果'
,
res
);
console
.
log
(
"提交结果"
,
res
);
if
(
res
.
code
===
'200'
){
if
(
res
.
code
===
"200"
)
{
window
.
messageApi
.
success
(
res
.
result
);
window
.
messageApi
.
success
(
"提交成功,请等待审核"
);
if
(
userInfo
)
{
setUserInfo
({
...
userInfo
,
companyAuthStatus
:
1
,
});
}
setTimeout
(()
=>
{
setTimeout
(()
=>
{
Router
.
push
(
'/'
);
Router
.
push
(
"/"
);
},
1000
)
},
1000
)
;
}
}
});
});
};
};
...
...
pages/equipmentLeasing/index.page.tsx
浏览文件 @
85d17ed1
...
@@ -129,6 +129,13 @@ export default function EquipmentLeasing(props: Props) {
...
@@ -129,6 +129,13 @@ export default function EquipmentLeasing(props: Props) {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
router
.
query
)
{
if
(
router
.
query
)
{
setFilterResult
({
...
router
.
query
});
setFilterResult
({
...
router
.
query
});
console
.
log
(
router
.
query
,{
brandId
:
1
});
onFilterChange
({
categoryId
:
{
id
:
2
,
name
:
"类目:航测"
}
},{
categoryId
:
2
});
}
}
},
[
router
]);
},
[
router
]);
return
(
return
(
...
...
pages/flyingHandService/detail/styled.tsx
浏览文件 @
85d17ed1
...
@@ -11,7 +11,6 @@ export const Box = styled.div`
...
@@ -11,7 +11,6 @@ export const Box = styled.div`
justify-content: space-between;
justify-content: space-between;
align-items: center;
align-items: center;
.left {
.left {
width: 190px;
height: 25px;
height: 25px;
font-size: 20px;
font-size: 20px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
...
...
pages/flyingHandService/index.page.tsx
浏览文件 @
85d17ed1
...
@@ -17,8 +17,8 @@ export default function FlyingHandService() {
...
@@ -17,8 +17,8 @@ export default function FlyingHandService() {
const
{
Option
}
=
Select
const
{
Option
}
=
Select
const
router
=
useRouter
();
const
router
=
useRouter
();
const
[
list
,
setList
]
=
useState
([
const
[
list
,
setList
]
=
useState
([
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
925072db-5872-44dd-8b71-e408ad3adf41
.jpg"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
540X844-1(1)
.jpg"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
12d624b0-1250-44a6-9a3f-9025725a2adc
.jpg"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
540X844(1)
.jpg"
,
]);
]);
const
[
productList
,
setProductList
]
=
useState
(
const
[
productList
,
setProductList
]
=
useState
(
Array
<
{
element
:
JSX
.
Element
}
>
Array
<
{
element
:
JSX
.
Element
}
>
...
@@ -32,8 +32,9 @@ export default function FlyingHandService() {
...
@@ -32,8 +32,9 @@ export default function FlyingHandService() {
const
[
skills
,
setSkills
]
=
useState
(
const
[
skills
,
setSkills
]
=
useState
(
Array
<
RegionResp
>
Array
<
RegionResp
>
);
);
const
[
skillsDefault
,
setSkillsDefault
]
=
useState
<
Array
<
number
>>
();
const
[
flightSkillsList
,
setFlightSkillsList
]
=
useState
(
Array
<
SkillsType
>
);
const
[
flightSkillsList
,
setFlightSkillsList
]
=
useState
(
Array
<
SkillsType
>
);
const
[
flightDefault
,
setFlightDefault
]
=
useState
<
number
|
null
>
();
const
leftDom
=
(
item
:
Flying
)
=>
{
const
leftDom
=
(
item
:
Flying
)
=>
{
return
(
return
(
<
div
<
div
...
@@ -113,6 +114,8 @@ export default function FlyingHandService() {
...
@@ -113,6 +114,8 @@ export default function FlyingHandService() {
//端口列表请求
//端口列表请求
useEffect
(()
=>
{
useEffect
(()
=>
{
console
.
log
(
router
);
let
queryVal
=
JSON
.
parse
(
JSON
.
stringify
(
router
.
query
));
let
queryVal
=
JSON
.
parse
(
JSON
.
stringify
(
router
.
query
));
for
(
const
key
in
queryVal
)
{
for
(
const
key
in
queryVal
)
{
queryVal
[
key
]
=
Number
(
queryVal
[
key
]);
queryVal
[
key
]
=
Number
(
queryVal
[
key
]);
...
@@ -133,25 +136,26 @@ export default function FlyingHandService() {
...
@@ -133,25 +136,26 @@ export default function FlyingHandService() {
});
});
},
[
abort
]);
},
[
abort
]);
const
onProvinceChange
=
(
value
:
string
,
type
:
string
)
=>
{
const
onProvinceChange
=
(
value
:
number
)
=>
{
if
(
type
===
"考证"
)
{
if
(
value
)
{
setFlightDefault
(
value
)
}
else
{
setFlightDefault
(
null
)
}
setFilterParams
((
props
)
=>
{
setFilterParams
((
props
)
=>
{
return
{
return
{
...
props
,
...
props
,
licenseId
:
Number
(
value
),
licenseId
:
Number
(
value
),
};
};
});
});
}
else
{
setFilterParams
((
props
)
=>
{
return
{
...
props
,
flightSkillsId
:
Number
(
value
),
};
});
}
};
};
const
onChange
=
(
value
:
any
)
=>
{
const
onChange
=
(
value
:
any
)
=>
{
if
(
value
)
{
setSkillsDefault
([
value
])
}
else
{
setSkillsDefault
([])
}
setFilterParams
((
props
)
=>
{
setFilterParams
((
props
)
=>
{
return
{
return
{
...
props
,
...
props
,
...
@@ -199,6 +203,11 @@ export default function FlyingHandService() {
...
@@ -199,6 +203,11 @@ export default function FlyingHandService() {
for
(
const
key
in
queryVal
)
{
for
(
const
key
in
queryVal
)
{
queryVal
[
key
]
=
Number
(
queryVal
[
key
]);
queryVal
[
key
]
=
Number
(
queryVal
[
key
]);
}
}
if
(
queryVal
.
flightSkillsId
)
{
setSkillsDefault
([
queryVal
.
flightSkillsId
])
}
else
{
setFlightDefault
(
queryVal
.
licenseId
)
}
setFilterParams
((
props
)
=>
{
setFilterParams
((
props
)
=>
{
return
{
return
{
...
props
,
...
props
,
...
@@ -284,29 +293,21 @@ export default function FlyingHandService() {
...
@@ -284,29 +293,21 @@ export default function FlyingHandService() {
children
:
"childLicenses"
,
children
:
"childLicenses"
,
}
}
}
}
options=
{
skills
}
options=
{
skills
}
onChange=
{
onChange
}
onChange=
{
(
value
)
=>
onChange
(
value
)
}
changeOnSelect
changeOnSelect
value=
{
skillsDefault
}
/>
/>
{
/* <Select
className="selectItem"
bordered={false}
popupMatchSelectWidth={false}
placeholder="考证"
size="large"
onChange={(value) => onProvinceChange(value, "考证")}
options={skills}
allowClear
/> */
}
<
Select
<
Select
className=
"selectItem"
className=
"selectItem"
bordered=
{
false
}
bordered=
{
false
}
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
value=
{
flightDefault
}
/>
/>
</
Space
>
</
Space
>
</
div
>
</
div
>
...
...
pages/forum/components/publishMessage/index.tsx
浏览文件 @
85d17ed1
...
@@ -2,11 +2,12 @@ import { PlusOutlined } from "@ant-design/icons";
...
@@ -2,11 +2,12 @@ import { PlusOutlined } from "@ant-design/icons";
import
{
Form
,
Input
,
Modal
,
Upload
,
Image
,
Button
,
Row
,
Col
}
from
"antd"
;
import
{
Form
,
Input
,
Modal
,
Upload
,
Image
,
Button
,
Row
,
Col
}
from
"antd"
;
import
type
{
RcFile
,
UploadProps
}
from
"antd/es/upload"
;
import
type
{
RcFile
,
UploadProps
}
from
"antd/es/upload"
;
import
type
{
UploadFile
}
from
"antd/es/upload/interface"
;
import
type
{
UploadFile
}
from
"antd/es/upload/interface"
;
import
{
useState
}
from
"react"
;
import
{
use
Context
,
use
State
}
from
"react"
;
import
gApi
from
"~/api"
;
import
gApi
from
"~/api"
;
import
NImage
from
"next/image"
;
import
NImage
from
"next/image"
;
import
api
from
"./api"
;
import
api
from
"./api"
;
import
{
useGeolocation
,
useUser
}
from
"~/lib/hooks"
;
import
{
useGeolocation
}
from
"~/lib/hooks"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
type
Props
=
{
type
Props
=
{
open
:
boolean
;
open
:
boolean
;
...
@@ -30,7 +31,7 @@ export default function PublishMessage(props: Props) {
...
@@ -30,7 +31,7 @@ export default function PublishMessage(props: Props) {
const
[
fileList
,
setFileList
]
=
useState
<
UploadFile
[]
>
([]);
const
[
fileList
,
setFileList
]
=
useState
<
UploadFile
[]
>
([]);
const
[
showLoading
,
setShowLoad
]
=
useState
(
false
);
const
[
showLoading
,
setShowLoad
]
=
useState
(
false
);
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
user
=
useUser
(
);
const
{
userInfo
,
setNeedLogin
}
=
useContext
(
UserContext
);
const
position
=
useGeolocation
();
const
position
=
useGeolocation
();
//预览关闭
//预览关闭
...
@@ -84,33 +85,38 @@ export default function PublishMessage(props: Props) {
...
@@ -84,33 +85,38 @@ export default function PublishMessage(props: Props) {
const
onFinish
=
(
values
:
any
)
=>
{
const
onFinish
=
(
values
:
any
)
=>
{
console
.
log
(
values
);
console
.
log
(
values
);
setShowLoad
(
true
);
setShowLoad
(
true
);
api
.
publish
({
lat
:
position
?.
position
?.
lat
,
//纬度
lon
:
position
?.
position
?.
lng
,
//经度
title
:
''
,
//标题
description
:
values
.
description
,
//描述
userId
:
user
!
.
id
,
//用户id
mediaVO
:
{
//发布图片
//@ts-ignore
picture
:
fileList
.
filter
((
item
)
=>
item
.
url
).
map
((
item
)
=>
item
.
url
),
},
})
.
then
((
res
)
=>
{
console
.
log
(
"提交结果"
,
res
);
setShowLoad
(
false
);
if
(
res
.
code
===
"200"
)
{
window
.
messageApi
.
success
(
"发布成功"
);
props
.
onCancel
();
props
.
onOk
&&
props
.
onOk
();
setTimeout
(()
=>
{
if
(
userInfo
)
{
form
.
resetFields
([
"title"
,
"description"
]);
api
setFileList
([]);
.
publish
({
},
500
);
lat
:
position
?.
position
?.
lat
,
//纬度
}
lon
:
position
?.
position
?.
lng
,
//经度
});
title
:
""
,
//标题
description
:
values
.
description
,
//描述
userId
:
userInfo
.
id
,
//用户id
mediaVO
:
{
//发布图片
//@ts-ignore
picture
:
fileList
.
filter
((
item
)
=>
item
.
url
)
.
map
((
item
)
=>
item
.
url
),
},
})
.
then
((
res
)
=>
{
console
.
log
(
"提交结果"
,
res
);
setShowLoad
(
false
);
if
(
res
.
code
===
"200"
)
{
window
.
messageApi
.
success
(
"发布成功"
);
props
.
onCancel
();
props
.
onOk
&&
props
.
onOk
();
setTimeout
(()
=>
{
form
.
resetFields
([
"title"
,
"description"
]);
setFileList
([]);
},
500
);
}
});
}
};
};
return
(
return
(
...
...
pages/forum/index.page.tsx
浏览文件 @
85d17ed1
...
@@ -13,11 +13,11 @@ import Layout from "~/components/layout";
...
@@ -13,11 +13,11 @@ import Layout from "~/components/layout";
import
styles
from
"./index.module.scss"
;
import
styles
from
"./index.module.scss"
;
import
errImg
from
"~/assets/errImg"
;
import
errImg
from
"~/assets/errImg"
;
import
{
RightOutlined
}
from
"@ant-design/icons"
;
import
{
RightOutlined
}
from
"@ant-design/icons"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
use
Context
,
use
Effect
,
useState
}
from
"react"
;
import
PublishMessage
from
"./components/publishMessage"
;
import
PublishMessage
from
"./components/publishMessage"
;
import
api
,
{
ByDynamicParams
,
Dynamic
}
from
"./api"
;
import
api
,
{
ByDynamicParams
,
Dynamic
}
from
"./api"
;
import
InfiniteScroll
from
"react-infinite-scroll-component"
;
import
InfiniteScroll
from
"react-infinite-scroll-component"
;
import
{
useUser
}
from
"~/lib/hooks
"
;
import
{
UserContext
}
from
"~/lib/userProvider
"
;
interface
Item
extends
Dynamic
{
interface
Item
extends
Dynamic
{
openComment
?:
boolean
;
//是否开启评论
openComment
?:
boolean
;
//是否开启评论
...
@@ -32,8 +32,8 @@ export default function Forum() {
...
@@ -32,8 +32,8 @@ export default function Forum() {
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
16
,
pageSize
:
16
,
});
});
const
[
count
,
setCount
]
=
useState
(
0
);
//动态总数
const
[
count
,
setCount
]
=
useState
(
0
);
//动态总数
const
userInfo
=
useUser
();
//获取信息
const
{
userInfo
,
setNeedLogin
}
=
useContext
(
UserContext
);
useEffect
(()
=>
{
useEffect
(()
=>
{
api
api
...
@@ -56,7 +56,11 @@ export default function Forum() {
...
@@ -56,7 +56,11 @@ export default function Forum() {
* 展示发布模态框
* 展示发布模态框
*/
*/
const
showModal
=
()
=>
{
const
showModal
=
()
=>
{
setIsModalOpen
(
true
);
if
(
userInfo
)
{
setIsModalOpen
(
true
);
}
else
{
setNeedLogin
(
true
);
}
};
};
/**
/**
...
@@ -78,15 +82,26 @@ export default function Forum() {
...
@@ -78,15 +82,26 @@ export default function Forum() {
//评论内容
//评论内容
const
onComment
=
(
values
:
any
,
id
:
number
,
i
:
number
)
=>
{
const
onComment
=
(
values
:
any
,
id
:
number
,
i
:
number
)
=>
{
api
.
comment
({
if
(
userInfo
)
{
content
:
values
.
content
,
api
dynamicId
:
id
,
.
comment
({
userId
:
userInfo
!
.
id
,
content
:
values
.
content
,
}).
then
(
res
=>
{
dynamicId
:
id
,
if
(
res
.
code
===
'200'
){
userId
:
userInfo
.
id
,
})
.
then
((
res
)
=>
{
if
(
res
.
code
===
"200"
)
{
}
});
}
};
}
//评论内容
});
const
onCommentContent
=
()
=>
{
if
(
userInfo
)
{
}
else
{
setNeedLogin
(
true
);
}
};
};
return
(
return
(
<
Layout
>
<
Layout
>
...
@@ -165,8 +180,17 @@ export default function Forum() {
...
@@ -165,8 +180,17 @@ export default function Forum() {
</
Space
>
</
Space
>
{
item
.
openComment
&&
(
{
item
.
openComment
&&
(
<
div
className=
{
styles
.
commentWrap
}
>
<
div
className=
{
styles
.
commentWrap
}
>
<
Form
onFinish=
{
(
values
)
=>
{
onComment
(
values
,
item
.
id
,
i
)}
}
>
<
Form
<
Form
.
Item
name=
"content"
rules=
{
[{
required
:
true
}]
}
help=
""
style=
{
{
marginBottom
:
0
}
}
>
onFinish=
{
(
values
)
=>
{
onComment
(
values
,
item
.
id
,
i
);
}
}
>
<
Form
.
Item
name=
"content"
rules=
{
[{
required
:
true
}]
}
help=
""
style=
{
{
marginBottom
:
0
}
}
>
<
div
className=
{
styles
.
draftWrap
}
>
<
div
className=
{
styles
.
draftWrap
}
>
<
div
className=
{
styles
.
commentHeadImg
}
>
自已
</
div
>
<
div
className=
{
styles
.
commentHeadImg
}
>
自已
</
div
>
<
Input
<
Input
...
@@ -176,7 +200,12 @@ export default function Forum() {
...
@@ -176,7 +200,12 @@ export default function Forum() {
</
div
>
</
div
>
</
Form
.
Item
>
</
Form
.
Item
>
<
div
className=
{
styles
.
btnCommentWrap
}
>
<
div
className=
{
styles
.
btnCommentWrap
}
>
<
Button
type=
"primary"
htmlType=
"submit"
className=
"btnComment"
>
<
Button
type=
"primary"
htmlType=
"submit"
className=
"btnComment"
onClick=
{
onCommentContent
}
>
评论
评论
</
Button
>
</
Button
>
</
div
>
</
div
>
...
...
pages/home/waterfallFlowBody/components/rotationChart/index.tsx
浏览文件 @
85d17ed1
...
@@ -5,11 +5,11 @@ import Image from "next/image";
...
@@ -5,11 +5,11 @@ import Image from "next/image";
export
default
function
RotationChart
()
{
export
default
function
RotationChart
()
{
const
list
=
[
const
list
=
[
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
pc%E7%AB%AF%E8%BD%AE%E6%92%AD%E5%9B%BE1.pn
g"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
1(1).jp
g"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
ebf4fd5d-f8da-45b7-b0b3-282a31e43929.pn
g"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
2(1).jp
g"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
6b62ee5b-d929-4dee-b441-258c81c14403.pn
g"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
3(1).jp
g"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
0dd9e0f6-c1cd-485a-bdf4-8aeb84b1c67a.pn
g"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
4(1).jp
g"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
bcdabab5-f2f8-4c6d-85c6-4d304d8bfe4c.png"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
5(1).jpg"
];
];
return
(
return
(
<
Box
>
<
Box
>
...
...
pages/home/waterfallFlowBody/index.tsx
浏览文件 @
85d17ed1
...
@@ -294,7 +294,7 @@ export default function WaterfallFlowBody() {
...
@@ -294,7 +294,7 @@ export default function WaterfallFlowBody() {
option
:
[]
option
:
[]
)
=>
{
)
=>
{
return
(
return
(
<
div
key=
{
item
.
title
}
className=
{
`item ${index>=3?'right-box':''}`
}
>
<
div
key=
{
item
.
title
}
className=
"item"
style=
{
{
marginRight
:
index
>=
3
?
0
:
10
}
}
>
<
div
className=
"item-title"
>
<
div
className=
"item-title"
>
<
div
className=
"item-left"
>
<
div
className=
"item-left"
>
<
div
className=
"item-left-label"
onClick=
{
()
=>
routerPath
(
index
)
}
>
<
div
className=
"item-left-label"
onClick=
{
()
=>
routerPath
(
index
)
}
>
...
...
pages/jobServices/detail/[id].page.tsx
浏览文件 @
85d17ed1
...
@@ -76,8 +76,8 @@ export default function JobServicesDetail() {
...
@@ -76,8 +76,8 @@ export default function JobServicesDetail() {
</
div
>
</
div
>
<
div
className=
'right-bottom'
>
<
div
className=
'right-bottom'
>
<
div
className=
'bottom-btn'
>
<
div
className=
'bottom-btn'
>
<
Button
className=
'btn-left'
size=
'small'
type=
"primary"
>
马上预约
</
Button
>
<
Button
className=
'btn-left'
size=
'small'
type=
"primary"
>
电话沟通
</
Button
>
<
Button
className=
'btn-right'
size=
'small'
type=
"primary"
>
电话沟通
</
Button
>
<
Button
className=
'btn-right'
size=
'small'
type=
"primary"
>
立即预约
</
Button
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
pages/jobServices/index.page.tsx
浏览文件 @
85d17ed1
...
@@ -19,7 +19,7 @@ interface ImageListType {}
...
@@ -19,7 +19,7 @@ interface ImageListType {}
export
default
function
JobServices
()
{
export
default
function
JobServices
()
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
[
list
,
setList
]
=
useState
([
const
[
list
,
setList
]
=
useState
([
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
90a52d3e-1ffa-4347-886e-a1c4535cf8b3
.jpg"
,
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/
540X844-2(1)
.jpg"
,
// "https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/665512fd-12e6-49a9-93c1-f9dcd0e82083.jpg",
// "https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/665512fd-12e6-49a9-93c1-f9dcd0e82083.jpg",
]);
]);
const
[
productList
,
setProductList
]
=
useState
(
const
[
productList
,
setProductList
]
=
useState
(
...
...
pages/mall/detail/[id].page.tsx
浏览文件 @
85d17ed1
import
styles
from
"./index.module.scss"
;
import
styles
from
"./index.module.scss"
;
import
Layout
from
"~/components/layout"
;
import
Layout
from
"~/components/layout"
;
import
{
Space
,
Image
as
AImage
,
Row
,
Col
,
Button
,
Divider
,
Badge
}
from
"antd"
;
import
{
Space
,
Image
as
AImage
,
Row
,
Col
,
Button
,
Divider
,
Badge
}
from
"antd"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
use
Context
,
use
Effect
,
useState
}
from
"react"
;
import
{
DownOutlined
,
RightOutlined
}
from
"@ant-design/icons"
;
import
{
DownOutlined
,
RightOutlined
}
from
"@ant-design/icons"
;
import
Image
from
"next/image"
;
import
Image
from
"next/image"
;
import
errImg
from
"~/assets/errImg"
;
import
errImg
from
"~/assets/errImg"
;
...
@@ -15,16 +15,28 @@ import "swiper/css";
...
@@ -15,16 +15,28 @@ import "swiper/css";
import
"swiper/css/navigation"
;
import
"swiper/css/navigation"
;
import
api
,
{
GetAppGoodsInfoDetailResult
}
from
"./api"
;
import
api
,
{
GetAppGoodsInfoDetailResult
}
from
"./api"
;
import
IntentionModal
from
"./components/intentionModal"
;
import
IntentionModal
from
"./components/intentionModal"
;
import
{
UserContext
}
from
"~/lib/userProvider"
;
export
default
function
MallDetail
()
{
export
default
function
MallDetail
()
{
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
{
userInfo
,
setNeedLogin
}
=
useContext
(
UserContext
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
//商品图预览
const
router
=
useRouter
();
const
router
=
useRouter
();
const
[
id
,
setId
]
=
useState
<
number
|
null
>
(
null
);
const
[
id
,
setId
]
=
useState
<
number
|
null
>
(
null
);
const
[
detail
,
setDetail
]
=
useState
<
GetAppGoodsInfoDetailResult
|
null
>
(
const
[
detail
,
setDetail
]
=
useState
<
GetAppGoodsInfoDetailResult
|
null
>
(
null
null
);
//详情数据
);
//详情数据
const
[
intentionModalOpen
,
setIntentionModalOpen
]
=
useState
(
false
);
//意向弹窗
const
[
intentionModalOpen
,
setIntentionModalOpen
]
=
useState
(
false
);
//意向弹窗
//打开意向modal
const
openIntentionModal
=
()
=>
{
if
(
userInfo
)
{
setIntentionModalOpen
(
true
);
}
else
{
setNeedLogin
(
true
);
}
};
//提交意向
const
handleIntentionOk
=
()
=>
{
const
handleIntentionOk
=
()
=>
{
setIntentionModalOpen
(
false
);
setIntentionModalOpen
(
false
);
};
};
...
@@ -52,7 +64,12 @@ export default function MallDetail() {
...
@@ -52,7 +64,12 @@ export default function MallDetail() {
return
(
return
(
<
Layout
>
<
Layout
>
{
/* 意向弹窗 */
}
{
/* 意向弹窗 */
}
<
IntentionModal
open=
{
intentionModalOpen
}
onOk=
{
handleIntentionOk
}
onCancel=
{
handleIntentionCancel
}
></
IntentionModal
>
<
IntentionModal
open=
{
intentionModalOpen
}
detail=
{
detail
}
onOk=
{
handleIntentionOk
}
onCancel=
{
handleIntentionCancel
}
></
IntentionModal
>
<
div
className=
"page"
style=
{
{
marginTop
:
20
,
backgroundColor
:
"#fff"
}
}
>
<
div
className=
"page"
style=
{
{
marginTop
:
20
,
backgroundColor
:
"#fff"
}
}
>
<
div
style=
{
{
display
:
"none"
}
}
>
<
div
style=
{
{
display
:
"none"
}
}
>
<
AImage
.
PreviewGroup
<
AImage
.
PreviewGroup
...
@@ -134,7 +151,9 @@ export default function MallDetail() {
...
@@ -134,7 +151,9 @@ export default function MallDetail() {
</
Col
>
</
Col
>
<
Col
>
<
Col
>
<
Row
align=
"middle"
style=
{
{
cursor
:
"pointer"
}
}
>
<
Row
align=
"middle"
style=
{
{
cursor
:
"pointer"
}
}
>
<
Col
className=
{
styles
.
font4
}
onClick=
{
()
=>
setIntentionModalOpen
(
true
)
}
>
共3种可选
</
Col
>
<
Col
className=
{
styles
.
font4
}
onClick=
{
openIntentionModal
}
>
共3种可选
</
Col
>
<
Col
style=
{
{
marginLeft
:
9
}
}
>
<
Col
style=
{
{
marginLeft
:
9
}
}
>
<
DownOutlined
<
DownOutlined
style=
{
{
style=
{
{
...
@@ -169,8 +188,14 @@ export default function MallDetail() {
...
@@ -169,8 +188,14 @@ export default function MallDetail() {
</
Row
>
</
Row
>
</
Space
>
</
Space
>
<
Space
size=
{
12
}
style=
{
{
marginTop
:
123
}
}
>
<
Space
size=
{
12
}
style=
{
{
marginTop
:
123
}
}
>
<
Button
className=
{
styles
.
btn1
}
>
加入购物车
</
Button
>
<
Button
className=
{
styles
.
btn1
}
onClick=
{
openIntentionModal
}
>
<
Button
className=
{
styles
.
btn2
}
type=
"primary"
onClick=
{
()
=>
setIntentionModalOpen
(
true
)
}
>
加入购物车
</
Button
>
<
Button
className=
{
styles
.
btn2
}
type=
"primary"
onClick=
{
openIntentionModal
}
>
提交意向
提交意向
</
Button
>
</
Button
>
<
Space
size=
{
20
}
style=
{
{
marginLeft
:
19
}
}
>
<
Space
size=
{
20
}
style=
{
{
marginLeft
:
19
}
}
>
...
...
pages/mall/detail/api/index.ts
浏览文件 @
85d17ed1
...
@@ -46,7 +46,7 @@ export interface GoodsSpec {
...
@@ -46,7 +46,7 @@ export interface GoodsSpec {
skuId
:
number
;
skuId
:
number
;
brandInfoId
:
number
;
brandInfoId
:
number
;
skuName
:
string
;
skuName
:
string
;
productSpecList
:
ProductSpec
List
[];
productSpecList
:
ProductSpec
[];
industrySpecList
?:
any
;
industrySpecList
?:
any
;
chooseType
:
number
;
chooseType
:
number
;
skuUnitId
:
number
;
skuUnitId
:
number
;
...
@@ -55,7 +55,7 @@ export interface GoodsSpec {
...
@@ -55,7 +55,7 @@ export interface GoodsSpec {
flag
?:
any
;
flag
?:
any
;
}
}
export
interface
ProductSpec
List
{
export
interface
ProductSpec
{
id
:
number
;
id
:
number
;
productSpec
:
number
;
productSpec
:
number
;
productSkuId
:
number
;
productSkuId
:
number
;
...
...
pages/mall/detail/components/intentionModal/index.tsx
浏览文件 @
85d17ed1
import
{
Button
,
Col
,
Image
,
Modal
,
Row
,
Space
}
from
"antd"
;
import
{
Button
,
Col
,
Image
,
Modal
,
Row
,
Space
}
from
"antd"
;
import
{
useState
}
from
"react"
;
import
{
useState
}
from
"react"
;
import
errImg
from
"~/assets/errImg"
;
import
errImg
from
"~/assets/errImg"
;
import
{
GetAppGoodsInfoDetailResult
}
from
"../../api"
;
import
styles
from
"./index.module.scss"
;
import
styles
from
"./index.module.scss"
;
type
Props
=
{
type
Props
=
{
open
?:
boolean
;
open
?:
boolean
;
onOk
?:
(
e
:
React
.
MouseEvent
<
HTMLButtonElement
>
)
=>
void
;
onOk
?:
(
e
:
React
.
MouseEvent
<
HTMLButtonElement
>
)
=>
void
;
onCancel
?:
(
e
:
React
.
MouseEvent
<
HTMLButtonElement
>
)
=>
void
;
onCancel
:
(
e
:
React
.
MouseEvent
<
HTMLButtonElement
>
)
=>
void
;
detail
:
GetAppGoodsInfoDetailResult
|
null
;
};
};
export
default
function
IntentionModal
(
props
:
Props
)
{
export
default
function
IntentionModal
(
props
:
Props
)
{
const
list
=
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
];
const
[
checkedMap
,
setCheckedMap
]
=
useState
<
{
string
?:
boolean
}
>
({});
//通过索引记录选中的产品规格 例: {'1,1': true|false}
//添加规格到购物车
function
addProductSpec
(
goodsSpecIndex
:
number
,
productSpecIndex
:
number
)
{
let
temp
=
{};
//@ts-ignore
temp
[
`
${
goodsSpecIndex
}
,
${
productSpecIndex
}
`
]
=
//@ts-ignore
!
checkedMap
[
`
${
goodsSpecIndex
}
,
${
productSpecIndex
}
`
];
setCheckedMap
({
...
checkedMap
,
...
temp
,
});
}
return
(
return
(
<
Modal
<
Modal
...
@@ -21,7 +37,13 @@ export default function IntentionModal(props: Props) {
...
@@ -21,7 +37,13 @@ export default function IntentionModal(props: Props) {
className=
{
styles
.
model
}
className=
{
styles
.
model
}
footer=
{
footer=
{
<
div
style=
{
{
padding
:
"13px 36px"
}
}
>
<
div
style=
{
{
padding
:
"13px 36px"
}
}
>
<
Button
type=
"primary"
className=
{
styles
.
font5
}
style=
{
{
width
:
'100%'
,
height
:
44
}
}
>
提交意向
</
Button
>
<
Button
type=
"primary"
className=
{
styles
.
font5
}
style=
{
{
width
:
"100%"
,
height
:
44
}
}
>
提交意向
</
Button
>
</
div
>
</
div
>
}
}
>
>
...
@@ -32,6 +54,7 @@ export default function IntentionModal(props: Props) {
...
@@ -32,6 +54,7 @@ export default function IntentionModal(props: Props) {
height=
{
100
}
height=
{
100
}
fallback=
{
errImg
}
fallback=
{
errImg
}
style=
{
{
borderRadius
:
8
}
}
style=
{
{
borderRadius
:
8
}
}
src=
{
props
.
detail
?.
images
?.[
0
]?.
imgUrl
}
></
Image
>
></
Image
>
</
Col
>
</
Col
>
<
Col
flex=
"auto"
style=
{
{
marginLeft
:
13
,
width
:
230
}
}
>
<
Col
flex=
"auto"
style=
{
{
marginLeft
:
13
,
width
:
230
}
}
>
...
@@ -39,13 +62,13 @@ export default function IntentionModal(props: Props) {
...
@@ -39,13 +62,13 @@ export default function IntentionModal(props: Props) {
className=
{
`${styles.font1} ${styles.ellipsis1}`
}
className=
{
`${styles.font1} ${styles.ellipsis1}`
}
style=
{
{
marginTop
:
28
}
}
style=
{
{
marginTop
:
28
}
}
>
>
垂直起降固定翼 插翅虎M9
{
props
.
detail
?.
goodsName
}
</
div
>
</
div
>
<
div
<
div
className=
{
`${styles.font2} ${styles.ellipsis2}`
}
className=
{
`${styles.font2} ${styles.ellipsis2}`
}
style=
{
{
marginTop
:
7
}
}
style=
{
{
marginTop
:
7
}
}
>
>
已选:
入云龙【机壳喷绘】+金眼彪Z40【222222222222222222222222233333555555555555555
已选:
</
div
>
</
div
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
...
@@ -54,40 +77,59 @@ export default function IntentionModal(props: Props) {
...
@@ -54,40 +77,59 @@ export default function IntentionModal(props: Props) {
<
div
className=
{
styles
.
font3
}
style=
{
{}
}
>
<
div
className=
{
styles
.
font3
}
style=
{
{}
}
>
无人机
无人机
</
div
>
</
div
>
<
div
>
{
props
.
detail
?.
goodsSpec
?.
map
((
item
,
goodsSpecIndex
)
=>
{
<
div
return
(
className=
{
styles
.
font2
}
<
div
key=
{
item
.
id
}
>
style=
{
{
marginBottom
:
5
,
marginTop
:
11
}
}
<
div
>
className=
{
styles
.
font2
}
入云龙
style=
{
{
marginBottom
:
5
,
marginTop
:
11
}
}
</
div
>
>
<
Space
size=
{
10
}
direction=
"vertical"
style=
{
{
width
:
"100%"
}
}
>
{
item
.
goodsSpecName
}
{
list
.
map
((
item
,
i
)
=>
{
</
div
>
return
(
<
Space
size=
{
10
}
direction=
"vertical"
style=
{
{
width
:
"100%"
}
}
>
<
Row
{
item
.
productSpecList
?.
map
((
product
,
productSpecIndex
)
=>
{
key=
{
i
}
return
(
align=
"middle"
<
Row
wrap=
{
false
}
key=
{
product
.
id
}
style=
{
{
align=
"middle"
borderRadius
:
5
,
wrap=
{
false
}
border
:
"1px solid #d6d6d6"
,
style=
{
{
height
:
50
,
borderRadius
:
5
,
}
}
//@ts-ignore
>
border
:
checkedMap
[
<
Col
style=
{
{
marginLeft
:
7
}
}
>
`${goodsSpecIndex},${productSpecIndex}`
<
Image
width=
{
52
}
height=
{
36
}
src=
""
fallback=
{
errImg
}
preview=
{
false
}
></
Image
>
]
</
Col
>
?
"1px solid #FF552D"
<
Col
:
"1px solid #d6d6d6"
,
className=
{
`${styles.ellipsis1} ${styles.font4}`
}
height
:
50
,
style=
{
{
width
:
238
,
marginLeft
:
18
}
}
cursor
:
"pointer"
,
>
}
}
入云龙1-机壳喷绘
onClick=
{
()
=>
</
Col
>
addProductSpec
(
goodsSpecIndex
,
productSpecIndex
)
</
Row
>
}
);
>
})
}
<
Col
style=
{
{
marginLeft
:
7
}
}
>
</
Space
>
<
Image
</
div
>
width=
{
52
}
height=
{
36
}
src=
{
product
.
specImage
}
fallback=
{
errImg
}
preview=
{
false
}
></
Image
>
</
Col
>
<
Col
className=
{
`${styles.ellipsis1} ${styles.font4}`
}
style=
{
{
width
:
238
,
marginLeft
:
18
}
}
>
{
product
.
specName
}
</
Col
>
</
Row
>
);
})
}
</
Space
>
</
div
>
);
})
}
</
div
>
</
div
>
</
div
>
</
div
>
</
Modal
>
</
Modal
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论