diff --git a/docs/README.md b/docs/README.md index c8c41a236..35e9ac932 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1657,6 +1657,10 @@ IATA 国际航空运输协会机场代码, 参见[维基百科 国际航空运 +### Westore + + + ## 小说·文学·阅读 ### 观止(每日一文) diff --git a/router.js b/router.js index f95db4ae7..af97feade 100644 --- a/router.js +++ b/router.js @@ -689,6 +689,9 @@ router.get('/chouti/:subject?', require('./routes/chouti')); // 西安电子科技大学 router.get('/xidian/jwc/:category?', require('./routes/xidian/jwc')); +// Westore +router.get('/westore/new', require('./routes/westore/new')); + // 优酷 router.get('/youku/channel/:channelId/:embed?', require('./routes/youku/channel')); diff --git a/routes/westore/new.js b/routes/westore/new.js new file mode 100644 index 000000000..49614d736 --- /dev/null +++ b/routes/westore/new.js @@ -0,0 +1,40 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const link = 'https://umall.vip.qq.com/v2/?_wv=1025&_wwv=4&product=32482&path=/category/list-ip&query=ip%253D20372%2526type%253Dip%2526isDetail%253D1%2526sortType%253D3#/category/list-ip?ip=20372&type=ip&isDetail=1&sortType=3'; + const response = await axios({ + method: 'post', + url: 'https://uapi.vip.qq.com/Api/api.brand.productssrf', + data: { + page: 1, + per_page: 20, + asc: 0, + brand_id: 20372, + sort_type: 3, + adtag2: 'search_mr', + scence: 'ipdetail', + }, + headers: { + Referer: link, + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', + }, + }); + + ctx.state.data = { + title: 'Westore', + link, + description: '微信周边', + item: response.data.brands.map(({ name, img, vipprice, id }) => { + const description = ` +
+ 价格: ${+vipprice / 100}元 + `; + + return { + title: name, + description: description, + link: `https://umall.vip.qq.com/v2/?_wv=1025&_wwv=4&product=32482&path=/product/${id}`, + }; + }), + }; +};