Commit bb22d5db by xuzhenghua

下单

parent d38495ed
......@@ -80,7 +80,7 @@ class Order extends Component {
perfect: this.props.location.state,
user_account: 0.00, // 账户余额
total: 0.00, // 需要支付总金额
discount: 0.00, //
discount: 0.00, //
useBalance: false,
orderList: [],
info: false,
......@@ -278,33 +278,46 @@ class Order extends Component {
this.publicGetData(courseInfo);
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;
}
}
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();
})
}
this.publicGetData(res);
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() {
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