调整购物车API

This commit is contained in:
TOP糯米 2023-03-11 22:42:13 +08:00
parent 8647e8dfb4
commit 75c7581a79
1 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ export default {
count(id, type) {
return new Promise((resolve, reject) => {
prototype.$request({
api: "order.cart.count",
api: "service.cart.count",
}).then((response) => {
return resolve(response.data.count);
}).catch(e => { });
@ -20,7 +20,7 @@ export default {
toCart(id) {
return new Promise((resolve, reject) => {
prototype.$request({
api: "order.cart.toCart",
api: "service.cart.toCart",
data: {
id: id,
}
@ -39,7 +39,7 @@ export default {
change(id, type) {
return new Promise((resolve, reject) => {
prototype.$request({
api: "order.cart." + (type == 'sub' ? 'sub' : 'add'),
api: "service.cart." + (type == 'sub' ? 'sub' : 'add'),
data: {
id: id,
}
@ -54,7 +54,7 @@ export default {
delete(id) {
return new Promise((resolve, reject) => {
prototype.$request({
api: "order.cart.delete",
api: "service.cart.delete",
data: {
id: id,
}
@ -74,7 +74,7 @@ export default {
}
prototype.$request({
api: "order.cart.list",
api: "service.cart.list",
}).then(response => {
if (response.code == 1) {
uni.setStorageSync('USER_CART', response.data);