优化购物车提示

This commit is contained in:
TOP糯米 2023-04-07 15:06:05 +08:00
parent ce1a13bdd0
commit 3a8c6a4361
2 changed files with 13 additions and 7 deletions

View File

@ -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 => { });
});
},

View File

@ -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);
});
},
/**