Files

87 lines
2.2 KiB
JavaScript
Raw Permalink Normal View History

/**
* 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.
*/
2026-04-01 15:18:35 +08:00
const request = require('../utils/request')
module.exports = {
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-01 15:18:35 +08:00
addToWishlist(productId) {
return request({
url: '/wishlist/add',
method: 'POST',
data: {
productId
}
})
},
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-01 15:18:35 +08:00
removeFromWishlist(productId) {
return request({
url: '/wishlist/remove',
method: 'POST',
data: {
productId
}
})
},
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-01 15:18:35 +08:00
checkWishlist(productId) {
return request({
url: '/wishlist/check',
params: {
productId
}
})
},
2026-05-23 18:45:41 +08:00
/**
* 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.
*/
2026-04-01 15:18:35 +08:00
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
})
2026-04-01 15:18:35 +08:00
}
}