Skip to content

Commit 90c53d7

Browse files
feat: ✨ 移除 keyboard 虚拟键盘车牌号模式下不可用的 I、O 键 (#1037)
✅ Closes: #1005
1 parent 73fae20 commit 90c53d7

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

‎src/uni_modules/wot-design-uni/components/wd-keyboard/constants.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const CAR_KEYBOARD_AREAS = [
4141
]
4242

4343
/**
44-
* 车牌号键盘-数字和字母
44+
* 车牌号键盘-数字和字母(不包含I和O,因为车牌号规则中不使用这两个字母)
4545
*/
4646
export const CAR_KEYBOARD_KEYS = [
4747
1,
@@ -61,8 +61,6 @@ export const CAR_KEYBOARD_KEYS = [
6161
'T',
6262
'Y',
6363
'U',
64-
'I',
65-
'O',
6664
'P',
6765
'A',
6866
'S',

‎tests/components/wd-keyboard.test.ts‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,20 @@ describe('WdKeyboard', () => {
255255

256256
// 检查车牌模式下的键盘布局
257257
const keys = wrapper.findAllComponents(WdKey)
258-
// 车牌模式键盘组成:
259-
// - 第一区域(省份简称):京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼,共30个键
260-
// - 第二区域(字母和数字):1-0共10个数字/字母键
261-
// - 第三区域:删除键、切换键(ABC/返回)、特殊字符(港澳学警领)共8个键
262-
// 总计:30 + 10 + 8 = 48个键,但由于键盘区域切换,实际渲染的是38个键
258+
// 车牌模式键盘有两种状态:
259+
// 1. 中文模式(初始状态):
260+
// - 36个省份和特殊用途的车牌前缀(京、津、沪等)
261+
// - 1个"ABC"切换键
262+
// - 1个删除键
263+
// 总计:38个按键
264+
//
265+
// 2. 字母模式(切换后):
266+
// - 10个数字(0-9)
267+
// - 24个字母(A-Z,不包含I和O)
268+
// - 1个"返回"切换键
269+
// - 1个删除键
270+
// 总计:36个按键
271+
//
263272
expect(keys.length).toBe(38)
264273
})
265274

0 commit comments

Comments
 (0)