-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* add router 关于bilibili票务 * bilibili票务基础模板 * add bilibili会员购票务 maintainer * add cookie * doc文档,radar * add 补充内容 * 修改doc条目顺序,优化代码 * fix:修复doc文旦错误,移除作者备注 * fix: delete radar.js中的多余文字 * fix: 修复错误
- Loading branch information
1 parent
20c284f
commit 15b41ae
Showing
5 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const got = require('@/utils/got'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
const config = require('@/config').value; | ||
|
||
module.exports = async (ctx) => { | ||
const { area = -1, type = '全部类型', uid } = ctx.params; | ||
const cookie = config.bilibili.cookies[uid]; | ||
const link = 'https://show.bilibili.com/api/ticket/project/listV2'; | ||
|
||
const headers = { | ||
Referer: 'https://space.bilibili.com', | ||
Cookie: cookie ? `SESSDATA=${cookie}` : undefined, | ||
}; | ||
|
||
const { data: response } = await got({ | ||
method: 'get', | ||
url: `${link}?version=134&page=1&pagesize=16&area=${area}&filter=&platform=web&p_type=${type}`, | ||
headers, | ||
}); | ||
// 列表 | ||
const list = response.data.result; | ||
|
||
const items = list.map((item) => { | ||
const bodyHtml = `<img src="${item.cover}"></img>`; | ||
const coordinate = `<div>活动地点: ${item.city} ${item.venue_name}</div>`; | ||
const liveTime = `<div>活动时间: ${item.tlabel}</div>`; | ||
const staff = `<div>参展览嘉宾: ${item.staff}</div>`; | ||
const countdown = `<div>结束日期: ${item.countdown}</div>`; | ||
const price = `<div>最低价: ${item.price_low / 100} ; 最高价: ${item.price_high / 100}</div>`; | ||
return { | ||
title: item.project_name, | ||
link: item.url, | ||
description: bodyHtml + coordinate + liveTime + staff + countdown + price, | ||
pubDate: parseDate(item.sale_start_time * 1000), | ||
}; | ||
}); | ||
|
||
ctx.state.data = { | ||
title: `bilibili会员购票务-${area}`, | ||
link, | ||
item: items, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters