Commit 29b512e3 by zhanghaozhe

定金

parent 437e88fb
...@@ -182,7 +182,7 @@ class FinalDepositOrder extends Component { ...@@ -182,7 +182,7 @@ class FinalDepositOrder extends Component {
cut_amount: 0, cut_amount: 0,
pay_amount: salePrice, pay_amount: salePrice,
is_deduction: useBalance ? 1 : 0, is_deduction: useBalance ? 1 : 0,
deduction_amount: useBalance ? user_account : 0, deduction_amount: useBalance ? this.getBalanceOffset() : 0,
plat_form: 5, plat_form: 5,
source: getParam('source') source: getParam('source')
}) })
...@@ -392,14 +392,14 @@ class FinalDepositOrder extends Component { ...@@ -392,14 +392,14 @@ class FinalDepositOrder extends Component {
} }
getOriginTotalPrice = ({courses = this.state.selectedCourses} = {}) => { getOriginTotalPrice = ({courses = this.state.selectedCourses} = {}) => {
return courses.reduce((accu, item) => { return courses.reduce((accu, item) => {
return accu + parseFloat(item['sale_price']) return accu + parseFloat(item['sale_price'])
}, 0) }, 0)
} }
getBalanceOffset = () => { getBalanceOffset = () => {
let originalTotalPrice = this.getOriginTotalPrice() let originalTotalPrice = this.getOriginTotalPrice()
let offset = parseFloat(this.state.user_account) - parseFloat(originalTotalPrice) let offset = parseFloat(this.state.user_account) - parseFloat(originalTotalPrice)
offset = offset >= 0 ? originalTotalPrice : this.state.user_account offset = offset >= 0 ? originalTotalPrice : this.state.user_account
return offset return offset
......
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