koishi-plugin-ets2-tools-tmp 3.1.1 → 3.1.3

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.
@@ -67,7 +67,7 @@ module.exports = async (ctx, session, serverType, tmpId, date) => {
67
67
  endTime = dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss');
68
68
  }
69
69
 
70
- if (date === 'tenday') {
70
+ if (date === 'sevenday') {
71
71
  startTime = dayjs().subtract(7, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss');
72
72
  endTime = dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss');
73
73
  }
@@ -67,6 +67,7 @@ module.exports = async (ctx, cfg, session, tmpId) => {
67
67
  let playerMapInfo = await truckyAppApi.online(ctx.http, tmpId);
68
68
  // 拼接数据
69
69
  let data = {};
70
+ data.showAvatar = cfg.tmpQuery?.showAvatar !== false;
70
71
  data.tmpId = playerInfo.data.tmpId;
71
72
  data.name = playerInfo.data.name;
72
73
  data.steamId = playerInfo.data.steamId;
package/lib/index.js CHANGED
@@ -310,7 +310,7 @@ function registerBaseCommands(ctx, cfg) {
310
310
  }
311
311
 
312
312
  if (cfg.commands?.tmpFootprint) {
313
- ctx.command('近十日足迹 [tmpId:string]')
313
+ ctx.command('近七日足迹 [tmpId:string]')
314
314
  .usage("查询ETS服务器今日足迹")
315
315
  .example("近七日足迹")
316
316
  .example("近七日足迹 12345")
@@ -4,95 +4,207 @@
4
4
  <meta charset="UTF-8">
5
5
  <title>DLC</title>
6
6
  <style>
7
+ * { margin: 0; padding: 0; box-sizing: border-box; }
8
+
9
+ body {
10
+ font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
11
+ background: #0a0a12;
12
+ -webkit-font-smoothing: antialiased;
13
+ }
14
+
7
15
  #dlc-info-container {
8
16
  width: 600px;
9
- background-color: #222d33;
10
- padding: 14px;
17
+ background: linear-gradient(180deg, #0d0d18 0%, #0a0a12 100%);
18
+ padding: 0;
19
+ overflow: hidden;
20
+ position: relative;
21
+ }
22
+
23
+ /* Header */
24
+ .page-header {
25
+ padding: 20px 20px 14px;
26
+ display: flex;
27
+ align-items: center;
28
+ gap: 10px;
29
+ background: linear-gradient(180deg, rgba(251, 191, 36, 0.06) 0%, transparent 100%);
30
+ border-bottom: 1px solid rgba(251, 191, 36, 0.08);
31
+ }
32
+
33
+ .page-header-icon {
34
+ font-size: 22px;
35
+ filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.4));
11
36
  }
12
37
 
38
+ .page-header-title {
39
+ font-size: 18px;
40
+ font-weight: 900;
41
+ color: #f5f5f5;
42
+ letter-spacing: 1px;
43
+ }
44
+
45
+ .page-header-title span {
46
+ color: #fbbf24;
47
+ text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
48
+ }
49
+
50
+ .page-header-count {
51
+ margin-left: auto;
52
+ font-size: 12px;
53
+ color: #666;
54
+ letter-spacing: 1px;
55
+ }
56
+
57
+ /* DLC list */
58
+ .dlc-list {
59
+ padding: 12px 14px;
60
+ display: flex;
61
+ flex-direction: column;
62
+ gap: 10px;
63
+ }
64
+
65
+ /* DLC Card */
13
66
  .dlc-box {
14
67
  display: flex;
15
68
  flex-direction: row;
16
- box-sizing: border-box;
17
- padding: 12px;
18
- margin-top: 12px;
69
+ border-radius: 12px;
70
+ overflow: hidden;
71
+ position: relative;
19
72
  background-size: cover;
20
73
  background-repeat: no-repeat;
21
74
  background-position: center;
75
+ border: 1px solid rgba(255, 255, 255, 0.06);
76
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
22
77
  }
23
- .dlc-box:nth-of-type(1) {
24
- margin-top: 0;
78
+
79
+ .dlc-box::after {
80
+ content: '';
81
+ position: absolute;
82
+ inset: 0;
83
+ background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.7) 100%);
84
+ pointer-events: none;
85
+ z-index: 1;
25
86
  }
26
87
 
27
88
  .dlc-box .header-image {
28
- width: 210px;
29
- display: inline-block;
89
+ width: 200px;
90
+ object-fit: cover;
91
+ flex-shrink: 0;
92
+ position: relative;
93
+ z-index: 2;
94
+ border-right: 1px solid rgba(255, 255, 255, 0.05);
30
95
  }
31
96
 
32
97
  .dlc-box .dlc-info {
33
98
  flex: 1;
34
99
  width: 0;
35
- //border: 1px solid red;
36
- box-sizing: border-box;
37
- padding: 2px 12px;
100
+ padding: 12px 14px;
101
+ display: flex;
102
+ flex-direction: column;
103
+ justify-content: center;
104
+ position: relative;
105
+ z-index: 2;
38
106
  }
107
+
39
108
  .dlc-info .name {
40
- color: #ffffff;
41
- font-size: 18px;
42
- font-weight: 600;
109
+ color: #f0f0f0;
110
+ font-size: 15px;
111
+ font-weight: 800;
43
112
  overflow: hidden;
44
113
  text-overflow: ellipsis;
45
114
  white-space: nowrap;
115
+ letter-spacing: 0.3px;
116
+ text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
46
117
  }
118
+
47
119
  .dlc-info .desc {
48
- color: #e5e5e5;
49
- font-size: 14px;
120
+ color: #999;
121
+ font-size: 12px;
122
+ line-height: 1.5;
50
123
  overflow: hidden;
51
124
  text-overflow: ellipsis;
52
125
  display: -webkit-box;
53
126
  -webkit-line-clamp: 2;
54
127
  -webkit-box-orient: vertical;
128
+ margin-top: 4px;
55
129
  }
130
+
56
131
  .dlc-info .price-box {
57
132
  margin-top: 8px;
133
+ display: flex;
134
+ align-items: center;
135
+ gap: 6px;
58
136
  }
59
137
 
60
- .dlc-info .price-box span {
61
- display: inline-block;
62
- color: #BEEE11;
138
+ .dlc-info .price-box .final-price {
139
+ color: #fbbf24;
63
140
  font-size: 16px;
141
+ font-weight: 900;
142
+ text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
64
143
  }
144
+
65
145
  .dlc-info .price-box .discount-price {
66
- color: #cbcbcb;
146
+ color: #555;
147
+ font-size: 12px;
67
148
  text-decoration: line-through;
68
149
  }
150
+
69
151
  .dlc-info .price-box .discount {
70
- font-size: 14px;
71
- color: #BEEE11;
72
- background-color: #4c6b22;
73
- padding: 2px 6px;
74
- margin-left: 4px;
152
+ font-size: 11px;
153
+ font-weight: 800;
154
+ color: #fbbf24;
155
+ background: rgba(251, 191, 36, 0.12);
156
+ border: 1px solid rgba(251, 191, 36, 0.25);
157
+ padding: 1px 6px;
158
+ border-radius: 4px;
159
+ letter-spacing: 0.5px;
160
+ }
161
+
162
+ .dlc-info .price-box .free-badge {
163
+ font-size: 11px;
164
+ font-weight: 800;
165
+ color: #4ade80;
166
+ background: rgba(74, 222, 128, 0.12);
167
+ border: 1px solid rgba(74, 222, 128, 0.25);
168
+ padding: 1px 8px;
169
+ border-radius: 4px;
170
+ letter-spacing: 0.5px;
75
171
  }
76
172
  </style>
77
173
  </head>
78
174
  <body>
79
175
  <div id="dlc-info-container">
176
+ <div class="page-header">
177
+ <span class="page-header-icon">🎮</span>
178
+ <div class="page-header-title">DLC <span>商店</span></div>
179
+ <div class="page-header-count" id="dlc-count"></div>
180
+ </div>
181
+ <div class="dlc-list" id="dlc-list"></div>
80
182
  </div>
81
183
 
82
184
  <script>
83
185
  function setData(dlcList) {
84
- // 遍历渲染DLC列表
186
+ document.getElementById('dlc-count').textContent = `${dlcList.length} 个DLC`;
187
+
188
+ const listEl = document.getElementById('dlc-list');
189
+
85
190
  for (let dlc of dlcList) {
86
- let dom = document.createElement(`div`);
191
+ let dom = document.createElement('div');
87
192
  dom.className = 'dlc-box';
88
193
  dom.style.backgroundImage = `url('${dlc.backgroundImageUrl}')`;
89
194
 
90
- let priceDiscountDom = ''
91
- if (dlc.discount > 0) {
92
- priceDiscountDom = `
93
- <span class="discount-price">¥${Math.ceil(dlc.originalPrice / 100)}</span>
94
- <span class="discount">-${dlc.discount}%</span>
95
- `;
195
+ const isFree = dlc.finalPrice === 0;
196
+ const hasDiscount = dlc.discount > 0 && !isFree;
197
+
198
+ let priceHtml = '';
199
+ if (isFree) {
200
+ priceHtml = '<span class="free-badge">免费</span>';
201
+ } else {
202
+ priceHtml = `<span class="final-price">¥${Math.ceil(dlc.finalPrice / 100)}</span>`;
203
+ if (hasDiscount) {
204
+ priceHtml += `
205
+ <span class="discount-price">¥${Math.ceil(dlc.originalPrice / 100)}</span>
206
+ <span class="discount">-${dlc.discount}%</span>`;
207
+ }
96
208
  }
97
209
 
98
210
  dom.innerHTML = `
@@ -100,14 +212,10 @@
100
212
  <div class="dlc-info">
101
213
  <div class="name">${dlc.name}</div>
102
214
  <div class="desc">${dlc.desc}</div>
103
- <div class="price-box">
104
- <span>¥${Math.ceil(dlc.finalPrice / 100)}</span>
105
- ${priceDiscountDom}
106
- </div>
107
- </div>
108
- `;
109
-
110
- document.querySelector('#dlc-info-container').appendChild(dom);
215
+ <div class="price-box">${priceHtml}</div>
216
+ </div>`;
217
+
218
+ listEl.appendChild(dom);
111
219
  }
112
220
  }
113
221
  </script>