Commit 00b6ad6b by wangshuo

满减

parent d7d2610c
......@@ -120,6 +120,8 @@ class Order extends Component {
orderList: [],
info: false,
offset: 0,
full_amount: 0, // 满金额
cut_amount: 0, // 减金额
};
}
// 提交订单
......@@ -267,6 +269,12 @@ class Order extends Component {
discount,
});
};
fullRules = (data) => {
this.setState({
full_amount: data.full_amount,
cut_amount: data.cut_amount,
});
};
// 公共方法 本地存储
publicLocalStorage = () => {
if(this.props.history.action === 'PUSH') {
......@@ -300,8 +308,11 @@ class Order extends Component {
// 普通课程立即报名 不带 type = 1
http.get(`${API['base-api']}/m/order/preorder`).then(res => {
if(res.data.errno === 200) {
console.log(res.data.data);
this.publicGetData(res.data.data);
this.publicLocalStorage();
this.fullRules(res.data.data);
}else{
Toast.info(res.data.msg, 2);
}
......@@ -407,7 +418,9 @@ class Order extends Component {
useBalance,
info,
offset,
groupPrice
groupPrice,
full_amount,
cut_amount,
} = this.state;
return (
......@@ -495,6 +508,20 @@ class Order extends Component {
</Item>
</List>
</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-course">
<span className="order-course-text">{`${orderList.length}门课程`}</span>
......
......@@ -265,7 +265,8 @@
.order-balance {
height: 44px;
line-height: 44px;
margin: 8px 0 50px 0;
margin: 8px 0 8px 0;
display: flow-root;
.am-list-item {
padding-left: 0 !important;
......@@ -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