@cniot/android-pda-components 0.2.17 → 0.2.21

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 (114) hide show
  1. package/README.md +4 -21
  2. package/build/assets/index.51a8714a.css +1 -0
  3. package/build/assets/{index.8c37299c.js → index.b428d9a3.js} +29 -29
  4. package/build/assets/vendor.999402d8.js +40 -0
  5. package/build/index.html +3 -3
  6. package/change.md +7 -0
  7. package/package.json +1 -1
  8. package/packages/AppList/doc.jsx +138 -0
  9. package/packages/AppList/index.jsx +33 -0
  10. package/packages/AppList/index.less +52 -0
  11. package/packages/BaseLayout/BarcodeScan.jsx +88 -0
  12. package/packages/BaseLayout/BaseLayoutContainer.jsx +208 -0
  13. package/packages/BaseLayout/RfidOnce.jsx +106 -0
  14. package/packages/BaseLayout/RfidScan.jsx +118 -0
  15. package/packages/BaseLayout/doc.jsx +177 -0
  16. package/packages/BaseLayout/index.jsx +52 -0
  17. package/packages/BaseLayout/index.less +47 -0
  18. package/packages/Button/doc.jsx +62 -0
  19. package/packages/Button/index.jsx +27 -0
  20. package/packages/Button/index.less +62 -0
  21. package/packages/Confirm/doc.jsx +147 -0
  22. package/packages/Confirm/index.jsx +71 -0
  23. package/packages/Confirm/index.less +55 -0
  24. package/packages/Header/doc.jsx +171 -0
  25. package/packages/Header/index.jsx +191 -0
  26. package/packages/Header/index.less +71 -0
  27. package/packages/InfoCard/doc.jsx +244 -0
  28. package/packages/InfoCard/index.jsx +67 -0
  29. package/packages/InfoCard/index.less +111 -0
  30. package/packages/List/doc.jsx +89 -0
  31. package/packages/List/index.jsx +54 -0
  32. package/packages/List/index.less +43 -0
  33. package/packages/Overlay/doc.jsx +103 -0
  34. package/packages/Overlay/index.jsx +42 -0
  35. package/packages/Overlay/index.less +28 -0
  36. package/packages/PdaActionSheet/doc.jsx +193 -0
  37. package/packages/PdaActionSheet/index.jsx +44 -0
  38. package/packages/PdaActionSheet/index.less +65 -0
  39. package/packages/PdaDistanceCard/doc.jsx +62 -0
  40. package/packages/PdaDistanceCard/index.jsx +35 -0
  41. package/packages/PdaDistanceCard/index.less +42 -0
  42. package/packages/PdaFinishCard/doc.jsx +111 -0
  43. package/packages/PdaFinishCard/index.jsx +62 -0
  44. package/packages/PdaFinishCard/index.less +62 -0
  45. package/packages/PdaInfiniteScroll/doc.jsx +121 -0
  46. package/packages/PdaInfiniteScroll/index.jsx +114 -0
  47. package/packages/PdaInfiniteScroll/index.less +12 -0
  48. package/packages/PdaInfiniteScroll/utils.jsx +25 -0
  49. package/packages/PdaSteps/PdaStep/index.jsx +38 -0
  50. package/packages/PdaSteps/PdaStep/index.less +70 -0
  51. package/packages/PdaSteps/PdaSteps/index.jsx +33 -0
  52. package/packages/PdaSteps/PdaSteps/index.less +0 -0
  53. package/packages/PdaSteps/doc.jsx +131 -0
  54. package/packages/PdaSteps/index.jsx +5 -0
  55. package/packages/PdaTitle/doc.jsx +102 -0
  56. package/packages/PdaTitle/index.jsx +51 -0
  57. package/packages/Presentation/doc.jsx +72 -0
  58. package/packages/Presentation/index.jsx +25 -0
  59. package/packages/Presentation/index.less +31 -0
  60. package/packages/SelectCard/doc.jsx +57 -0
  61. package/packages/SelectCard/index.jsx +13 -0
  62. package/packages/SelectCard/index.less +30 -0
  63. package/packages/SimpleCard/doc.jsx +59 -0
  64. package/packages/SimpleCard/index.jsx +13 -0
  65. package/packages/SimpleCard/index.less +38 -0
  66. package/packages/SimpleCardBlock/doc.jsx +77 -0
  67. package/packages/SimpleCardBlock/index.jsx +43 -0
  68. package/packages/SimpleCardBlock/index.less +26 -0
  69. package/packages/SubCard/doc.jsx +63 -0
  70. package/packages/SubCard/index.jsx +28 -0
  71. package/packages/SubCard/index.less +64 -0
  72. package/packages/Tag/doc.jsx +47 -0
  73. package/packages/Tag/index.jsx +12 -0
  74. package/packages/Tag/index.less +22 -0
  75. package/packages/TaskCard/doc.jsx +151 -0
  76. package/packages/TaskCard/index.jsx +65 -0
  77. package/packages/TaskCard/index.less +101 -0
  78. package/packages/Toast/doc.jsx +112 -0
  79. package/packages/Toast/index.jsx +7 -0
  80. package/packages/Toast/index.less +23 -0
  81. package/packages/Toast/methods.jsx +77 -0
  82. package/packages/Toast/toast.jsx +96 -0
  83. package/packages/WakeKeyborard/doc.jsx +170 -0
  84. package/packages/WakeKeyborard/index.jsx +61 -0
  85. package/packages/WakeKeyborard/index.less +55 -0
  86. package/packages/WakeKeyborard/keyborard.jsx +61 -0
  87. package/packages/doc.jsx +19 -0
  88. package/packages/global.less +7 -0
  89. package/packages/index.jsx +60 -0
  90. package/packages/index.less +3 -0
  91. package/packages/pageflow-system-pages/alert/doc.jsx +70 -0
  92. package/packages/pageflow-system-pages/alert/index.jsx +22 -0
  93. package/packages/pageflow-system-pages/confirm/doc.jsx +118 -0
  94. package/packages/pageflow-system-pages/confirm/index.jsx +31 -0
  95. package/packages/pageflow-system-pages/debug/index.jsx +27 -0
  96. package/packages/pageflow-system-pages/debug/index.less +5 -0
  97. package/packages/pageflow-system-pages/index.jsx +38 -0
  98. package/packages/pageflow-system-pages/loading/index.jsx +37 -0
  99. package/packages/pageflow-system-pages/not-found/index.jsx +12 -0
  100. package/packages/pageflow-system-pages/not-found/index.less +26 -0
  101. package/packages/pageflow-system-pages/prompt/doc.jsx +95 -0
  102. package/packages/pageflow-system-pages/prompt/index.jsx +43 -0
  103. package/packages/pageflow-system-pages/prompt/index.less +44 -0
  104. package/packages/pageflow-system-pages/start/index.jsx +28 -0
  105. package/packages/pageflow-system-pages/start/index.less +12 -0
  106. package/packages/pageflow-system-pages/toast/doc.jsx +76 -0
  107. package/packages/pageflow-system-pages/toast/index.jsx +42 -0
  108. package/packages/utils/index.js +56 -0
  109. package/packages/variable.less +4 -0
  110. package/build/assets/index.b8d6d64c.css +0 -1
  111. package/build/assets/vendor.5080796b.js +0 -40
  112. package/es/index.cjs.js +0 -7
  113. package/es/index.es.js +0 -2170
  114. package/es/style.css +0 -1
@@ -0,0 +1,61 @@
1
+ import React, { useState, useEffect, useRef } from "react";
2
+ import "./index.less";
3
+ import Button from '../Button'
4
+
5
+ const blankFunc = () => { };
6
+ export default function Keyborard(props) {
7
+ const { label = "查询", onWakeKeyboard = blankFunc, onClick = blankFunc, onHidden = blankFunc, type='tel', placeholder='请输入' } = props;
8
+ const inputRef = useRef(null);
9
+ const [visible, setVisible] = useState(true);
10
+
11
+ useEffect(() => {
12
+ const handleKeyUp = e => {
13
+ const { code, keyCode, key } = e;
14
+ if (code === 'Enter') {
15
+ e.preventDefault();
16
+ onClick(inputRef.current.value, e);
17
+ onHidden(true);
18
+ setVisible(false);
19
+ return;
20
+ }
21
+ }
22
+ requestAnimationFrame(() => {
23
+ inputRef.current.focus();
24
+ onWakeKeyboard();
25
+ })
26
+
27
+ document.addEventListener('keyup', handleKeyUp);
28
+ return () => {
29
+ document.removeEventListener('keyup', handleKeyUp);
30
+ }
31
+ }, [])
32
+
33
+ if(!visible) return null;
34
+ return (
35
+ <div
36
+ className="wakekeyborard-overlay"
37
+ onClick={e => {
38
+ if (e.target.className && e.target.className.includes('wakekeyborard-overlay')) {
39
+ onHidden(false);
40
+ setVisible(false);
41
+ }
42
+ }}
43
+ >
44
+ <div className="wakekeyborard-inputbox">
45
+ <input
46
+ ref={inputRef}
47
+ type={type}
48
+ placeholder={placeholder}
49
+ />
50
+ <Button
51
+ type="cutout"
52
+ onClick={ e => {
53
+ onClick(inputRef.current.value, e);
54
+ onHidden(true);
55
+ setVisible(false);
56
+ }}
57
+ >{label}</Button>
58
+ </div>
59
+ </div>
60
+ )
61
+ }
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ // import Button from "./index";
3
+ export default function () {
4
+ return (
5
+ <div>
6
+ <h1>快速开始</h1>
7
+
8
+ <code className="code">{`
9
+
10
+ tnpm install @cniot/android-pda-components --save
11
+
12
+ import { Button } from '@cniot/android-pda-components';
13
+
14
+ import '@cniot/android-pda-components/es/style.css';
15
+
16
+ `}</code>
17
+ </div>
18
+ );
19
+ }
@@ -0,0 +1,7 @@
1
+ * {
2
+ margin: 0;
3
+ padding: 0;
4
+ }
5
+ div {
6
+ box-sizing: border-box;
7
+ }
@@ -0,0 +1,60 @@
1
+ import './global.less';
2
+
3
+ import Title from "./PdaTitle";
4
+ import Header from "./Header";
5
+ import Button from "./Button";
6
+ import InfoCard from "./InfoCard";
7
+ import TaskCard from "./TaskCard";
8
+ import Confirm from './Confirm';
9
+ import Toast from './Toast';
10
+ import Overlay from "./Overlay";
11
+ import PageFlowSystemPages from './pageflow-system-pages/index.jsx';
12
+ import Presentation from "./Presentation";
13
+ import List from "./List";
14
+ import BaseLayout from "./BaseLayout";
15
+ import WakeKeyborard from "./WakeKeyborard";
16
+ import Keyborard from './WakeKeyborard/keyborard';
17
+
18
+ import Steps from "./PdaSteps";
19
+ import FinishCard from "./PdaFinishCard";
20
+ import DistanceCard from "./PdaDistanceCard";
21
+ import SubCard from './SubCard';
22
+ import SelectCard from './SelectCard';
23
+ import AppList from './AppList';
24
+ import InfiniteScroll from './PdaInfiniteScroll';
25
+ import ActionSheet from './PdaActionSheet';
26
+ import Tag from './Tag';
27
+ import SimpleCard from './SimpleCard';
28
+ import SimpleCardBlock from './SimpleCardBlock';
29
+
30
+ // 兼容之前 ListItem 卡片命名逻辑
31
+ const ListItem = TaskCard;
32
+
33
+ export {
34
+ Title,
35
+ Header,
36
+ Button,
37
+ InfoCard,
38
+ Steps,
39
+ ListItem,
40
+ TaskCard,
41
+ Confirm,
42
+ Toast,
43
+ Overlay,
44
+ DistanceCard,
45
+ PageFlowSystemPages,
46
+ Presentation,
47
+ List,
48
+ WakeKeyborard,
49
+ Keyborard,
50
+ SubCard,
51
+ SelectCard,
52
+ FinishCard,
53
+ InfiniteScroll,
54
+ BaseLayout,
55
+ ActionSheet,
56
+ AppList,
57
+ Tag,
58
+ SimpleCard,
59
+ SimpleCardBlock,
60
+ };
@@ -0,0 +1,3 @@
1
+ html{
2
+ font-size:10px;
3
+ }
@@ -0,0 +1,70 @@
1
+ import React from "react";
2
+ import SystemAlert from "./index";
3
+
4
+ import service from '../../../mock/service';
5
+ export default function () {
6
+ return (
7
+ <div>
8
+ <h1>/system/alert</h1>
9
+ <p>弹出一个警告窗,用户必须点击确认才能继续</p>
10
+ <h2>示例</h2>
11
+ <code className="code">
12
+ {
13
+ `
14
+ // gs 代码如下
15
+ pageFlow.alert({
16
+ title: '111',
17
+ message: '2222',
18
+ okText: "确认"
19
+ })
20
+ `
21
+ }
22
+ </code>
23
+ <h2>页面效果</h2>
24
+ <div className="light-block light-block-overlay">
25
+ <SystemAlert service={service} data={{
26
+ title: '111',
27
+ message: '2222',
28
+ okText: "确认"
29
+ }} ></SystemAlert>
30
+ </div>
31
+ <h2>Alert</h2>
32
+ <table className="pure-table pure-table-bordered">
33
+ <thead>
34
+ <tr>
35
+ <th>属性</th>
36
+ <th>说明</th>
37
+ <th>类型</th>
38
+ <th>默认值</th>
39
+ </tr>
40
+ </thead>
41
+ <tbody>
42
+ <tr>
43
+ <td>title</td>
44
+ <td>标题</td>
45
+ <td>string</td>
46
+ <td></td>
47
+ </tr>
48
+ <tr>
49
+ <td>message</td>
50
+ <td>信息</td>
51
+ <td>string</td>
52
+ <td></td>
53
+ </tr>
54
+ <tr>
55
+ <td>okText</td>
56
+ <td>确认文本</td>
57
+ <td>string</td>
58
+ <td></td>
59
+ </tr>
60
+ <tr>
61
+ <td>okDataClick</td>
62
+ <td>ok 按钮 arms 监控</td>
63
+ <td>string</td>
64
+ <td></td>
65
+ </tr>
66
+ </tbody>
67
+ </table>
68
+ </div>
69
+ );
70
+ }
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import Confirm from '../../Confirm';
3
+ import Overlay from "../../Overlay";
4
+ // import "./index.less";
5
+
6
+ export default function Alert(props) {
7
+ const { service, data = {} } = props;
8
+ // const { title = "title", message = "message", okText = "okText", cancelText="" } = data;
9
+ const onClickCallback = React.useCallback(
10
+ function () {
11
+ service.onNext(true);
12
+ },
13
+ [service]
14
+ );
15
+
16
+ return (
17
+ <Overlay verticalPosition="bottom">
18
+ {/* <Confirm title={title} message={message} okText={okText} cancelText={cancelText} onClick={onClickCallback} ></Confirm> */}
19
+ <Confirm {...data} onClick={onClickCallback} ></Confirm>
20
+ </Overlay>
21
+ );
22
+ }
@@ -0,0 +1,118 @@
1
+ import React from "react";
2
+ import SystemConfirm from "./index";
3
+
4
+ import service from '../../../mock/service';
5
+ export default function () {
6
+ return (
7
+ <div>
8
+ <h1>/system/confirm</h1>
9
+ <p>弹出一个确认框,用户必须点击确认才能继续</p>
10
+ <h2>示例</h2>
11
+ <code className="code">
12
+ {
13
+ `
14
+ // gs 代码如下
15
+ pageFlow.confirm({
16
+ title: '111',
17
+ message: '2222',
18
+ okText: "确认",
19
+ cancelText:"取消"
20
+ })
21
+ // 如果 message 需要多行显示,使用 subMessage 方式
22
+ pageFlow.confirm({
23
+ title: '111',
24
+ subMessage: [
25
+ {label: 'title1', content: 'content1'},
26
+ {label: 'title2', content: 'content2'},
27
+ {label: 'title3', content: 'content3'},
28
+ ],
29
+ okText: "确认",
30
+ cancelText:"取消"
31
+ })
32
+ `
33
+ }
34
+ </code>
35
+ <h2>页面效果</h2>
36
+ <div className="light-block light-block-overlay">
37
+ <SystemConfirm service={service} data={{
38
+ title: '111',
39
+ message: <span>栈板码:<span style={{color: '#0091EA'}}>111</span><br/><span>箱码:222</span></span>,
40
+ okText: "确认",
41
+ cancelText:"取消"
42
+ }} ></SystemConfirm>
43
+ </div>
44
+ <h2>Confirm</h2>
45
+ <table className="pure-table pure-table-bordered">
46
+ <thead>
47
+ <tr>
48
+ <th>属性</th>
49
+ <th>说明</th>
50
+ <th>类型</th>
51
+ <th>默认值</th>
52
+ </tr>
53
+ </thead>
54
+ <tbody>
55
+ <tr>
56
+ <td>title</td>
57
+ <td>标题</td>
58
+ <td>string</td>
59
+ <td></td>
60
+ </tr>
61
+ <tr>
62
+ <td>message</td>
63
+ <td>信息</td>
64
+ <td>string</td>
65
+ <td></td>
66
+ </tr>
67
+ <tr>
68
+ <td>subMessage</td>
69
+ <td>副文本消息</td>
70
+ <td>string</td>
71
+ <td></td>
72
+ </tr>
73
+ <tr>
74
+ <td>okText</td>
75
+ <td>确认文本</td>
76
+ <td>string</td>
77
+ <td></td>
78
+ </tr>
79
+ <tr>
80
+ <td>cancelText</td>
81
+ <td>取消文本</td>
82
+ <td>string</td>
83
+ <td></td>
84
+ </tr>
85
+ <tr>
86
+ <td>okDataClick</td>
87
+ <td>ok 按钮 arms 监控</td>
88
+ <td>string</td>
89
+ <td></td>
90
+ </tr>
91
+ <tr>
92
+ <td>cancelDataClick</td>
93
+ <td>cancel 按钮 arms 监控</td>
94
+ <td>string</td>
95
+ <td></td>
96
+ </tr>
97
+ <tr>
98
+ <td>insertButtons</td>
99
+ <td>插入在默认按钮上面</td>
100
+ <td>{JSON.stringify([
101
+ { label: '查看详情111', value: 'hello', dataClick: '查看详情1234' }
102
+ ])}</td>
103
+ <td></td>
104
+ </tr>
105
+ <tr>
106
+ <td>appendButtons</td>
107
+ <td>追加到默认按钮下面</td>
108
+ <td>{JSON.stringify([
109
+ { label: '查看详情222', value: 'hello', dataClick: '查看详情1234' }
110
+ ])}</td>
111
+ <td></td>
112
+ </tr>
113
+ </tbody>
114
+ </table>
115
+
116
+ </div>
117
+ );
118
+ }
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import Confirm from '../../Confirm';
3
+ import Overlay from "../../Overlay";
4
+ // import "./index.less";
5
+
6
+ export default function confirm(props) {
7
+ const { service, data = {} } = props;
8
+ // const { title = "title", message, subMessage=[], okText = "okText", cancelText="" } = data;
9
+ // const { title = "title", message, subMessage=[], okText = "okText", cancelText="" } = data;
10
+ const onClickCallback = React.useCallback(
11
+ function (v) {
12
+ service.onNext(v);
13
+ },
14
+ [service]
15
+ );
16
+
17
+ return (
18
+ <Overlay verticalPosition="bottom">
19
+ {/* <Confirm
20
+ title={title}
21
+ message={message}
22
+ subMessage={subMessage}
23
+ okText={okText}
24
+ cancelText={cancelText}
25
+ onClick={onClickCallback}
26
+ >
27
+ </Confirm> */}
28
+ <Confirm {...data} onClick={onClickCallback}></Confirm>
29
+ </Overlay>
30
+ );
31
+ }
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { createHashHistory } from "history";
3
+ import "./index.less";
4
+ // debug
5
+ export default function Debug(props) {
6
+ const { appManager } = props;
7
+ const pages = Array.from(appManager.pageManager.keys()).reverse();
8
+ React.useEffect(function () {
9
+ const history = createHashHistory();
10
+ const unListen = history.listen(({ action, location }) => {
11
+ const pathname = location.pathname;
12
+ appManager.mockToPage(pathname, {});
13
+ });
14
+ return unListen;
15
+ }, []);
16
+ return (
17
+ <div className="local-debug-side">
18
+ <ul>
19
+ {pages.map((pathname) => (
20
+ <li key={pathname}>
21
+ <a href={`#${pathname}`}>{pathname}</a>
22
+ </li>
23
+ ))}
24
+ </ul>
25
+ </div>
26
+ );
27
+ }
@@ -0,0 +1,5 @@
1
+ .local-debug-side {
2
+ position: absolute;
3
+ right: 0;
4
+ bottom: 0;
5
+ }
@@ -0,0 +1,38 @@
1
+ import Alert from "./alert";
2
+ import Start from "./start";
3
+ import Confirm from "./confirm";
4
+ import Prompt from "./prompt";
5
+ import Toast from "./toast";
6
+ import NotFound from "./not-found";
7
+ import Debug from "./debug";
8
+ import Loading from "./loading";
9
+
10
+ function PlaySound({ data, service, action }) {
11
+ const { sound } = data;
12
+ if(window.WindVane) {
13
+ var params = {
14
+ domain: 'audio',
15
+ method: 'playSound',
16
+ params: { sound, }
17
+ }
18
+ WindVane.call(
19
+ 'WindvanePlugin',
20
+ 'invoke',
21
+ JSON.stringify(params),
22
+ );
23
+ }
24
+ service.onNext({});
25
+ return null
26
+ }
27
+
28
+ export default {
29
+ Alert,
30
+ Start,
31
+ Toast,
32
+ Confirm,
33
+ NotFound,
34
+ Debug,
35
+ Prompt,
36
+ Loading,
37
+ PlaySound,
38
+ };
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ // import "./index.less";
3
+
4
+ export default function Loading(props) {
5
+ const [showLoading, setShowLoading] = React.useState(false);
6
+ const edgeService = props.edgeService;
7
+ React.useEffect(
8
+ function () {
9
+ let currentLoading = false;
10
+ const throttleSetShowLoading = function(loading){
11
+ currentLoading = loading;
12
+ if(loading){
13
+ setTimeout(function(){
14
+ if(currentLoading === loading){
15
+ setShowLoading(true)
16
+ }
17
+ }, 350)
18
+ }else{
19
+ setTimeout(function(){
20
+ if(currentLoading === loading){
21
+ setShowLoading(false)
22
+ }
23
+ }, 100)
24
+ }
25
+ }
26
+ edgeService.on("IO_STATUS", throttleSetShowLoading);
27
+ return function () {
28
+ edgeService.off("IO_STATUS", throttleSetShowLoading);
29
+ }
30
+ },
31
+ [edgeService]
32
+ );
33
+
34
+ return showLoading ? (
35
+ <div style={{position:"absolute",left:0,top:0, zIndex: 100}} >LOADING...</div>
36
+ ) : null;
37
+ }
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ export default function NotFound(props) {
4
+ return (
5
+ <div style={{ padding: "20%" }}>
6
+ <h1>
7
+ 404 <small style={{ fontSize: "60%" }}>Not found</small>
8
+ </h1>
9
+ <div>{props.action.getPage()}</div>
10
+ </div>
11
+ );
12
+ }
@@ -0,0 +1,26 @@
1
+ .mini-app-start-page {
2
+ display: flex;
3
+ flex-direction: column;
4
+ justify-content: center;
5
+ align-items: center;
6
+ width: 100vw;
7
+ height: 100vh;
8
+ button {
9
+ padding: 0.3em 3em;
10
+ // height: 3em;
11
+ border-radius: 6px;
12
+ border: none;
13
+ font-size: 36px;
14
+ background-color: #00bdff;
15
+ color: #ffffff;
16
+ margin-top: 20px;
17
+
18
+ &:active {
19
+ transform: scale(0.95);
20
+ }
21
+ }
22
+
23
+ .desc {
24
+ opacity: 0.3;
25
+ }
26
+ }
@@ -0,0 +1,95 @@
1
+ import React from "react";
2
+ import SystemPrompt from "./index";
3
+ import service from '../../../mock/service';
4
+
5
+ export default function () {
6
+ const [display, setDisplay] = React.useState(false);
7
+ return (
8
+ <div>
9
+ <h1>/system/prompt</h1>
10
+ <p>弹出输入框,用户输入内容然后提交,取消按钮输入返回 'back' 字符串</p>
11
+ <h2>示例</h2>
12
+ <code className="code">
13
+ {
14
+ `
15
+ // gs 代码如下
16
+ pageFlow.prompt({
17
+ defaultValue:"111", //默认值
18
+ placeholder:"请输入..." //输入占位符
19
+ type:"text",//控制弹出键盘的类型,可选值 number|text|tel 参考:https://www.w3school.com.cn/tags/att_input_type.asp
20
+ okText:"确认", //确认按钮文案
21
+ cancelText:"取消" //取消文案 没有取消文案将不能取消输入
22
+ })
23
+ `
24
+ }
25
+ </code>
26
+ <h2>页面效果</h2>
27
+ <div className="light-block">
28
+ <button onClick={()=> setDisplay(true)}>点击显示</button>
29
+ {
30
+ display ? <SystemPrompt
31
+ service={service}
32
+ data={{
33
+ defaultValue:"111", //默认值
34
+ placeholder:"请输入...", //输入占位符
35
+ type:"text",//控制弹出键盘的类型,可选值 number|text|tel 参考:https://www.w3school.com.cn/tags/att_input_type.asp
36
+ okText:"确认", //确认按钮文案
37
+ cancelText:"取消" //取消文案 没有取消文案将不能取消输入
38
+ }}
39
+ onNext={(value)=> {console.log(value); setDisplay(false);}}
40
+ ></SystemPrompt> : null
41
+ }
42
+
43
+ </div>
44
+ <h2>/system/prompt</h2>
45
+ <table className="pure-table pure-table-bordered">
46
+ <thead>
47
+ <tr>
48
+ <th>属性</th>
49
+ <th>说明</th>
50
+ <th>类型</th>
51
+ <th>默认值</th>
52
+ </tr>
53
+ </thead>
54
+ <tbody>
55
+ <tr>
56
+ <td>title</td>
57
+ <td>标题</td>
58
+ <td>string</td>
59
+ <td>请输入</td>
60
+ </tr>
61
+ <tr>
62
+ <td>defaultValue</td>
63
+ <td>默认值</td>
64
+ <td>string</td>
65
+ <td>-</td>
66
+ </tr>
67
+ <tr>
68
+ <td>placeholder</td>
69
+ <td>input 占位符</td>
70
+ <td>string</td>
71
+ <td>请输入...</td>
72
+ </tr>
73
+ <tr>
74
+ <td>type</td>
75
+ <td>定制键盘类型 参考:https://www.w3school.com.cn/tags/att_input_type.asp</td>
76
+ <td>string</td>
77
+ <td>text</td>
78
+ </tr>
79
+ <tr>
80
+ <td>okText</td>
81
+ <td>确认文案</td>
82
+ <td>string</td>
83
+ <td>确认</td>
84
+ </tr>
85
+ <tr>
86
+ <td>cancelText</td>
87
+ <td>取消文案,取消文案为空,不显示取消按钮</td>
88
+ <td>string</td>
89
+ <td>取消</td>
90
+ </tr>
91
+ </tbody>
92
+ </table>
93
+ </div>
94
+ );
95
+ }