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-04-20 16:02:57 +08:00
|
|
|
getProductPage(params) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/product/list/page',
|
|
|
|
|
params
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-04-01 15:18:35 +08:00
|
|
|
getAllProducts() {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/product/list/all'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getProductById(id) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/product/get/${id}`
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getProductsByTag(tag) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/product/list/tag/${encodeURIComponent(tag)}`
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
searchProducts(keyword) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/product/list/search',
|
|
|
|
|
params: {
|
|
|
|
|
keyword
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|