koishi-plugin-tmp-bot 1.16.7 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/evmOpenApi.d.ts +6 -0
- package/lib/api/evmOpenApi.js +22 -0
- package/lib/command/tmpDlcMap.js +4 -0
- package/lib/command/tmpPosition.js +0 -1
- package/lib/resource/dlc.html +23 -32
- package/package.json +1 -1
package/lib/api/evmOpenApi.d.ts
CHANGED
|
@@ -16,3 +16,9 @@ export function mapPlayerList(http: any, serverId: any, ax: any, ay: any, bx: an
|
|
|
16
16
|
export function playerInfo(http: any, tmpId: any): Promise<{
|
|
17
17
|
error: boolean;
|
|
18
18
|
}>;
|
|
19
|
+
/**
|
|
20
|
+
* DLC列表
|
|
21
|
+
*/
|
|
22
|
+
export function dlcList(http: any, type: any): Promise<{
|
|
23
|
+
error: boolean;
|
|
24
|
+
}>;
|
package/lib/api/evmOpenApi.js
CHANGED
|
@@ -65,5 +65,27 @@ module.exports = {
|
|
|
65
65
|
data.data = result.data;
|
|
66
66
|
}
|
|
67
67
|
return data;
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* DLC列表
|
|
71
|
+
*/
|
|
72
|
+
async dlcList(http, type) {
|
|
73
|
+
let result = null;
|
|
74
|
+
try {
|
|
75
|
+
result = await http.get(`${BASE_API}/dlc/list?type=${type}`);
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
return {
|
|
79
|
+
error: true
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
// 拼接返回数据
|
|
83
|
+
let data = {
|
|
84
|
+
error: result.code !== 200
|
|
85
|
+
};
|
|
86
|
+
if (!data.error) {
|
|
87
|
+
data.data = result.data;
|
|
88
|
+
}
|
|
89
|
+
return data;
|
|
68
90
|
}
|
|
69
91
|
};
|
package/lib/command/tmpDlcMap.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
const { segment } = require('koishi');
|
|
2
2
|
const { resolve } = require('path');
|
|
3
3
|
const common = require('../util/common');
|
|
4
|
+
const evmOpenApi = require('../api/evmOpenApi');
|
|
4
5
|
module.exports = async (ctx, session) => {
|
|
5
6
|
if (!ctx.puppeteer) {
|
|
6
7
|
return '未启用 Puppeteer 功能';
|
|
7
8
|
}
|
|
9
|
+
// 查询DLC数据
|
|
10
|
+
let dlcData = await evmOpenApi.dlcList(ctx.http, 1);
|
|
8
11
|
let page;
|
|
9
12
|
try {
|
|
10
13
|
page = await ctx.puppeteer.page();
|
|
11
14
|
await page.setViewport({ width: 1000, height: 1000 });
|
|
12
15
|
await page.goto(`file:///${resolve(__dirname, '../resource/dlc.html')}`);
|
|
16
|
+
await page.evaluate(`setData(${JSON.stringify(dlcData.data)})`);
|
|
13
17
|
await page.waitForNetworkIdle();
|
|
14
18
|
await common.sleep(500);
|
|
15
19
|
const element = await page.$("#dlc-info-container");
|
package/lib/resource/dlc.html
CHANGED
|
@@ -80,44 +80,35 @@
|
|
|
80
80
|
</div>
|
|
81
81
|
|
|
82
82
|
<script>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
{"id": 6, "name": "Euro Truck Simulator 2 - Vive la France !", "desc": "《Vive la France !》是《Euro Truck Simulator 2》的大型地图扩展包。 在工业化城市宽阔的林荫大道和偏远村镇的狭窄街区徜徉。从北到南,领略不同的地貌与植被,体验独特的法式户外风情。", "header_image_url": "https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/header.jpg?t=1733308938", "background_url": "https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/page_bg_generated_v6b.jpg?t=1733308938", "background_url": "https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/page_bg_generated_v6b.jpg?t=1733308938", "init_price": 78.00, "discount": 0, "final_price": 78.00, "screenshot_url": ["https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_0d828f1216c13480337a572db465b6f2fd288a3d.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_fa1a682646d525a7386c4cb8202f8baae92bf7ed.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_fafafc3504c79a713e7e732f9218e24512b23ec4.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_84a4abf681632ef2ef520f70d7f3fdb1c52b767d.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_a81a4c21dac178c2f4a545a550ed74830be9647a.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_1070f45b453dcd532e92509ce98cec82483bb93a.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_23179353389df121bbb42d204682fa11a9c28e85.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_751241eb01a71ebfab2af86ca48508e124a0383f.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_a8c56abb12e4c9a142f520f37bdafcc622675e67.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_e736bc6b34c4d1fc0f0850862352f468ed0640cf.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_1e833a7cde315c5b91d185ffd0c7f16700f2ce3e.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_62542b1b066d4a8a04d5fa42e37078c5ca13f24a.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_91b6eb73961717d69d3b57703f5232b4a700762c.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_89ef0d4721374e72bc1a54e1e2a606a3d886cb6f.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_c8e41dc830149849af82dc3cd53adbaea4029e17.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_5262bc18dca6f2fc360a75f19ea436c8570d53d6.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_c21f57bc38c24d466fa8bc773a26cebaeae07f1a.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_636699019725f3e13950d5ab614c476cfdac16f3.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_83cf72d60983b2c3c4b0637848d97507394eff5a.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_b3a9eb050aff55acc4627db3d369ffbd7fbded07.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_3cc3eaec5dca60912df276ed82313de77ccaf143.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_64f15999f69862278886f22e191a32683eaeb6c9.600x338.jpg?t=1733308938","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/531130/ss_ba0f451a6ee371d3f6970419eedbf4e8fb5db624.600x338.jpg?t=1733308938"]},
|
|
90
|
-
{"id": 7, "name": "Euro Truck Simulator 2 - Scandinavia", "desc": "本次地图扩展包囊括瑞典、挪威和丹麦三国,为您带来绵长秀丽、风景如画的道路,以及遍布北欧三国的众多地标景点。全新的渡轮码头让您可以直接驾驶卡车登上渡轮,方便您前往沿海城市,还可以使用全新航线,前往德国北部、波兰和英国的港口。探索包括斯德哥尔摩、马尔默、哥德堡、奥斯陆、斯塔万格、卑尔根、哥本哈根、奥尔堡和埃斯比约在内的 27 座斯堪的纳维亚城市。", "header_image_url": "https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/header.jpg?t=1731584398", "background_url": "https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/page_bg_generated_v6b.jpg?t=1731584398", "background_url": "https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/page_bg_generated_v6b.jpg?t=1731584398", "init_price": 78.00, "discount": 0, "final_price": 78.00, "screenshot_url": ["https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_2368e04ac29ed068abef5e9238201ebd809f81f2.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_c1c6d8379c1f3ff3f055bb6d153a061c6e0f69cd.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_22c657ab42457c2e3dc8f40f91e695568aab19df.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_886292ff8566b47c46828f632cc878da6fba54d2.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_980e9b5a8c814e1b605aa190cd235a11137c43d5.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_5fe60f929de8aefbe8230566cce9affa0ecd73df.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_8a00c9e60979bc3cf4edbbc9ca71c9d3d38904bb.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_7328db37cd23765f49f7f1deb8d5d3a50d68ce5f.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_fe033ec40e84c0ffb2c739810323852bef6665c3.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_196c86ed1360e7d1960fcd6cd1f59286bccc399e.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_51f88093a1e6de1e6e653c7a5e7d7402a2361dc5.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_2b138aa33fe82de6b8c1c5a13ad92747baa4e25e.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_89e71beebff0ea3221ca3d75f71afd03d541c5cd.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_5da06bfff5d0a841bea5d40593eeb5f0dfe5784b.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_e6444f18b3fedb6c5d438be34fe0b45f9d3d1ac4.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_e77ab5133db6a27bc4631d572f28ab598472c9f9.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_23cd9d76612567ae9c93584334238b5ba745553d.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_89cfb0b014c43d520ea780ef080f164bad8fcbce.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_79dcf2ca232518e23dc4e8ec55123e5cf3cec1cc.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_e077b3cbbc0d40752695702cf1c4882bb9fdc6d3.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_d933fb3f7ae391a4d1e86528092370bb08c3513a.600x338.jpg?t=1731584398","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/304212/ss_a4734b2fbace59f67474576f47ca3d3348aad892.600x338.jpg?t=1731584398"]},
|
|
91
|
-
{"id": 8, "name": "Euro Truck Simulator 2 - Going East!", "desc": "《Going East!》扩展包扩展了《Euro Truck Simulator 2》中的地图,新增了波兰、捷克、斯洛伐克和匈牙利境内的货运目的地。特色:在游戏中驾驶逾 20 小时来探索全新的区域包括华沙、克拉科夫、斯特拉瓦、布达佩斯、科希策等城市在内的 13 个新增城市许多窄路、山道和正在维修的道路等您来挑战,检验您的驾驶技术", "header_image_url": "https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/header.jpg?t=1731584535", "background_url": "https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/page_bg_generated_v6b.jpg?t=1731584535", "background_url": "https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/page_bg_generated_v6b.jpg?t=1731584535", "init_price": 45.00, "discount": 0, "final_price": 45.00, "screenshot_url": ["https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_86d55a657e69ae570208dd3a8646d639cacf367c.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_2e7648274fd01fb5b6ee87563736b1c6518c58dc.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_2dbb55879d096ac1f3e8ada7121dc0708b220948.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_c63cdb6ab12e43b56eac72150cacda18e5c4db31.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_648a48a47c93ba4c065c71645bd284df98a290bd.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_442177ec882f9b2c127d5eff14677ce6aa4481cd.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_af11938793af406dcd21e554e905da70decb0df5.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_b563889f05a68eaea5c08850bb7eb36568656ca8.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_0cd7d2aec6e1c6c0d699fed8be1180ec7f9ca4b1.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_2dc4ad08c332166ff2e11da4aee968879fa18518.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_dff1a882889780ce977b7b4752a11502d219fb5f.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_03952524564d2ef31fbb5ed62c95fc4b5444523d.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_cac79e5ea183c1bdfa3a8178f5a508925dc23cac.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_72c9f78eaf10ac15f2ff18ad43680dac3f4c0631.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_018a1aaaed8bb6cdfe9b638b0ad7475c0c88b51c.600x338.jpg?t=1731584535","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/227310/ss_4942751b37f00093f2f0de3bd9aca6566881e5c0.600x338.jpg?t=1731584535"]},
|
|
92
|
-
{"id": 9, "name": "Euro Truck Simulator 2 - West Balkans", "desc": "探索,运输,拓展你们的货运公司至阿尔巴尼亚、波黑、克罗地亚、科索沃、黑山、北马其顿、塞尔维亚、斯洛文尼亚。", "header_image_url": "https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/header_schinese.jpg?t=1731584650", "background_url": "https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/page_bg_generated_v6b.jpg?t=1731584650", "background_url": "https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/page_bg_generated_v6b.jpg?t=1731584650", "init_price": 78.00, "discount": 0, "final_price": 78.00, "screenshot_url": ["https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_671b9a1ba60a843cd8faa3432f7ce57f2bee204a.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_9cfde4ed121d4f85e0108bf46f11e4a1ab3a0aea.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_ef2a6b28f3535265c021b0b01de2211db9e3c0dd.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_1b9a4ec443b874393db0c1cd5ed59ca9feaa3901.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_1ec41b7de5586f67ad0242591e6cfb5cf51fe11d.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_ab2b211e776283ba7c0269d5a5107f231a767752.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_b44b899838e1320c2c4da22a509480749ccd628c.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_2e28842cbe27515cc186d40eefc4ac004a92c2b6.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_33d443f0c71f50710aa5db4c9f24f37c7415f851.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_41c8a4b3d22bfb4d1dd95fa8a5ee1b5a0ca60df2.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_8ede5c4d177281ee66e57e8d88129f68dfb40dca.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_6689a9c3e5e94be1b28cda49eece9b2e60674f69.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_18442ccd9492b9d336150778d5a0c53c32e3a87f.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_41f0a8d6ce8188e6fd66caf36c8c8a22cd9111d0.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_f94993775b41a54939382417f17ae831fbec012a.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_a123e11afa0a9b75a1f1672c1e9b05673ccc3f0b.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_b0a30b4baf97651dceedc9e49d442cdaf2c5835e.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_4f2d04d31451b0e37d15ee96ea72fb43a5f53025.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_170f940215b2a8281f6c95172da04520111a6598.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_ddf38d27a2502639da46461329b44bc85cfff22e.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_e3b9e11305d749eb7d97e418c0b137f28bc5b244.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_6364176f38664fa58412158ad6efcdc01dd85b97.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_7074b7d8695873a32ea0d3639ca4a979c65c975f.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_6e391aaff1f4f91a2a5429b768ca411eeaaa1c28.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_0486d6f4fca26f634737b46690b53e3c472bf902.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_e13180c8b90bcf7be3b5fb76f3b6a6b2329daa55.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_5cce8918cfc80059ffa7d7a4ec5e07bb164570c4.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_1f0a1115b2aa4bb5cd233a991ea64677b68053d0.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_811fe0bf36988e8e03b4ab04d189158288fc76ed.600x338.jpg?t=1731584650","https://shared.akamai.steamstatic.com/store_item_assets/steam/apps/2004210/ss_924be5979571a8e74f27b265ddf142d3be0e9dff.600x338.jpg?t=1731584650"]}];
|
|
83
|
+
function setData(dlcList) {
|
|
84
|
+
// 遍历渲染DLC列表
|
|
85
|
+
for (let dlc of dlcList) {
|
|
86
|
+
let dom = document.createElement(`div`);
|
|
87
|
+
dom.className = 'dlc-box';
|
|
88
|
+
dom.style.backgroundImage = `url('${dlc.backgroundImageUrl}')`;
|
|
93
89
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
dom.style.backgroundImage = `url('${dlc.background_url}')`;
|
|
99
|
-
|
|
100
|
-
let priceDiscountDom = ''
|
|
101
|
-
if (dlc.discount > 0) {
|
|
102
|
-
priceDiscountDom = `
|
|
103
|
-
<span class="discount-price">¥${dlc.init_price}</span>
|
|
90
|
+
let priceDiscountDom = ''
|
|
91
|
+
if (dlc.discount > 0) {
|
|
92
|
+
priceDiscountDom = `
|
|
93
|
+
<span class="discount-price">¥${Math.ceil(dlc.originalPrice / 100)}</span>
|
|
104
94
|
<span class="discount">-${dlc.discount}%</span>
|
|
105
95
|
`;
|
|
106
|
-
|
|
96
|
+
}
|
|
107
97
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
98
|
+
dom.innerHTML = `
|
|
99
|
+
<img class="header-image" src="${dlc.headerImageUrl}"/>
|
|
100
|
+
<div class="dlc-info">
|
|
101
|
+
<div class="name">${dlc.name}</div>
|
|
102
|
+
<div class="desc">${dlc.desc}</div>
|
|
103
|
+
<div class="price-box">
|
|
104
|
+
<span>¥${Math.ceil(dlc.finalPrice / 100)}</span>
|
|
105
|
+
${priceDiscountDom}
|
|
106
|
+
</div>
|
|
116
107
|
</div>
|
|
117
|
-
|
|
118
|
-
`;
|
|
108
|
+
`;
|
|
119
109
|
|
|
120
|
-
|
|
110
|
+
document.querySelector('#dlc-info-container').appendChild(dom);
|
|
111
|
+
}
|
|
121
112
|
}
|
|
122
113
|
</script>
|
|
123
114
|
</body>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-tmp-bot",
|
|
3
3
|
"description": "欧洲卡车模拟2 TMP查询插件,不会部署的可以直接使用此机器人->QQ:3523283907",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.17.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"homepage": "https://github.com/79887143/koishi-plugin-tmp-bot",
|