Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
web-ci-test
Commits
3a9094c2
提交
3a9094c2
authored
6月 08, 2023
作者:
曹云
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添-设备租赁-详情-立即租赁弹框,确认租期弹框,确认订单页面
上级
3b3eac38
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
1127 行增加
和
393 行删除
+1127
-393
[id].page.tsx
pages/equipmentLeasing/detail/[id].page.tsx
+387
-207
index.tsx
...quipmentLeasing/detail/components/orderForGoods/index.tsx
+166
-0
styled.tsx
...uipmentLeasing/detail/components/orderForGoods/styled.tsx
+303
-0
styled.tsx
pages/equipmentLeasing/detail/styled.tsx
+271
-186
没有找到文件。
pages/equipmentLeasing/detail/[id].page.tsx
浏览文件 @
3a9094c2
import
React
,
{
useEffect
,
useState
,
useContext
}
from
'react'
import
React
,
{
useEffect
,
useState
,
useContext
}
from
'react'
import
{
useRouter
}
from
'next/router'
;
import
{
useRouter
}
from
'next/router'
import
Layout
from
"~/components/layout"
;
import
Layout
from
'~/components/layout'
import
{
Box
}
from
'./styled'
;
import
{
Box
}
from
'./styled'
import
ImagePreview
from
'./components/picture-preview'
;
import
ImagePreview
from
'./components/picture-preview'
import
{
Button
,
Image
as
AImage
,
Divider
,
Select
,
Modal
,
Tag
,
Space
,
Form
,
message
}
from
'antd'
;
import
OrderForGoods
from
'./components/orderForGoods'
import
Image
from
'next/image'
;
import
moment
from
'moment'
import
errImg
from
"~/assets/errImg"
;
import
{
import
api
,{
GetWebDeviceDetailResult
,
GetWebDeviceWareSkuById
}
from
'./api'
;
Button
,
import
{
UserContext
}
from
"~/lib/userProvider"
;
Image
as
AImage
,
Divider
,
Select
,
Modal
,
Tag
,
Space
,
Form
,
message
,
InputNumber
,
DatePicker
,
}
from
'antd'
import
Image
from
'next/image'
import
errImg
from
'~/assets/errImg'
import
api
,
{
GetWebDeviceDetailResult
,
GetWebDeviceWareSkuById
}
from
'./api'
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'
const
{
RangePicker
}
=
DatePicker
const
{
CheckableTag
}
=
Tag
const
{
CheckableTag
}
=
Tag
export
default
function
EquipmentLeasingDetail
()
{
export
default
function
EquipmentLeasingDetail
()
{
const
router
=
useRouter
();
const
router
=
useRouter
()
const
{
userInfo
,
setNeedLogin
}
=
useContext
(
UserContext
);
const
{
userInfo
,
setNeedLogin
}
=
useContext
(
UserContext
)
const
[
id
,
setId
]
=
useState
<
number
|
null
>
(
null
);
const
[
id
,
setId
]
=
useState
<
number
|
null
>
(
null
)
const
[
detail
,
setDetail
]
=
useState
<
GetWebDeviceDetailResult
|
null
>
()
const
[
detail
,
setDetail
]
=
useState
<
GetWebDeviceDetailResult
|
null
>
()
const
[
wareSkuList
,
setWareSkuList
]
=
useState
<
GetWebDeviceWareSkuById
[]
|
undefined
>
()
const
[
wareSkuList
,
setWareSkuList
]
=
useState
<
GetWebDeviceWareSkuById
[]
|
undefined
>
()
useEffect
(()
=>
{
useEffect
(()
=>
{
setId
(
Number
(
router
.
query
.
id
))
setId
(
Number
(
router
.
query
.
id
))
},[
router
])
},
[
router
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
id
)
{
if
(
id
)
{
api
api
.
listDetailDeviceInfo
({
.
listDetailDeviceInfo
({
id
:
id
id
:
id
,
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
setDetail
(
res
.
result
||
null
)
;
setDetail
(
res
.
result
||
null
)
})
;
})
api
api
.
listWareSkuById
({
.
listWareSkuById
({
id
:
id
id
:
id
,
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
res
.
result
?.
map
(
item
=>
{
res
.
result
?.
map
(
(
item
)
=>
{
return
item
return
item
})
})
setWareSkuList
(
res
.
result
||
undefined
)
;
setWareSkuList
(
res
.
result
||
undefined
)
})
;
})
}
}
},[
id
])
},
[
id
])
//租赁弹框
//租赁弹框
const
[
isModalOpen
,
setIsModalOpen
]
=
useState
(
false
);
const
[
isModalOpen
,
setIsModalOpen
]
=
useState
(
false
)
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
isModalDateOpen
,
setIsModalDateOpen
]
=
useState
(
false
)
const
[
form
]
=
Form
.
useForm
();
const
[
loading
,
setLoading
]
=
useState
(
false
)
const
tagsData
=
[
'3-7天'
,
'8-15天'
,
'16-30天'
,
'30天以上'
];
const
[
isorderForGoods
,
setIsorderForGoods
]
=
useState
(
false
)
const
[
selectedTags
,
setSelectedTags
]
=
useState
<
number
>
();
const
[
form
]
=
Form
.
useForm
()
const
[
selectedTagsData
,
setSelectedTagsData
]
=
useState
<
string
>
();
const
[
formDate
]
=
Form
.
useForm
()
const
tagsData
=
[
{
label
:
'3-7天'
,
disable
:
false
},
{
label
:
'8-15天'
,
disable
:
false
},
{
label
:
'16-30天'
,
disable
:
true
},
{
label
:
'30天以上'
,
disable
:
false
},
]
const
[
selectedTags
,
setSelectedTags
]
=
useState
<
number
>
()
const
[
selectedTagsData
,
setSelectedTagsData
]
=
useState
<
string
>
()
const
showModal
=
()
=>
{
const
showModal
=
()
=>
{
if
(
userInfo
)
{
if
(
userInfo
)
{
setIsModalOpen
(
true
)
;
setIsModalOpen
(
true
)
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
(
"3-7天"
)
setSelectedTagsData
(
'3-7天'
)
form
.
setFieldValue
(
"date"
,
"3-7天"
)
form
.
setFieldValue
(
'date'
,
'3-7天'
)
}
}
}
else
{
}
else
{
setNeedLogin
(
true
)
setNeedLogin
(
true
)
}
}
}
;
}
const
handleOk
=
()
=>
{
const
handleOk
=
()
=>
{
setLoading
(
true
);
setLoading
(
true
)
form
.
validateFields
()
.
then
(
async
(
values
)
=>
{
setLoading
(
false
)
setIsModalOpen
(
false
)
setIsModalDateOpen
(
true
)
})
.
catch
((
err
)
=>
{
message
.
warning
({
content
:
err
.
errorFields
[
0
].
errors
[
0
],
})
.
then
()
setLoading
(
false
)
})
}
const
[
days
,
setDays
]
=
useState
<
number
>
()
const
handleOkDate
=
async
()
=>
{
setLoading
(
true
)
const
result
=
await
Promise
.
all
([
form
.
validateFields
(),
formDate
.
validateFields
(),
])
console
.
log
(
result
)
if
(
result
)
{
}
form
form
.
validateFields
()
.
validateFields
()
.
then
(
async
(
values
)
=>
{
.
then
(
async
(
values
)
=>
{
form
.
resetFields
(
)
setLoading
(
false
)
message
.
success
(
"租赁成功"
)
setIsModalOpen
(
false
)
setLoading
(
false
);
setIsModalDateOpen
(
false
)
setIsModalOpen
(
false
);
setIsorderForGoods
(
true
)
// try{
// try{
// const res = await api.listWareSkuUpdate(values)
// const res = await api.listWareSkuUpdate(values)
// if (res.code === "200") {
// if (res.code === "200") {
// setLoading(false);
// setLoading(false);
// setIsModalOpen(false);
// setIsModalOpen(false);
// form.resetFields()
// form.resetFields()
// message.success('租赁成功')
// message.success('租赁成功')
// }else{
// }else{
// setLoading(false);
// setLoading(false);
// message.error(res.message)
// message.error(res.message)
// }
// }
// }catch(e:any){
// }catch(e:any){
// message.error(e.message)
// message.error(e.message)
// }
// }
}).
catch
((
err
)
=>
{
})
message
.
catch
((
err
)
=>
{
.
warning
({
message
content
:
err
.
errorFields
[
0
].
errors
[
0
],
.
warning
({
})
content
:
err
.
errorFields
[
0
].
errors
[
0
],
.
then
();
})
setLoading
(
false
);
.
then
()
});
setLoading
(
false
)
})
}
;
}
const
handleCancel
=
()
=>
{
const
handleCancel
=
()
=>
{
setIsModalOpen
(
false
);
setIsModalOpen
(
false
)
};
setIsModalDateOpen
(
false
)
form
.
resetFields
()
const
handleChange
=
(
tag
:
number
,
checked
:
boolean
)
=>
{
formDate
.
resetFields
()
if
(
checked
)
{
}
const
nextWareSkuList
=
checked
?
tag
:
wareSkuList
?.
filter
((
t
)
=>
t
.
id
!==
tag
)[
0
].
id
;
console
.
log
(
'You are interested in: '
,
nextWareSkuList
);
setSelectedTags
(
nextWareSkuList
);
form
.
setFieldValue
(
"id"
,
tag
)
}
};
const
handleChange
Date
=
(
tag
:
string
,
checked
:
boolean
)
=>
{
const
handleChange
=
(
tag
:
number
,
checked
:
boolean
)
=>
{
if
(
checked
)
{
if
(
checked
)
{
const
nextWareSkuList
=
checked
?
tag
:
wareSkuList
?.
filter
((
t
)
=>
t
.
id
!==
tag
)[
0
].
id
console
.
log
(
'You are interested in: '
,
nextWareSkuList
)
setSelectedTags
(
nextWareSkuList
)
form
.
setFieldValue
(
'id'
,
tag
)
}
}
const
handleChangeDate
=
(
tag
:
string
,
checked
:
boolean
,
disable
:
boolean
)
=>
{
if
(
checked
&&
!
disable
)
{
const
nextSelectedTags
=
checked
const
nextSelectedTags
=
checked
?
tag
?
tag
:
tagsData
.
filter
((
t
)
=>
t
!==
tag
)[
0
];
:
tagsData
.
filter
((
t
)
=>
t
.
label
!==
tag
)[
0
].
label
console
.
log
(
'You are interested in: '
,
nextSelectedTags
);
console
.
log
(
'You are interested in: '
,
nextSelectedTags
)
setSelectedTagsData
(
nextSelectedTags
);
setSelectedTagsData
(
nextSelectedTags
)
form
.
setFieldValue
(
"date"
,
tag
)
form
.
setFieldValue
(
'date'
,
tag
)
}
}
const
onChangeNum
=
(
value
:
number
|
string
|
null
)
=>
{
console
.
log
(
'changed'
,
value
)
}
const
goBack
=
()
=>
{
setIsModalDateOpen
(
false
)
setIsModalOpen
(
true
)
}
const
onchanges
=
(
values
:
any
)
=>
{
if
(
values
)
{
const
day
=
new
Date
(
values
[
1
]).
getTime
()
-
new
Date
(
values
[
0
]).
getTime
()
const
totalDays
=
Math
.
floor
(
day
/
(
1000
*
3600
*
24
))
setDays
(
totalDays
)
}
else
{
setDays
(
undefined
)
}
}
};
}
const
disabledDate
:
RangePickerProps
[
'disabledDate'
]
=
(
current
)
=>
{
return
current
&&
current
<
moment
().
endOf
(
'day'
)
}
return
(
return
(
<
Layout
>
<
Layout
>
<
Box
>
{
!
isorderForGoods
?
(
<
div
className=
'item'
>
<
Box
>
<
ImagePreview
imgList=
{
detail
?.
wareImgs
!
}
/>
<
div
className=
"item"
>
<
div
className=
'item-right'
>
<
ImagePreview
imgList=
{
detail
?.
wareImgs
!
}
/>
<
div
className=
'title'
>
{
detail
?.
wareTitle
}
</
div
>
<
div
className=
"item-right"
>
{
<
div
className=
"title"
>
{
detail
?.
wareTitle
}
</
div
>
detail
?.
tags
?.
length
?
{
detail
?.
tags
?.
length
?
(
(<
div
className=
'function'
>
<
div
className=
"function"
>
{
detail
?.
tags
?.
map
(
item
=>
(<
div
key=
{
item
}
className=
'function-item'
>
{
item
}
</
div
>))
}
{
detail
?.
tags
?.
map
((
item
)
=>
(
</
div
>)
:
(<
div
className=
'function not'
></
div
>)
<
div
key=
{
item
}
className=
"function-item"
>
}
{
item
}
<
div
className=
'menoy'
>
</
div
>
<
span
className=
'menoy-left'
>
{
`¥${detail?.minRent}`
}
</
span
>
))
}
<
span
className=
'menoy-right'
>
/天起
</
span
>
</
div
>
</
div
>
)
:
(
<
div
className=
'classification'
>
<
div
className=
"function not"
></
div
>
<
div
className=
'top'
>
)
}
<
div
className=
'left'
>
<
div
className=
"menoy"
>
<
span
className=
'label'
>
选择
</
span
>
<
span
className=
"menoy-left"
>
{
`¥${detail?.minRent}`
}
</
span
>
<
span
className=
'value'
>
商品分类
</
span
>
<
span
className=
"menoy-right"
>
/天起
</
span
>
</
div
>
<
div
className=
"classification"
>
<
div
className=
"top"
>
<
div
className=
"left"
>
<
span
className=
"label"
>
选择
</
span
>
<
span
className=
"value"
>
商品分类
</
span
>
</
div
>
<
div
className=
"right"
>
<
Select
className=
"selectItem"
defaultActiveFirstOption
defaultValue=
{
wareSkuList
}
style=
{
{
width
:
120
}
}
bordered=
{
false
}
options=
{
wareSkuList
}
fieldNames=
{
{
label
:
'skuTitle'
,
value
:
'id'
}
}
placeholder=
"选择商品"
/>
</
div
>
</
div
>
</
div
>
<
div
className=
'right'
>
<
div
className=
"bottom"
>
<
Select
<
span
className=
"label"
>
发货
</
span
>
className=
"selectItem"
<
span
className=
"value"
>
顺丰到付
</
span
>
defaultActiveFirstOption
defaultValue=
{
wareSkuList
}
style=
{
{
width
:
120
}
}
bordered=
{
false
}
options=
{
wareSkuList
}
fieldNames=
{
{
label
:
"skuTitle"
,
value
:
"id"
}
}
placeholder=
"选择商品"
/>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
'bottom'
>
<
div
className=
"botton-btn"
>
<
span
className=
'label'
>
发货
</
span
>
{
/* <Button className='btn-left' size='small' type="primary">成为渠道商</Button> */
}
<
span
className=
'value'
>
顺丰到付
</
span
>
<
Button
className=
"btn-right"
size=
"small"
type=
"primary"
onClick=
{
showModal
}
>
立即租赁
</
Button
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
'botton-btn'
>
{
/* <Button className='btn-left' size='small' type="primary">成为渠道商</Button> */
}
<
Button
className=
'btn-right'
size=
'small'
type=
"primary"
onClick=
{
showModal
}
>
立即租赁
</
Button
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"flow-path"
>
<
div
className=
'flow-path'
>
<
Image
className=
"image"
fill
src=
{
flowPat
.
src
}
alt=
""
/>
<
Image
className=
'image'
fill
src=
{
flowPat
.
src
}
alt=
""
/>
</
div
>
<
div
className=
'prompt'
>
更多租金规则请前往【云享飞】微信小程序查
</
div
>
<
Divider
className=
'divider'
>
商品详情
</
Divider
>
{
detail
?.
wareDetailContent
?
<
div
style=
{
{
textAlign
:
"center"
}
}
dangerouslySetInnerHTML=
{
{
__html
:
detail
?.
wareDetailContent
}
}
>
</
div
>
:
<
div
style=
{
{
textAlign
:
"center"
}
}
></
div
>
}
{
/* 立即租赁 */
}
<
Modal
wrapClassName=
'application'
open=
{
isModalOpen
}
onOk=
{
handleOk
}
onCancel=
{
handleCancel
}
getContainer=
{
false
}
footer=
{
[
<
Button
style=
{
{
width
:
"100%"
,
height
:
44
}
}
key=
"submit"
type=
"primary"
loading=
{
loading
}
onClick=
{
handleOk
}
>
立即租赁
</
Button
>,
]
}
>
<
div
className=
'title'
>
<
div
className=
"left"
></
div
>
<
div
className=
"right"
>
<
div
className=
"top"
>
<
span
className=
'tag'
>
¥
</
span
>
<
span
className=
'money'
>
{
detail
?.
minRent
}
</
span
>
<
span
className=
'unit'
>
/天
</
span
>
</
div
>
<
div
className=
"bottom"
>
渠道免押金
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"prompt"
>
更多租金规则请前往【云享飞】微信小程序查
</
div
>
<
Form
<
Divider
className=
"divider"
>
商品详情
</
Divider
>
form=
{
form
}
{
detail
?.
wareDetailContent
?
(
layout=
"vertical"
<
div
name=
"application"
style=
{
{
textAlign
:
'center'
}
}
initialValues=
{
{
modifier
:
'public'
}
}
dangerouslySetInnerHTML=
{
{
__html
:
detail
?.
wareDetailContent
}
}
>
></
div
>
<
Form
.
Item
style=
{
{
flex
:
1
,
marginRight
:
16
}
}
name=
"id"
label=
"选择商品"
>
)
:
(
<
Space
size=
{
[
0
,
8
]
}
wrap
>
<
div
style=
{
{
textAlign
:
'center'
}
}
></
div
>
{
wareSkuList
?.
map
((
tag
)
=>
(
)
}
<
CheckableTag
{
/* 立即租赁 */
}
style=
{
{
height
:
28
,
lineHeight
:
"28px"
}
}
<
Modal
key=
{
tag
.
id
}
wrapClassName=
"application"
checked=
{
wareSkuList
?.
some
(
item
=>
tag
.
id
===
selectedTags
)
}
open=
{
isModalOpen
}
onChange=
{
(
checked
)
=>
handleChange
(
tag
.
id
,
checked
)
}
onOk=
{
handleOk
}
>
onCancel=
{
handleCancel
}
{
tag
.
skuTitle
}
getContainer=
{
false
}
</
CheckableTag
>
footer=
{
[
))
}
<
Button
</
Space
>
style=
{
{
width
:
'100%'
,
height
:
44
}
}
</
Form
.
Item
>
key=
"submit"
<
Form
.
Item
style=
{
{
flex
:
1
,
marginRight
:
16
}
}
name=
"date"
label=
"租期天数(拿到和归还当天不算入租期)"
>
type=
"primary"
<
Space
size=
{
[
0
,
8
]
}
wrap
>
loading=
{
loading
}
{
tagsData
.
map
((
tag
)
=>
(
onClick=
{
handleOk
}
<
CheckableTag
>
key=
{
tag
}
立即租赁
checked=
{
tag
===
selectedTagsData
}
</
Button
>,
onChange=
{
(
checked
)
=>
handleChangeDate
(
tag
,
checked
)
}
]
}
>
<
div
className=
"title"
>
<
div
className=
"left"
></
div
>
<
div
className=
"right"
>
<
div
className=
"top"
>
<
span
className=
"tag"
>
¥
</
span
>
<
span
className=
"money"
>
{
detail
?.
minRent
}
</
span
>
<
span
className=
"unit"
>
/天
</
span
>
</
div
>
<
div
className=
"bottom"
>
渠道免押金
</
div
>
</
div
>
</
div
>
<
Form
form=
{
form
}
layout=
"vertical"
name=
"application"
initialValues=
{
{
modifier
:
'public'
}
}
className=
"form-data"
>
<
Form
.
Item
style=
{
{
flex
:
1
,
marginRight
:
16
}
}
name=
"id"
label=
"选择商品"
>
<
Space
size=
{
[
0
,
8
]
}
wrap
>
{
wareSkuList
?.
map
((
tag
)
=>
(
<
CheckableTag
style=
{
{
height
:
28
,
lineHeight
:
'28px'
}
}
key=
{
tag
.
id
}
checked=
{
wareSkuList
?.
some
(
(
item
)
=>
tag
.
id
===
selectedTags
)
}
onChange=
{
(
checked
)
=>
handleChange
(
tag
.
id
,
checked
)
}
>
{
tag
.
skuTitle
}
</
CheckableTag
>
))
}
</
Space
>
</
Form
.
Item
>
<
Form
.
Item
style=
{
{
flex
:
1
,
marginRight
:
16
}
}
name=
"date"
label=
"租期天数(拿到和归还当天不算入租期)"
>
<
Space
size=
{
[
0
,
8
]
}
wrap
>
{
tagsData
.
map
((
tag
)
=>
(
<
CheckableTag
key=
{
tag
.
label
}
checked=
{
tag
.
label
===
selectedTagsData
}
onChange=
{
(
checked
)
=>
handleChangeDate
(
tag
.
label
,
checked
,
tag
.
disable
)
}
className=
{
`tagsData ${
tag.disable ? 'disable tagsDisable' : ''
}`
}
>
{
tag
.
label
}
</
CheckableTag
>
))
}
</
Space
>
</
Form
.
Item
>
<
Form
.
Item
style=
{
{
flex
:
1
,
marginRight
:
16
}
}
name=
"num"
>
<
div
className=
"num-box"
>
<
div
className=
"num-left"
>
<
div
className=
"label"
>
租赁数量
</
div
>
<
div
className=
"inventory"
>
库存9件
</
div
>
</
div
>
<
div
className=
"num-right"
>
<
InputNumber
min=
{
1
}
max=
{
10
}
defaultValue=
{
3
}
onChange=
{
onChangeNum
}
/>
</
div
>
</
div
>
</
Form
.
Item
>
</
Form
>
</
Modal
>
<
Modal
wrapClassName=
"applicationDate"
open=
{
isModalDateOpen
}
onOk=
{
handleOkDate
}
onCancel=
{
handleCancel
}
getContainer=
{
false
}
width=
{
420
}
footer=
{
[
<
Button
style=
{
{
width
:
'100%'
,
height
:
44
}
}
key=
"submit"
type=
"primary"
loading=
{
loading
}
onClick=
{
handleOkDate
}
>
确认租期
{
days
?
`${days}天`
:
null
}
</
Button
>,
]
}
>
>
{
tag
}
<
div
className=
"title"
>
</
CheckableTag
>
<
div
className=
"left"
onClick=
{
goBack
}
>
))
}
{
'<'
}
</
Space
>
</
div
>
</
Form
.
Item
>
<
div
className=
"right"
>
选择租期
</
div
>
</
Form
>
</
div
>
</
Modal
>
<
Form
</
Box
>
form=
{
formDate
}
layout=
"vertical"
name=
"applicationDate"
initialValues=
{
{
modifier
:
'public'
}
}
className=
"form-data"
>
<
Form
.
Item
style=
{
{
flex
:
1
,
marginRight
:
16
}
}
name=
"dateDetail"
>
<
RangePicker
style=
{
{
width
:
376
,
marginTop
:
10
}
}
disabledDate=
{
disabledDate
}
onChange=
{
onchanges
}
/>
</
Form
.
Item
>
</
Form
>
<
div
className=
"bottom-item"
>
<
div
className=
"label"
>
租金合计
</
div
>
<
div
className=
"price"
>
<
div
className=
"left"
>
¥700
</
div
>
<
div
className=
"right"
>
(日均175)
</
div
>
</
div
>
</
div
>
</
Modal
>
</
Box
>
)
:
(
<
OrderForGoods
setIsorderForGoods=
{
setIsorderForGoods
}
/>
)
}
</
Layout
>
</
Layout
>
)
)
}
}
pages/equipmentLeasing/detail/components/orderForGoods/index.tsx
0 → 100644
浏览文件 @
3a9094c2
import
React
,
{
useState
}
from
'react'
import
{
OrderForGoodsBox
}
from
'./styled'
import
type
{
RadioChangeEvent
}
from
'antd'
import
{
Button
,
Radio
,
Space
,
Input
,
message
}
from
'antd'
const
{
TextArea
}
=
Input
interface
PropsBox
{
setIsorderForGoods
:
(
boolean
:
boolean
)
=>
void
}
export
default
function
OrderForGoods
(
props
:
PropsBox
)
{
const
{
setIsorderForGoods
}
=
props
const
[
value
,
setValue
]
=
useState
(
1
)
const
[
areaValue
,
setAreaValue
]
=
useState
<
string
>
()
const
[
list
,
setList
]
=
useState
([{},
{},
{},
{}])
const
onChange
=
(
e
:
RadioChangeEvent
)
=>
{
console
.
log
(
'radio checked'
,
e
.
target
.
value
)
setValue
(
e
.
target
.
value
)
}
const
onChangeValue
=
(
index
:
number
)
=>
{
setValue
(
index
)
}
const
detailSumbit
=
()
=>
{
message
.
success
(
'提交成功'
)
setIsorderForGoods
(
false
)
}
return
(
<
OrderForGoodsBox
>
<
div
className=
"address"
>
<
div
className=
"top"
>
<
div
className=
"left"
>
确认收货地址
</
div
>
<
div
className=
"right"
>
<
Button
type=
"link"
style=
{
{
color
:
'#007aff'
}
}
>
管理收货地址
</
Button
>
</
div
>
</
div
>
<
div
className=
"bottom"
>
{
list
.
map
((
item
,
index
)
=>
(
<
div
className=
{
`item ${value === index ? 'active' : ''}`
}
onClick=
{
()
=>
onChangeValue
(
index
)
}
>
<
div
className=
"left"
>
<
div
className=
"active"
>
<
div
className=
"icon"
></
div
>
<
div
className=
"label"
>
寄送至
</
div
>
</
div
>
<
Radio
.
Group
onChange=
{
onChange
}
value=
{
value
}
>
<
Space
direction=
"vertical"
>
<
Radio
value=
{
index
}
>
广东省深圳市南山区国际创谷6栋(黄晓敏收)
</
Radio
>
</
Space
>
</
Radio
.
Group
>
</
div
>
{
value
===
index
?
(
<
div
className=
"right"
>
<
Button
type=
"link"
style=
{
{
color
:
'#007aff'
}
}
>
修改地址
</
Button
>
</
div
>
)
:
null
}
</
div
>
))
}
</
div
>
</
div
>
<
div
className=
"info"
>
<
div
className=
"title"
>
确认订单信息
</
div
>
<
div
className=
"table"
>
<
div
className=
"table-title"
>
<
div
className=
"table-item"
style=
{
{
width
:
290
}
}
>
宝贝
</
div
>
<
div
className=
"table-item"
style=
{
{
width
:
130
}
}
>
单价
</
div
>
<
div
className=
"table-item"
style=
{
{
width
:
130
}
}
>
数量
</
div
>
<
div
className=
"table-item"
style=
{
{
width
:
300
}
}
>
租期
</
div
>
<
div
className=
"table-item"
style=
{
{
width
:
135
}
}
>
合计
</
div
>
</
div
>
<
div
className=
"table-body"
>
<
div
className=
"body-item article"
style=
{
{
width
:
290
}
}
>
<
div
className=
"image"
></
div
>
<
div
className=
"right"
>
<
div
className=
"top"
>
智多星航电版智多星航电版智多星航电版智多
</
div
>
<
div
className=
"bottom"
>
商品简介商品简介商品简介商品简介商品简介
</
div
>
</
div
>
</
div
>
<
div
className=
"body-item"
style=
{
{
width
:
130
}
}
>
800.00/天
</
div
>
<
div
className=
"body-item"
style=
{
{
width
:
130
}
}
>
1
</
div
>
<
div
className=
"body-item lease-term"
style=
{
{
width
:
300
}
}
>
2023/05/10
<
div
className=
"num"
>
4天
</
div
>
2023/05/13
</
div
>
<
div
className=
"body-item total-price"
style=
{
{
width
:
135
}
}
>
800.00
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"notes"
>
<
div
className=
"left"
>
<
div
className=
"label"
>
备注:
</
div
>
<
TextArea
value=
{
areaValue
}
onChange=
{
(
e
)
=>
setAreaValue
(
e
.
target
.
value
)
}
placeholder=
"请输入备注"
autoSize=
{
{
minRows
:
3
,
maxRows
:
5
}
}
style=
{
{
width
:
385
,
height
:
72
}
}
/>
</
div
>
<
div
className=
"right"
>
<
div
className=
"top"
>
<
div
className=
"font"
>
<
div
className=
"label"
>
运费:
</
div
>
<
div
className=
"value"
>
邮寄到付,由客户自己承担
</
div
>
</
div
>
<
div
className=
"price"
>
200.00
</
div
>
</
div
>
<
div
className=
"bottom"
>
<
div
className=
"font"
>
<
div
className=
"label"
>
押金:
</
div
>
<
div
className=
"value"
>
渠道商可免押金
</
div
>
</
div
>
<
div
className=
"price"
>
1000.00
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"detail-box"
>
<
div
className=
"right-box"
>
<
div
className=
"detail"
>
<
div
className=
"top"
>
<
div
className=
"label"
>
实付款
</
div
>
<
div
className=
"price"
>
¥20000.00
</
div
>
</
div
>
<
div
className=
"bottom"
>
<
div
className=
"value"
>
寄送至
</
div
>
<
div
className=
"value-content"
>
广东省深圳市南山区国际创谷6栋国际创谷6
</
div
>
</
div
>
</
div
>
<
div
className=
"detail-sumbit"
>
<
Button
className=
"btn"
onClick=
{
detailSumbit
}
>
提交订单
</
Button
>
</
div
>
</
div
>
</
div
>
</
OrderForGoodsBox
>
)
}
pages/equipmentLeasing/detail/components/orderForGoods/styled.tsx
0 → 100644
浏览文件 @
3a9094c2
import
styled
from
'styled-components'
export
const
OrderForGoodsBox
=
styled
.
div
`
box-sizing: border-box;
width: 1000px;
.address {
.top {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #e6e6e6;
height: 30px;
line-height: 30px;
margin-top: 30px;
.left {
font-size: 14px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #333333;
line-height: 18px;
}
.right {
.btn {
font-size: 14px;
font-family: MicrosoftYaHei;
color: #007aff;
line-height: 19px;
}
}
}
.bottom {
.item {
display: flex;
justify-content: space-between;
align-items: center;
width: 1000px;
height: 48px;
border: 1px solid transparent;
margin-top: 8px;
&.active {
background: #fff1e8;
border-radius: 6px;
border: 1px solid #ff552d;
}
.left {
display: flex;
align-items: center;
justify-content: space-around;
.active {
margin-right: 18px;
display: flex;
.icon {
width: 15px;
height: 22px;
background: #ff552d;
margin-left: 17px;
}
.label {
font-size: 14px;
font-family: MicrosoftYaHei;
color: #000000;
line-height: 19px;
margin-left: 18px;
}
}
}
.right {
margin-right: 22px;
}
}
}
}
.info {
margin-top: 30px;
.title {
font-size: 14px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #333333;
line-height: 18px;
}
.table {
.table-title {
display: flex;
align-items: center;
width: 1000px;
border-bottom: 1px solid #e6e6e6;
padding: 10px 0;
margin-top: 20px;
.table-item {
text-align: center;
font-size: 14px;
font-family: MicrosoftYaHei;
color: #000000;
line-height: 19px;
}
}
.table-body {
display: flex;
align-items: center;
height: 100px;
margin-top: 10px;
.body-item {
text-align: center;
&.article {
display: flex;
justify-content: space-between;
.image {
width: 80px;
height: 80px;
background-color: pink;
margin-right: 10px;
}
.right {
.top {
width: 171px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #141414;
line-height: 20px;
}
.bottom {
width: 171px;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #929295;
line-height: 17px;
}
}
}
&.lease-term {
display: flex;
align-items: center;
justify-content: center;
.num {
width: 62px;
height: 24px;
background: #ff552d;
border-radius: 2px;
position: relative;
margin: 0 15px;
line-height: 24px;
font-size: 14px;
font-family: MicrosoftYaHei;
color: #ffffff;
&::before {
content: '';
width: 10px;
height: 1px;
background-color: #ff552d;
position: absolute;
left: -10px;
top: 50%;
transform: translateY(-50%);
}
&::after {
content: '';
width: 10px;
height: 1px;
background-color: #ff552d;
position: absolute;
right: -10px;
top: 50%;
transform: translateY(-50%);
}
}
}
&.total-price {
font-size: 14px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #ff3100;
line-height: 18px;
}
}
}
}
}
.notes {
display: flex;
align-items: center;
justify-content: space-between;
width: 1000px;
height: 110px;
background: #e1efff;
border: 1px solid #d0eaf5;
padding: 0 22px 0 16px;
.left {
display: flex;
align-items: top;
.label {
font-size: 14px;
font-family: MicrosoftYaHei;
color: #000000;
margin-top: 4px;
}
}
.right {
width: 430px;
.top {
display: flex;
align-items: center;
justify-content: space-between;
}
.font {
display: flex;
}
.bottom {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 18px;
}
.label {
font-size: 14px;
font-family: MicrosoftYaHei;
color: #000000;
line-height: 19px;
margin-right: 12px;
}
.value {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #2b2b2b;
line-height: 20px;
}
.price {
font-size: 14px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #ff3100;
line-height: 18px;
}
}
}
.detail-box {
display: flex;
justify-content: flex-end;
margin-top: 26px;
.right-box {
.detail {
width: 477px;
height: 110px;
border: 1px solid #ff5001;
padding: 16px 19px 19px 19px;
.top {
display: flex;
justify-content: flex-end;
align-items: center;
.label {
font-size: 14px;
font-family: MicrosoftYaHei;
color: #474747;
line-height: 19px;
margin-right: 10px;
}
.price {
font-size: 26px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #ff552d;
line-height: 33px;
}
}
.bottom {
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: 15px;
.value {
font-size: 12px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #000000;
line-height: 15px;
margin-right: 10px;
}
.value-content {
font-size: 12px;
font-family: MicrosoftYaHei;
color: #333333;
line-height: 16px;
}
}
}
.detail-sumbit {
display: flex;
justify-content: flex-end;
.btn {
width: 182px;
height: 39px;
background: #ff552d;
border: 1px solid #ff5001;
border-radius: 0;
color: #ffffff;
}
}
}
}
`
pages/equipmentLeasing/detail/styled.tsx
浏览文件 @
3a9094c2
import
styled
from
"styled-components"
import
styled
from
'styled-components'
export
const
Box
=
styled
.
div
`
export
const
Box
=
styled
.
div
`
box-sizing: border-box;
box-sizing: border-box;
width: 1200px;
width: 1200px;
background-color: #fff;
background-color: #fff;
padding: 42px 0 24px 24px;
padding: 42px 0 24px 24px;
.item{
.item {
display: flex;
&-right {
height: 300px;
margin-left: 30px;
.title {
height: 26px;
font-size: 28px;
margin-top: 5px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #090909;
line-height: 26px;
}
.function {
display: flex;
display: flex;
&-right{
align-items: center;
height: 300px;
justify-content: space-evenly;
margin-left: 30px;
width: 375px;
.title{
height: 45px;
height: 26px;
margin-top: 17px;
font-size: 28px;
background: linear-gradient(90deg, #d7f7f5 0%, #eefde9 100%);
margin-top: 5px;
&.not {
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
background: none;
font-weight: bold;
}
color: #090909;
&-item {
line-height: 26px;
}
}
}
.function{
.menoy {
display: flex;
margin-top: 17px;
align-items: center;
&-left {
justify-content: space-evenly;
width: 79px;
width: 375px;
height: 41px;
height: 45px;
font-size: 32px;
margin-top: 17px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
background: linear-gradient(90deg, #D7F7F5 0%, #EEFDE9 100%);
font-weight: bold;
&.not{
color: #ef2e00;
background: none;
line-height: 41px;
}
}
&-item{
&-right {
}
width: 40px;
}
height: 20px;
.menoy{
font-size: 16px;
margin-top: 17px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
&-left{
font-weight: bold;
width: 79px;
color: #ef2e00;
height: 41px;
line-height: 20px;
font-size: 32px;
}
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
}
font-weight: bold;
.classification {
color: #EF2E00;
margin-top: 28px;
line-height: 41px;
width: 375px;
}
height: 50px;
&-right{
.label {
width: 40px;
height: 21px;
height: 20px;
font-size: 16px;
font-size: 16px;
font-family: MicrosoftYaHei;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
color: #9a9a9a;
font-weight: bold;
line-height: 21px;
color: #EF2E00;
margin-right: 36px;
line-height: 20px;
}
}
.value {
}
height: 21px;
.classification{
font-size: 16px;
margin-top: 28px;
font-family: MicrosoftYaHei;
width: 375px;
color: #151515;
height: 50px;
line-height: 21px;
.label{
}
height: 21px;
.top {
font-size: 16px;
display: flex;
font-family: MicrosoftYaHei;
justify-content: space-between;
color: #9A9A9A;
align-items: center;
line-height: 21px;
.left {
margin-right: 36px;
}
}
.right {
.value{
.selectItem {
height: 21px;
.ant-select-selection-placeholder {
font-size: 16px;
color: #000;
font-family: MicrosoftYaHei;
}
color: #151515;
line-height: 21px;
}
.top{
display: flex;
justify-content: space-between;
align-items: center;
.left{
}
.right{
.selectItem{
.ant-select-selection-placeholder {
color: #000;
}
}
}
}
.bottom{
margin-top: 5px;
}
}
.botton-btn{
margin-top: 30px;
.btn-left{
width: 207px;
height: 40px;
background-color: #FFE4D1;
border: 1px solid #EBBAAF;
font-family: MicrosoftYaHei;
color: #FF552D;
letter-spacing: 1px;
margin-right: 12px;
}
.btn-right{
width: 207px;
height: 40px;
background: #FF552D;
font-family: MicrosoftYaHei;
color: #FFFFFF;
letter-spacing: 1px;
}
}
}
}
}
.bottom {
margin-top: 5px;
}
}
.botton-btn {
margin-top: 30px;
.btn-left {
width: 207px;
height: 40px;
background-color: #ffe4d1;
border: 1px solid #ebbaaf;
font-family: MicrosoftYaHei;
color: #ff552d;
letter-spacing: 1px;
margin-right: 12px;
}
}
.btn-right {
width: 207px;
height: 40px;
background: #ff552d;
font-family: MicrosoftYaHei;
color: #ffffff;
letter-spacing: 1px;
}
}
}
}
}
.flow-path{
.flow-path {
width: 100%;
width: 100%;
height: 192px;
height: 192px;
text-align: center;
text-align: center;
margin-top: 72px;
margin-top: 72px;
position: relative;
position: relative;
.image{
.image {
margin: 0 auto;
margin: 0 auto;
}
}
}
.prompt{
}
width: 420px;
.prompt {
height: 25px;
width: 420px;
font-size: 20px;
height: 25px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-size: 20px;
font-weight: bold;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
color: #2B2B2B;
font-weight: bold;
line-height: 25px;
color: #2b2b2b;
margin: 30px auto 58px auto;
line-height: 25px;
margin: 30px auto 58px auto;
}
.divider {
display: flex;
justify-content: center;
margin: 46px 0 30px !important;
&::before {
width: 65px !important;
}
}
.divider {
display: flex;
justify-content: center;
margin: 46px 0 30px !important;
&::before
{
&::after
{
width: 65px !important;
width: 65px !important;
}
}
&::after {
.ant-divider-inner-text {
width: 65px !important;
font-size: 16px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #989898;
}
}
.application {
.title {
display: flex;
align-items: center;
padding-bottom: 25px;
.left {
width: 58px;
height: 58px;
background: #d8d8d8;
border-radius: 2px;
}
.right {
margin-left: 15px;
.top {
.tag {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ff0f0f;
}
.money {
font-size: 22px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #ff0f0f;
}
.unit {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ff0f0f;
}
}
}
.bottom {
.ant-divider-inner-text {
width: 65px;
font-size: 16px;
height: 18px;
font-size: 13px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #121212;
line-height: 18px;
}
}
}
.form-data {
.tagsData {
position: relative;
&.disable {
cursor: no-drop;
}
&.tagsDisable::after {
content: '缺货';
position: absolute;
top: -10px;
right: -10px;
border-radius: 5px 0;
width: 37px;
height: 14px;
line-height: 14px;
text-align: center;
background-color: #ccc;
font-size: 12px;
color: rgb(248, 248, 248);
}
}
.num-box {
display: flex;
justify-content: space-between;
align-items: center;
.num-left {
display: flex;
align-items: center;
.label {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
font-weight: 400;
color: #989898;
color: #121212;
margin-right: 5px;
}
.inventory {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #acacac;
}
}
}
}
}
}
.application{
}
.title{
.applicationDate {
display: flex;
.title {
align-items: center;
display: flex;
padding-bottom: 25px;
align-items: center;
.left{
.left {
width: 58px;
width: 10px;
height: 58px;
cursor: pointer;
background: #D8D8D8;
}
border-radius: 2px;
.right {
}
flex: 1;
.right{
text-align: center;
margin-left: 15px;
}
.top{
}
.tag{
.bottom-item {
font-size: 14px;
display: flex;
font-family: PingFangSC-Regular, PingFang SC;
justify-content: space-between;
font-weight: 400;
align-items: center;
color: #FF0F0F;
height: 50px;
}
line-height: 50px;
.money{
border-bottom: 1px solid #d9d9d9;
font-size: 22px;
.label {
font-family: PingFangSC-Medium, PingFang SC;
font-size: 14px;
font-weight: 500;
font-family: ArialMT;
color: #FF0F0F;
color: #2f2f2f;
}
}
.unit{
.price {
font-size: 12px;
display: flex;
font-family: PingFangSC-Regular, PingFang SC;
.left {
font-weight: 400;
font-size: 14px;
color: #FF0F0F;
font-family: Arial-BoldMT, Arial;
}
font-weight: normal;
}
color: #ff552d;
.bottom{
margin-right: 4px;
width: 65px;
}
height: 18px;
.right {
font-size: 13px;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #959595;
color: #121212;
line-height: 18px;
}
}
}
}
}
}
}
`
}
\ No newline at end of file
`
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论