Files
JayuCloud/JC-ArtList-WeChat/api/wishlist.js
T

87 lines
2.2 KiB
JavaScript

/**
* Mini program API wrapper for this module.
* Call guide: require this module in a page, then invoke the matching method from page event handlers or lifecycle hooks.
*/
const request = require('../utils/request')
module.exports = {
/**
* Purpose: addToWishlist supports wishlist.js by holding or executing the add to wishlist page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
addToWishlist(productId) {
return request({
url: '/wishlist/add',
method: 'POST',
data: {
productId
}
})
},
/**
* Purpose: removeFromWishlist supports wishlist.js by holding or executing the remove from wishlist page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
removeFromWishlist(productId) {
return request({
url: '/wishlist/remove',
method: 'POST',
data: {
productId
}
})
},
/**
* Purpose: checkWishlist supports wishlist.js by holding or executing the check wishlist page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
checkWishlist(productId) {
return request({
url: '/wishlist/check',
params: {
productId
}
})
},
/**
* Purpose: getWishlist supports wishlist.js by holding or executing the get wishlist page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
getWishlist() {
return request({
url: '/wishlist/list'
})
},
getGroups() {
return request({
url: '/wishlist/groups'
})
},
getInspiration() {
return request({
url: '/wishlist/inspiration'
})
},
addWithGroup(data) {
return request({
url: '/wishlist/add-with-group',
method: 'POST',
data
})
},
moveWishlist(data) {
return request({
url: '/wishlist/move',
method: 'POST',
data
})
}
}