koishi-plugin-rocom 1.0.11 → 1.0.13

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.
Files changed (42) hide show
  1. package/lib/client.d.ts +17 -1
  2. package/lib/client.js +121 -21
  3. package/lib/commands/merchant.js +409 -61
  4. package/lib/commands/query.js +95 -27
  5. package/lib/index.d.ts +4 -0
  6. package/lib/index.js +600 -127
  7. package/lib/render-templates/home/img/rocomuid/a_title.png +0 -0
  8. package/lib/render-templates/home/img/rocomuid/banner_bg.png +0 -0
  9. package/lib/render-templates/home/img/rocomuid/bg.jpg +0 -0
  10. package/lib/render-templates/home/img/rocomuid/img_head.png +0 -0
  11. package/lib/render-templates/home/img/rocomuid/jindu_bar.png +0 -0
  12. package/lib/render-templates/home/img/rocomuid/jindu_tc.png +0 -0
  13. package/lib/render-templates/home/img/rocomuid/level_icon.png +0 -0
  14. package/lib/render-templates/home/img/rocomuid/pet_bg.png +0 -0
  15. package/lib/render-templates/home/img/rocomuid/plant_bg.png +0 -0
  16. package/lib/render-templates/home/img/rocomuid/star_1.png +0 -0
  17. package/lib/render-templates/home/img/rocomuid/star_8.png +0 -0
  18. package/lib/render-templates/home/img/rocomuid/star_9.png +0 -0
  19. package/lib/render-templates/home/img/rocomuid/title_fg.png +0 -0
  20. package/lib/render-templates/home/img/rocomuid/top_bg.png +0 -0
  21. package/lib/render-templates/home/img/rocomuid/touxiang_mask.png +0 -0
  22. package/lib/render-templates/home/index.html +81 -97
  23. package/lib/render-templates/home/style.css +316 -375
  24. package/lib/render-templates/yuanxing-shangren/CHANGELOG.md +138 -0
  25. package/lib/render-templates/yuanxing-shangren/README.md +86 -0
  26. package/lib/render-templates/yuanxing-shangren/img/coin.png +0 -0
  27. package/lib/render-templates/yuanxing-shangren/img//345/272/225/351/203/250/344/277/241/346/201/257/346/241/206.png +0 -0
  28. package/lib/render-templates/yuanxing-shangren/img//346/240/207/351/242/230.png +0 -0
  29. package/lib/render-templates/yuanxing-shangren/img//347/203/255/351/224/200.png +0 -0
  30. package/lib/render-templates/yuanxing-shangren/img//347/274/226/345/217/267/350/203/214/346/231/257/346/241/206.png +0 -0
  31. package/lib/render-templates/yuanxing-shangren/index.html +233 -148
  32. package/lib/render-templates/yuanxing-shangren/index.html.backup +356 -0
  33. package/lib/render-templates/yuanxing-shangren/merchant.html +461 -0
  34. package/lib/render-templates/yuanxing-shangren/style.css +201 -256
  35. package/lib/render-templates/yuanxing-shangren/today.html +461 -0
  36. package/lib/render-templates/yuanxing-shangren/today.style.css +366 -0
  37. package/lib/render.js +11 -4
  38. package/lib/subscription-send.js +4 -5
  39. package/lib/ttf/rocom_skill_origin.ttf +0 -0
  40. package/lib/ttf//351/200/240/345/255/227/345/267/245/346/210/277/345/220/257/351/273/221/344/275/223.ttf +0 -0
  41. package/lib/types.d.ts +4 -0
  42. package/package.json +1 -1
@@ -0,0 +1,356 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>远行商人</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fraunces:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet">
10
+ <style>
11
+ @font-face {
12
+ font-family: "fzlant";
13
+ src: url("{{_res_path}}ttf/fzlant.D5FI9Et0.ttf");
14
+ }
15
+
16
+ @font-face {
17
+ font-family: "dundun";
18
+ src: url("{{_res_path}}ttf/dundun.xHd_Ee5-.woff2");
19
+ }
20
+
21
+ * {
22
+ margin: 0;
23
+ padding: 0;
24
+ box-sizing: border-box;
25
+ }
26
+
27
+ :root {
28
+ /* Warm earthy palette */
29
+ --bg-cream: #F7F4EF;
30
+ --surface-warm: #FBF9F5;
31
+ --surface-white: #FFFFFF;
32
+ --border-hairline: #E7E1D7;
33
+ --ink: #1F2421;
34
+ --text-muted: #5C635D;
35
+ --terracotta: #C4612F;
36
+ --terracotta-hover: #A94E22;
37
+ --terracotta-tint: #F2E3D6;
38
+ --charcoal: #1F2421;
39
+
40
+ /* Typography */
41
+ --font-sans: 'Inter', 'fzlant', 'Microsoft YaHei', 'PingFang SC', sans-serif;
42
+ --font-serif: 'Fraunces', 'dundun', 'fzlant', Georgia, serif;
43
+ }
44
+
45
+ html,
46
+ body {
47
+ width: 100%;
48
+ height: auto;
49
+ font-family: var(--font-sans);
50
+ color: var(--ink);
51
+ background: var(--bg-cream);
52
+ -webkit-font-smoothing: antialiased;
53
+ -moz-osx-font-smoothing: grayscale;
54
+ }
55
+
56
+ .merchant-page {
57
+ position: relative;
58
+ width: min(1200px, 100%);
59
+ margin: 0 auto;
60
+ background: var(--bg-cream);
61
+ padding: 32px;
62
+ }
63
+
64
+ .hero {
65
+ position: relative;
66
+ padding: 48px 40px;
67
+ border-radius: 24px;
68
+ background: var(--surface-white);
69
+ border: 1px solid var(--border-hairline);
70
+ box-shadow: 0 2px 8px rgba(31, 36, 33, 0.04);
71
+ margin-bottom: 24px;
72
+ }
73
+
74
+ .hero-eyebrow {
75
+ display: inline-block;
76
+ padding: 6px 16px;
77
+ border-radius: 999px;
78
+ background: var(--terracotta-tint);
79
+ color: var(--terracotta);
80
+ font-size: 13px;
81
+ font-weight: 600;
82
+ letter-spacing: 0.02em;
83
+ margin-bottom: 16px;
84
+ }
85
+
86
+ .hero-title {
87
+ font-family: var(--font-serif);
88
+ font-size: 56px;
89
+ font-weight: 400;
90
+ line-height: 1.1;
91
+ letter-spacing: -0.02em;
92
+ margin-bottom: 12px;
93
+ color: var(--ink);
94
+ }
95
+
96
+ .hero-title em {
97
+ font-style: italic;
98
+ color: var(--terracotta);
99
+ }
100
+
101
+ .hero-subtitle {
102
+ font-size: 18px;
103
+ font-weight: 300;
104
+ line-height: 1.6;
105
+ color: var(--text-muted);
106
+ max-width: 600px;
107
+ }
108
+
109
+ .hero-meta {
110
+ display: flex;
111
+ align-items: center;
112
+ gap: 16px;
113
+ margin-top: 24px;
114
+ padding-top: 24px;
115
+ border-top: 1px solid var(--border-hairline);
116
+ }
117
+
118
+ .meta-chip {
119
+ display: inline-flex;
120
+ align-items: center;
121
+ gap: 8px;
122
+ padding: 10px 18px;
123
+ border-radius: 999px;
124
+ background: var(--surface-warm);
125
+ border: 1px solid var(--border-hairline);
126
+ font-size: 15px;
127
+ font-weight: 500;
128
+ }
129
+
130
+ .meta-chip-label {
131
+ color: var(--text-muted);
132
+ font-weight: 400;
133
+ }
134
+
135
+ .meta-chip-value {
136
+ color: var(--ink);
137
+ font-weight: 600;
138
+ }
139
+
140
+ .meta-chip.accent .meta-chip-value {
141
+ color: var(--terracotta);
142
+ }
143
+
144
+ .products-section {
145
+ display: flex;
146
+ flex-direction: column;
147
+ gap: 32px;
148
+ }
149
+
150
+ .category-group {
151
+ display: flex;
152
+ flex-direction: column;
153
+ gap: 16px;
154
+ }
155
+
156
+ .category-header {
157
+ display: flex;
158
+ align-items: center;
159
+ gap: 12px;
160
+ }
161
+
162
+ .category-title {
163
+ font-family: var(--font-serif);
164
+ font-size: 28px;
165
+ font-weight: 600;
166
+ letter-spacing: -0.01em;
167
+ color: var(--ink);
168
+ }
169
+
170
+ .category-badge {
171
+ padding: 4px 12px;
172
+ border-radius: 999px;
173
+ font-size: 13px;
174
+ font-weight: 600;
175
+ }
176
+
177
+ .category-badge.normal {
178
+ background: rgba(46, 125, 50, 0.12);
179
+ color: #2E7D32;
180
+ }
181
+
182
+ .category-badge.round {
183
+ background: rgba(25, 118, 210, 0.12);
184
+ color: #1976D2;
185
+ }
186
+
187
+ .category-badge.weekend {
188
+ background: rgba(211, 47, 47, 0.12);
189
+ color: #D32F2F;
190
+ }
191
+
192
+ .products-grid {
193
+ display: grid;
194
+ grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
195
+ gap: 16px;
196
+ }
197
+
198
+ .product-card {
199
+ position: relative;
200
+ display: flex;
201
+ flex-direction: column;
202
+ padding: 24px;
203
+ border-radius: 16px;
204
+ background: var(--surface-white);
205
+ border: 1px solid var(--border-hairline);
206
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
207
+ }
208
+
209
+ .product-card:hover {
210
+ transform: translateY(-2px);
211
+ box-shadow: 0 4px 16px rgba(31, 36, 33, 0.08);
212
+ }
213
+
214
+ .product-image-wrap {
215
+ width: 100%;
216
+ aspect-ratio: 1;
217
+ border-radius: 12px;
218
+ background: var(--surface-warm);
219
+ display: flex;
220
+ align-items: center;
221
+ justify-content: center;
222
+ margin-bottom: 16px;
223
+ overflow: hidden;
224
+ }
225
+
226
+ .product-image {
227
+ width: 80%;
228
+ height: 80%;
229
+ object-fit: contain;
230
+ }
231
+
232
+ .product-name {
233
+ font-family: var(--font-serif);
234
+ font-size: 22px;
235
+ font-weight: 600;
236
+ line-height: 1.3;
237
+ color: var(--ink);
238
+ margin-bottom: 8px;
239
+ }
240
+
241
+ .product-time {
242
+ display: inline-flex;
243
+ align-items: center;
244
+ gap: 6px;
245
+ padding: 6px 12px;
246
+ border-radius: 999px;
247
+ background: var(--terracotta-tint);
248
+ color: var(--terracotta);
249
+ font-size: 13px;
250
+ font-weight: 500;
251
+ margin-top: 8px;
252
+ }
253
+
254
+ .product-time::before {
255
+ content: '⏱';
256
+ font-size: 14px;
257
+ }
258
+
259
+ .empty-state {
260
+ text-align: center;
261
+ padding: 64px 32px;
262
+ border-radius: 16px;
263
+ border: 1px dashed var(--border-hairline);
264
+ background: var(--surface-warm);
265
+ }
266
+
267
+ .empty-state-icon {
268
+ font-size: 48px;
269
+ margin-bottom: 16px;
270
+ opacity: 0.4;
271
+ }
272
+
273
+ .empty-state-text {
274
+ font-size: 18px;
275
+ font-weight: 400;
276
+ color: var(--text-muted);
277
+ }
278
+
279
+ @media (max-width: 768px) {
280
+ .merchant-page {
281
+ padding: 16px;
282
+ }
283
+
284
+ .hero {
285
+ padding: 32px 24px;
286
+ }
287
+
288
+ .hero-title {
289
+ font-size: 36px;
290
+ }
291
+
292
+ .hero-meta {
293
+ flex-wrap: wrap;
294
+ }
295
+
296
+ .products-grid {
297
+ grid-template-columns: 1fr;
298
+ }
299
+ }
300
+ </style>
301
+ </head>
302
+ <body>
303
+ <div class="merchant-page">
304
+ <header class="hero">
305
+ <span class="hero-eyebrow">每日刷新</span>
306
+ <h1 class="hero-title">远行<em>商人</em></h1>
307
+ <p class="hero-subtitle">{{subtitle}}</p>
308
+ <div class="hero-meta">
309
+ <div class="meta-chip accent">
310
+ <span class="meta-chip-label">当前商品</span>
311
+ <span class="meta-chip-value">{{product_count}} 件</span>
312
+ </div>
313
+ <div class="meta-chip">
314
+ <span class="meta-chip-label">轮次</span>
315
+ <span class="meta-chip-value">{{round_info.current || '未开放'}} / {{round_info.total}}</span>
316
+ </div>
317
+ <div class="meta-chip">
318
+ <span class="meta-chip-label">剩余</span>
319
+ <span class="meta-chip-value">{{round_info.countdown}}</span>
320
+ </div>
321
+ </div>
322
+ </header>
323
+
324
+ <main class="products-section">
325
+ {{if categories && categories.length > 0}}
326
+ {{each categories cat}}
327
+ <section class="category-group">
328
+ <div class="category-header">
329
+ <h2 class="category-title">{{cat.label}}</h2>
330
+ <span class="category-badge {{cat.key}}">{{cat.products.length}} 件</span>
331
+ </div>
332
+ <div class="products-grid">
333
+ {{each cat.products product}}
334
+ <article class="product-card">
335
+ <div class="product-image-wrap">
336
+ <img class="product-image" src="{{product.image}}" alt="{{product.name}}" loading="lazy">
337
+ </div>
338
+ <h3 class="product-name">{{product.name}}</h3>
339
+ {{if product.time_label}}
340
+ <div class="product-time">{{product.time_label}}</div>
341
+ {{/if}}
342
+ </article>
343
+ {{/each}}
344
+ </div>
345
+ </section>
346
+ {{/each}}
347
+ {{else}}
348
+ <div class="empty-state">
349
+ <div class="empty-state-icon">📦</div>
350
+ <p class="empty-state-text">本轮暂无商品,稍后再来看看</p>
351
+ </div>
352
+ {{/if}}
353
+ </main>
354
+ </div>
355
+ </body>
356
+ </html>