2026-05-18 09:46:11 +08:00
|
|
|
/**
|
|
|
|
|
* 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: getAllTags supports tag.js by holding or executing the get all tags 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
|
|
|
getAllTags() {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/tag/list/all'
|
|
|
|
|
})
|
2026-05-23 21:56:52 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Purpose: getFilterOptions loads grouped public tag filters for scene-based browsing.
|
|
|
|
|
* Usage: call it from product list pages, then pass selected tag ids to getProductPage.
|
|
|
|
|
*/
|
|
|
|
|
getFilterOptions(shopId) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/tag/list/filter-options',
|
|
|
|
|
params: shopId ? { shopId } : undefined
|
|
|
|
|
})
|
2026-04-01 15:18:35 +08:00
|
|
|
}
|
|
|
|
|
}
|