Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
1a02234b
提交
1a02234b
authored
1月 06, 2024
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:订单购买成功
上级
6f13e17d
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
141 行增加
和
12 行删除
+141
-12
index.tsx
src/components/breadcrumb/index.tsx
+2
-0
index.tsx
src/components/payment-checkout/index.tsx
+4
-1
[id].tsx
src/pages/cart/submit/[id].tsx
+7
-9
[second].tsx
src/pages/mall/[main]/[second].tsx
+1
-1
index.tsx
src/pages/mall/[main]/index.tsx
+1
-1
[id].tsx
src/pages/order/success/[id].tsx
+126
-0
没有找到文件。
src/components/breadcrumb/index.tsx
浏览文件 @
1a02234b
...
...
@@ -31,6 +31,8 @@ const BreadcrumbView: React.FC = () => {
{
name
:
'购物车'
,
path
:
'cart'
},
{
name
:
'提交订单'
,
path
:
'submit'
},
{
name
:
'服务详情'
,
path
:
'detail'
},
{
name
:
'产品订单'
,
path
:
'order'
},
{
name
:
'提交成功'
,
path
:
'success'
},
];
// 转换路由
const
getCurrentRouter
=
()
=>
{
...
...
src/components/payment-checkout/index.tsx
浏览文件 @
1a02234b
...
...
@@ -124,9 +124,12 @@ const PaymentCheckout: React.FC<{ cost: number }> = ({ cost }) => {
useEffect
(()
=>
{
if
(
!
system
?.
token
)
return
;
getUserPayWalletInfo
().
then
();
},
[
cost
]);
// 钱包金额副作用
useEffect
(()
=>
{
if
(
!
cost
)
return
;
setDefaultSelect
();
},
[
cost
]);
},
[
walletInfo
]);
return
(
<
PaymentCheckoutWrap
>
<
Checkbox
.
Group
value=
{
paymentTypeValue
}
onChange=
{
setPaymentTypeValue
}
>
...
...
src/pages/cart/submit/[id].tsx
浏览文件 @
1a02234b
import
React
from
'react'
;
import
{
Input
,
Modal
}
from
'antd'
;
import
{
Input
,
message
,
Modal
}
from
'antd'
;
import
Big
from
'big.js'
;
import
{
GetServerSidePropsContext
}
from
'next'
;
import
{
useRouter
}
from
'next/router'
;
...
...
@@ -79,14 +79,12 @@ const MallCartSubmitView: React.FC<{
content
:
`确认提交订单?`
,
onOk
:
()
=>
{
dispatch
(
setGlobalData
({
loadingSpinnerVisible
:
true
}));
setTimeout
(()
=>
{
dispatch
(
setGlobalData
({
toastModalVisible
:
true
,
toastModalBack
:
true
,
loadingSpinnerVisible
:
false
,
}),
);
setTimeout
(
async
()
=>
{
dispatch
(
setGlobalData
({
loadingSpinnerVisible
:
false
}));
await
Promise
.
all
([
message
.
success
(
'订单提交成功'
),
router
.
push
(
'/order/success/236'
),
]);
},
1000
);
},
});
...
...
src/pages/mall/[main]/[second].tsx
浏览文件 @
1a02234b
...
...
@@ -27,6 +27,6 @@ export async function getServerSideProps() {
}
const
MallSecondView
:
React
.
FC
<
{
categoryList
:
CategoryListType
;
}
>
=
(
props
)
=>
MallView
(
props
)
;
}
>
=
(
props
)
=>
<
MallView
{
...
props
}
/>
;
export
default
MallSecondView
;
src/pages/mall/[main]/index.tsx
浏览文件 @
1a02234b
...
...
@@ -27,6 +27,6 @@ export async function getServerSideProps() {
}
const
MallMainView
:
React
.
FC
<
{
categoryList
:
CategoryListType
;
}
>
=
(
props
)
=>
MallView
(
props
)
;
}
>
=
(
props
)
=>
<
MallView
{
...
props
}
/>
;
export
default
MallMainView
;
src/pages/order/success/[id].tsx
0 → 100644
浏览文件 @
1a02234b
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
CheckCircleFilled
}
from
'@ant-design/icons'
;
import
{
Button
}
from
'antd'
;
import
styled
from
'styled-components'
;
import
{
HomeAPI
}
from
'@/api'
;
import
{
InterDataType
}
from
'@/api/interface'
;
import
{
RecommendGoodsType
}
from
'@/api/interface/home'
;
import
BreadcrumbView
from
'@/components/breadcrumb'
;
import
LayoutView
from
'@/components/layout'
;
import
ProductItemView
from
'@/components/productItem'
;
// 列表类型
type
ListType
=
InterDataType
<
RecommendGoodsType
>
;
const
OrderSuccessView
=
()
=>
{
// 推荐商品列表
const
[
recommendGoodsList
,
setRecommendGoodsList
]
=
useState
<
ListType
[
0
][
'mallGoodsList'
]
>
([]);
// 获取推荐商品
const
getRecommendGoodsList
=
async
()
=>
{
const
res
=
await
HomeAPI
.
getRecommendGoods
();
if
(
res
&&
res
.
code
===
'200'
)
{
const
list
=
res
.
result
||
[];
setRecommendGoodsList
(
list
?.
map
((
i
)
=>
i
.
mallGoodsList
)
?.
flat
()
?.
slice
(
0
,
10
),
);
}
};
// 页面加载
useEffect
(()
=>
{
getRecommendGoodsList
().
then
();
},
[]);
return
(
<
LayoutView
>
<
OrderSuccessWrap
>
<
BreadcrumbView
/>
<
div
className=
"order-success"
>
<
div
className=
"success-title"
>
<
CheckCircleFilled
className=
"text-3xl text-[#54A536]"
/>
<
div
className=
"title"
>
您已成功付款
</
div
>
</
div
>
<
div
className=
"success-content"
>
<
div
className=
"content-item mb-2 flex"
>
<
div
className=
"item-label"
>
收货地址:
</
div
>
<
div
className=
"item-value"
>
浙江省杭州市富阳区银湖街道富闲路15号浙大网新银湖科技园25幢
{
' '
}
吴彦祖 18888888888
</
div
>
</
div
>
<
div
className=
"content-item mb-2 flex"
>
<
div
className=
"item-label"
>
实付款:
</
div
>
<
div
className=
"item-value price"
>
¥19.9
</
div
>
</
div
>
<
Button
type=
"link"
className=
"mb-2 px-0"
>
查看订单
</
Button
>
</
div
>
</
div
>
<
div
className=
"order-product"
>
{
recommendGoodsList
?.
map
((
i
,
j
)
=>
(
<
ProductItemView
key=
{
j
}
detail=
{
i
as
any
}
/>
))
}
</
div
>
</
OrderSuccessWrap
>
</
LayoutView
>
);
};
export
default
OrderSuccessView
;
// 样式
const
OrderSuccessWrap
=
styled
.
div
`
position: relative;
max-width: 1190px;
box-sizing: border-box;
padding: 2rem 0 0 0;
margin: 0 auto;
.order-success {
position: relative;
width: 100%;
box-sizing: border-box;
min-height: 8.25rem;
border: 0.02rem solid #e3e3e3;
margin-bottom: 1rem;
.success-title {
position: relative;
width: 100%;
height: 3.5rem;
background: #ecffdc;
display: flex;
justify-content: flex-start;
align-items: center;
box-sizing: border-box;
padding: 0 5rem;
margin-bottom: 1rem;
.title {
font-size: 16px;
font-weight: bold;
margin-left: 1rem;
}
}
.success-content {
position: relative;
width: 100%;
box-sizing: border-box;
padding: 0 5rem;
color: #999999;
.price {
color: #ea0000;
font-weight: bold;
}
}
}
.order-product {
position: relative;
width: 100%;
box-sizing: border-box;
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
margin-bottom: 1rem;
}
`
;
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论