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.
- package/lib/client.d.ts +17 -1
- package/lib/client.js +121 -21
- package/lib/commands/merchant.js +409 -61
- package/lib/commands/query.js +95 -27
- package/lib/index.d.ts +4 -0
- package/lib/index.js +600 -127
- package/lib/render-templates/home/img/rocomuid/a_title.png +0 -0
- package/lib/render-templates/home/img/rocomuid/banner_bg.png +0 -0
- package/lib/render-templates/home/img/rocomuid/bg.jpg +0 -0
- package/lib/render-templates/home/img/rocomuid/img_head.png +0 -0
- package/lib/render-templates/home/img/rocomuid/jindu_bar.png +0 -0
- package/lib/render-templates/home/img/rocomuid/jindu_tc.png +0 -0
- package/lib/render-templates/home/img/rocomuid/level_icon.png +0 -0
- package/lib/render-templates/home/img/rocomuid/pet_bg.png +0 -0
- package/lib/render-templates/home/img/rocomuid/plant_bg.png +0 -0
- package/lib/render-templates/home/img/rocomuid/star_1.png +0 -0
- package/lib/render-templates/home/img/rocomuid/star_8.png +0 -0
- package/lib/render-templates/home/img/rocomuid/star_9.png +0 -0
- package/lib/render-templates/home/img/rocomuid/title_fg.png +0 -0
- package/lib/render-templates/home/img/rocomuid/top_bg.png +0 -0
- package/lib/render-templates/home/img/rocomuid/touxiang_mask.png +0 -0
- package/lib/render-templates/home/index.html +81 -97
- package/lib/render-templates/home/style.css +316 -375
- package/lib/render-templates/yuanxing-shangren/CHANGELOG.md +138 -0
- package/lib/render-templates/yuanxing-shangren/README.md +86 -0
- package/lib/render-templates/yuanxing-shangren/img/coin.png +0 -0
- 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
- package/lib/render-templates/yuanxing-shangren/img//346/240/207/351/242/230.png +0 -0
- package/lib/render-templates/yuanxing-shangren/img//347/203/255/351/224/200.png +0 -0
- 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
- package/lib/render-templates/yuanxing-shangren/index.html +233 -148
- package/lib/render-templates/yuanxing-shangren/index.html.backup +356 -0
- package/lib/render-templates/yuanxing-shangren/merchant.html +461 -0
- package/lib/render-templates/yuanxing-shangren/style.css +201 -256
- package/lib/render-templates/yuanxing-shangren/today.html +461 -0
- package/lib/render-templates/yuanxing-shangren/today.style.css +366 -0
- package/lib/render.js +11 -4
- package/lib/subscription-send.js +4 -5
- package/lib/ttf/rocom_skill_origin.ttf +0 -0
- 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
- package/lib/types.d.ts +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# 远行商人UI更新日志
|
|
2
|
+
|
|
3
|
+
## 更新时间
|
|
4
|
+
2026-06-19
|
|
5
|
+
|
|
6
|
+
## 更新内容
|
|
7
|
+
|
|
8
|
+
### 1. 模板文件更新
|
|
9
|
+
|
|
10
|
+
#### ✅ 主模板 (index.html)
|
|
11
|
+
- **来源**: 从 `src/doc/plugins/WeGame-plugin/modules/rocom/resources/render/yuanxing-shangren/today.html` 搬运
|
|
12
|
+
- **特性**:
|
|
13
|
+
- 标题改为"今日远行商人"
|
|
14
|
+
- 按轮次分组显示商品(支持4轮展示)
|
|
15
|
+
- 每个轮次显示独立的商品列表
|
|
16
|
+
- 当前轮次高亮显示(is-current样式)
|
|
17
|
+
- 空轮次显示"该轮次暂无商品"提示
|
|
18
|
+
|
|
19
|
+
#### 📦 备份文件
|
|
20
|
+
- **index.html.backup**: 保存了现代化WeGame风格的设计版本
|
|
21
|
+
- 采用Inter + Fraunces字体
|
|
22
|
+
- 温暖的奶油色调 (#F7F4EF)
|
|
23
|
+
- 陶土色强调 (#C4612F)
|
|
24
|
+
- 卡片式网格布局
|
|
25
|
+
|
|
26
|
+
#### 📄 样式文件
|
|
27
|
+
- **style.css**: 保留的原始旧版样式(传统中式风格)
|
|
28
|
+
- **today.style.css**: 从today.html提取的样式文件(供参考)
|
|
29
|
+
|
|
30
|
+
#### 📖 文档文件
|
|
31
|
+
- **README.md**: 详细说明各版本差异和切换方法
|
|
32
|
+
|
|
33
|
+
### 2. 数据结构调整 (merchant.ts)
|
|
34
|
+
|
|
35
|
+
#### 新增字段
|
|
36
|
+
```typescript
|
|
37
|
+
{
|
|
38
|
+
total_products: number, // 今日商品总数
|
|
39
|
+
categories: [
|
|
40
|
+
{
|
|
41
|
+
product_count: number, // 该分类商品数
|
|
42
|
+
roundGroups: [ // 轮次分组
|
|
43
|
+
{
|
|
44
|
+
round_id: number, // 轮次ID (1-4)
|
|
45
|
+
label: string, // 时间标签 "08:00-12:00"
|
|
46
|
+
is_current: boolean,// 是否当前轮次
|
|
47
|
+
products: [] // 该轮次的商品列表
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### 轮次分组逻辑
|
|
56
|
+
- 第1轮: 08:00-12:00
|
|
57
|
+
- 第2轮: 12:00-16:00
|
|
58
|
+
- 第3轮: 16:00-20:00
|
|
59
|
+
- 第4轮: 20:00-次日08:00
|
|
60
|
+
|
|
61
|
+
#### 当前实现特点
|
|
62
|
+
- 常规商品(round)按轮次分组显示
|
|
63
|
+
- 热销商品(normal)和周末限定(weekend)不分轮次
|
|
64
|
+
- 只在当前轮次显示商品(可根据实际需求调整)
|
|
65
|
+
|
|
66
|
+
### 3. 视觉设计特点
|
|
67
|
+
|
|
68
|
+
#### 配色方案
|
|
69
|
+
- 背景: #ece3d3 (温暖土色)
|
|
70
|
+
- 卡片: 白色渐变 + 暖黄渐变
|
|
71
|
+
- 边框: 暖色系半透明
|
|
72
|
+
- 强调色:
|
|
73
|
+
- 热销: 绿色 (#2a8040)
|
|
74
|
+
- 常规: 蓝色 (#2a60b0)
|
|
75
|
+
- 周末: 红色 (#c04030)
|
|
76
|
+
|
|
77
|
+
#### 布局特点
|
|
78
|
+
- 最大宽度: 1040px
|
|
79
|
+
- 圆角设计: 16px-30px
|
|
80
|
+
- 卡片阴影: 柔和的暖色调阴影
|
|
81
|
+
- 响应式: 移动端自适应
|
|
82
|
+
|
|
83
|
+
#### 字体
|
|
84
|
+
- 主字体: fzlant (方正兰亭)
|
|
85
|
+
- 强调字体: dundun (敦敦体)
|
|
86
|
+
- 后备字体: Microsoft YaHei, PingFang SC
|
|
87
|
+
|
|
88
|
+
### 4. 文件结构
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
src/render-templates/yuanxing-shangren/
|
|
92
|
+
├── index.html # 当前使用(今日版)
|
|
93
|
+
├── index.html.backup # 现代化版本备份
|
|
94
|
+
├── style.css # 旧版样式(保留)
|
|
95
|
+
├── today.style.css # 今日版样式(独立文件)
|
|
96
|
+
└── README.md # 版本说明文档
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## 兼容性说明
|
|
100
|
+
|
|
101
|
+
### ✅ 已验证
|
|
102
|
+
- 数据结构已适配新模板
|
|
103
|
+
- merchant.ts 已更新以支持 roundGroups
|
|
104
|
+
- 保留了原有的 fallback 文本功能
|
|
105
|
+
|
|
106
|
+
### ⚠️ 待测试
|
|
107
|
+
- 实际渲染效果
|
|
108
|
+
- 各种商品数量组合的显示
|
|
109
|
+
- 空轮次的处理
|
|
110
|
+
- 订阅推送功能的兼容性
|
|
111
|
+
|
|
112
|
+
## 回滚方法
|
|
113
|
+
|
|
114
|
+
### 恢复到现代化版本
|
|
115
|
+
```bash
|
|
116
|
+
cd src/render-templates/yuanxing-shangren
|
|
117
|
+
cp index.html.backup index.html
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 恢复到仓库原始版本
|
|
121
|
+
```bash
|
|
122
|
+
git checkout HEAD -- src/render-templates/yuanxing-shangren/index.html
|
|
123
|
+
git checkout HEAD -- src/commands/merchant.ts
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 后续优化建议
|
|
127
|
+
|
|
128
|
+
1. **轮次分组优化**: 根据实际API数据调整商品分配逻辑
|
|
129
|
+
2. **性能优化**: 考虑缓存渲染结果
|
|
130
|
+
3. **样式提取**: 将index.html中的内嵌样式提取到外部CSS
|
|
131
|
+
4. **数据验证**: 添加数据结构验证,确保类型安全
|
|
132
|
+
5. **错误处理**: 完善空数据和异常情况的处理
|
|
133
|
+
|
|
134
|
+
## 技术债务
|
|
135
|
+
|
|
136
|
+
- [ ] style.css 与 today.style.css 内容重复,需要整合
|
|
137
|
+
- [ ] 轮次分组逻辑较为简化,可能需要根据实际时间窗口动态分配商品
|
|
138
|
+
- [ ] 现代化版本(backup)的样式依赖外部字体CDN,考虑本地化
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# 远行商人模板说明
|
|
2
|
+
|
|
3
|
+
## 文件列表
|
|
4
|
+
|
|
5
|
+
### 当前使用版本
|
|
6
|
+
- **index.html** - "今日远行商人"版本(从 WeGame-plugin modules 搬运)
|
|
7
|
+
- 特点:按轮次分组展示,显示"今日商品数"
|
|
8
|
+
- 数据结构:需要 `total_products`、`categories` 中包含 `roundGroups`
|
|
9
|
+
- 样式:内嵌在HTML中
|
|
10
|
+
|
|
11
|
+
### 备份版本
|
|
12
|
+
- **index.html.backup** - 之前创建的现代化设计版本
|
|
13
|
+
- 特点:使用 WeGame-plugin 风格的现代化设计
|
|
14
|
+
- 采用 Inter + Fraunces 字体,温暖的奶油色调
|
|
15
|
+
- 编辑风格排版,卡片式布局
|
|
16
|
+
|
|
17
|
+
### 样式文件
|
|
18
|
+
- **style.css** - 原始旧版本的样式(传统中式风格)
|
|
19
|
+
- **today.style.css** - 从 today.html 提取的样式(供参考)
|
|
20
|
+
|
|
21
|
+
## 版本对比
|
|
22
|
+
|
|
23
|
+
| 版本 | 文件 | 风格 | 数据结构 |
|
|
24
|
+
|------|------|------|----------|
|
|
25
|
+
| 今日商人 | index.html | 传统土色调,按轮次分组 | 需要 `total_products`, `roundGroups` |
|
|
26
|
+
| 现代版 | index.html.backup | 现代化 WeGame 风格 | 原有的 `categories` 结构 |
|
|
27
|
+
| 旧版 | 仓库历史版本 | 传统中式风格 | 原有的 `categories` 结构 |
|
|
28
|
+
|
|
29
|
+
## 切换版本
|
|
30
|
+
|
|
31
|
+
如需切换回现代化版本:
|
|
32
|
+
```bash
|
|
33
|
+
cd src/render-templates/yuanxing-shangren
|
|
34
|
+
cp index.html.backup index.html
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
如需恢复到仓库原始版本:
|
|
38
|
+
```bash
|
|
39
|
+
git checkout HEAD -- index.html
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 数据结构差异
|
|
43
|
+
|
|
44
|
+
### 今日商人版本需要的数据
|
|
45
|
+
```javascript
|
|
46
|
+
{
|
|
47
|
+
title: "今日远行商人",
|
|
48
|
+
subtitle: "...",
|
|
49
|
+
total_products: 10,
|
|
50
|
+
categories: [
|
|
51
|
+
{
|
|
52
|
+
key: "round",
|
|
53
|
+
label: "常规商品",
|
|
54
|
+
product_count: 8,
|
|
55
|
+
roundGroups: [
|
|
56
|
+
{
|
|
57
|
+
round_id: 1,
|
|
58
|
+
label: "08:00-12:00",
|
|
59
|
+
is_current: true,
|
|
60
|
+
products: [...]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 原版本数据结构
|
|
69
|
+
```javascript
|
|
70
|
+
{
|
|
71
|
+
title: "远行商人",
|
|
72
|
+
product_count: 10,
|
|
73
|
+
round_info: { current: 1, total: 4, countdown: "3小时20分钟" },
|
|
74
|
+
categories: [
|
|
75
|
+
{
|
|
76
|
+
key: "normal",
|
|
77
|
+
label: "热销商品",
|
|
78
|
+
products: [...]
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## 注意事项
|
|
85
|
+
|
|
86
|
+
使用 today.html 版本需要修改 merchant.ts 中的数据渲染逻辑,以匹配新的数据结构。
|
|
Binary file
|
|
Binary file
|