增加: 小程序商店 (#1131)

This commit is contained in:
凉凉
2018-11-13 10:52:36 +08:00
committed by DIYgod
parent 3739e40a16
commit aba5fbe103
3 changed files with 39 additions and 0 deletions

View File

@@ -733,6 +733,8 @@ GitHub 官方也提供了一些 RSS:
</route> </route>
<route name="小程序商店-最新" author="xyqfer" example="/miniapp/store/newest" path="/miniapp/store/newest"/>
### 技术头条 ### 技术头条
<route name="最新分享" author="xyqfer" example="/blogread/newest" path="/blogread/newest"/> <route name="最新分享" author="xyqfer" example="/blogread/newest" path="/blogread/newest"/>

View File

@@ -691,6 +691,7 @@ router.get('/dwnews/rank/:type/:range', require('./routes/dwnews/rank'));
// 知晓程序 // 知晓程序
router.get('/miniapp/article/:category', require('./routes/miniapp/article')); router.get('/miniapp/article/:category', require('./routes/miniapp/article'));
router.get('/miniapp/store/newest', require('./routes/miniapp/store/newest'));
// 后续 // 后续
router.get('/houxu/:type/:id', require('./routes/houxu/houxu')); router.get('/houxu/:type/:id', require('./routes/houxu/houxu'));

View File

@@ -0,0 +1,36 @@
const axios = require('../../../utils/axios');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: 'https://minapp.com/api/v5/trochili/miniapp/?tag=&offset=0&limit=21',
});
const data = response.data.objects;
ctx.state.data = {
title: '小程序商店-知晓程序',
link: 'https://minapp.com/miniapp/',
description: '知晓程序,让你更知微信小程序。我们提供微信小程序开发资讯,解读微信小程序开发文档,制作微信小程序开发教程。此外,我们还有国内第一家微信小程序商店/应用市场/应用商店。点击入驻,立刻畅游微信小程序的海洋。',
item: data.map((item) => {
const screenshots = item.screenshot.reduce((screenshots, item) => {
screenshots += `<img referrerpolicy="no-referrer" src="${item.image}"><br>`;
return screenshots;
}, '');
return {
title: `${item.name}-${item.description}`,
link: `https://minapp.com/miniapp/${item.id}/`,
description: `
<strong>${item.name}</strong><br>
${item.description}<br><br>
<img referrerpolicy="no-referrer" src="${item.qrcode.image}"><br><br>
<strong>截图:</strong><br>
${screenshots}
`,
pubDate: new Date(item.created_at * 1000).toUTCString(),
author: item.created_by,
};
}),
};
};