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