Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
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
baiguangyao
mr-julyedu
Commits
93905627
Commit
93905627
authored
Oct 23, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
de88cb5e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
+30
-4
src/components/order/deposit/deposit-order/index.js
+1
-1
src/components/order/deposit/final-order/index.js
+21
-3
src/components/order/deposit/final-order/index.scss
+8
-0
No files found.
src/components/order/deposit/deposit-order/index.js
View file @
93905627
...
@@ -177,7 +177,7 @@ class Order extends Component {
...
@@ -177,7 +177,7 @@ class Order extends Component {
useBalance
=
()
=>
{
useBalance
=
()
=>
{
let
{
user_account
,
depositPrice
}
=
this
.
state
let
{
user_account
,
depositPrice
}
=
this
.
state
let
offset
=
parseFloat
(
user_account
)
-
parseFloat
(
depositPrice
)
let
offset
=
parseFloat
(
user_account
)
-
parseFloat
(
depositPrice
)
offset
=
offset
>
0
?
depositPrice
:
offse
t
offset
=
offset
>
0
?
depositPrice
:
user_accoun
t
this
.
setState
(
prevState
=>
({
useBalance
:
!
prevState
.
useBalance
,
offset
}))
this
.
setState
(
prevState
=>
({
useBalance
:
!
prevState
.
useBalance
,
offset
}))
}
}
...
...
src/components/order/deposit/final-order/index.js
View file @
93905627
...
@@ -6,6 +6,7 @@ import VlistBase from '@/common/v-list-base'
...
@@ -6,6 +6,7 @@ import VlistBase from '@/common/v-list-base'
import
'./index.scss'
import
'./index.scss'
import
{
WithFullSize
}
from
'@/HOCs'
import
{
WithFullSize
}
from
'@/HOCs'
import
{
Link
}
from
"react-router-dom"
import
{
Link
}
from
"react-router-dom"
import
app
from
"@/utils/app"
const
RadioItem
=
Radio
.
RadioItem
const
RadioItem
=
Radio
.
RadioItem
...
@@ -127,7 +128,8 @@ class FinalDepositOrder extends Component {
...
@@ -127,7 +128,8 @@ class FinalDepositOrder extends Component {
order_id
:
''
,
order_id
:
''
,
moneyOffRules
:
[],
moneyOffRules
:
[],
finalEndTime
:
''
,
finalEndTime
:
''
,
offset
:
0
offset
:
0
,
appliedMoneyOffRule
:
{}
}
}
}
}
...
@@ -367,6 +369,9 @@ class FinalDepositOrder extends Component {
...
@@ -367,6 +369,9 @@ class FinalDepositOrder extends Component {
for
(
let
i
=
0
;
i
<
rules
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
rules
.
length
;
i
++
)
{
let
rule
=
rules
[
i
]
let
rule
=
rules
[
i
]
if
(
result
>=
rule
.
full_amount
)
{
if
(
result
>=
rule
.
full_amount
)
{
this
.
setState
({
appliedMoneyOffRule
:
rule
})
return
result
-
parseFloat
(
rule
.
cut_amount
)
return
result
-
parseFloat
(
rule
.
cut_amount
)
}
}
}
}
...
@@ -378,7 +383,7 @@ class FinalDepositOrder extends Component {
...
@@ -378,7 +383,7 @@ class FinalDepositOrder extends Component {
this
.
setState
(
prevState
=>
{
this
.
setState
(
prevState
=>
{
const
useBalance
=
!
prevState
.
useBalance
const
useBalance
=
!
prevState
.
useBalance
let
offset
=
parseFloat
(
this
.
state
.
user_account
)
-
parseFloat
(
this
.
getTotalPrice
())
let
offset
=
parseFloat
(
this
.
state
.
user_account
)
-
parseFloat
(
this
.
getTotalPrice
())
offset
=
offset
>
0
?
offset
:
this
.
state
.
user_account
offset
=
offset
>
0
?
this
.
getTotalPrice
()
:
this
.
state
.
user_account
return
{
return
{
useBalance
,
useBalance
,
salePrice
:
this
.
getTotalPrice
({
useBalance
}),
salePrice
:
this
.
getTotalPrice
({
useBalance
}),
...
@@ -398,7 +403,8 @@ class FinalDepositOrder extends Component {
...
@@ -398,7 +403,8 @@ class FinalDepositOrder extends Component {
useBalance
,
useBalance
,
info
,
info
,
finalEndTime
,
finalEndTime
,
offset
offset
,
appliedMoneyOffRule
}
=
this
.
state
}
=
this
.
state
return
(
return
(
<
div
className
=
'pay-order'
>
<
div
className
=
'pay-order'
>
...
@@ -464,6 +470,18 @@ class FinalDepositOrder extends Component {
...
@@ -464,6 +470,18 @@ class FinalDepositOrder extends Component {
<
/Flex
>
<
/Flex
>
<
/WingBlank
>
<
/WingBlank
>
<
/div
>
<
/div
>
<
WhiteSpace
/>
{
appliedMoneyOffRule
.
full_amount
&&
<
div
className
=
"money-off"
>
<
WingBlank
>
<
Flex
justify
=
'end'
align
=
'center'
style
=
{{
height
:
'44px'
}}
>
<
span
>
满
{
appliedMoneyOffRule
.
full_amount
}
减
{
appliedMoneyOffRule
.
cut_amount
}
:
<
/span
>
<
span
className
=
'money'
>
{
`-¥
${
appliedMoneyOffRule
.
cut_amount
}
`
}
<
/span
>
<
/Flex
>
<
/WingBlank
>
<
/div
>
}
<
WhiteSpace
size
=
'md'
><
/WhiteSpace
>
<
WhiteSpace
size
=
'md'
><
/WhiteSpace
>
<
List
renderHeader
=
{()
=>
'支付方式'
}
className
=
'pay-type-list'
>
<
List
renderHeader
=
{()
=>
'支付方式'
}
className
=
'pay-type-list'
>
...
...
src/components/order/deposit/final-order/index.scss
View file @
93905627
...
@@ -21,6 +21,14 @@
...
@@ -21,6 +21,14 @@
color
:
#ff3131
;
color
:
#ff3131
;
}
}
}
}
.money-off
{
font-size
:
14px
;
background
:
#fff
;
color
:
#999
;
.money
{
color
:
#FF3131
;
}
}
.pay-type-list
{
.pay-type-list
{
.am-list-body
{
.am-list-body
{
...
...
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