fix: 小黑盒热门折扣 (#2237)

This commit is contained in:
aka-rin 2019-05-27 11:12:27 +08:00 committed by DIYgod
parent 60cbf755e7
commit 0bb5acf6ce
1 changed files with 7 additions and 7 deletions

View File

@ -3,18 +3,18 @@ const axios = require('@/utils/axios');
module.exports = async (ctx) => {
const response = await axios({
method: 'get',
url: `https://api.xiaoheihe.cn/game/all_recommend/games/?show_type=discount&offset=0&limit=30&heybox_id=12777814&imei=867252032615972&os_type=Android&os_version=9&version=1.1.55&_time=1551803757&hkey=6977cde54ab859fbb98757d3e6b953d9`,
url: 'https://api.xiaoheihe.cn/game/web/all_recommend/games/?show_type=discount&limit=20&offset=0&os_type=web&version=999.0.0',
});
const data = response.data.result.list;
ctx.state.data = {
title: `小黑盒游戏打折情况`,
link: `https://xiaoheihe.cn/games/index`,
title: '小黑盒 Steam 热门折扣',
link: 'https://xiaoheihe.cn/games/index',
item: data.map((item) => ({
title: item.game_name,
description: `原价¥${item.heybox_price.original_coin / 1000}元,现价¥${item.heybox_price.cost_coin / 1000}元,折扣力度${item.heybox_price.discount}%OFF`,
pubDate: ('' + item.price.deadline_date).replace(' 截止', ''),
link: item.game_img,
title: (item.price.discount === item.price.lowest_discount ? '[史低] ' : '') + item.name + (item.name_en ? ' / ' + item.name_en : ''),
description: `<img src="https://steamcdn-a.akamaihd.net/steam/apps/${item.appid}/header.jpg" referrerpolicy="no-referrer"> <br> 原价¥${item.heybox_price.original_coin / 1000},现价¥${item.heybox_price.cost_coin /
1000}折扣力度 ${item.heybox_price.discount}%${item.price.deadline_date} <br> 评分${item.score} <br> 简介${item.about_the_game}`,
link: `https://store.steampowered.com/app/${item.appid}/?l=zh&cc=cn`,
})),
};
};