Commit 93905627 by zhanghaozhe

bug

parent de88cb5e
......@@ -177,7 +177,7 @@ class Order extends Component {
useBalance = () => {
let {user_account, depositPrice} = this.state
let offset = parseFloat(user_account) - parseFloat(depositPrice)
offset = offset > 0 ? depositPrice : offset
offset = offset > 0 ? depositPrice : user_account
this.setState(prevState => ({useBalance: !prevState.useBalance, offset}))
}
......
......@@ -6,6 +6,7 @@ import VlistBase from '@/common/v-list-base'
import './index.scss'
import { WithFullSize } from '@/HOCs'
import { Link } from "react-router-dom"
import app from "@/utils/app"
const RadioItem = Radio.RadioItem
......@@ -127,7 +128,8 @@ class FinalDepositOrder extends Component {
order_id: '',
moneyOffRules: [],
finalEndTime: '',
offset: 0
offset: 0,
appliedMoneyOffRule: {}
}
}
......@@ -367,6 +369,9 @@ class FinalDepositOrder extends Component {
for (let i = 0; i < rules.length; i++) {
let rule = rules[i]
if (result >= rule.full_amount) {
this.setState({
appliedMoneyOffRule: rule
})
return result - parseFloat(rule.cut_amount)
}
}
......@@ -378,7 +383,7 @@ class FinalDepositOrder extends Component {
this.setState(prevState => {
const useBalance = !prevState.useBalance
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 {
useBalance,
salePrice: this.getTotalPrice({useBalance}),
......@@ -398,7 +403,8 @@ class FinalDepositOrder extends Component {
useBalance,
info,
finalEndTime,
offset
offset,
appliedMoneyOffRule
} = this.state
return (
<div className='pay-order'>
......@@ -464,6 +470,18 @@ class FinalDepositOrder extends Component {
</Flex>
</WingBlank>
</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>
<List renderHeader={() => '支付方式'} className='pay-type-list'>
......
......@@ -21,6 +21,14 @@
color: #ff3131;
}
}
.money-off{
font-size: 14px;
background: #fff;
color: #999;
.money{
color: #FF3131;
}
}
.pay-type-list {
.am-list-body {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment