Commit 00b6ad6b by wangshuo

满减

parent d7d2610c
...@@ -120,6 +120,8 @@ class Order extends Component { ...@@ -120,6 +120,8 @@ class Order extends Component {
orderList: [], orderList: [],
info: false, info: false,
offset: 0, offset: 0,
full_amount: 0, // 满金额
cut_amount: 0, // 减金额
}; };
} }
// 提交订单 // 提交订单
...@@ -267,6 +269,12 @@ class Order extends Component { ...@@ -267,6 +269,12 @@ class Order extends Component {
discount, discount,
}); });
}; };
fullRules = (data) => {
this.setState({
full_amount: data.full_amount,
cut_amount: data.cut_amount,
});
};
// 公共方法 本地存储 // 公共方法 本地存储
publicLocalStorage = () => { publicLocalStorage = () => {
if(this.props.history.action === 'PUSH') { if(this.props.history.action === 'PUSH') {
...@@ -300,8 +308,11 @@ class Order extends Component { ...@@ -300,8 +308,11 @@ class Order extends Component {
// 普通课程立即报名 不带 type = 1 // 普通课程立即报名 不带 type = 1
http.get(`${API['base-api']}/m/order/preorder`).then(res => { http.get(`${API['base-api']}/m/order/preorder`).then(res => {
if(res.data.errno === 200) { if(res.data.errno === 200) {
console.log(res.data.data);
this.publicGetData(res.data.data); this.publicGetData(res.data.data);
this.publicLocalStorage(); this.publicLocalStorage();
this.fullRules(res.data.data);
}else{ }else{
Toast.info(res.data.msg, 2); Toast.info(res.data.msg, 2);
} }
...@@ -407,7 +418,9 @@ class Order extends Component { ...@@ -407,7 +418,9 @@ class Order extends Component {
useBalance, useBalance,
info, info,
offset, offset,
groupPrice groupPrice,
full_amount,
cut_amount,
} = this.state; } = this.state;
return ( return (
...@@ -495,6 +508,20 @@ class Order extends Component { ...@@ -495,6 +508,20 @@ class Order extends Component {
</Item> </Item>
</List> </List>
</div> </div>
{
(full_amount > 0 && cut_amount > 0) ? (
<>
<div className="full__rules">
<WingBlank>
<div className="money__off">
<span>{full_amount}{cut_amount}</span>
<span className='money'>{`-¥${cut_amount}`}</span>
</div>
</WingBlank>
</div>
</>
) : (null)
}
<div className="order-bar"> <div className="order-bar">
<div className="order-course"> <div className="order-course">
<span className="order-course-text">{`${orderList.length}门课程`}</span> <span className="order-course-text">{`${orderList.length}门课程`}</span>
......
...@@ -265,7 +265,8 @@ ...@@ -265,7 +265,8 @@
.order-balance { .order-balance {
height: 44px; height: 44px;
line-height: 44px; line-height: 44px;
margin: 8px 0 50px 0; margin: 8px 0 8px 0;
display: flow-root;
.am-list-item { .am-list-item {
padding-left: 0 !important; padding-left: 0 !important;
...@@ -282,4 +283,23 @@ ...@@ -282,4 +283,23 @@
} }
} }
} }
.full__rules {
width: 100%;
height: 50px;
margin-top: 16px;
background: #FFF;
font-size: 14px;
background: #fff;
color: #999;
.money__off {
height: 50px;
display: flex;
justify-content: space-between;
align-items: center;
}
.money{
color: #FF3131;
}
}
} }
\ No newline at end of file
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