Commit bb22d5db by xuzhenghua

下单

parent d38495ed
......@@ -278,21 +278,8 @@ 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{
else{
http.get(`${API['base-api']}/m/order/preorder`).then((res) => {
console.log('为了验证什么条件下会走这段代码');
if (res.data.errno !== 200) {
......@@ -304,7 +291,33 @@ class Order extends Component {
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