@cniot/android-pda-components 0.0.23 → 0.0.27

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/es/index.es.js CHANGED
@@ -14,6 +14,18 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
+ var __objRest = (source, exclude) => {
18
+ var target = {};
19
+ for (var prop in source)
20
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
+ target[prop] = source[prop];
22
+ if (source != null && __getOwnPropSymbols)
23
+ for (var prop of __getOwnPropSymbols(source)) {
24
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
+ target[prop] = source[prop];
26
+ }
27
+ return target;
28
+ };
17
29
  var __publicField = (obj, key, value) => {
18
30
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
19
31
  return value;
@@ -120,7 +132,7 @@ class ButtonGroup extends React__default.Component {
120
132
  }
121
133
  Button.Group = ButtonGroup;
122
134
  var index$i = "";
123
- const blankFunc$2 = () => {
135
+ const blankFunc$5 = () => {
124
136
  };
125
137
  class PdaTitle extends React__default.Component {
126
138
  constructor(props) {
@@ -130,7 +142,7 @@ class PdaTitle extends React__default.Component {
130
142
  });
131
143
  }
132
144
  render() {
133
- const { className, goBack = true, goBackHandle = blankFunc$2, icon = "scan", title = "\u4EFB\u52A1", menuList = null } = this.props;
145
+ const { className, goBack = true, goBackHandle = blankFunc$5, icon = "scan", title = "\u4EFB\u52A1", menuList = null } = this.props;
134
146
  const { showMenu } = this.state;
135
147
  return /* @__PURE__ */ React__default.createElement("div", {
136
148
  className: classNames({ [className]: true, "pda-header": true })
@@ -262,9 +274,9 @@ var index$f = "";
262
274
  function empty$1() {
263
275
  }
264
276
  function Confirm$1(props) {
265
- const { title = "title", message = null, subMessage = [], okText = "okText", cancelText = "cancelText", onClick = empty$1 } = props;
277
+ const { title = "title", message = null, subMessage = [], okText = "okText", cancelText = null, onClick = empty$1, type = "primary" } = props;
266
278
  return /* @__PURE__ */ React__default.createElement("div", {
267
- className: "confirm-wrap"
279
+ className: classNames({ "confirm-wrap": true, ["confirm-" + type]: true })
268
280
  }, /* @__PURE__ */ React__default.createElement("div", {
269
281
  className: "confirm-title"
270
282
  }, title), message ? /* @__PURE__ */ React__default.createElement("div", {
@@ -368,17 +380,19 @@ function Prompt(props) {
368
380
  function toast(props) {
369
381
  const { data = {}, service } = props;
370
382
  const { title, level, message, duration = null } = data;
383
+ const [hidden, setHidden2] = useState(false);
371
384
  React__default.useEffect(() => {
372
- if (data.hasNext !== false) {
373
- service.onNext("");
385
+ let timeout = null;
386
+ if (duration) {
387
+ setTimeout(() => {
388
+ setHidden2(true);
389
+ service.onNext("");
390
+ }, duration);
374
391
  }
375
- }, [data, service]);
376
- const [hidden, setHidden2] = useState(false);
377
- if (duration) {
378
- setTimeout(() => {
379
- setHidden2(true);
380
- }, duration);
381
- }
392
+ return () => {
393
+ clearTimeout(timeout);
394
+ };
395
+ }, []);
382
396
  return !hidden ? /* @__PURE__ */ React__default.createElement(Overlay, {
383
397
  verticalPosition: "bottom"
384
398
  }, /* @__PURE__ */ React__default.createElement(Confirm, {
@@ -702,19 +716,16 @@ function DefaultItem(props) {
702
716
  }
703
717
  List.Item = DefaultItem;
704
718
  var index$8 = "";
705
- const blankFunc$1 = () => {
719
+ const blankFunc$4 = () => {
706
720
  };
707
- class BaseLayout extends React__default.Component {
721
+ class BaseLayoutContainer extends React__default.Component {
708
722
  constructor(props) {
709
723
  super(props);
724
+ this.state = {};
710
725
  this._handleKeyUp = (e) => {
711
- const { onScan = blankFunc$1, onEnter = blankFunc$1, onEsc = blankFunc$1, onDelete = blankFunc$1 } = this.props;
726
+ const { onScan = blankFunc$4, onEnter = blankFunc$4, onEsc = blankFunc$4, onDelete = blankFunc$4, scanMode = null } = this.props;
712
727
  e.preventDefault();
713
728
  const { code, keyCode, key } = e;
714
- if (code === "F23" || code === "F24") {
715
- onScan(e);
716
- return;
717
- }
718
729
  if (code === "Enter") {
719
730
  onEnter(e);
720
731
  return;
@@ -729,7 +740,7 @@ class BaseLayout extends React__default.Component {
729
740
  }
730
741
  };
731
742
  this._handleContinuousRfidScan = (ev) => {
732
- const { continuousRfidScan = false, onRfidScan = blankFunc$1 } = this.props;
743
+ const { continuousRfidScan = false, onRfidScan = blankFunc$4 } = this.props;
733
744
  if (continuousRfidScan) {
734
745
  onRfidScan(ev.param);
735
746
  }
@@ -769,6 +780,232 @@ class BaseLayout extends React__default.Component {
769
780
  }, footer));
770
781
  }
771
782
  }
783
+ const blankFunc$3 = () => {
784
+ };
785
+ class RfidOnce$1 extends React__default.Component {
786
+ constructor(props) {
787
+ super(props);
788
+ this._rfidBeginScan = false;
789
+ this._handleRfidScan = (e) => {
790
+ const { onRfidOnce, onRfidBoxOnce, onRfidPalletOnce } = this.props;
791
+ const data = e.param;
792
+ const isBox = !data.rfidData.startsWith("0F011");
793
+ if (onRfidBoxOnce) {
794
+ if (isBox) {
795
+ this._stopWork();
796
+ onRfidBoxOnce(e.param);
797
+ }
798
+ } else if (onRfidPalletOnce) {
799
+ if (!isBox) {
800
+ this._stopWork();
801
+ onRfidPalletOnce(e.param);
802
+ }
803
+ }
804
+ if (onRfidOnce) {
805
+ this._stopWork();
806
+ onRfidOnce(e.param);
807
+ }
808
+ };
809
+ this._startWork = (e) => {
810
+ document.addEventListener("ContinuousRfidScan", this._handleRfidScan);
811
+ WindVane.call("WindvanePlugin", "invoke", "{'domain': 'rfid', 'method': 'startScan', 'params': null}", function(e2) {
812
+ }, function(e2) {
813
+ });
814
+ this._rfidBeginScan = true;
815
+ };
816
+ this._stopWork = (e) => {
817
+ document.removeEventListener("ContinuousRfidScan", this._handleRfidScan);
818
+ WindVane.call("WindvanePlugin", "invoke", "{'domain': 'rfid', 'method': 'stopScan', 'params':null}", function(e2) {
819
+ }, function(e2) {
820
+ });
821
+ };
822
+ this._handleKeyDown = (e) => {
823
+ const { code, keyCode, key } = e;
824
+ if (code === "F23" || code === "F24") {
825
+ if (!this._rfidBeginScan) {
826
+ this._startWork();
827
+ }
828
+ }
829
+ };
830
+ this._handleKeyUp = (e) => {
831
+ const { code, keyCode, key } = e;
832
+ if (code === "F23" || code === "F24") {
833
+ this._stopWork();
834
+ this._rfidBeginScan = false;
835
+ }
836
+ };
837
+ }
838
+ componentDidMount() {
839
+ document.addEventListener("keydown", this._handleKeyDown);
840
+ document.addEventListener("keyup", this._handleKeyUp);
841
+ WindVane.call("WindvanePlugin", "invoke", "{'domain': 'keyboard', 'method': 'changeScanMode', 'params': {'scanMode': 'RFID'}}", function(e) {
842
+ }, function(e) {
843
+ });
844
+ }
845
+ componentWillUnmount() {
846
+ document.removeEventListener("keydown", this._handleKeyDown);
847
+ document.removeEventListener("keyup", this._handleKeyUp);
848
+ }
849
+ render() {
850
+ const props = this.props;
851
+ const _a = props, { onRfidOnce = blankFunc$3 } = _a, opts = __objRest(_a, ["onRfidOnce"]);
852
+ return /* @__PURE__ */ React__default.createElement(BaseLayoutContainer, __spreadValues({}, opts));
853
+ }
854
+ }
855
+ const blankFunc$2 = () => {
856
+ };
857
+ class RfidOnce extends React__default.Component {
858
+ constructor(props) {
859
+ super(props);
860
+ this._rfidBeginScan = false;
861
+ this._handleRfidScan = (e) => {
862
+ const { onRfidScan, onRfidBoxScan, onRfidPalletScan } = this.props;
863
+ const data = e.param;
864
+ const isBox = !data.rfidData.startsWith("0F011");
865
+ if (isBox && onRfidBoxScan) {
866
+ onRfidBoxScan(data);
867
+ } else if (!isBox && onRfidPalletScan) {
868
+ onRfidPalletScan(data);
869
+ }
870
+ onRfidScan(data);
871
+ };
872
+ this._startWork = (e) => {
873
+ document.addEventListener("ContinuousRfidScan", this._handleRfidScan);
874
+ WindVane.call("WindvanePlugin", "invoke", "{'domain': 'rfid', 'method': 'startScan', 'params': null}", function(e2) {
875
+ }, function(e2) {
876
+ });
877
+ this._rfidBeginScan = true;
878
+ };
879
+ this._stopWork = (e) => {
880
+ document.removeEventListener("ContinuousRfidScan", this._handleRfidScan);
881
+ WindVane.call("WindvanePlugin", "invoke", "{'domain': 'rfid', 'method': 'stopScan', 'params':null}", function(e2) {
882
+ }, function(e2) {
883
+ });
884
+ };
885
+ this._handleKeyDown = (e) => {
886
+ const { code, keyCode, key } = e;
887
+ if (code === "F23" || code === "F24") {
888
+ if (!this._rfidBeginScan) {
889
+ this._startWork();
890
+ }
891
+ }
892
+ };
893
+ this._handleKeyUp = (e) => {
894
+ const { code, keyCode, key } = e;
895
+ if (code === "F23" || code === "F24") {
896
+ this._stopWork();
897
+ this._rfidBeginScan = false;
898
+ }
899
+ };
900
+ }
901
+ componentDidMount() {
902
+ const { autoRfidScan = false, rfidReaderSleep } = this.props;
903
+ WindVane.call("WindvanePlugin", "invoke", "{'domain': 'keyboard', 'method': 'changeScanMode', 'params': {'scanMode': 'RFID'}}", function(e) {
904
+ }, function(e) {
905
+ });
906
+ if (!autoRfidScan) {
907
+ document.addEventListener("keydown", this._handleKeyDown);
908
+ document.addEventListener("keyup", this._handleKeyUp);
909
+ } else {
910
+ if (!rfidReaderSleep) {
911
+ this._startWork();
912
+ }
913
+ }
914
+ }
915
+ componentWillUnmount() {
916
+ document.removeEventListener("keydown", this._handleKeyDown);
917
+ document.removeEventListener("keyup", this._handleKeyUp);
918
+ this._stopWork();
919
+ }
920
+ shouldComponentUpdate(nextProps, nextState) {
921
+ if (this.props.autoRfidScan && this.props.rfidReaderSleep !== nextProps.rfidReaderSleep) {
922
+ if (!nextProps.rfidReaderSleep) {
923
+ this._startWork();
924
+ } else {
925
+ this._stopWork();
926
+ }
927
+ }
928
+ return true;
929
+ }
930
+ render() {
931
+ const props = this.props;
932
+ const _a = props, { onRfidScan = blankFunc$2, autoRfidScan } = _a, opts = __objRest(_a, ["onRfidScan", "autoRfidScan"]);
933
+ return /* @__PURE__ */ React__default.createElement(BaseLayoutContainer, __spreadValues({}, opts));
934
+ }
935
+ }
936
+ __publicField(RfidOnce, "defaultProps", {
937
+ rfidReaderSleep: false
938
+ });
939
+ const blankFunc$1 = () => {
940
+ };
941
+ class BarcodeScan extends React__default.Component {
942
+ constructor(props) {
943
+ super(props);
944
+ this._barcodeBeginScan = false;
945
+ this._handleBarcodeScan = (e) => {
946
+ const { onBarcodeScan } = this.props;
947
+ this._stopWork();
948
+ onBarcodeScan(e.param);
949
+ };
950
+ this._startWork = (e) => {
951
+ document.addEventListener("BarcodeScan", this._handleBarcodeScan);
952
+ this._barcodeBeginScan = true;
953
+ };
954
+ this._stopWork = (e) => {
955
+ document.removeEventListener("BarcodeScan", this._handleBarcodeScan);
956
+ };
957
+ this._handleKeyDown = (e) => {
958
+ const { code, keyCode, key } = e;
959
+ if (code === "F23" || code === "F24") {
960
+ if (!this._barcodeBeginScan) {
961
+ this._startWork();
962
+ }
963
+ }
964
+ };
965
+ this._handleKeyUp = (e) => {
966
+ const { code, keyCode, key } = e;
967
+ if (code === "F23" || code === "F24") {
968
+ this._stopWork();
969
+ this._barcodeBeginScan = false;
970
+ }
971
+ };
972
+ }
973
+ componentDidMount() {
974
+ document.addEventListener("keydown", this._handleKeyDown);
975
+ document.addEventListener("keyup", this._handleKeyUp);
976
+ WindVane.call("WindvanePlugin", "invoke", "{'domain': 'keyboard', 'method': 'changeScanMode', 'params': {'scanMode': 'barcode'}}", function(e) {
977
+ }, function(e) {
978
+ });
979
+ }
980
+ componentWillUnmount() {
981
+ document.removeEventListener("keydown", this._handleKeyDown);
982
+ document.removeEventListener("keyup", this._handleKeyUp);
983
+ }
984
+ render() {
985
+ const props = this.props;
986
+ const _a = props, { onBarcodeScan = blankFunc$1 } = _a, opts = __objRest(_a, ["onBarcodeScan"]);
987
+ return /* @__PURE__ */ React__default.createElement(BaseLayoutContainer, __spreadValues({}, opts));
988
+ }
989
+ }
990
+ class BaseLayout extends React__default.Component {
991
+ constructor(props) {
992
+ super(props);
993
+ }
994
+ render() {
995
+ const props = this.props;
996
+ const { onBarcodeScan, onRfidOnce, onRfidBoxOnce, onRfidPalletOnce, onRfidScan, onRfidBoxScan, onRfidPalletScan } = props;
997
+ if (onRfidOnce || onRfidBoxOnce || onRfidPalletOnce) {
998
+ return /* @__PURE__ */ React__default.createElement(RfidOnce$1, __spreadValues({}, props));
999
+ }
1000
+ if (onRfidScan || onRfidBoxScan || onRfidPalletScan) {
1001
+ return /* @__PURE__ */ React__default.createElement(RfidOnce, __spreadValues({}, props));
1002
+ }
1003
+ if (onBarcodeScan) {
1004
+ return /* @__PURE__ */ React__default.createElement(BarcodeScan, __spreadValues({}, props));
1005
+ }
1006
+ return /* @__PURE__ */ React__default.createElement(BaseLayoutContainer, __spreadValues({}, props));
1007
+ }
1008
+ }
772
1009
  var index$7 = "";
773
1010
  const blankFunc = () => {
774
1011
  };
package/es/style.css CHANGED
@@ -1 +1 @@
1
- *{margin:0;padding:0}div{box-sizing:border-box}.op-overlay{top:0;left:0;position:fixed;width:100vw;height:100vh;display:flex;justify-content:center;align-items:center;background-color:#0006;z-index:100}.op-overlay.center{align-items:center;justify-content:center}.op-overlay.top{align-items:flex-start;justify-content:center}.op-overlay.bottom{align-items:flex-end;justify-content:center}.pda-button{display:block;box-sizing:border-box;padding-right:0;text-align:center;font-size:40px;height:90px;line-height:90px;color:#fff;background-color:#f3f4f8;border-radius:10px;width:100%;border-width:0}.pda-button.pda-button-default{color:#000}.pda-button:active{background-color:#979797}.pda-button.pda-button-primary{background-color:#0091ea}.pda-button.pda-button-primary:active{background-color:#0074bb}.pda-button.pda-button-dark{background-color:#282828}.pda-button.pda-button-dark:active{background-color:#979797}.pda-button.pda-button-cutout{color:#0091ea;border-width:4px;border-color:#0091ea}.button-group{display:flex;flex-direction:row;padding:20px 24px;width:100%}.button-group .pda-button:not(:last-child){margin-right:16px}.pda-header{display:flex;flex-direction:row;align-items:center;color:#fff;height:84px;padding-left:24px;padding-right:24px}.pda-header .pda-goback{background-image:url(https://img.alicdn.com/imgextra/i4/O1CN01O46CYm1Gc4yvZtk7A_!!6000000000642-2-tps-36-64.png);width:18px;height:32px;background-size:100%;margin-left:4px;margin-right:8px}.pda-header .pda-header-icon{height:36px;width:36px;margin-left:16px;background-size:100%}.pda-header .pda-header-icon-scan{background-image:url(https://img.alicdn.com/imgextra/i4/O1CN017UD9RM1vCKxsjxsrE_!!6000000006136-2-tps-68-68.png)}.pda-header .pda-header-icon-select{background-image:url(https://img.alicdn.com/imgextra/i2/O1CN0170QXc91udWriUp19S_!!6000000006060-2-tps-74-72.png)}.pda-header .pda-header-icon-read{background-image:url(https://img.alicdn.com/imgextra/i2/O1CN01EMphgH1ylYGXImCZn_!!6000000006619-2-tps-70-70.png)}.pda-header .pda-title-text{margin-left:16px;font-size:40px}.pda-header .pda-header-more{height:36px;width:36px;background-image:url(https://img.alicdn.com/imgextra/i4/O1CN01dTdXds1p9gz4wKAve_!!6000000005318-2-tps-70-26.png);background-size:100%;background-repeat:no-repeat;background-position:center;margin-left:auto}.pda-header .pda-menus{background-color:#fff;border-radius:8px;width:100%;padding:24px;display:flex;flex-direction:column}.pda-header .pda-menus>*{margin-bottom:12px}.pda-info-card{border-radius:16px;padding:24px 16px;background-color:#fff}.pda-info-card p{margin:0}.pda-info-card .pda-info-card-title-section{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.pda-info-card .pda-info-card-title-section .pda-info-card-title{font-size:32px;color:#666}.pda-info-card .pda-info-card-title-section .pda-info-card-tag{display:flex;align-items:center;justify-content:center;height:36px;padding:0 8px;background-color:#fc0;border-radius:8px}.pda-info-card .pda-info-card-highlight-section{display:flex;flex-direction:row;justify-content:space-between;align-items:flex-start}.pda-info-card .pda-info-card-highlight-section .pda-info-card-title{font-size:32px;color:#666;margin-top:20px}.pda-info-card .pda-info-card-highlight-section .pda-info-card-highlight{font-size:80px;line-height:64px;color:#0091ea;font-weight:bold;display:flex;flex-direction:row;align-items:flex-end}.pda-info-card .pda-info-card-highlight-section .pda-info-card-highlight .pda-info-card-highlight1CN{font-size:64px}.pda-info-card .pda-info-card-highlight-section .pda-info-card-highlight .pda-info-card-highlight2{font-size:50px;line-height:40px}.pda-info-card .pda-info-card-highlight-section .pda-info-card-highlight .pda-info-card-highlight2CN{font-size:40px;line-height:40px}.pda-info-card .pda-info-card-bold{font-weight:bold;font-size:40px;line-height:48px;color:#000;margin-top:12px}.pda-info-card .pda-info-card-list{margin-top:8px;color:#4a4a4a;font-size:32px;line-height:32px;word-break:break-all}.pda-info-card-progress{background-color:#f3f4f8;height:12px;border-radius:6px;margin-top:17px}.pda-info-card-progress .pda-info-card-progress-inside{background-color:#0091ea;height:12px;border-radius:6px}.pda-info-card.pda-info-card-dark{background-color:#000}.pda-info-card.pda-info-card-dark .pda-info-card-title{color:#ffffff60}.pda-info-card.pda-info-card-dark .pda-info-card-highlight{color:#fff}.pda-info-card.pda-info-card-dark .pda-info-card-bold{color:#fff}.pda-info-card.pda-info-card-dark .pda-info-card-list{color:#ffffff60}.pda-list-item{padding:24px 16px;border-radius:16px;position:relative}.pda-list-item p{margin:0}.pda-list-item>p,.pda-list-item>div{margin-bottom:16px}.pda-list-item .pda-listitem-highlight{font-size:40px;line-height:40px;font-weight:bold;color:#fff;display:flex;flex-direction:row;justify-content:space-between}.pda-list-item .pda-listitem-header,.pda-list-item .pda-listitem-state-text,.pda-list-item .pda-listitem-subinfo{font-size:32px;line-height:32px;color:#ffffff60;word-break:break-all}.pda-list-item .pda-listitem-state-block{display:flex;flex-direction:row;flex-wrap:wrap;margin-bottom:0}.pda-list-item .pda-listitem-state-block>div{padding:6px 10px;border-radius:4px;background-color:#0091ea;margin-bottom:12px;margin-right:12px;font-size:24px;line-height:24px}.pda-list-item .pda-listitem-state-block>div.success{background-color:#0f0}.pda-list-item .pda-listitem-state-block>div.warning{background-color:#fc0}.pda-list-item .pda-listitem-state-block>div.error{background-color:red}.pda-list-item .pda-listitem-icon{position:absolute;top:0;right:0;width:60px;height:60px;background-color:#0091ea;border-radius:0 16px;display:flex;justify-content:center;align-items:center}.pda-list-item .listitem-icon-container{background-size:100%;background-repeat:no-repeat;width:16px;height:24px}.pda-list-item .listitem-icon-next{background-image:url(https://img.alicdn.com/imgextra/i4/O1CN01FkZisA1tCg1sj3b6U_!!6000000005866-2-tps-40-58.png)}.confirm-wrap{background:#ffffff;border-radius:6px 6px 0 0;padding:24px 20px;width:100%}.confirm-wrap .confirm-title{font-size:2.4rem;font-weight:700}.confirm-wrap .confirm-message{font-size:2.2rem;margin-bottom:1rem}.confirm-wrap .confirm-sub-message{font-size:2.2rem;margin-bottom:1rem}.confirm-wrap .confirm-btns{display:flex}.confirm-wrap .confirm-btns .confirm-cancel-button{margin-right:2%}.toast-wrap{background:#00FF00;border-radius:6px;padding:10px 15px;width:90%;box-sizing:border-box}.toast-wrap.warning{background-color:#ffcb00}.toast-wrap.error{background-color:red}.toast-wrap .toast-title{font-size:2.4rem;font-weight:700}.toast-wrap .toast-message{font-size:1.9rem}.mini-app-start-page{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100vw;height:100vh}.mini-app-start-page button{padding:.3em 3em;border-radius:6px;border:none;font-size:36px;background-color:#00bdff;color:#fff;margin-top:20px}.mini-app-start-page button:active{transform:scale(.95)}.mini-app-start-page .desc{opacity:.3}.local-debug-side{position:absolute;right:0;bottom:0}.presentation-card{margin:12px;background-color:#fff;border-radius:6px;text-align:center;padding:20px 6px}.presentation-card img{width:50%;height:auto}.presentation-card.transparent{background-color:transparent;color:#fff}.presentation-card .text{margin-top:12px;font-weight:700;font-size:16px}.presentation-card .sub-text{margin-top:6px;font-weight:700;font-size:12px}.android-pda-list .default-item{background-color:#282828;font-size:23.76px;padding:10px;border-radius:6px;color:#fff;margin:5px 0;display:flex;justify-content:space-between;align-items:center}.android-pda-list .default-item:hover,.android-pda-list .default-item:active,.android-pda-list .default-item:focus{background-color:#686868}.android-pda-list .default-item .text{flex:1}.android-pda-list .default-item .sub-text{font-size:80%;opacity:.7}.android-pda-list .default-item .sub-tags{display:flex}.android-pda-list .default-item .sub-tags .sub-tag-item{background-color:#0f0;padding:2px;font-size:60%;margin-right:3px;border-radius:2px;color:#000;line-height:1em}.android-pda-list .default-item .sub-tags .sub-tag-item:first-child{margin-left:0}.android-pda-list .default-item .extra{font-size:80%;opacity:.7}.baselayout-wrapper{height:100%;min-height:100%;display:flex;flex-direction:column;position:absolute;top:0;left:0;right:0;bottom:0}.baselayout-wrapper .baselayout-container{padding:0 24px;overflow-x:auto;flex:1}.baselayout-wrapper .baselayout-footer{padding:16px 0}.wakekeyborard .wakekeyborard-icon{width:80px;height:80px;background-image:url(https://img.alicdn.com/imgextra/i3/O1CN01kxYh3U25Xzr9nAcYp_!!6000000007537-2-tps-240-240.png);background-size:100%;position:fixed;right:24px;bottom:24px}.wakekeyborard .wakekeyborard-overlay{position:fixed;top:0;right:0;left:0;bottom:0;background-color:#dedede33}.wakekeyborard .wakekeyborard-inputbox{display:flex;flex-direction:row;height:85px;position:absolute;bottom:0;left:0;right:0}.wakekeyborard .wakekeyborard-inputbox input{flex:2}.wakekeyborard .wakekeyborard-inputbox button{flex:1}.pda-step-card{display:flex;flex-direction:row}.pda-step-card .pda-step-indictor{display:flex;flex-direction:column;align-items:center;margin-right:16px}.pda-step-card .pda-step-indictor .pda-step-indictor-top{width:1px;background-color:#bec0c6;flex:1}.pda-step-card .pda-step-indictor .pda-step-indictor-top-hidden{background-color:#fff0}.pda-step-card .pda-step-indictor .pda-step-indictor-center{height:24px;width:24px;border-radius:12px;background-color:#bec0c6}.pda-step-card .pda-step-indictor .pda-step-indictor-center-active{background-color:#0091ea}.pda-step-card .pda-step-indictor .pda-step-indictor-bottom{flex:1;width:1px;background-color:#bec0c6}.pda-step-card .pda-step-indictor .pda-step-indictor-bottom-hidden{background-color:#fff0}.pda-step{border-radius:16px;padding:24px 16px;background-color:#fff;margin-bottom:16px}.pda-step p{margin:0}.pda-step .pda-step-title{font-size:60px;color:#0091ea}.pda-step .pda-step-list{margin-top:8px;color:#4a4a4a;font-size:32px;line-height:32px}.pda-step.pda-step-dark{background-color:#000}.pda-step.pda-step-dark .pda-step-title{color:#fff}.pda-step.pda-step-dark .pda-step-list{color:#bec0c6}.pda-finish-card-top{height:100%;display:flex;flex-direction:column;align-items:center;color:#fff}.pda-finish-card-top .pda-finish-card-img{width:100%;margin:100px auto 0}.pda-finish-card-top .pda-finish-card-title{font-size:50px;line-height:45px;color:#fff;font-weight:500;margin-bottom:16px}.pda-finish-card-top .pda-finish-card-list{margin-top:16px;color:#ffffff80;font-size:32px;line-height:30px}.pda-distance-card{border-radius:16px;padding:36px 16px;background-color:#fff}.pda-distance-card p{margin:0;font-size:28px;color:#738399}.pda-distance-card .pda-distance-card-highlight{font-size:60px;line-height:64px;color:#0091ea}.pda-distance-card .pda-distance-indictor{margin-top:36px;display:flex}.pda-distance-card .pda-distance-card-progress{background-color:#ebecf2;height:34px;border-radius:6px;border:4px solid #D9D9D9;margin-top:8px;position:relative}.pda-distance-card .pda-distance-card-progress .pda-distance-card-progress-indictor{position:absolute;bottom:0;left:5px}.pda-distance-card .pda-distance-card-progress .pda-distance-card-progress-inside{background-color:#0091ea;height:26px;border-radius:6px 0 0 6px}.pda-distance-card .pda-distance-label{display:flex;justify-content:space-between}.android-sub-card{background:#282828;border-radius:16px;padding:10px;color:#fff}.android-sub-card .android-sub-card-title-section{display:flex;justify-content:space-between}.android-sub-card .android-sub-card-title-section .android-sub-card-title{opacity:.6;font-size:21.312px}.android-sub-card .android-sub-card-title-section .android-sub-card-tag{margin-bottom:0}.android-sub-card .android-sub-card-title-section .android-sub-card-tag>div{padding:6px 10px;border-radius:4px;background-color:#0091ea;color:#fff;font-size:15.984px;line-height:15.984px}.android-sub-card .android-sub-card-title-section .android-sub-card-tag>div.success{background-color:#0f0}.android-sub-card .android-sub-card-title-section .android-sub-card-tag>div.warning{background-color:#fc0;color:#000}.android-sub-card .android-sub-card-title-section .android-sub-card-tag>div.error{background-color:red}.android-sub-card .android-sub-card-context{font-size:39.6px;margin:-6px 0}.android-sub-card .android-sub-card-name{font-size:26.4px}.android-sub-card .android-sub-card-attrs{opacity:.6;font-size:21.12px}.pda-infinite-scroll{margin-top:10px}.pda-infinite-scroll span{color:#999}.pda-infinite-scroll .pda-infinite-scroll-view{display:flex;align-items:center;justify-content:center}.pda-action-sheet{position:absolute;z-index:1000;width:100%;height:100%;background-color:#00000059}.pda-action-sheet .pda-action-sheet-body{position:absolute;background-color:#fff;z-index:1010;width:100%;bottom:0;left:0;border-radius:9.9px 9.9px 0 0;padding-bottom:10.56px}.pda-action-sheet .pda-action-sheet-body .pda-action-sheet-item{margin:10.56px 15.84px 0;background-color:#f3f4f8;height:54px;display:flex;align-items:center;justify-content:center;font-size:24px;border-radius:9.9px}
1
+ *{margin:0;padding:0}div{box-sizing:border-box}.op-overlay{top:0;left:0;position:fixed;right:0;bottom:0;display:flex;justify-content:center;align-items:center;background-color:#0006;z-index:100}.op-overlay.center{align-items:center;justify-content:center}.op-overlay.top{align-items:flex-start;justify-content:center}.op-overlay.bottom{align-items:flex-end;justify-content:center}.pda-button{display:block;box-sizing:border-box;padding-right:0;text-align:center;font-size:40px;height:90px;line-height:90px;color:#fff;background-color:#f3f4f8;border-radius:10px;width:100%;border-width:0}.pda-button.pda-button-default{color:#000}.pda-button:active{background-color:#979797}.pda-button.pda-button-primary{background-color:#0091ea}.pda-button.pda-button-primary:active{background-color:#0074bb}.pda-button.pda-button-dark{background-color:#282828}.pda-button.pda-button-dark:active{background-color:#979797}.pda-button.pda-button-cutout{color:#0091ea;border-width:4px;border-color:#0091ea}.button-group{display:flex;flex-direction:row;padding:20px 24px;width:100%}.button-group .pda-button:not(:last-child){margin-right:16px}.pda-header{display:flex;flex-direction:row;align-items:center;color:#fff;height:84px;padding-left:24px;padding-right:24px}.pda-header .pda-goback{background-image:url(https://img.alicdn.com/imgextra/i4/O1CN01O46CYm1Gc4yvZtk7A_!!6000000000642-2-tps-36-64.png);width:18px;height:32px;background-size:100%;margin-left:4px;margin-right:8px}.pda-header .pda-header-icon{height:36px;width:36px;margin-left:16px;background-size:100%}.pda-header .pda-header-icon-scan{background-image:url(https://img.alicdn.com/imgextra/i4/O1CN017UD9RM1vCKxsjxsrE_!!6000000006136-2-tps-68-68.png)}.pda-header .pda-header-icon-select{background-image:url(https://img.alicdn.com/imgextra/i2/O1CN0170QXc91udWriUp19S_!!6000000006060-2-tps-74-72.png)}.pda-header .pda-header-icon-read{background-image:url(https://img.alicdn.com/imgextra/i2/O1CN01EMphgH1ylYGXImCZn_!!6000000006619-2-tps-70-70.png)}.pda-header .pda-title-text{margin-left:16px;font-size:40px}.pda-header .pda-header-more{height:36px;width:36px;background-image:url(https://img.alicdn.com/imgextra/i4/O1CN01dTdXds1p9gz4wKAve_!!6000000005318-2-tps-70-26.png);background-size:100%;background-repeat:no-repeat;background-position:center;margin-left:auto}.pda-header .pda-menus{background-color:#fff;border-radius:8px;width:100%;padding:24px;display:flex;flex-direction:column}.pda-header .pda-menus>*{margin-bottom:12px}.pda-info-card{border-radius:16px;padding:24px 16px;background-color:#fff}.pda-info-card p{margin:0}.pda-info-card .pda-info-card-title-section{display:flex;flex-direction:row;justify-content:space-between;align-items:center}.pda-info-card .pda-info-card-title-section .pda-info-card-title{font-size:32px;color:#666}.pda-info-card .pda-info-card-title-section .pda-info-card-tag{display:flex;align-items:center;justify-content:center;height:36px;padding:0 8px;background-color:#fc0;border-radius:8px}.pda-info-card .pda-info-card-highlight-section{display:flex;flex-direction:row;justify-content:space-between;align-items:flex-start}.pda-info-card .pda-info-card-highlight-section .pda-info-card-title{font-size:32px;color:#666;margin-top:20px}.pda-info-card .pda-info-card-highlight-section .pda-info-card-highlight{font-size:80px;line-height:64px;color:#0091ea;font-weight:bold;display:flex;flex-direction:row;align-items:flex-end}.pda-info-card .pda-info-card-highlight-section .pda-info-card-highlight .pda-info-card-highlight1CN{font-size:64px}.pda-info-card .pda-info-card-highlight-section .pda-info-card-highlight .pda-info-card-highlight2{font-size:50px;line-height:40px}.pda-info-card .pda-info-card-highlight-section .pda-info-card-highlight .pda-info-card-highlight2CN{font-size:40px;line-height:40px}.pda-info-card .pda-info-card-bold{font-weight:bold;font-size:40px;line-height:48px;color:#000;margin-top:12px}.pda-info-card .pda-info-card-list{margin-top:8px;color:#4a4a4a;font-size:32px;line-height:32px;word-break:break-all}.pda-info-card-progress{background-color:#f3f4f8;height:12px;border-radius:6px;margin-top:17px}.pda-info-card-progress .pda-info-card-progress-inside{background-color:#0091ea;height:12px;border-radius:6px}.pda-info-card.pda-info-card-dark{background-color:#000}.pda-info-card.pda-info-card-dark .pda-info-card-title{color:#ffffff60}.pda-info-card.pda-info-card-dark .pda-info-card-highlight{color:#fff}.pda-info-card.pda-info-card-dark .pda-info-card-bold{color:#fff}.pda-info-card.pda-info-card-dark .pda-info-card-list{color:#ffffff60}.pda-list-item{padding:24px 16px;border-radius:16px;position:relative}.pda-list-item p{margin:0}.pda-list-item>p,.pda-list-item>div{margin-bottom:16px}.pda-list-item .pda-listitem-highlight{font-size:40px;line-height:40px;font-weight:bold;color:#fff;display:flex;flex-direction:row;justify-content:space-between}.pda-list-item .pda-listitem-header,.pda-list-item .pda-listitem-state-text,.pda-list-item .pda-listitem-subinfo{font-size:32px;line-height:32px;color:#ffffff60;word-break:break-all}.pda-list-item .pda-listitem-state-block{display:flex;flex-direction:row;flex-wrap:wrap;margin-bottom:0}.pda-list-item .pda-listitem-state-block>div{padding:6px 10px;border-radius:4px;background-color:#0091ea;margin-bottom:12px;margin-right:12px;font-size:24px;line-height:24px}.pda-list-item .pda-listitem-state-block>div.success{background-color:#0f0}.pda-list-item .pda-listitem-state-block>div.warning{background-color:#fc0}.pda-list-item .pda-listitem-state-block>div.error{background-color:red}.pda-list-item .pda-listitem-icon{position:absolute;top:0;right:0;width:60px;height:60px;background-color:#0091ea;border-radius:0 16px;display:flex;justify-content:center;align-items:center}.pda-list-item .listitem-icon-container{background-size:100%;background-repeat:no-repeat;width:16px;height:24px}.pda-list-item .listitem-icon-next{background-image:url(https://img.alicdn.com/imgextra/i4/O1CN01FkZisA1tCg1sj3b6U_!!6000000005866-2-tps-40-58.png)}.confirm-wrap{background:#ffffff;border-radius:6px 6px 0 0;padding:24px 20px;width:100%}.confirm-wrap .confirm-title{font-size:2.4rem;font-weight:700}.confirm-wrap .confirm-message{font-size:2.2rem;margin-bottom:1rem}.confirm-wrap .confirm-sub-message{font-size:2.2rem;margin-bottom:1rem}.confirm-wrap .confirm-btns{display:flex}.confirm-wrap .confirm-btns .confirm-cancel-button{margin-right:2%}.confirm-wrap.confirm-warning{background-color:red}.confirm-wrap.confirm-warning .pda-button{background-color:transparent;color:#000;border:2px solid black;border-radius:40px}.toast-wrap{background:#00FF00;border-radius:6px;padding:10px 15px;width:90%;box-sizing:border-box}.toast-wrap.warning{background-color:#ffcb00}.toast-wrap.error{background-color:red}.toast-wrap .toast-title{font-size:2.4rem;font-weight:700}.toast-wrap .toast-message{font-size:1.9rem}.mini-app-start-page{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100vw;height:100vh}.mini-app-start-page button{padding:.3em 3em;border-radius:6px;border:none;font-size:36px;background-color:#00bdff;color:#fff;margin-top:20px}.mini-app-start-page button:active{transform:scale(.95)}.mini-app-start-page .desc{opacity:.3}.local-debug-side{position:absolute;right:0;bottom:0}.presentation-card{margin:12px;background-color:#fff;border-radius:6px;text-align:center;padding:20px 6px}.presentation-card img{width:50%;height:auto}.presentation-card.transparent{background-color:transparent;color:#fff}.presentation-card .text{margin-top:12px;font-weight:700;font-size:16px}.presentation-card .sub-text{margin-top:6px;font-weight:700;font-size:12px}.android-pda-list .default-item{background-color:#282828;font-size:23.76px;padding:10px;border-radius:6px;color:#fff;margin:5px 0;display:flex;justify-content:space-between;align-items:center}.android-pda-list .default-item:hover,.android-pda-list .default-item:active,.android-pda-list .default-item:focus{background-color:#686868}.android-pda-list .default-item .text{flex:1}.android-pda-list .default-item .sub-text{font-size:80%;opacity:.7}.android-pda-list .default-item .sub-tags{display:flex}.android-pda-list .default-item .sub-tags .sub-tag-item{background-color:#0f0;padding:2px;font-size:60%;margin-right:3px;border-radius:2px;color:#000;line-height:1em}.android-pda-list .default-item .sub-tags .sub-tag-item:first-child{margin-left:0}.android-pda-list .default-item .extra{font-size:80%;opacity:.7}.baselayout-wrapper{height:100%;min-height:100%;display:flex;flex-direction:column;position:absolute;top:0;left:0;right:0;bottom:0}.baselayout-wrapper .baselayout-container{padding:0 24px;overflow-x:auto;flex:1}.baselayout-wrapper .baselayout-footer{padding:16px 0}.wakekeyborard .wakekeyborard-icon{width:80px;height:80px;background-image:url(https://img.alicdn.com/imgextra/i3/O1CN01kxYh3U25Xzr9nAcYp_!!6000000007537-2-tps-240-240.png);background-size:100%;position:fixed;right:24px;bottom:24px}.wakekeyborard .wakekeyborard-overlay{position:fixed;top:0;right:0;left:0;bottom:0;background-color:#dedede33}.wakekeyborard .wakekeyborard-inputbox{display:flex;flex-direction:row;height:85px;position:absolute;bottom:0;left:0;right:0}.wakekeyborard .wakekeyborard-inputbox input{flex:2}.wakekeyborard .wakekeyborard-inputbox button{flex:1}.pda-step-card{display:flex;flex-direction:row}.pda-step-card .pda-step-indictor{display:flex;flex-direction:column;align-items:center;margin-right:16px}.pda-step-card .pda-step-indictor .pda-step-indictor-top{width:1px;background-color:#bec0c6;flex:1}.pda-step-card .pda-step-indictor .pda-step-indictor-top-hidden{background-color:#fff0}.pda-step-card .pda-step-indictor .pda-step-indictor-center{height:24px;width:24px;border-radius:12px;background-color:#bec0c6}.pda-step-card .pda-step-indictor .pda-step-indictor-center-active{background-color:#0091ea}.pda-step-card .pda-step-indictor .pda-step-indictor-bottom{flex:1;width:1px;background-color:#bec0c6}.pda-step-card .pda-step-indictor .pda-step-indictor-bottom-hidden{background-color:#fff0}.pda-step{border-radius:16px;padding:24px 16px;background-color:#fff;margin-bottom:16px}.pda-step p{margin:0}.pda-step .pda-step-title{font-size:60px;color:#0091ea}.pda-step .pda-step-list{margin-top:8px;color:#4a4a4a;font-size:32px;line-height:32px}.pda-step.pda-step-dark{background-color:#000}.pda-step.pda-step-dark .pda-step-title{color:#fff}.pda-step.pda-step-dark .pda-step-list{color:#bec0c6}.pda-finish-card-top{height:100%;display:flex;flex-direction:column;align-items:center;color:#fff}.pda-finish-card-top .pda-finish-card-img{width:100%;margin:100px auto 0}.pda-finish-card-top .pda-finish-card-title{font-size:50px;line-height:45px;color:#fff;font-weight:500;margin-bottom:16px}.pda-finish-card-top .pda-finish-card-list{margin-top:16px;color:#ffffff80;font-size:32px;line-height:30px}.pda-distance-card{border-radius:16px;padding:36px 16px;background-color:#fff}.pda-distance-card p{margin:0;font-size:28px;color:#738399}.pda-distance-card .pda-distance-card-highlight{font-size:60px;line-height:64px;color:#0091ea}.pda-distance-card .pda-distance-indictor{margin-top:36px;display:flex}.pda-distance-card .pda-distance-card-progress{background-color:#ebecf2;height:34px;border-radius:6px;border:4px solid #D9D9D9;margin-top:8px;position:relative}.pda-distance-card .pda-distance-card-progress .pda-distance-card-progress-indictor{position:absolute;bottom:0;left:5px}.pda-distance-card .pda-distance-card-progress .pda-distance-card-progress-inside{background-color:#0091ea;height:26px;border-radius:6px 0 0 6px}.pda-distance-card .pda-distance-label{display:flex;justify-content:space-between}.android-sub-card{background:#282828;border-radius:16px;padding:10px;color:#fff}.android-sub-card .android-sub-card-title-section{display:flex;justify-content:space-between}.android-sub-card .android-sub-card-title-section .android-sub-card-title{opacity:.6;font-size:21.312px}.android-sub-card .android-sub-card-title-section .android-sub-card-tag{margin-bottom:0}.android-sub-card .android-sub-card-title-section .android-sub-card-tag>div{padding:6px 10px;border-radius:4px;background-color:#0091ea;color:#fff;font-size:15.984px;line-height:15.984px}.android-sub-card .android-sub-card-title-section .android-sub-card-tag>div.success{background-color:#0f0}.android-sub-card .android-sub-card-title-section .android-sub-card-tag>div.warning{background-color:#fc0;color:#000}.android-sub-card .android-sub-card-title-section .android-sub-card-tag>div.error{background-color:red}.android-sub-card .android-sub-card-context{font-size:39.6px;margin:-6px 0}.android-sub-card .android-sub-card-name{font-size:26.4px}.android-sub-card .android-sub-card-attrs{opacity:.6;font-size:21.12px}.pda-infinite-scroll{margin-top:10px}.pda-infinite-scroll span{color:#999}.pda-infinite-scroll .pda-infinite-scroll-view{display:flex;align-items:center;justify-content:center}.pda-action-sheet{position:absolute;z-index:1000;width:100%;height:100%;background-color:#00000059}.pda-action-sheet .pda-action-sheet-body{position:absolute;background-color:#fff;z-index:1010;width:100%;bottom:0;left:0;border-radius:9.9px 9.9px 0 0;padding-bottom:10.56px}.pda-action-sheet .pda-action-sheet-body .pda-action-sheet-item{margin:10.56px 15.84px 0;background-color:#f3f4f8;height:54px;display:flex;align-items:center;justify-content:center;font-size:24px;border-radius:9.9px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cniot/android-pda-components",
3
- "version": "0.0.23",
3
+ "version": "0.0.27",
4
4
  "description": "",
5
5
  "main": "./es/index.cjs.js",
6
6
  "module": "./es/index.es.js",
@@ -28,7 +28,10 @@
28
28
  <!-- @cniot/pageflow 指令 end -->
29
29
 
30
30
  <!-- 自定义页面 start -->
31
+ <function name = "index" action="router" page="/pages/index" />
31
32
  <function name = "scanContainer" action="router" page="/pages/scanContainer" />
33
+ <function name = "rfidOnce" action="router" page="/pages/rfidOnce" />
34
+ <function name = "rfidScan" action="router" page="/pages/rfidScan" />
32
35
  <function name = "continuousRfidScan" action="router" page="/pages/continuousRfidScan" />
33
36
  <function name = "success" action="router" page="/pages/success" />
34
37
  <!-- 自定义页面 end -->
@@ -41,26 +41,23 @@ var flow = Flow();
41
41
  // });
42
42
 
43
43
  flow.push('index', function(data, flow) {
44
- var ret = pageFlow.scanContainer({
44
+ var ret = pageFlow.index({
45
45
 
46
46
  })
47
47
  var code = ret.code;
48
48
  pageFlow.log(ret);
49
- // if(String(code) === 'continuousRfidScan') {
50
- // // pageFlow.log({in: 'continuousRfidScan', code: code});
51
- // // 分支1
52
- // return flow.get('continuousRfidScan', {})
53
- // }
54
- // if(String(code) === 'success') {
55
- // // pageFlow.log({in: 'success', code: code});
56
- // // 分支2
57
- // return flow.get('success', {})
58
- // }
59
49
  if(code === 0) {
60
50
  pageFlow.log({in: 'continuousRfidScan', code: code});
61
51
  // 分支1
62
52
  return flow.get('continuousRfidScan', {})
63
53
  }
54
+ if(String(code) === 'rfidOnce') {
55
+ return flow.get('rfidOnce', {})
56
+ }
57
+ if(String(code) === 'rfidScan') {
58
+ return flow.get('rfidScan', {})
59
+ }
60
+
64
61
  if(code === 1) {
65
62
  pageFlow.log({in: 'success', code: code});
66
63
  // 分支2
@@ -70,37 +67,33 @@ flow.push('index', function(data, flow) {
70
67
  return {}
71
68
  });
72
69
 
73
- // flow.push('pageName', function(data, flow) {
74
- // var res = linkdo();
75
- // if(!res.true) {
76
- // new Error('xxx 接口请求错误')
77
- // }
78
- // var ret = pageFlow.page({
79
- // // page data
80
- // })
81
- // var code = ret.code;
82
-
83
- // if(code === -1) {
84
- // return flow.back();
85
- // }
86
- // if(code === 0) {
87
- // // 错误处理
88
- // }
89
- // if(String(code) === 'fenzhi1') {
90
- // // pageFlow.log({in: 'success', code: code});
91
- // // 分支1
92
- // return flow.get('fenzhi1', {})
93
- // }
94
-
95
- // // 默认按照 push 流程走
96
- // return {}
97
- // })
98
70
 
99
71
  flow.push('continuousRfidScan', function(data, flow) {
100
72
  var ret = pageFlow.continuousRfidScan({
101
73
 
102
74
  })
103
75
  })
76
+
77
+ flow.push('rfidOnce', function(data, flow) {
78
+ var ret = pageFlow.rfidOnce({
79
+
80
+ })
81
+
82
+ const code = ret.code;
83
+ if(code === -1) {
84
+ return flow.back({});
85
+ }
86
+ })
87
+ flow.push('rfidScan', function(data, flow) {
88
+ var ret = pageFlow.rfidScan({
89
+
90
+ })
91
+ const code = ret.code;
92
+ if(code === -1) {
93
+ return flow.back({});
94
+ }
95
+ })
96
+
104
97
  flow.push('success', function(data, flow) {
105
98
  // pageFlow.log({render: 'success'});
106
99
  var ret = pageFlow.success({
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, {useState, useEffect} from "react";
2
2
  import "./index.less";
3
3
  // import { Title, BaseLayout, Button, Presentation, WakeKeyborard } from '@cniot/android-pda-components'
4
4
  import { Title, BaseLayout, Button, Presentation, WakeKeyborard } from '../../../../../packages'
@@ -10,35 +10,34 @@ import { Title, BaseLayout, Button, Presentation, WakeKeyborard } from '../../..
10
10
  */
11
11
  export default function (props) {
12
12
  const { data, service, isActive } = props;
13
+ const [barcode, setBarcode] = useState('')
13
14
 
14
- const header = <Title></Title>;
15
+ const header = <Title goBackHandle={e => {console.log('hhhhhh')}}></Title>;
15
16
  const footer = (
16
17
  <Button.Group>
17
- <Button type="cutout" onClick={e => service.onNext({code: 0, data: {}})}>连扫</Button>
18
+ <Button type="cutout" onClick={e => service.onNext({code: 'rfidOnce', data: {}})}>Rfid单次</Button>
18
19
  <Button
19
20
  type="primary"
20
21
  onClick={e => {
21
- WindVane.call('WindvanePlugin', 'invoke', "{'domain': 'rfid', 'method': 'startScanOnce', 'params':null}", function(e) {
22
- console.log(e);
23
- service.onNext({code: 1, data: e.data})
24
- }, function(e) {
25
- alert('failure ' + JSON.stringify(e));
26
- });
22
+ service.onNext({code: 'rfidScan', data: {}});
27
23
  }
28
- }>单次</Button>
24
+ }>Rfid连续</Button>
29
25
  </Button.Group>
30
26
  )
31
27
  return (
32
28
  <BaseLayout
33
29
  header={header}
34
30
  footer={footer}
35
- onScan={
36
- e => {
37
- alert('scan key down');
31
+ onBarcodeScan = {
32
+ data => {
33
+ console.log('barcode scan');
34
+ console.log(data);
35
+ setBarcode(data.scanData)
38
36
  }
39
37
  }
40
38
  >
41
39
  <Presentation text="请靠近箱码进行识别" ></Presentation>
40
+ <p style={{color: 'white'}}>barcode: {barcode}</p>
42
41
  <WakeKeyborard
43
42
  onWakeKeyboard={() => { console.log('wake keyboard') }}
44
43
  onClick={v => { alert(v) }}
@@ -10,52 +10,48 @@ import { Title, BaseLayout, Button, Presentation, WakeKeyborard } from '../../..
10
10
  */
11
11
  export default function (props) {
12
12
  const { data, service, isActive } = props;
13
- const [rfidList, setRfidList] = useState([]);
14
- const [scanning, setScanning] = useState(true)
13
+ const [rfid, setRfid] = useState('')
14
+ const [box, setBox] = useState('')
15
15
 
16
- const header = <Title></Title>;
16
+ const header = <Title goBackHandle={e => { service.onNext({code: -1, data: {}}) }}></Title>;
17
17
  const footer = (
18
18
  <Button.Group>
19
19
  <Button
20
20
  type="cutout"
21
+ onClick={
22
+ e => {
23
+
24
+ }
25
+ }>连扫</Button>
26
+ <Button
27
+ type="primary"
21
28
  onClick={e => {
22
- setScanning(!scanning);
23
- }}
24
- >{scanning ? '暂停' : '开始'}</Button>
25
- <Button type="primary" onClick={e => service.onNext({code: '', data: {}})}>完成</Button>
29
+ }
30
+ }>完成</Button>
26
31
  </Button.Group>
27
32
  )
28
33
  return (
29
34
  <BaseLayout
30
35
  header={header}
31
36
  footer={footer}
32
- continuousRfidScan={scanning}
33
- onRfidScan={
37
+ onRfidBoxOnce= {
34
38
  data => {
35
- // console.log(data);
36
- setRfidList(data.rfidHistory);
39
+ setBox(data.rfidData);
37
40
  }
38
41
  }
39
- onScan={
40
- e => {
41
- alert('scan key down');
42
+ onRfidOnce={
43
+ data => {
44
+ setRfid(data.rfidData);
42
45
  }
43
46
  }
44
47
  >
45
- <Presentation image={Presentation.IMAGE_4} text="请靠近纸箱" subText="开始识别" transparent={true}></Presentation>
48
+ <Presentation text="请靠近箱码进行识别" ></Presentation>
49
+ <p style={{color: 'white'}}>rfid: {rfid}</p>
50
+ <p style={{color: 'white'}}>box: {box}</p>
46
51
  <WakeKeyborard
47
52
  onWakeKeyboard={() => { console.log('wake keyboard') }}
48
53
  onClick={v => { alert(v) }}
49
54
  />
50
- {
51
- <div>
52
- {
53
- rfidList.map((item, index) => {
54
- return <p key={index} style={{color: 'white'}}>{item}</p>
55
- })
56
- }
57
- </div>
58
- }
59
55
  </BaseLayout>
60
56
  )
61
57
  }