Commit 93905627 by zhanghaozhe

bug

parent de88cb5e
...@@ -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 : offset offset = offset > 0 ? depositPrice : user_account
this.setState(prevState => ({useBalance: !prevState.useBalance, offset})) this.setState(prevState => ({useBalance: !prevState.useBalance, offset}))
} }
......
...@@ -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'>
......
...@@ -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 {
......
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