Commit bb22d5db by xuzhenghua

下单

parent d38495ed
...@@ -80,7 +80,7 @@ class Order extends Component { ...@@ -80,7 +80,7 @@ class Order extends Component {
perfect: this.props.location.state, perfect: this.props.location.state,
user_account: 0.00, // 账户余额 user_account: 0.00, // 账户余额
total: 0.00, // 需要支付总金额 total: 0.00, // 需要支付总金额
discount: 0.00, // discount: 0.00, //
useBalance: false, useBalance: false,
orderList: [], orderList: [],
info: false, info: false,
...@@ -278,33 +278,46 @@ class Order extends Component { ...@@ -278,33 +278,46 @@ class Order extends Component {
this.publicGetData(courseInfo); this.publicGetData(courseInfo);
this.publicLocalStorage(); this.publicLocalStorage();
}); });
} else { }
if(getParam('id')) { else{
Promise.all([http.get(`${API.home}/m/del_cart_order/${getParam('id')}`), http.get(`${API['base-api']}/m/order/preorder`)]).then(res => { http.get(`${API['base-api']}/m/order/preorder`).then((res) => {
console.log(res); console.log('为了验证什么条件下会走这段代码');
let preorder = res[1], if (res.data.errno !== 200) {
orderList = preorder.data.data.course; Toast.info(res.data.msg, 2);
if(preorder.data.errno !== 200) { return;
Toast.info(preorder.data.msg, 2); }
return;
}
this.publicGetData(preorder);
this.publicLocalStorage();
})
}else{
http.get(`${API['base-api']}/m/order/preorder`).then((res) => {
console.log('为了验证什么条件下会走这段代码');
if (res.data.errno !== 200) {
Toast.info(res.data.msg, 2);
return;
}
this.publicGetData(res); this.publicGetData(res);
this.publicLocalStorage(); this.publicLocalStorage();
}) })
}
} }
// else {
// if(getParam('id')) {
// Promise.all([http.get(`${API.home}/m/del_cart_order/${getParam('id')}`), http.get(`${API['base-api']}/m/order/preorder`)]).then(res => {
// console.log(res);
// let preorder = res[1],
// orderList = preorder.data.data.course;
// if(preorder.data.errno !== 200) {
// Toast.info(preorder.data.msg, 2);
// return;
// }
//
// this.publicGetData(preorder);
// this.publicLocalStorage();
// })
// }else{
// http.get(`${API['base-api']}/m/order/preorder`).then((res) => {
// console.log('为了验证什么条件下会走这段代码');
// if (res.data.errno !== 200) {
// Toast.info(res.data.msg, 2);
// return;
// }
//
// this.publicGetData(res);
// this.publicLocalStorage();
// })
// }
// }
}; };
render() { render() {
const { const {
......
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