优化购物车提示
This commit is contained in:
parent
ce1a13bdd0
commit
3a8c6a4361
|
@ -25,9 +25,8 @@ export default {
|
|||
id: id,
|
||||
}
|
||||
}).then((response) => {
|
||||
prototype.$utils.toast(response.msg);
|
||||
if (response.code == 1) {
|
||||
return resolve();
|
||||
return resolve(response.msg);
|
||||
}
|
||||
return reject(response.msg);
|
||||
}).catch(e => { });
|
||||
|
@ -43,8 +42,11 @@ export default {
|
|||
data: {
|
||||
id: id,
|
||||
}
|
||||
}).then(() => {
|
||||
return resolve();
|
||||
}).then((response) => {
|
||||
if (response.code == 1) {
|
||||
return resolve(response.msg);
|
||||
}
|
||||
return reject(response.msg);
|
||||
}).catch(e => { });
|
||||
});
|
||||
},
|
||||
|
@ -58,8 +60,11 @@ export default {
|
|||
data: {
|
||||
id: id,
|
||||
}
|
||||
}).then(() => {
|
||||
return resolve();
|
||||
}).then((response) => {
|
||||
if (response.code == 1) {
|
||||
return resolve(response.msg);
|
||||
}
|
||||
return reject(response.msg);
|
||||
}).catch(e => { });
|
||||
});
|
||||
},
|
||||
|
|
|
@ -176,8 +176,9 @@ export default {
|
|||
* 加入购物车
|
||||
*/
|
||||
addToCart() {
|
||||
this.$models.cart.toCart(this.id).then(() => {
|
||||
this.$models.cart.toCart(this.id).then((msg) => {
|
||||
this.$store.dispatch("cart/updateAll");
|
||||
this.$utils.toast(msg);
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue