Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
0f44fa60
提交
0f44fa60
authored
6月 11, 2023
作者:
曹云
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添-设备租赁-订单按照1-7天,8-15天,16-30天,30天以上进行钱款计算,商品规格价格接口
上级
c1e5ee7d
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
73 行增加
和
31 行删除
+73
-31
[id].page.tsx
pages/equipmentLeasing/detail/[id].page.tsx
+44
-15
index.tsx
pages/equipmentLeasing/detail/api/index.tsx
+1
-1
index.tsx
...quipmentLeasing/detail/components/orderForGoods/index.tsx
+28
-15
没有找到文件。
pages/equipmentLeasing/detail/[id].page.tsx
浏览文件 @
0f44fa60
...
@@ -20,7 +20,11 @@ import {
...
@@ -20,7 +20,11 @@ import {
}
from
'antd'
}
from
'antd'
import
Image
from
'next/image'
import
Image
from
'next/image'
import
errImg
from
'~/assets/errImg'
import
errImg
from
'~/assets/errImg'
import
api
,
{
GetWebDeviceDetailResult
,
GetWebDeviceWareSkuById
}
from
'./api'
import
api
,
{
GetWebDeviceDetailResult
,
GetWebDeviceWareSkuById
,
GetLeaseGoodsResult
,
}
from
'./api'
import
{
UserContext
}
from
'~/lib/userProvider'
import
{
UserContext
}
from
'~/lib/userProvider'
import
flowPat
from
'./assets/flow-path.png'
import
flowPat
from
'./assets/flow-path.png'
import
{
RangePickerProps
}
from
'antd/es/date-picker'
import
{
RangePickerProps
}
from
'antd/es/date-picker'
...
@@ -76,13 +80,15 @@ export default function EquipmentLeasingDetail() {
...
@@ -76,13 +80,15 @@ export default function EquipmentLeasingDetail() {
const
[
form
]
=
Form
.
useForm
()
const
[
form
]
=
Form
.
useForm
()
const
[
formDate
]
=
Form
.
useForm
()
const
[
formDate
]
=
Form
.
useForm
()
const
tagsData
=
[
const
tagsData
=
[
{
label
:
'1-7天'
,
disable
:
false
},
{
id
:
0
,
label
:
'1-7天'
,
disable
:
false
},
{
label
:
'8-15天'
,
disable
:
false
},
{
id
:
1
,
label
:
'8-15天'
,
disable
:
false
},
{
label
:
'16-30天'
,
disable
:
false
},
{
id
:
2
,
label
:
'16-30天'
,
disable
:
false
},
{
label
:
'30天以上'
,
disable
:
false
},
{
id
:
3
,
label
:
'30天以上'
,
disable
:
false
},
]
]
const
[
discount
,
setDiscount
]
=
useState
<
GetLeaseGoodsResult
|
null
>
()
const
[
selectedTags
,
setSelectedTags
]
=
useState
<
number
>
()
const
[
selectedTags
,
setSelectedTags
]
=
useState
<
number
>
()
const
[
selectedTagsData
,
setSelectedTagsData
]
=
useState
<
string
>
()
const
[
selectedTagsData
,
setSelectedTagsData
]
=
useState
<
number
>
()
const
[
shopDetail
,
setShopDetail
]
=
useState
<
ShopDetail
>
()
const
[
shopDetail
,
setShopDetail
]
=
useState
<
ShopDetail
>
()
const
showModal
=
()
=>
{
const
showModal
=
()
=>
{
...
@@ -91,8 +97,9 @@ export default function EquipmentLeasingDetail() {
...
@@ -91,8 +97,9 @@ export default function EquipmentLeasingDetail() {
if
(
wareSkuList
?.
length
)
{
if
(
wareSkuList
?.
length
)
{
setSelectedTags
(
wareSkuList
[
0
].
id
)
setSelectedTags
(
wareSkuList
[
0
].
id
)
form
.
setFieldValue
(
'id'
,
wareSkuList
[
0
].
id
)
form
.
setFieldValue
(
'id'
,
wareSkuList
[
0
].
id
)
setSelectedTagsData
(
'1-7天'
)
setSelectedTagsData
(
0
)
form
.
setFieldValue
(
'date'
,
'3-7天'
)
form
.
setFieldValue
(
'date'
,
0
)
getPrice
(
0
)
}
}
}
else
{
}
else
{
setNeedLogin
(
true
)
setNeedLogin
(
true
)
...
@@ -157,16 +164,30 @@ export default function EquipmentLeasingDetail() {
...
@@ -157,16 +164,30 @@ export default function EquipmentLeasingDetail() {
}
}
const
handleChangeDate
=
(
const
handleChangeDate
=
(
tag
:
string
,
tag
:
number
,
checked
:
boolean
,
checked
:
boolean
,
disable
:
boolean
disable
:
boolean
)
=>
{
)
=>
{
if
(
checked
&&
!
disable
)
{
if
(
checked
&&
!
disable
)
{
const
nextSelectedTags
=
checked
const
nextSelectedTags
=
checked
?
tag
?
tag
:
tagsData
.
filter
((
t
)
=>
t
.
label
!==
tag
)[
0
].
label
:
tagsData
.
filter
((
t
)
=>
t
.
id
!==
tag
)[
0
].
id
setSelectedTagsData
(
nextSelectedTags
)
setSelectedTagsData
(
nextSelectedTags
)
form
.
setFieldValue
(
'date'
,
tag
)
form
.
setFieldValue
(
'date'
,
tag
)
getPrice
(
tag
)
}
}
const
getPrice
=
(
tag
:
number
)
=>
{
const
Id
=
wareSkuList
?.
filter
(
(
item
)
=>
item
.
id
===
form
.
getFieldValue
(
'id'
)
)[
0
].
productSpec
if
(
Id
)
{
api
.
GoodsPriceDetail
({
leaseTerm
:
tag
,
productSpecId
:
Id
})
.
then
((
res
)
=>
{
setDiscount
(
res
.
result
)
})
}
}
}
}
...
@@ -307,7 +328,9 @@ export default function EquipmentLeasingDetail() {
...
@@ -307,7 +328,9 @@ export default function EquipmentLeasingDetail() {
<
div
className=
"right"
>
<
div
className=
"right"
>
<
div
className=
"top"
>
<
div
className=
"top"
>
<
span
className=
"tag"
>
¥
</
span
>
<
span
className=
"tag"
>
¥
</
span
>
<
span
className=
"money"
>
{
detail
?.
price
||
0
}
</
span
>
<
span
className=
"money"
>
{
discount
?.
specPrice
[
0
]?.
price
||
0
}
</
span
>
<
span
className=
"unit"
>
/天
</
span
>
<
span
className=
"unit"
>
/天
</
span
>
</
div
>
</
div
>
<
div
className=
"bottom"
>
渠道免押金
</
div
>
<
div
className=
"bottom"
>
渠道免押金
</
div
>
...
@@ -348,10 +371,10 @@ export default function EquipmentLeasingDetail() {
...
@@ -348,10 +371,10 @@ export default function EquipmentLeasingDetail() {
<
Space
size=
{
[
0
,
8
]
}
wrap
>
<
Space
size=
{
[
0
,
8
]
}
wrap
>
{
tagsData
.
map
((
tag
)
=>
(
{
tagsData
.
map
((
tag
)
=>
(
<
CheckableTag
<
CheckableTag
key=
{
tag
.
label
}
key=
{
tag
.
id
}
checked=
{
tag
.
label
===
selectedTagsData
}
checked=
{
tag
.
id
===
selectedTagsData
}
onChange=
{
(
checked
)
=>
onChange=
{
(
checked
)
=>
handleChangeDate
(
tag
.
label
,
checked
,
tag
.
disable
)
handleChangeDate
(
tag
.
id
,
checked
,
tag
.
disable
)
}
}
className=
{
`tagsData ${
className=
{
`tagsData ${
tag.disable ? 'disable tagsDisable' : ''
tag.disable ? 'disable tagsDisable' : ''
...
@@ -423,7 +446,12 @@ export default function EquipmentLeasingDetail() {
...
@@ -423,7 +446,12 @@ export default function EquipmentLeasingDetail() {
<
div
className=
"bottom-item"
>
<
div
className=
"bottom-item"
>
<
div
className=
"label"
>
租金合计
</
div
>
<
div
className=
"label"
>
租金合计
</
div
>
<
div
className=
"price"
>
<
div
className=
"price"
>
<
div
className=
"left"
>
¥
{
detail
?.
price
!
*
days
!
||
0
}
</
div
>
<
div
className=
"left"
>
¥
{
discount
?.
specPrice
[
0
]?.
price
!
*
days
!
*
form
.
getFieldValue
(
'num'
)
||
0
}
</
div
>
{
/* <div className="right">(日均175)</div> */
}
{
/* <div className="right">(日均175)</div> */
}
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -435,6 +463,7 @@ export default function EquipmentLeasingDetail() {
...
@@ -435,6 +463,7 @@ export default function EquipmentLeasingDetail() {
shopDetail=
{
shopDetail
}
shopDetail=
{
shopDetail
}
days=
{
days
}
days=
{
days
}
detailData=
{
detail
}
detailData=
{
detail
}
discount=
{
discount
}
wareSkuList=
{
wareSkuList
?.
filter
(
wareSkuList=
{
wareSkuList
?.
filter
(
(
item
)
=>
item
.
id
===
form
.
getFieldValue
(
'id'
)
(
item
)
=>
item
.
id
===
form
.
getFieldValue
(
'id'
)
)
}
)
}
...
...
pages/equipmentLeasing/detail/api/index.tsx
浏览文件 @
0f44fa60
...
@@ -26,7 +26,7 @@ export interface GetLeaseGoodsResult {
...
@@ -26,7 +26,7 @@ export interface GetLeaseGoodsResult {
productSpecId
:
number
productSpecId
:
number
type
:
number
|
null
type
:
number
|
null
leaseTerm
:
number
leaseTerm
:
number
specPrice
:
PriceType
specPrice
:
PriceType
[]
}
}
export
interface
GetWebDeviceDetailResult
{
export
interface
GetWebDeviceDetailResult
{
id
:
number
id
:
number
...
...
pages/equipmentLeasing/detail/components/orderForGoods/index.tsx
浏览文件 @
0f44fa60
...
@@ -5,7 +5,11 @@ import { Button, Radio, Space, Input, message, Modal, Image } from 'antd'
...
@@ -5,7 +5,11 @@ import { Button, Radio, Space, Input, message, Modal, Image } from 'antd'
import
api
,
{
UserAddress
,
GetOrderForGoods
}
from
'./api'
import
api
,
{
UserAddress
,
GetOrderForGoods
}
from
'./api'
import
moment
from
'moment'
import
moment
from
'moment'
import
{
ShopDetail
}
from
'../../[id].page'
import
{
ShopDetail
}
from
'../../[id].page'
import
{
GetWebDeviceDetailResult
,
GetWebDeviceWareSkuById
}
from
'../../api'
import
{
GetWebDeviceDetailResult
,
GetWebDeviceWareSkuById
,
GetLeaseGoodsResult
,
}
from
'../../api'
import
{
UserContext
}
from
'~/lib/userProvider'
import
{
UserContext
}
from
'~/lib/userProvider'
const
{
TextArea
}
=
Input
const
{
TextArea
}
=
Input
...
@@ -15,11 +19,18 @@ interface PropsBox {
...
@@ -15,11 +19,18 @@ interface PropsBox {
days
?:
number
days
?:
number
shopDetail
?:
ShopDetail
shopDetail
?:
ShopDetail
wareSkuList
?:
GetWebDeviceWareSkuById
[]
wareSkuList
?:
GetWebDeviceWareSkuById
[]
discount
?:
GetLeaseGoodsResult
|
null
}
}
export
default
function
OrderForGoods
(
props
:
PropsBox
)
{
export
default
function
OrderForGoods
(
props
:
PropsBox
)
{
const
{
setIsorderForGoods
,
shopDetail
,
days
,
detailData
,
wareSkuList
}
=
const
{
props
setIsorderForGoods
,
shopDetail
,
days
,
detailData
,
wareSkuList
,
discount
,
}
=
props
const
[
value
,
setValue
]
=
useState
(
1
)
const
[
value
,
setValue
]
=
useState
(
1
)
const
[
areaValue
,
setAreaValue
]
=
useState
<
string
>
()
const
[
areaValue
,
setAreaValue
]
=
useState
<
string
>
()
const
[
list
,
setList
]
=
useState
<
Array
<
UserAddress
>
|
null
>
()
const
[
list
,
setList
]
=
useState
<
Array
<
UserAddress
>
|
null
>
()
...
@@ -35,8 +46,8 @@ export default function OrderForGoods(props: PropsBox) {
...
@@ -35,8 +46,8 @@ export default function OrderForGoods(props: PropsBox) {
const
detailSumbit
=
()
=>
{
const
detailSumbit
=
()
=>
{
if
(
detailData
&&
shopDetail
&&
list
&&
wareSkuList
)
{
if
(
detailData
&&
shopDetail
&&
list
&&
wareSkuList
)
{
const
pushList
=
{
const
pushList
=
{
// actualPay: shopDetail.num * detailData.price!,
actualPay
:
actualPay
:
10
0
,
discount
?.
specPrice
[
0
].
price
!
*
shopDetail
?.
num
!
*
days
!
||
0
,
deposit
:
0
,
deposit
:
0
,
endDate
:
moment
(
new
Date
(
shopDetail
.
dateDetail
[
1
])).
format
(
endDate
:
moment
(
new
Date
(
shopDetail
.
dateDetail
[
1
])).
format
(
'YYYY-MM-DD'
'YYYY-MM-DD'
...
@@ -48,13 +59,13 @@ export default function OrderForGoods(props: PropsBox) {
...
@@ -48,13 +59,13 @@ export default function OrderForGoods(props: PropsBox) {
takeName
:
list
[
value
].
takeName
,
takeName
:
list
[
value
].
takeName
,
takePhone
:
Number
(
list
[
value
].
takePhone
),
takePhone
:
Number
(
list
[
value
].
takePhone
),
},
},
// rentPrice: shopDetail.num * detailData.price!,
rentPrice
:
rentPrice
:
10
0
,
discount
?.
specPrice
[
0
].
price
!
*
shopDetail
?.
num
!
*
days
!
||
0
,
returnDate
:
moment
(
returnDate
:
moment
(
new
Date
(
shopDetail
.
dateDetail
[
1
]).
getTime
()
+
864
e5
new
Date
(
shopDetail
.
dateDetail
[
1
]).
getTime
()
+
864
e5
).
format
(
'YYYY-MM-DD'
),
).
format
(
'YYYY-MM-DD'
),
// shouldPay: shopDetail.num * detailData.price!,
shouldPay
:
shouldPay
:
10
0
,
discount
?.
specPrice
[
0
].
price
!
*
shopDetail
?.
num
!
*
days
!
||
0
,
specsId
:
wareSkuList
[
0
].
productSpec
,
specsId
:
wareSkuList
[
0
].
productSpec
,
startDate
:
moment
(
new
Date
(
shopDetail
.
dateDetail
[
0
]
!
)).
format
(
startDate
:
moment
(
new
Date
(
shopDetail
.
dateDetail
[
0
]
!
)).
format
(
'YYYY-MM-DD'
'YYYY-MM-DD'
...
@@ -81,8 +92,6 @@ export default function OrderForGoods(props: PropsBox) {
...
@@ -81,8 +92,6 @@ export default function OrderForGoods(props: PropsBox) {
}
}
useEffect
(()
=>
{
useEffect
(()
=>
{
console
.
log
(
days
)
api
api
.
listUserAddress
({})
.
listUserAddress
({})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
...
@@ -219,7 +228,7 @@ export default function OrderForGoods(props: PropsBox) {
...
@@ -219,7 +228,7 @@ export default function OrderForGoods(props: PropsBox) {
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"body-item"
style=
{
{
width
:
130
}
}
>
<
div
className=
"body-item"
style=
{
{
width
:
130
}
}
>
{
d
etailData
?
.
price
||
0
}
{
d
iscount
?.
specPrice
[
0
]
.
price
||
0
}
</
div
>
</
div
>
<
div
className=
"body-item"
style=
{
{
width
:
130
}
}
>
<
div
className=
"body-item"
style=
{
{
width
:
130
}
}
>
{
shopDetail
?.
num
||
1
}
{
shopDetail
?.
num
||
1
}
...
@@ -234,7 +243,7 @@ export default function OrderForGoods(props: PropsBox) {
...
@@ -234,7 +243,7 @@ export default function OrderForGoods(props: PropsBox) {
)
}
)
}
</
div
>
</
div
>
<
div
className=
"body-item total-price"
style=
{
{
width
:
135
}
}
>
<
div
className=
"body-item total-price"
style=
{
{
width
:
135
}
}
>
{
d
etailData
?.
price
!
*
shopDetail
?.
num
!
||
0
}
{
d
iscount
?.
specPrice
[
0
].
price
!
*
shopDetail
?.
num
!
*
days
!
||
0
}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -272,7 +281,9 @@ export default function OrderForGoods(props: PropsBox) {
...
@@ -272,7 +281,9 @@ export default function OrderForGoods(props: PropsBox) {
<
div
className=
"detail"
>
<
div
className=
"detail"
>
<
div
className=
"top"
>
<
div
className=
"top"
>
<
div
className=
"label"
>
实付款
</
div
>
<
div
className=
"label"
>
实付款
</
div
>
<
div
className=
"price"
>
¥20000.00
</
div
>
<
div
className=
"price"
>
¥
{
discount
?.
specPrice
[
0
].
price
!
*
shopDetail
?.
num
!
*
days
!
||
0
}
</
div
>
</
div
>
</
div
>
<
div
className=
"bottom"
>
<
div
className=
"bottom"
>
<
div
className=
"value"
>
寄送至
</
div
>
<
div
className=
"value"
>
寄送至
</
div
>
...
@@ -309,7 +320,9 @@ export default function OrderForGoods(props: PropsBox) {
...
@@ -309,7 +320,9 @@ export default function OrderForGoods(props: PropsBox) {
</
Button
>,
</
Button
>,
]
}
]
}
>
>
<
div
className=
"title"
>
¥
{
detailData
?.
price
!
*
days
!
}
</
div
>
<
div
className=
"title"
>
¥
{
discount
?.
specPrice
[
0
].
price
!
*
shopDetail
?.
num
!
*
days
!
||
0
}
</
div
>
<
div
>
云享飞账号:
{
userInfo
?.
uid
}
</
div
>
<
div
>
云享飞账号:
{
userInfo
?.
uid
}
</
div
>
<
div
>
付款方式: 可用(¥
{
paymentDetail
?.
balance
}
)
</
div
>
<
div
>
付款方式: 可用(¥
{
paymentDetail
?.
balance
}
)
</
div
>
</
Modal
>
</
Modal
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论