deeke-script-app 1.8.8 → 1.9.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.
@@ -26,7 +26,7 @@ interface DeviceHardware {
26
26
  * 禁用/启用状态栏
27
27
  * 禁用后,状态栏将被隐藏
28
28
  * 需要Device Owner权限
29
- * API级别要求:API 23 (Android 6.0) 及以上
29
+ * API级别要求:API 26 (Android 8.0) 及以上
30
30
  * @param disabled true表示禁用状态栏,false表示启用状态栏
31
31
  * @returns 是否成功,true表示成功,false表示失败
32
32
  */
@@ -42,6 +42,30 @@ interface FloatDialogs {
42
42
  * @param visible 是否显示
43
43
  */
44
44
  public setFloatWindowVisible(visible: boolean): void;
45
+
46
+ /**
47
+ * 显示确认对话框,支持动态修改内容和回调函数
48
+ * 此方法会阻塞当前线程,直到用户点击按钮或回调函数返回true
49
+ * 注意:此方法需要在初始化FloatDialogs时传入scope参数才能使用
50
+ * @param title 弹窗标题
51
+ * @param content 弹窗内容
52
+ * @param confirmText 确定按钮文字
53
+ * @param cancelText 取消按钮文字
54
+ * @param callback 回调函数,接收一个dialog对象作为参数,可以通过dialog.setContent()动态修改弹窗内容。如果回调函数返回true,则自动关闭对话框;返回false或不返回值,则继续等待用户点击按钮
55
+ * @returns 如果用户点击了确定按钮返回true,点击了取消按钮返回false
56
+ */
57
+ public confirm(title: string, content: string, confirmText: string, cancelText: string, callback: (dialog: FloatDialog) => boolean | void): boolean;
58
+ }
59
+
60
+ /**
61
+ * FloatDialog 接口,用于管理对话框状态
62
+ */
63
+ interface FloatDialog {
64
+ /**
65
+ * 设置对话框内容
66
+ * @param content 对话框内容
67
+ */
68
+ setContent(content: string): void;
45
69
  }
46
70
 
47
71
  export { };
@@ -49,6 +49,15 @@ interface KeyBoards {
49
49
  * 发送空格键
50
50
  */
51
51
  public pressSpace(): boolean;
52
+
53
+ /**
54
+ * 智能方法:根据当前状态自动跳转到合适的页面
55
+ * - 如果已经是默认输入法,返回 true
56
+ * - 如果未启用,跳转到启用页面(用户需要先启用)
57
+ * - 如果已启用但未设为默认,弹出输入法选择界面(用户可以选择为默认)
58
+ * @returns 返回当前输入法是否已设为默认(true表示已是默认,false表示需要用户操作)
59
+ */
60
+ public showInputMethodPicker(): boolean;
52
61
  }
53
62
 
54
63
  export { };
package/deekeScript.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "icon": "images/test/app.png",
5
5
  "head": "images/test/app.png",
6
6
  "settingTopBg": "images/test/setting-top.png",
7
+ "packageName": "cn.deeke.test",
7
8
  "versionCode": "101",
8
9
  "versionName": "1.0.1",
9
10
  "host": "https://home.deeke.top",
@@ -119,6 +120,26 @@
119
120
  "step": 1,
120
121
  "value": 60
121
122
  },
123
+ {
124
+ "type": "switch",
125
+ "value": true,
126
+ "name": "switch",
127
+ "label": "开启后,子表单也开启",
128
+ "childrenParams": [
129
+ {
130
+ "type": "text",
131
+ "label": "子表单1",
132
+ "name": "child_text1",
133
+ "value": ""
134
+ },
135
+ {
136
+ "type": "number",
137
+ "label": "子表单2",
138
+ "name": "child_number1",
139
+ "value": 0
140
+ }
141
+ ]
142
+ },
122
143
  {
123
144
  "type": "checkboxGroup",
124
145
  "label": "运行时间",
@@ -3,7 +3,20 @@
3
3
  "title": "DeekeScript 配置文件",
4
4
  "description": "DeekeScript Android 项目配置文件,用于动态渲染页面",
5
5
  "type": "object",
6
- "required": ["name", "versionCode", "versionName", "icon", "host", "switchSetting", "bottomMenusHidden", "groups", "bottomMenus", "settingLists", "apis"],
6
+ "required": [
7
+ "name",
8
+ "packageName",
9
+ "versionCode",
10
+ "versionName",
11
+ "icon",
12
+ "host",
13
+ "switchSetting",
14
+ "bottomMenusHidden",
15
+ "groups",
16
+ "bottomMenus",
17
+ "settingLists",
18
+ "apis"
19
+ ],
7
20
  "additionalProperties": false,
8
21
  "properties": {
9
22
  "$schema": {
@@ -14,6 +27,10 @@
14
27
  "type": "string",
15
28
  "description": "App安装成功之后,在手机上的名称"
16
29
  },
30
+ "packageName": {
31
+ "type": "string",
32
+ "description": "包名,如:cn.deeke.script"
33
+ },
17
34
  "versionCode": {
18
35
  "type": "string",
19
36
  "description": "版本号(软件自动升级凭证,当前版本号大于或者等于后台上传的版本号,则无法升级)"
@@ -44,7 +61,7 @@
44
61
  "description": "接口请求域名",
45
62
  "format": "uri"
46
63
  },
47
- "bottomMenusHidden": {
64
+ "bottomMenusHidden": {
48
65
  "type": "boolean",
49
66
  "default": false,
50
67
  "description": "是否隐藏底部菜单"
@@ -52,7 +69,9 @@
52
69
  "switchSetting": {
53
70
  "type": "object",
54
71
  "description": "功能开关设置",
55
- "required": ["alipay"],
72
+ "required": [
73
+ "alipay"
74
+ ],
56
75
  "additionalProperties": false,
57
76
  "properties": {
58
77
  "alipay": {
@@ -85,7 +104,10 @@
85
104
  "description": "主界面的功能组,每组都会包含若干个功能",
86
105
  "items": {
87
106
  "type": "object",
88
- "required": ["title", "methods"],
107
+ "required": [
108
+ "title",
109
+ "methods"
110
+ ],
89
111
  "additionalProperties": false,
90
112
  "properties": {
91
113
  "title": {
@@ -117,7 +139,11 @@
117
139
  "description": "App中底部菜单,可以使用系统内置的,也可以自定义",
118
140
  "items": {
119
141
  "type": "object",
120
- "required": ["title", "icon", "type"],
142
+ "required": [
143
+ "title",
144
+ "icon",
145
+ "type"
146
+ ],
121
147
  "additionalProperties": false,
122
148
  "properties": {
123
149
  "title": {
@@ -135,7 +161,11 @@
135
161
  "type": {
136
162
  "type": "string",
137
163
  "description": "菜单类型",
138
- "enum": ["home", "speech", "setting"]
164
+ "enum": [
165
+ "home",
166
+ "speech",
167
+ "setting"
168
+ ]
139
169
  }
140
170
  }
141
171
  }
@@ -145,7 +175,11 @@
145
175
  "description": "App中设置页的列表项,可以使用系统内置的,也可以自定义",
146
176
  "items": {
147
177
  "type": "object",
148
- "required": ["title", "icon", "type"],
178
+ "required": [
179
+ "title",
180
+ "icon",
181
+ "type"
182
+ ],
149
183
  "additionalProperties": false,
150
184
  "properties": {
151
185
  "title": {
@@ -159,7 +193,16 @@
159
193
  "type": {
160
194
  "type": "string",
161
195
  "description": "设置项类型",
162
- "enum": ["customerService", "notice", "settingService", "statistics", "uploadLog", "updateApp", "clear", "qiwei"]
196
+ "enum": [
197
+ "customerService",
198
+ "notice",
199
+ "settingService",
200
+ "statistics",
201
+ "uploadLog",
202
+ "updateApp",
203
+ "clear",
204
+ "qiwei"
205
+ ]
163
206
  },
164
207
  "description": {
165
208
  "type": "string",
@@ -193,13 +236,23 @@
193
236
  "description": "设置相关api,比如激活码api,验证激活码是否有效api等",
194
237
  "items": {
195
238
  "type": "object",
196
- "required": ["type", "url"],
239
+ "required": [
240
+ "type",
241
+ "url"
242
+ ],
197
243
  "additionalProperties": false,
198
244
  "properties": {
199
245
  "type": {
200
246
  "type": "string",
201
247
  "description": "API类型",
202
- "enum": ["bind", "checkBind", "aiSpeechToken", "config", "getToken", "createOrder"]
248
+ "enum": [
249
+ "bind",
250
+ "checkBind",
251
+ "aiSpeechToken",
252
+ "config",
253
+ "getToken",
254
+ "createOrder"
255
+ ]
203
256
  },
204
257
  "url": {
205
258
  "type": "string",
@@ -212,7 +265,10 @@
212
265
  "definitions": {
213
266
  "method": {
214
267
  "type": "object",
215
- "required": ["title", "icon"],
268
+ "required": [
269
+ "title",
270
+ "icon"
271
+ ],
216
272
  "additionalProperties": false,
217
273
  "properties": {
218
274
  "title": {
@@ -238,7 +294,9 @@
238
294
  "runType": {
239
295
  "type": "string",
240
296
  "description": "如果为floatSwitch则需要手动点击右侧悬浮窗执行",
241
- "enum": ["floatSwitch"]
297
+ "enum": [
298
+ "floatSwitch"
299
+ ]
242
300
  },
243
301
  "packageName": {
244
302
  "type": "string",
@@ -297,7 +355,9 @@
297
355
  },
298
356
  "settingPage": {
299
357
  "type": "object",
300
- "required": ["params"],
358
+ "required": [
359
+ "params"
360
+ ],
301
361
  "additionalProperties": false,
302
362
  "properties": {
303
363
  "params": {
@@ -313,7 +373,10 @@
313
373
  "oneOf": [
314
374
  {
315
375
  "type": "object",
316
- "required": ["type", "title"],
376
+ "required": [
377
+ "type",
378
+ "title"
379
+ ],
317
380
  "additionalProperties": false,
318
381
  "properties": {
319
382
  "type": {
@@ -342,7 +405,14 @@
342
405
  },
343
406
  {
344
407
  "type": "object",
345
- "required": ["type", "label", "name", "min", "max", "value"],
408
+ "required": [
409
+ "type",
410
+ "label",
411
+ "name",
412
+ "min",
413
+ "max",
414
+ "value"
415
+ ],
346
416
  "additionalProperties": false,
347
417
  "properties": {
348
418
  "type": {
@@ -382,7 +452,11 @@
382
452
  },
383
453
  {
384
454
  "type": "object",
385
- "required": ["type", "label", "name"],
455
+ "required": [
456
+ "type",
457
+ "label",
458
+ "name"
459
+ ],
386
460
  "additionalProperties": false,
387
461
  "properties": {
388
462
  "type": {
@@ -422,7 +496,13 @@
422
496
  },
423
497
  {
424
498
  "type": "object",
425
- "required": ["type", "label", "name", "children", "values"],
499
+ "required": [
500
+ "type",
501
+ "label",
502
+ "name",
503
+ "children",
504
+ "values"
505
+ ],
426
506
  "additionalProperties": false,
427
507
  "properties": {
428
508
  "type": {
@@ -464,7 +544,11 @@
464
544
  },
465
545
  {
466
546
  "type": "object",
467
- "required": ["type", "label", "name"],
547
+ "required": [
548
+ "type",
549
+ "label",
550
+ "name"
551
+ ],
468
552
  "additionalProperties": false,
469
553
  "properties": {
470
554
  "type": {
@@ -500,7 +584,11 @@
500
584
  },
501
585
  {
502
586
  "type": "object",
503
- "required": ["type", "label", "name"],
587
+ "required": [
588
+ "type",
589
+ "label",
590
+ "name"
591
+ ],
504
592
  "additionalProperties": false,
505
593
  "properties": {
506
594
  "type": {
@@ -536,7 +624,14 @@
536
624
  },
537
625
  {
538
626
  "type": "object",
539
- "required": ["type", "label", "name", "min", "max", "value"],
627
+ "required": [
628
+ "type",
629
+ "label",
630
+ "name",
631
+ "min",
632
+ "max",
633
+ "value"
634
+ ],
540
635
  "additionalProperties": false,
541
636
  "properties": {
542
637
  "type": {
@@ -576,7 +671,11 @@
576
671
  },
577
672
  {
578
673
  "type": "object",
579
- "required": ["type", "label", "name"],
674
+ "required": [
675
+ "type",
676
+ "label",
677
+ "name"
678
+ ],
580
679
  "additionalProperties": false,
581
680
  "properties": {
582
681
  "type": {
@@ -607,12 +706,23 @@
607
706
  "type": "boolean",
608
707
  "description": "是否隐藏",
609
708
  "default": false
709
+ },
710
+ "childrenParams": {
711
+ "type": "array",
712
+ "description": "子表单参数列表(仅在 switch 类型下使用,当 switch 开启时显示)",
713
+ "items": {
714
+ "$ref": "#/definitions/param"
715
+ }
610
716
  }
611
717
  }
612
718
  },
613
719
  {
614
720
  "type": "object",
615
- "required": ["type", "label", "name"],
721
+ "required": [
722
+ "type",
723
+ "label",
724
+ "name"
725
+ ],
616
726
  "additionalProperties": false,
617
727
  "properties": {
618
728
  "type": {
@@ -652,12 +762,19 @@
652
762
  },
653
763
  {
654
764
  "type": "object",
655
- "required": ["type", "label", "name"],
765
+ "required": [
766
+ "type",
767
+ "label",
768
+ "name"
769
+ ],
656
770
  "additionalProperties": false,
657
771
  "properties": {
658
772
  "type": {
659
773
  "type": "string",
660
- "enum": ["radio", "select"]
774
+ "enum": [
775
+ "radio",
776
+ "select"
777
+ ]
661
778
  },
662
779
  "label": {
663
780
  "type": "string",
@@ -701,5 +818,4 @@
701
818
  ]
702
819
  }
703
820
  }
704
- }
705
-
821
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deeke-script-app",
3
- "version": "1.8.8",
3
+ "version": "1.9.0",
4
4
  "description": "DeekeScript应用",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {