重构项目文件夹目录
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* 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
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user