Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
844a295a
Commit
844a295a
authored
Sep 17, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:添加签署合同模态框
parent
fb551d9f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
16 deletions
+114
-16
index.less
src/components/SignModal/index.less
+39
-0
index.tsx
src/components/SignModal/index.tsx
+40
-5
index.tsx
src/pages/lxMall/order/index.tsx
+34
-10
index.less
src/pages/lxMall/order/payway/index.less
+1
-1
No files found.
src/components/SignModal/index.less
View file @
844a295a
.sign_modal {
:global {
.ant-modal-body {
padding: 0;
}
.ant-modal-footer {
.ant-btn {
&:hover {
color: #D32F2F;
border-color: #D32F2F;
}
}
.ant-btn-primary {
background-color: #D32F2F;
border-color: #D32F2F;
&:hover {
color: #ffffff;
}
}
}
}
.sign_modal_body {
position: relative;
height: 70vh;
overflow-y: auto;
.sign_iframe {
width: 100%;
height: 100%;
border: none;
}
}
}
\ No newline at end of file
src/components/SignModal/index.tsx
View file @
844a295a
import
React
from
'react'
import
React
,
{
useEffect
,
useCallback
,
useRef
}
from
'react'
import
{
Modal
}
from
'antd'
import
styles
from
'./index.less'
interface
SignModalPropsType
{
visible
:
boolean
visible
:
boolean
,
onOk
?:
Function
,
onCancel
?:
Function
,
contractUrl
?:
string
}
const
SignModal
:
React
.
FC
<
SignModalPropsType
>
=
(
props
)
=>
{
const
{
visible
}
=
props
const
{
visible
,
onOk
,
onCancel
,
contractUrl
}
=
props
const
iframeRef
=
useRef
<
HTMLIFrameElement
>
(
null
)
// const iframeScrollBottom = () => {
// console.log(iframeRef.current.scrollHeight, 'iframeRef.current.scrollHeight')
// iframeRef.current.contentWindow.scrollTo(0, 1000)
// }
const
handleSignConfirm
=
()
=>
{
// iframeScrollBottom()
onOk
&&
onOk
()
}
const
handleCancel
=
()
=>
{
onCancel
&&
onCancel
()
}
return
(
<
div
>
11
<
Modal
className=
{
styles
.
sign_modal
}
title=
"签署电子合同"
width=
{
1000
}
visible=
{
visible
}
centered
okText=
"签署合同并提交"
cancelText=
"不签署"
onCancel=
{
()
=>
handleCancel
()
}
onOk=
{
()
=>
handleSignConfirm
()
}
>
<
div
className=
{
styles
.
sign_modal_body
}
>
<
iframe
ref=
{
iframeRef
}
id=
"sign-iframe"
className=
{
styles
.
sign_iframe
}
src=
{
contractUrl
}
/>
</
div
>
</
Modal
>
)
}
...
...
src/pages/lxMall/order/index.tsx
View file @
844a295a
...
...
@@ -14,6 +14,7 @@ import Invoice from './invoice'
import
styles
from
'./index.less'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetLogisticsReceiverAddressGetResponse
}
from
'@/services/LogisticsApi'
import
SignModal
from
'@/components/SignModal'
import
{
isEmpty
}
from
'lodash'
import
{
LAYOUT_TYPE
,
OrderModalType
}
from
'@/constants'
...
...
@@ -26,7 +27,7 @@ interface OrderPropsType {
const
Order
:
React
.
FC
<
OrderPropsType
>
=
(
props
)
=>
{
const
{
shopInfo
,
mallInfo
,
layoutType
}
=
props
cons
ole
.
log
(
shopInfo
,
"shopInfo"
)
cons
t
[
signModalVisible
,
setSignModalVisible
]
=
useState
<
boolean
>
(
false
)
const
{
spam_id
}
=
props
.
location
.
query
const
OrderStore
=
useLocalStore
(()
=>
store
.
OrderStore
)
const
{
clearOrderInfo
,
getOrderInfo
}
=
OrderStore
...
...
@@ -136,14 +137,14 @@ const Order: React.FC<OrderPropsType> = (props) => {
* 提交订单
*/
const
submitOrder
=
()
=>
{
if
(
isEmpty
(
selectPayWay
))
{
message
.
info
(
'请选择支付方式'
)
return
}
if
(
!
needTheContract
)
{
message
.
info
(
'请先同意签订电子合同'
)
return
}
//
if (isEmpty(selectPayWay)) {
//
message.info('请选择支付方式')
//
return
//
}
//
if (!needTheContract) {
//
message.info('请先同意签订电子合同')
//
return
//
}
let
params
:
any
=
{
orderModel
:
layoutType
===
LAYOUT_TYPE
.
channel
?
OrderModalType
.
CHANNEL_SPOT_PURCHASE_ORDER
:
OrderModalType
.
PURCHASE_ORDER
,
// 下单模式
deliveryAddresId
:
selectAddressInfo
.
id
,
...
...
@@ -195,6 +196,23 @@ const Order: React.FC<OrderPropsType> = (props) => {
})
}
const
checkOrder
=
()
=>
{
if
(
isEmpty
(
selectPayWay
))
{
message
.
info
(
'请选择支付方式'
)
return
}
if
(
!
needTheContract
)
{
message
.
info
(
'请先同意签订电子合同'
)
return
}
setSignModalVisible
(
true
)
}
const
handleSignModalConfirm
=
()
=>
{
// submitOrder()
}
return
orderInfo
&&
(
<
Spin
spinning=
{
spinningState
}
>
<
div
className=
{
styles
.
order
}
>
...
...
@@ -287,11 +305,17 @@ const Order: React.FC<OrderPropsType> = (props) => {
<
b
className=
{
styles
.
settlement_box_item_price_total
}
>
{
getAmount
()
}
</
b
>
<
span
>
RMB
</
span
>
</
div
>
<
Button
loading=
{
confirmLoading
}
className=
{
styles
.
settlement_box_item_btn
}
onClick=
{
()
=>
submit
Order
()
}
>
提交订单
</
Button
>
<
Button
loading=
{
confirmLoading
}
className=
{
styles
.
settlement_box_item_btn
}
onClick=
{
()
=>
check
Order
()
}
>
提交订单
</
Button
>
</
div
>
</
div
>
</
div
>
</
div
>
<
SignModal
visible=
{
signModalVisible
}
onCancel=
{
()
=>
setSignModalVisible
(
false
)
}
onOk=
{
()
=>
handleSignModalConfirm
()
}
contractUrl=
"https://shushangyun01.oss-cn-shenzhen.aliyuncs.com/40907bcbf5174713b64df540a7238b4a1600322828098.pdf"
/>
</
Spin
>
)
}
...
...
src/pages/lxMall/order/payway/index.less
View file @
844a295a
...
...
@@ -36,7 +36,7 @@
}
&.active {
border: 1px solid
rgba(211, 47, 47, 1
);
border: 1px solid
var(--mall_main_color
);
&::after {
content: '';
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment