diff --git a/docs/README.md b/docs/README.md index 66bf769c48..c9ce55613a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2195,3 +2195,7 @@ IATA 国际航空运输协会机场代码, 参见[维基百科 国际航空运 ### 搜狗 + +### 探物 + + diff --git a/router.js b/router.js index 72bad69bce..08a1f33240 100644 --- a/router.js +++ b/router.js @@ -752,4 +752,7 @@ router.get('/hko/weather', require('./routes/hko/weather')); // sankakucomplex router.get('/sankakucomplex/post', require('./routes/sankakucomplex/post')); +// 探物 +router.get('/tanwu/products', require('./routes/tanwu/products')); + module.exports = router; diff --git a/routes/tanwu/products.js b/routes/tanwu/products.js new file mode 100644 index 0000000000..3cca9b4b0e --- /dev/null +++ b/routes/tanwu/products.js @@ -0,0 +1,27 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: 'https://api.tanwuapp.com/iOS/2.0.0/products?rentType=0&pageSize=1000&pageNum=1&clientType=web:h5', + }); + + const data = response.data.details.allProductList.data; + + ctx.state.data = { + title: '探物', + link: 'https://m.tanwuapp.com', + description: '探物是一个科技数码产品租赁平台,旨在把市面上最新、最酷、最实用的科技产品带去给用户,传播科技便捷生活、共享丰富生活的价值理念。', + item: data.map(({ productName, productImageSrc, productRent, rentUnit, productId, appraiseAvgScore }) => ({ + title: productName, + link: `https://m.tanwuapp.com/?source=mobile#/productDetails?productId=${productId}`, + description: ` +
+ ${productName}

+ 价格: ¥${productRent} / ${rentUnit}
+ 评分: ${appraiseAvgScore} + `, + guid: productId, + })), + }; +};