Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
3607b7bf
提交
3607b7bf
authored
12月 20, 2023
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:提交成功弹窗
上级
aca83790
流水线
#7686
已通过 于阶段
in 5 分 5 秒
变更
6
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
74 行增加
和
20 行删除
+74
-20
index.tsx
src/components/layout/index.tsx
+7
-0
index.tsx
src/components/product-comp/product-head/index.tsx
+3
-3
index.tsx
src/components/toastModal/index.tsx
+30
-2
_document.tsx
src/pages/_document.tsx
+2
-0
[id].tsx
src/pages/cart/submit/[id].tsx
+30
-15
globalData.ts
src/store/module/globalData.ts
+2
-0
没有找到文件。
src/components/layout/index.tsx
浏览文件 @
3607b7bf
...
...
@@ -6,6 +6,7 @@ import HeaderView from '@/components/layout/header';
import
{
LayoutWrap
}
from
'@/components/layout/styled'
;
import
LoginModalView
from
'@/components/loginModal'
;
import
QrcodeModalView
from
'@/components/qrcodeModal'
;
import
ToastModalView
from
'@/components/toastModal'
;
import
{
RootState
}
from
'@/store'
;
import
{
GlobalDataState
,
setGlobalData
}
from
'@/store/module/globalData'
;
...
...
@@ -25,6 +26,7 @@ const LayoutView: React.FC<{
setGlobalData
({
loginModalVisible
:
false
,
qrcodeModalVisible
:
false
,
toastModalVisible
:
false
,
}),
);
};
...
...
@@ -53,6 +55,11 @@ const LayoutView: React.FC<{
open=
{
globalData
?.
qrcodeModalVisible
}
onCancel=
{
handleModalClose
}
/>
{
/* 功能正在完善中 */
}
<
ToastModalView
open=
{
globalData
?.
toastModalVisible
}
onCancel=
{
handleModalClose
}
/>
</
LayoutWrap
>
);
};
...
...
src/components/product-comp/product-head/index.tsx
浏览文件 @
3607b7bf
...
...
@@ -227,9 +227,9 @@ const ProductHeadView: React.FC<{ detail: DetailType }> = ({ detail }) => {
</div>
</div>
<div className="content-action flex-start select-none">
<div className="action-item" onClick={() => handleSubmit(3)}>
加入购物车
</div>
{/* <div className="action-item" onClick={() => handleSubmit(3)}> */}
{/* 加入购物车 */}
{/* </div> */}
<div className="action-item" onClick={() => handleSubmit(2)}>
提交意向
</div>
...
...
src/components/toastModal/index.tsx
浏览文件 @
3607b7bf
import
React
from
'react'
;
import
{
CheckCircleOutlined
}
from
'@ant-design/icons'
;
import
{
Modal
}
from
'antd'
;
import
styled
from
'styled-components'
;
const
ToastModalView
:
React
.
FC
<
{
open
:
boolean
;
onCancel
:
()
=>
void
;
}
>
=
({
open
,
onCancel
})
=>
{
return
(
<
Modal
open=
{
open
}
title=
{
'提示'
}
>
通知弹窗
<
Modal
open=
{
open
}
title=
{
'提示'
}
onCancel=
{
onCancel
}
width=
{
400
}
footer=
{
null
}
>
<
ToastModalWrap
>
<
CheckCircleOutlined
style=
{
{
color
:
'#07c160'
,
fontSize
:
68
}
}
/>
<
div
className=
"toast-title"
>
订单提交成功
</
div
>
</
ToastModalWrap
>
</
Modal
>
);
};
export
default
ToastModalView
;
// 样式
const
ToastModalWrap
=
styled
.
div
`
position: relative;
width: 100%;
height: 16.8rem;
display: flex;
justify-content: flex-start;
align-items: center;
flex-direction: column;
box-sizing: border-box;
padding-top: 3rem;
.toast-title {
font-size: 20px;
font-weight: bold;
margin-top: 2.5rem;
}
`
;
src/pages/_document.tsx
浏览文件 @
3607b7bf
...
...
@@ -17,6 +17,8 @@ const MyDocument = () => (
{
/* eslint-disable-next-line */
}
<
title
>
云享飞
</
title
>
{
/* <title>【云享飞 iuav.com】无人机分类信息 - 让世界为天空所用</title> */
}
{
/* 强制使用浅色模式 */
}
<
meta
name=
"color-scheme"
content=
"light"
/>
</
Head
>
<
body
>
<
Main
/>
...
...
src/pages/cart/submit/[id].tsx
浏览文件 @
3607b7bf
import
React
from
'react'
;
import
{
Input
}
from
'antd'
;
import
{
Input
,
Modal
}
from
'antd'
;
import
Big
from
'big.js'
;
import
{
GetServerSidePropsContext
}
from
'next'
;
import
{
useRouter
}
from
'next/router'
;
...
...
@@ -74,20 +74,35 @@ const MallCartSubmitView: React.FC<{
// 提交订单
const
handleSubmit
=
()
=>
{
if
(
!
productDetail
?.
id
)
return
;
const
{
id
,
specId
,
type
}
=
router
.
query
as
{
[
key
:
string
]:
string
};
const
path
=
`k=
${
id
}
&sId=
${
specId
}
&sNum=
${
globalData
?.
productSpecNum
||
1
}
&
t
=
$
{
type
}
`;
dispatch(
setGlobalData({
qrcodeModalVisible: true,
qrcodeModalPath:
path.length >= 32
? 'page-product/product-detail/index'
: 'page-order/product-confirm/index',
qrcodeModalScene: path.length >= 32 ? `
id
=
$
{
id
}
` : path,
}),
);
Modal
.
confirm
({
title
:
'提示'
,
content
:
`确认提交订单?`
,
onOk
:
()
=>
{
dispatch
(
setGlobalData
({
loadingSpinnerVisible
:
true
}));
setTimeout
(()
=>
{
dispatch
(
setGlobalData
({
toastModalVisible
:
true
,
loadingSpinnerVisible
:
false
,
}),
);
},
1000
);
},
});
// const { id, specId, type } = router.query as { [key: string]: string };
// const path = `k=${id}&sId=${specId}&sNum=${
// globalData?.productSpecNum || 1
// }&t=${type}`;
// dispatch(
// setGlobalData({
// qrcodeModalVisible: true,
// qrcodeModalPath:
// path.length >= 32
// ? 'page-product/product-detail/index'
// : 'page-order/product-confirm/index',
// qrcodeModalScene: path.length >= 32 ? `id=${id}` : path,
// }),
// );
};
return
(
<
LayoutView
>
...
...
src/store/module/globalData.ts
浏览文件 @
3607b7bf
...
...
@@ -15,12 +15,14 @@ export type GlobalDataState = {
userAddressSelectId
?:
number
;
productSpecNum
?:
number
;
priceUnitList
?:
InterDataType
<
ListInspectionPriceUnit
>
;
toastModalVisible
:
boolean
;
};
const
initialState
:
GlobalDataState
=
{
loadingSpinnerVisible
:
false
,
loginModalVisible
:
false
,
qrcodeModalVisible
:
false
,
toastModalVisible
:
false
,
};
const
globalDataSlice
=
createSlice
({
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论