add 樊登读书福州运营中心 (#8734)
This commit is contained in:
parent
9de3f017d9
commit
bdb0e125d2
|
|
@ -1578,6 +1578,12 @@ area 分区选项
|
|||
|
||||
<Route author="emdoe" example="/plainlaw/archives" path="/plainlaw/archives"/>
|
||||
|
||||
## 樊登读书
|
||||
|
||||
### 樊登福州运营中心
|
||||
|
||||
<Route author="Fatpandac" example="/dushu/fuzhou" path="/dushu/fuzhou" />
|
||||
|
||||
## 飞雪娱乐网
|
||||
|
||||
<Route author="nczitzk" example="/feixuew/rj" path="/feixuew/:id?" :paramsDesc="['分类 id,可在对应分类页面的 URL 中找到,默认为首页最近更新']">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
const got = require('@/utils/got');
|
||||
const { art } = require('@/utils/render');
|
||||
const path = require('path');
|
||||
|
||||
const host = 'https://gateway-api-ipv4.dushu365.com/compose-orch/offlineActivity/v100/activity/list';
|
||||
const itemLink = 'https://card.dushu.io/requirement/offline-activity/activity-detail/v/index.html';
|
||||
const link = 'https://card.dushu.io/requirement/offline-activity/host-home/v/index.html?webview-type=rn&hostId=xtntzsnwsnkw511r';
|
||||
|
||||
const transformTime = (item) => {
|
||||
const startTime = new Date(item.startTime);
|
||||
item.startTime = `${startTime.getFullYear()}-${startTime.getMonth() + 1}-${startTime.getDate()} ${startTime.getHours()}:${startTime.getMinutes()}`;
|
||||
const endTime = new Date(item.endTime);
|
||||
item.endTime = `${endTime.getFullYear()}-${endTime.getMonth() + 1}-${endTime.getDate()} ${endTime.getHours()}:${endTime.getMinutes()}`;
|
||||
};
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await got
|
||||
.post(host, {
|
||||
json: {
|
||||
channelTid: 'xtntzsnwsnkw511r',
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
type: 0,
|
||||
},
|
||||
})
|
||||
.json();
|
||||
|
||||
const data = response.data.activityListVOS;
|
||||
data.map(transformTime);
|
||||
|
||||
ctx.state.data = {
|
||||
title: '樊登福州运营中心',
|
||||
link,
|
||||
item: data.map((item) => ({
|
||||
title: item.activityName,
|
||||
link: itemLink + '?productId=' + item.activityId + '&type=' + item.type,
|
||||
description: art(path.join(__dirname, 'templates/message.art'), {
|
||||
item,
|
||||
}),
|
||||
})),
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<text>地区:{{item.areaName}}</text>
|
||||
<br>
|
||||
<text>地点:{{item.address}}</text>
|
||||
<br>
|
||||
<text>开始时间: {{item.startTime}}</text>
|
||||
<br>
|
||||
<text>结束时间: {{item.endTime}}</text>
|
||||
<br>
|
||||
<img style="heigth:500px;width:500px" src="{{item.posterImg}}">
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
'/fuzhou': ['Fatpandac'],
|
||||
};
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
module.exports = {
|
||||
'dushu.io': {
|
||||
_name: '樊登读书会',
|
||||
card: [
|
||||
{
|
||||
title: '福州运营中心',
|
||||
docs: 'https://docs.rsshub.app/new-media.html#fan-deng-du-shu-fan-deng-fu-zhou-yun-ying-zhong-xin',
|
||||
source: ['*'],
|
||||
target: '/dushu/fuzhou',
|
||||
},
|
||||
],
|
||||
},
|
||||
'dushu365.com': {
|
||||
_name: '樊登读书会',
|
||||
www: [
|
||||
{
|
||||
title: '福州运营中心',
|
||||
docs: 'https://docs.rsshub.app/new-media.html#fan-deng-du-shu-fan-deng-fu-zhou-yun-ying-zhong-xin',
|
||||
source: ['*'],
|
||||
target: '/dushu/fuzhou',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function (router) {
|
||||
router.get('/fuzhou', require('./fuzhou/index'));
|
||||
};
|
||||
Loading…
Reference in New Issue