Compare commits
810 Commits
master
...
hella_onli
Author | SHA1 | Date |
---|---|---|
|
b6692a8325 | 6 months ago |
|
24fe84795c | 6 months ago |
|
4482bffe6b | 6 months ago |
|
513e2da8a9 | 6 months ago |
|
c43c338668 | 6 months ago |
|
c633d46ed9 | 6 months ago |
|
50d3e76522 | 6 months ago |
|
1df4f61591 | 6 months ago |
|
f5e31ee1e5 | 6 months ago |
|
7b9c272f20 | 6 months ago |
|
87aa66567e | 6 months ago |
|
e08a8ae336 | 6 months ago |
|
8b45890360 | 6 months ago |
|
994d1ca168 | 6 months ago |
|
eb63ed4f5e | 6 months ago |
|
b1ef7583bb | 6 months ago |
|
4495ad99bf | 6 months ago |
|
d8bb622a72 | 6 months ago |
|
6172e62b33 | 6 months ago |
|
22e34028d2 | 6 months ago |
|
1c11e4ea0b | 6 months ago |
|
93508acd61 | 6 months ago |
|
d656c643eb | 6 months ago |
|
895bf6c855 | 6 months ago |
|
36fe6cb120 | 6 months ago |
|
0f194e6870 | 6 months ago |
|
53a5156037 | 6 months ago |
|
df6cf1ff23 | 6 months ago |
|
ca3dc72b15 | 6 months ago |
|
330128d328 | 6 months ago |
|
2f5d6c0e84 | 6 months ago |
|
fdcf2ab346 | 6 months ago |
|
d097282c73 | 6 months ago |
|
658da25bcb | 6 months ago |
|
9e6e5b799d | 6 months ago |
|
1c1628290c | 6 months ago |
|
7b5f7f91d4 | 6 months ago |
|
c8727798e2 | 6 months ago |
|
8b7c4acc0f | 6 months ago |
|
a13c98f018 | 6 months ago |
|
d88bdff7c5 | 6 months ago |
|
6bbef5511c | 6 months ago |
|
7ac7b1b8a3 | 6 months ago |
|
ff475dc920 | 6 months ago |
|
e3659c8500 | 6 months ago |
|
a219065216 | 6 months ago |
|
0838194993 | 6 months ago |
|
6936ef7611 | 6 months ago |
|
3aef9849c9 | 6 months ago |
|
1a1c9874a2 | 6 months ago |
|
b3cc6cf0e8 | 6 months ago |
|
340f99514c | 6 months ago |
|
b75a0bb9a8 | 6 months ago |
|
42e5dc42ea | 6 months ago |
|
cb15c0cf5d | 6 months ago |
|
a3c4e52f0d | 6 months ago |
|
31710c05bc | 6 months ago |
|
1e82452cf9 | 6 months ago |
|
23c50409f4 | 6 months ago |
|
61d96a6582 | 6 months ago |
|
110767de2a | 6 months ago |
|
908af99949 | 6 months ago |
|
7113fa4c29 | 6 months ago |
|
06bc901945 | 6 months ago |
|
59f793ebc0 | 6 months ago |
|
22d90fa4c1 | 6 months ago |
|
14061c3dc9 | 6 months ago |
|
2fb8148b9f | 6 months ago |
|
9eb9161274 | 6 months ago |
|
b21fbc2f76 | 6 months ago |
|
6e1ba14992 | 6 months ago |
|
6c59175d87 | 6 months ago |
|
87538b9e03 | 6 months ago |
|
6e36f0d4c1 | 6 months ago |
|
be34c04d36 | 6 months ago |
|
72c471f366 | 6 months ago |
|
a6c5e6eff5 | 6 months ago |
|
e18ff3f478 | 6 months ago |
|
ba7690e089 | 6 months ago |
|
b74b62c827 | 6 months ago |
|
686a10f682 | 6 months ago |
|
776ffd16b1 | 6 months ago |
|
12f8e803a5 | 6 months ago |
|
eae8993265 | 6 months ago |
|
c23b7e763d | 6 months ago |
|
33752bccdf | 6 months ago |
|
75599d2de2 | 6 months ago |
|
aa5e7822b5 | 6 months ago |
|
1395fb7523 | 6 months ago |
|
dda8f76fd5 | 6 months ago |
|
898276b3c3 | 6 months ago |
|
e9ed633dd0 | 6 months ago |
|
68ebff7d5a | 6 months ago |
|
069cad56cc | 6 months ago |
|
efa494646a | 6 months ago |
|
354132d81a | 6 months ago |
|
ac9da76b5b | 6 months ago |
|
c078fb5ca1 | 6 months ago |
|
2cb797443d | 6 months ago |
|
85dff3ceb5 | 6 months ago |
|
8b10e9feab | 6 months ago |
|
95ccec7137 | 6 months ago |
|
659fcccfa6 | 6 months ago |
|
9fa8cef3f7 | 6 months ago |
|
7544da2ee9 | 6 months ago |
|
52ab0f3c8c | 6 months ago |
|
082cd2658a | 6 months ago |
|
06f67bc481 | 6 months ago |
|
ab395f1498 | 6 months ago |
|
16fa4a2516 | 6 months ago |
|
c1952deaf1 | 6 months ago |
|
a0b86df6ac | 6 months ago |
|
edd078a40f | 6 months ago |
|
bf836b13f5 | 6 months ago |
|
89d63b84aa | 6 months ago |
|
01063ee217 | 6 months ago |
|
77ffbfaa87 | 6 months ago |
|
64035597b5 | 6 months ago |
|
045e7dbed6 | 6 months ago |
|
66bf11b1ad | 6 months ago |
|
fdd13cfb7f | 6 months ago |
|
da277ea4e3 | 6 months ago |
|
5f7d5c99cf | 6 months ago |
|
e53f0f2305 | 6 months ago |
|
aa24a51d04 | 6 months ago |
|
249c4f86e8 | 6 months ago |
|
0bf35b1c5b | 6 months ago |
|
be5db4daa2 | 6 months ago |
|
2b7189011c | 6 months ago |
|
2adcb664b0 | 6 months ago |
|
a08835663f | 6 months ago |
|
f0f1ae3784 | 6 months ago |
|
6a3ce8cbeb | 6 months ago |
|
2ea7adafb1 | 6 months ago |
|
07e193f3e2 | 6 months ago |
|
cc1840e913 | 6 months ago |
|
281c52e21a | 6 months ago |
|
54c16fcd37 | 6 months ago |
|
0aa7c71af5 | 6 months ago |
|
4ee3560350 | 6 months ago |
|
9815f5fea1 | 6 months ago |
|
03c18d18d5 | 6 months ago |
|
cd78dae974 | 6 months ago |
|
89e4ee684a | 6 months ago |
|
6d36ca4061 | 6 months ago |
|
a564a0d7a8 | 6 months ago |
|
e48b95f16e | 6 months ago |
|
508588531f | 6 months ago |
|
fa4db3face | 6 months ago |
|
be5c719210 | 6 months ago |
|
8682596e8d | 6 months ago |
|
0d746ef993 | 6 months ago |
|
455ef36364 | 6 months ago |
|
5fb50d500f | 6 months ago |
|
1def4a9f0a | 6 months ago |
|
fd44a8f5ae | 6 months ago |
|
ac40331586 | 6 months ago |
|
10a9374db3 | 6 months ago |
|
f46c669c99 | 6 months ago |
|
dce1cbea29 | 6 months ago |
|
90599b48a0 | 6 months ago |
|
ff3a0a854d | 6 months ago |
|
214ee581a9 | 6 months ago |
|
807f478822 | 6 months ago |
|
c5f600bdb6 | 6 months ago |
|
c51559a5a7 | 6 months ago |
|
282ffac8ff | 6 months ago |
|
51dfc46bd4 | 6 months ago |
|
164325490a | 6 months ago |
|
f1e08fae23 | 6 months ago |
|
4c656ca31a | 6 months ago |
|
aaf46bd33d | 6 months ago |
|
b2e89e01b4 | 6 months ago |
|
c60d94dccb | 6 months ago |
|
a1f3fee1fe | 6 months ago |
|
4679fc2ec2 | 6 months ago |
|
c534b06d4c | 6 months ago |
|
dcc474f523 | 6 months ago |
|
5faae71e92 | 6 months ago |
|
e5e6fccc49 | 6 months ago |
|
0207d68575 | 6 months ago |
|
15420552bd | 6 months ago |
|
79c34eec7a | 6 months ago |
|
babf49cebf | 6 months ago |
|
9671661e04 | 6 months ago |
|
c2f5c47a1b | 6 months ago |
|
099cbf2c5e | 6 months ago |
|
fedf07772c | 6 months ago |
|
37f0fa259c | 6 months ago |
|
b929adb42e | 6 months ago |
|
f845bd9c8a | 6 months ago |
|
472ce7a8d5 | 6 months ago |
|
6e9e4c67c1 | 6 months ago |
|
623bc18fae | 6 months ago |
|
04ff62bd8e | 6 months ago |
|
c5a2c30498 | 6 months ago |
|
53a6c55676 | 6 months ago |
|
3e058c3aa1 | 6 months ago |
|
f025ee1d49 | 6 months ago |
|
d1dbad5380 | 6 months ago |
|
8efe269405 | 6 months ago |
|
34a71dc87f | 6 months ago |
|
2bcdac813c | 6 months ago |
|
b47b4dc384 | 6 months ago |
|
932b27d238 | 6 months ago |
|
14952117a8 | 6 months ago |
|
e0b42908d5 | 6 months ago |
|
d0f3957afb | 6 months ago |
|
35074a7896 | 6 months ago |
|
4bc8223f6e | 6 months ago |
|
03a1108523 | 6 months ago |
|
55434c535c | 6 months ago |
|
34dcffe6f6 | 6 months ago |
|
07ae61e8e5 | 6 months ago |
|
dca73faa4c | 6 months ago |
|
e5dc3c7e07 | 6 months ago |
|
bb339f4a04 | 6 months ago |
|
00c7142435 | 6 months ago |
|
d119803e64 | 6 months ago |
|
86c0d3a6d4 | 6 months ago |
|
ddb9e59c40 | 6 months ago |
|
852687bece | 6 months ago |
|
a53ea32abc | 6 months ago |
|
11d164628a | 6 months ago |
|
1f5b93e8df | 6 months ago |
|
4853bc97c7 | 6 months ago |
|
e2a212e442 | 6 months ago |
|
52ac426659 | 6 months ago |
|
91aa7c9eec | 6 months ago |
|
1b8105506f | 6 months ago |
|
ac00e4b979 | 6 months ago |
|
346ff7dadd | 6 months ago |
|
428c493a25 | 6 months ago |
|
ce637b31fe | 6 months ago |
|
f3f9c2207c | 6 months ago |
|
9d76e00b8a | 6 months ago |
|
8ec07d581c | 6 months ago |
|
fea084033a | 6 months ago |
|
6671b9a75b | 6 months ago |
|
8a53754329 | 6 months ago |
|
922bb7898b | 6 months ago |
|
90f3569ec2 | 6 months ago |
|
0c579789f3 | 6 months ago |
|
9861e328fe | 6 months ago |
|
3c8f4bf5f8 | 6 months ago |
|
57e3bfcd0b | 6 months ago |
|
9aa14a8bee | 6 months ago |
|
9a8a293424 | 6 months ago |
|
2eb864f2fc | 6 months ago |
|
1f3ce1388e | 6 months ago |
|
290e97ccdb | 6 months ago |
|
0b42c5eb4d | 6 months ago |
|
4088c602ed | 6 months ago |
|
5cbf9f019e | 6 months ago |
|
dd565c0380 | 6 months ago |
|
085868a42b | 6 months ago |
|
25583aabeb | 6 months ago |
|
15e3754fbd | 6 months ago |
|
7b47169780 | 6 months ago |
|
0995886427 | 6 months ago |
|
720ccb7be8 | 6 months ago |
|
f196c2c4e8 | 6 months ago |
|
13daee251d | 6 months ago |
|
9df39f73b2 | 6 months ago |
|
bee9f31488 | 6 months ago |
|
e9d797c27a | 6 months ago |
|
c32137458e | 6 months ago |
|
dd36693b2d | 6 months ago |
|
f82bdf95ed | 6 months ago |
|
51f7882f62 | 6 months ago |
|
855bda3c75 | 6 months ago |
|
76b0811241 | 6 months ago |
|
aabb5b1df3 | 6 months ago |
|
e118fa142e | 6 months ago |
|
bb06d9c95c | 6 months ago |
|
2c7a88ee40 | 6 months ago |
|
d696ee447b | 6 months ago |
|
c77aa345cf | 6 months ago |
|
11d21d4b13 | 6 months ago |
|
7ed4ff1de0 | 6 months ago |
|
452761d2b8 | 6 months ago |
|
685921703b | 6 months ago |
|
44db15d865 | 6 months ago |
|
2e1b4bb68f | 6 months ago |
|
d95b0fc036 | 6 months ago |
|
5a42a54da9 | 6 months ago |
|
44868c10d6 | 6 months ago |
|
36a20a84e0 | 6 months ago |
|
2614e0bb49 | 6 months ago |
|
513ec5a63a | 6 months ago |
|
d3d6259971 | 6 months ago |
|
bb35c27145 | 6 months ago |
|
df70ee395f | 6 months ago |
|
f8cbd6cfad | 6 months ago |
|
d3d7a4db9b | 6 months ago |
|
c22abb2f8d | 6 months ago |
|
bb845c1493 | 6 months ago |
|
2948094bbe | 6 months ago |
|
a1c0a8f9de | 6 months ago |
|
0543304083 | 6 months ago |
|
19ad1242fa | 6 months ago |
|
72b487b66e | 6 months ago |
|
db6d9ffcd4 | 6 months ago |
|
b73c058e7f | 6 months ago |
|
8819121a61 | 6 months ago |
|
ed8ce17a22 | 6 months ago |
|
e42e1a825d | 6 months ago |
|
f552b6b67a | 6 months ago |
|
d577fd4469 | 6 months ago |
|
d65b7cfdc4 | 6 months ago |
|
1f01056843 | 6 months ago |
|
2e8244cde7 | 6 months ago |
|
ec4b1771a8 | 6 months ago |
|
3ed8961d9c | 6 months ago |
|
cb06a3ef47 | 6 months ago |
|
0f4ba9cb62 | 7 months ago |
|
a30a16f320 | 7 months ago |
|
6d33f3722f | 7 months ago |
|
0f33a08905 | 7 months ago |
|
cd29b1bc4d | 7 months ago |
|
b87b91a85e | 7 months ago |
|
5b7c9b365d | 7 months ago |
|
d3ecd8699a | 7 months ago |
|
f95dd9aec1 | 7 months ago |
|
0a7efcc351 | 7 months ago |
|
c6c7a03dfa | 7 months ago |
|
8d7072a3d9 | 7 months ago |
|
f80e546e98 | 7 months ago |
|
eb362df030 | 7 months ago |
|
8f4abc38f9 | 7 months ago |
|
e041b06fc3 | 7 months ago |
|
3a3f01d6a8 | 7 months ago |
|
8f350d3462 | 7 months ago |
|
ad21ba9d38 | 7 months ago |
|
5f0de76cb8 | 7 months ago |
|
08a08b6975 | 7 months ago |
|
0676d819e4 | 7 months ago |
|
0eee8c8c60 | 7 months ago |
|
0e906a58a3 | 7 months ago |
|
ae70a4e6d5 | 7 months ago |
|
f5ed14a53a | 7 months ago |
|
f2efcae5a8 | 7 months ago |
|
60f6f7e2f8 | 7 months ago |
|
d4a2cc2d8b | 7 months ago |
|
7319b88fe9 | 7 months ago |
|
caccc47374 | 7 months ago |
|
5b655d55cc | 7 months ago |
|
8ab3e67121 | 7 months ago |
|
e9c98c38f8 | 7 months ago |
|
23570aa57f | 7 months ago |
|
1ef7f2e8fc | 7 months ago |
|
994ec5ca2c | 7 months ago |
|
95c5a5f947 | 7 months ago |
|
264d65868a | 7 months ago |
|
2ca84a5ac3 | 7 months ago |
|
c14f45f9b6 | 7 months ago |
|
577165bb0e | 7 months ago |
|
03d58da87b | 7 months ago |
|
fe797443b0 | 7 months ago |
|
6702628fc3 | 7 months ago |
|
21231e4b42 | 7 months ago |
|
acf7a8e8ab | 7 months ago |
|
b321a9efb7 | 7 months ago |
|
26d2988f6a | 7 months ago |
|
1ba0c24325 | 7 months ago |
|
9d0fcc427d | 7 months ago |
|
6151d9c306 | 7 months ago |
|
887cff4304 | 7 months ago |
|
d22ce86ad7 | 7 months ago |
|
10c5feb381 | 7 months ago |
|
59c1a0ac5f | 7 months ago |
|
022a534a72 | 7 months ago |
|
ea7ce795b2 | 7 months ago |
|
f6dc8ac567 | 7 months ago |
|
444a22a154 | 7 months ago |
|
8951bc8caf | 7 months ago |
|
baf9d49195 | 7 months ago |
|
522867af63 | 7 months ago |
|
e7b25bc2d6 | 7 months ago |
|
8263d01dc6 | 7 months ago |
|
16d6fc1ca7 | 7 months ago |
|
6eded3ab5a | 7 months ago |
|
c480c1bef1 | 7 months ago |
|
5f8bdab46a | 7 months ago |
|
2fbc89521a | 7 months ago |
|
8e96b49fb1 | 7 months ago |
|
87b1180925 | 7 months ago |
|
6505203cc2 | 7 months ago |
|
3130e4fc75 | 7 months ago |
|
00682722b5 | 7 months ago |
|
8bccf2e22b | 7 months ago |
|
81140cd3b6 | 7 months ago |
|
c8550b8800 | 7 months ago |
|
25338b2896 | 7 months ago |
|
8d62fb8c4e | 7 months ago |
|
50321fdac4 | 7 months ago |
|
66b46dbd00 | 7 months ago |
|
56f4edc128 | 7 months ago |
|
a57e217762 | 7 months ago |
|
98374b342e | 7 months ago |
|
3e1400bc96 | 7 months ago |
|
1c61e37949 | 7 months ago |
|
7974dd05f6 | 7 months ago |
|
3e8b80466c | 7 months ago |
|
1ff926df13 | 7 months ago |
|
64371643ef | 7 months ago |
|
12986c21e3 | 7 months ago |
|
f4979f1562 | 7 months ago |
|
b6eeb59f2d | 7 months ago |
|
03843e32a6 | 7 months ago |
|
20a01f95ac | 7 months ago |
|
e46529b30f | 7 months ago |
|
5ecf40301f | 7 months ago |
|
ff0fae1d0e | 7 months ago |
|
ef8d37726f | 7 months ago |
|
ef13c07590 | 7 months ago |
|
703bae6cb7 | 7 months ago |
|
22bdd6088f | 7 months ago |
|
0f6fbdf8bd | 7 months ago |
|
190cb66f12 | 7 months ago |
|
07f811dcd2 | 7 months ago |
|
2ba850365a | 7 months ago |
|
a462aa4553 | 7 months ago |
|
2ff626ac13 | 7 months ago |
|
17453d538a | 7 months ago |
|
8bf9529dee | 7 months ago |
|
d8d9a98fcc | 7 months ago |
|
dcfc2de656 | 7 months ago |
|
bd6edb3bb2 | 7 months ago |
|
d33c18bbec | 7 months ago |
|
984fc9d606 | 7 months ago |
|
1aa078bafe | 7 months ago |
|
bce4898c20 | 7 months ago |
|
bbcf70e004 | 7 months ago |
|
65ad620eea | 7 months ago |
|
27e2899161 | 7 months ago |
|
5dbb1b4588 | 7 months ago |
|
a3bc8abbe2 | 7 months ago |
|
bfe4bd2201 | 7 months ago |
|
1079e8d646 | 7 months ago |
|
7cfa9ba78e | 7 months ago |
|
030b04b451 | 7 months ago |
|
f33b772dbe | 7 months ago |
|
ba23442990 | 7 months ago |
|
c779e95e98 | 7 months ago |
|
80b3042b18 | 7 months ago |
|
3b49f5be9d | 8 months ago |
|
25b50d5638 | 8 months ago |
|
6323e895c3 | 8 months ago |
|
64a920de56 | 8 months ago |
|
1d598e816c | 8 months ago |
|
ba09ec2028 | 8 months ago |
|
d9ce8c6848 | 8 months ago |
|
4806229c2d | 8 months ago |
|
af7fa46e7f | 8 months ago |
|
c2eddadbdf | 8 months ago |
|
60818e9066 | 8 months ago |
|
87f1d216a3 | 8 months ago |
|
f2e9b156e0 | 8 months ago |
|
442eec9995 | 8 months ago |
|
f30ee6d70f | 8 months ago |
|
2f89f1a25c | 8 months ago |
|
debe4a8915 | 8 months ago |
|
afd099e004 | 8 months ago |
|
4c3966c183 | 8 months ago |
|
2f4fa85a58 | 8 months ago |
|
4e0dd695fb | 8 months ago |
|
e05444bba7 | 8 months ago |
|
78fa700cf1 | 8 months ago |
|
7e533122f7 | 8 months ago |
|
101aa144e5 | 8 months ago |
|
d72a0e1b9b | 8 months ago |
|
9507f591f0 | 8 months ago |
|
cd9a8a2f81 | 8 months ago |
|
0d39c46f7e | 8 months ago |
|
d73d3170a8 | 8 months ago |
|
0dfcd38f6f | 8 months ago |
|
1591a96398 | 8 months ago |
|
423915014f | 8 months ago |
|
b57c42b20d | 8 months ago |
|
ce41be1f6b | 8 months ago |
|
7aa011367c | 8 months ago |
|
73a29a9139 | 8 months ago |
|
db5cc9e986 | 8 months ago |
|
b1a00236ba | 8 months ago |
|
2247f1ce48 | 8 months ago |
|
872f18bcbb | 8 months ago |
|
d3dc9d1f72 | 8 months ago |
|
b9b4703ac7 | 8 months ago |
|
e8afa08675 | 8 months ago |
|
0abf867a0d | 8 months ago |
|
baeb8fe44b | 8 months ago |
|
bd869f9bd7 | 8 months ago |
|
8ca3d13e3c | 8 months ago |
|
a144a2485a | 8 months ago |
|
c178901d52 | 8 months ago |
|
60c07403e4 | 8 months ago |
|
e5db860c41 | 8 months ago |
|
67d891f59a | 8 months ago |
|
0eb6365958 | 8 months ago |
|
c9417c7149 | 8 months ago |
|
ab8e5fe15e | 8 months ago |
|
ac927c3d60 | 8 months ago |
|
5202489224 | 8 months ago |
|
4b0d6857e9 | 8 months ago |
|
bd90f6eb94 | 8 months ago |
|
fc1127b0c4 | 8 months ago |
|
1905bc71ae | 8 months ago |
|
37c5ed0c10 | 8 months ago |
|
6f0c491740 | 8 months ago |
|
5ae6174b2a | 8 months ago |
|
1976767453 | 8 months ago |
|
953349cddf | 8 months ago |
|
92942ea474 | 8 months ago |
|
06eebdd125 | 8 months ago |
|
025261565f | 8 months ago |
|
333427db6b | 8 months ago |
|
54189f6128 | 8 months ago |
|
a0afbf3966 | 8 months ago |
|
c52f9a1426 | 8 months ago |
|
0592a6dd50 | 8 months ago |
|
db43a52425 | 8 months ago |
|
2cd14de25b | 8 months ago |
|
ce63c3983d | 8 months ago |
|
4617ffbe33 | 8 months ago |
|
831f84fd40 | 8 months ago |
|
7d2eec95d2 | 8 months ago |
|
7fac613bd9 | 8 months ago |
|
b01fa16f2e | 8 months ago |
|
07d7918708 | 8 months ago |
|
3b0dbda1da | 8 months ago |
|
a1e6ec03c1 | 8 months ago |
|
2e13528e16 | 8 months ago |
|
ca78bd093b | 8 months ago |
|
5baab70e77 | 8 months ago |
|
02048a8413 | 8 months ago |
|
80788b560d | 8 months ago |
|
7fc04491da | 8 months ago |
|
8a30cc7cd3 | 8 months ago |
|
abae5057c3 | 8 months ago |
|
46da16cd4f | 8 months ago |
|
40ae9cf066 | 8 months ago |
|
7a7b0f5bff | 8 months ago |
|
c3407bfabf | 8 months ago |
|
834bf0a12e | 8 months ago |
|
442e877896 | 8 months ago |
|
91a2fd0c1b | 8 months ago |
|
9e74f3242e | 8 months ago |
|
9baefe421a | 8 months ago |
|
607284e703 | 8 months ago |
|
66c38efc42 | 8 months ago |
|
1aadce221f | 8 months ago |
|
739c621c33 | 8 months ago |
|
ea668e5b30 | 8 months ago |
|
200950c993 | 8 months ago |
|
b3526cd99f | 8 months ago |
|
5d283a233d | 8 months ago |
|
93e7e4a6a6 | 8 months ago |
|
556dbfbbe6 | 8 months ago |
|
825343562e | 8 months ago |
|
6235e2ce3f | 8 months ago |
|
8b8ad96dce | 8 months ago |
|
6b8a304b40 | 8 months ago |
|
40e5655fc6 | 8 months ago |
|
571c86f95c | 8 months ago |
|
dd09967678 | 8 months ago |
|
03aa0559e4 | 8 months ago |
|
e16b0aa9b8 | 8 months ago |
|
8c799e4069 | 8 months ago |
|
93d746f45f | 8 months ago |
|
308a854728 | 8 months ago |
|
8241cb8888 | 8 months ago |
|
6b89f51a0b | 8 months ago |
|
b9c4169441 | 8 months ago |
|
75c5eb1746 | 8 months ago |
|
41ebac85d9 | 8 months ago |
|
4974de75e4 | 8 months ago |
|
181b82e30c | 8 months ago |
|
b2d7ed436e | 8 months ago |
|
2b3d3407db | 8 months ago |
|
4a8d7cd833 | 8 months ago |
|
858cf07e72 | 8 months ago |
|
8992042d50 | 8 months ago |
|
c9df467047 | 8 months ago |
|
eb7e212674 | 8 months ago |
|
e2f56a429a | 8 months ago |
|
65984a7747 | 8 months ago |
|
f48c13b295 | 8 months ago |
|
8f11fe53e1 | 8 months ago |
|
74d4fbc256 | 8 months ago |
|
3267c9dd4f | 8 months ago |
|
529ed07161 | 8 months ago |
|
15fffc3938 | 8 months ago |
|
85a8549322 | 8 months ago |
|
74911a88cb | 8 months ago |
|
1c491af3f3 | 8 months ago |
|
121712ab8e | 8 months ago |
|
78a741f1d3 | 8 months ago |
|
41460ca259 | 8 months ago |
|
d6605482bc | 8 months ago |
|
95007ee992 | 9 months ago |
|
0de8d970a7 | 9 months ago |
|
5ef9045127 | 9 months ago |
|
3a2044f7ed | 9 months ago |
|
17e043e30c | 9 months ago |
|
6fd95dfac8 | 9 months ago |
|
000872176b | 9 months ago |
|
bd2e8b49fa | 9 months ago |
|
3eb6e4ff0f | 9 months ago |
|
fe5fdede4e | 9 months ago |
|
51f8d7c6e7 | 9 months ago |
|
c41602a2b5 | 9 months ago |
|
a925e1827c | 9 months ago |
|
42a45d5abf | 9 months ago |
|
c9106101cd | 9 months ago |
|
d127d63f6d | 9 months ago |
|
5c7cba5b60 | 9 months ago |
|
a03bbbf86a | 9 months ago |
|
62328a3123 | 9 months ago |
|
abe0e8da16 | 9 months ago |
|
5e1f2820ee | 9 months ago |
|
69e6a564cb | 9 months ago |
|
749aaf547c | 9 months ago |
|
8985ed091a | 9 months ago |
|
7d6fa392bc | 9 months ago |
|
57adc01844 | 9 months ago |
|
6265b5f694 | 9 months ago |
|
895f07961d | 9 months ago |
|
b132c5f890 | 9 months ago |
|
09366286f2 | 9 months ago |
|
59bdee3ab7 | 9 months ago |
|
15e435e691 | 9 months ago |
|
59c9aecf11 | 9 months ago |
|
27092c9dff | 9 months ago |
|
271d6e0c39 | 9 months ago |
|
a4fc2697b1 | 9 months ago |
|
3a779bb9ca | 9 months ago |
|
598b24f495 | 9 months ago |
|
e6e606ca0e | 9 months ago |
|
f25f4a54b3 | 9 months ago |
|
e4b4632a29 | 9 months ago |
|
db25fa87fa | 9 months ago |
|
1ccdeabc43 | 9 months ago |
|
721b2e5023 | 9 months ago |
|
74ee9afb34 | 9 months ago |
|
9417b21505 | 9 months ago |
|
89f14bc889 | 9 months ago |
|
1b54ab0043 | 9 months ago |
|
593221f9d4 | 9 months ago |
|
483f132025 | 9 months ago |
|
98b9d50e65 | 9 months ago |
|
782bc9338c | 9 months ago |
|
530e081112 | 9 months ago |
|
d56f7d350a | 9 months ago |
|
e8285275f1 | 9 months ago |
|
81ba95f72f | 9 months ago |
|
821a00b0f9 | 9 months ago |
|
774673db69 | 9 months ago |
|
14eb1ea494 | 9 months ago |
|
ad1f917aae | 9 months ago |
|
6d0ff67faa | 9 months ago |
|
e70999633d | 9 months ago |
|
220ba45e18 | 9 months ago |
|
9d6f0981ec | 9 months ago |
|
80646d47c8 | 9 months ago |
|
e91a0f5909 | 9 months ago |
|
a557f5be70 | 9 months ago |
|
61084b90ca | 9 months ago |
|
2f61b30b4b | 9 months ago |
|
6cb5b7840a | 10 months ago |
|
143e95c540 | 10 months ago |
|
fbe96a097b | 10 months ago |
|
95de5ee2b3 | 10 months ago |
|
11a0986d6b | 10 months ago |
|
965f7e81cc | 10 months ago |
|
b023fad1f0 | 10 months ago |
|
dfd3742667 | 10 months ago |
|
f6f44c02bb | 10 months ago |
|
e19c63b2d3 | 10 months ago |
|
2fcc173aad | 10 months ago |
|
25eb91a677 | 10 months ago |
|
813738ef39 | 10 months ago |
|
191a9ca271 | 10 months ago |
|
0dbb038e57 | 10 months ago |
|
11609288fb | 10 months ago |
|
9b0818564b | 10 months ago |
|
c7ef460c8a | 10 months ago |
|
aac9333bc9 | 10 months ago |
|
becd39f135 | 10 months ago |
|
9725bd4a7a | 10 months ago |
|
ab46faec0a | 10 months ago |
|
0ba1a3439d | 10 months ago |
|
e092299817 | 10 months ago |
|
4109a37d70 | 10 months ago |
|
3945e8c62c | 10 months ago |
|
0459a9b101 | 10 months ago |
|
501062b03b | 10 months ago |
|
06c418c66c | 10 months ago |
|
96978e396a | 10 months ago |
|
832778a318 | 10 months ago |
|
77d6dc77d6 | 10 months ago |
|
ddb00b8e8c | 10 months ago |
|
3100ee0625 | 10 months ago |
|
f3ad067992 | 10 months ago |
|
00e5d71199 | 10 months ago |
|
2d2b0928a2 | 10 months ago |
|
0ad4051cbc | 10 months ago |
|
2a61a76747 | 10 months ago |
|
b2996bc205 | 10 months ago |
|
a16bdb3639 | 10 months ago |
|
1f35ccc894 | 10 months ago |
|
6f09def9de | 10 months ago |
|
11598d0fe9 | 10 months ago |
|
4f628eef9f | 10 months ago |
|
7eb925f20d | 10 months ago |
|
de241ef8f6 | 10 months ago |
|
26981d77e1 | 10 months ago |
|
64831c1f73 | 10 months ago |
|
19a677fcc1 | 10 months ago |
|
4da7dcc15f | 10 months ago |
|
e209873949 | 10 months ago |
|
2981c09a62 | 10 months ago |
|
97fb039d25 | 10 months ago |
|
ebe3e03872 | 10 months ago |
|
77d44406e0 | 10 months ago |
|
033dbb39d0 | 10 months ago |
|
29284fb824 | 10 months ago |
|
13039715d5 | 10 months ago |
|
a197bf484f | 10 months ago |
|
725adb6a5c | 10 months ago |
|
558b3b400e | 10 months ago |
|
a8d2d7e890 | 10 months ago |
|
fff686d287 | 10 months ago |
|
9525533074 | 10 months ago |
|
1ec30743b1 | 10 months ago |
|
dfb9194b13 | 10 months ago |
|
5c9165bc75 | 10 months ago |
|
49959e3862 | 10 months ago |
|
9bda5815a0 | 10 months ago |
|
b2bb54b6c7 | 10 months ago |
|
0ba5894242 | 10 months ago |
|
e07512faf6 | 10 months ago |
|
2a2509e2d4 | 10 months ago |
|
0a1235c223 | 10 months ago |
|
677a9f7d10 | 11 months ago |
|
d9fb5fecc5 | 11 months ago |
|
837339efb0 | 11 months ago |
|
44a8f369d5 | 11 months ago |
|
e2f9b05134 | 11 months ago |
|
9582c1d183 | 11 months ago |
|
95c6594fa3 | 11 months ago |
|
4fc1029961 | 11 months ago |
|
e50e73f3e0 | 11 months ago |
|
6241e913ae | 11 months ago |
|
8d354069eb | 11 months ago |
|
244c2042c9 | 11 months ago |
|
07082655da | 11 months ago |
|
351ae12524 | 11 months ago |
|
9a7677546f | 11 months ago |
|
f5d1e37384 | 11 months ago |
|
3462f73287 | 11 months ago |
|
ab69394079 | 11 months ago |
|
7cd4df004d | 11 months ago |
|
cf3e1311fd | 11 months ago |
|
c0c637388a | 11 months ago |
|
4f173f179d | 11 months ago |
|
e83e6a4512 | 11 months ago |
|
d27bcf2313 | 11 months ago |
|
e31d10e346 | 11 months ago |
|
f796ccac69 | 11 months ago |
|
b8ff5958ad | 11 months ago |
|
c4450633fb | 11 months ago |
|
8c54221efa | 11 months ago |
|
eb44fa07b8 | 11 months ago |
|
04997d2d1e | 11 months ago |
|
ac9d1b0458 | 11 months ago |
|
086fc126d9 | 11 months ago |
|
061f57a2f5 | 11 months ago |
|
3b1fcc747d | 11 months ago |
|
db2b76947e | 11 months ago |
|
3cffde3b2f | 11 months ago |
|
98f6a409bd | 11 months ago |
|
8e4ce6de11 | 11 months ago |
|
f6b5639e6d | 11 months ago |
|
f5d2e2ace1 | 11 months ago |
|
fe91a3f283 | 11 months ago |
|
5ca1cc49e7 | 11 months ago |
|
3167e9e482 | 11 months ago |
|
32c46f219c | 11 months ago |
|
3c19692f8e | 11 months ago |
|
c8519dfc3d | 11 months ago |
|
2fd174658e | 11 months ago |
|
1fa968c4ae | 11 months ago |
|
a8353597d4 | 11 months ago |
|
cae517392c | 11 months ago |
|
4467f0a6b1 | 11 months ago |
|
67a30941d2 | 11 months ago |
|
927b162255 | 11 months ago |
|
3851d362da | 11 months ago |
|
c342722ca9 | 11 months ago |
|
c1bb7601b0 | 11 months ago |
|
29c71637f5 | 11 months ago |
|
6b63aaf4d4 | 11 months ago |
|
9610965086 | 11 months ago |
|
6d3fdb8c57 | 11 months ago |
|
1df31bb8bc | 11 months ago |
|
bd9e6a0afb | 11 months ago |
|
068bd7c003 | 11 months ago |
|
da4c5c11e2 | 11 months ago |
|
be9985d925 | 12 months ago |
614 changed files with 76638 additions and 18456 deletions
@ -0,0 +1,11 @@ |
|||||
|
VITE_BASE_URL=http://172.22.32.9:81/api/admin-api |
||||
|
VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api |
||||
|
|
||||
|
# 租户配置 |
||||
|
VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' |
||||
|
|
||||
|
# 是否是测试环境 |
||||
|
VITE_isDevelopment=true |
||||
|
|
||||
|
# 积木报表请求路径 |
||||
|
VITE_JMREPORT_BASE_URL='http://172.22.32.9:90' |
@ -0,0 +1,11 @@ |
|||||
|
VITE_BASE_URL=http://172.21.32.13:81/api/admin-api |
||||
|
VITE_BASE_URL_IMAGE=http://172.21.32.13:81/admin-api |
||||
|
|
||||
|
# 租户配置 |
||||
|
VITE_TENANT='[{"text":"长春1379","value":1}]' |
||||
|
|
||||
|
# 是否是测试环境 |
||||
|
VITE_isDevelopment=false |
||||
|
|
||||
|
# 积木报表请求路径 |
||||
|
VITE_JMREPORT_BASE_URL='http://172.21.32.13:90' |
@ -0,0 +1,11 @@ |
|||||
|
VITE_BASE_URL=http://172.21.32.14:81/api/admin-api |
||||
|
VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api |
||||
|
|
||||
|
# 租户配置 |
||||
|
VITE_TENANT='[{"text":"长春1379","value":1}]' |
||||
|
|
||||
|
# 是否是测试环境 |
||||
|
VITE_isDevelopment=true |
||||
|
|
||||
|
# 积木报表请求路径 |
||||
|
VITE_JMREPORT_BASE_URL='http://172.21.32.14:90' |
@ -0,0 +1,11 @@ |
|||||
|
VITE_BASE_URL=https://scp.faway-hella.com:81/api/admin-api |
||||
|
VITE_BASE_URL_IMAGE=https://scp.faway-hella.com:81/admin-api |
||||
|
|
||||
|
# 租户配置 |
||||
|
VITE_TENANT='[{"text":"长春1379","value":1}]' |
||||
|
|
||||
|
# 是否是测试环境 |
||||
|
VITE_isDevelopment=true |
||||
|
|
||||
|
# 积木报表请求路径 |
||||
|
VITE_JMREPORT_BASE_URL='https://scp.faway-hella.com' |
@ -0,0 +1,11 @@ |
|||||
|
VITE_BASE_URL=https://scptest.faway-hella.com:81/api/admin-api |
||||
|
VITE_BASE_URL_IMAGE=https://scptest.faway-hella.com:81/admin-api |
||||
|
|
||||
|
# 租户配置 |
||||
|
VITE_TENANT='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' |
||||
|
|
||||
|
# 是否是测试环境 |
||||
|
VITE_isDevelopment=true |
||||
|
|
||||
|
# 积木报表请求路径 |
||||
|
VITE_JMREPORT_BASE_URL='https://scptest.faway-hella.com' |
@ -0,0 +1,12 @@ |
|||||
|
VITE_BASE_URL=http://172.22.32.8:81/api/admin-api |
||||
|
VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api |
||||
|
|
||||
|
# 租户配置 |
||||
|
VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' |
||||
|
|
||||
|
# 是否是测试环境 |
||||
|
VITE_isDevelopment=false |
||||
|
|
||||
|
|
||||
|
# 积木报表请求路径 |
||||
|
VITE_JMREPORT_BASE_URL='http://172.22.32.8:90' |
@ -0,0 +1,11 @@ |
|||||
|
VITE_BASE_URL=http://172.22.32.9:81/api/admin-api |
||||
|
VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api |
||||
|
|
||||
|
# 租户配置 |
||||
|
VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' |
||||
|
|
||||
|
# 是否是测试环境 |
||||
|
VITE_isDevelopment=true |
||||
|
|
||||
|
# 积木报表请求路径 |
||||
|
VITE_JMREPORT_BASE_URL='http://172.22.32.9:90' |
@ -0,0 +1,12 @@ |
|||||
|
VITE_BASE_URL=http://172.22.32.8:81/api/admin-api |
||||
|
VITE_BASE_URL_IMAGE=http://172.22.32.8:81/admin-api |
||||
|
|
||||
|
# 租户配置 |
||||
|
VITE_TENANT='[{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' |
||||
|
|
||||
|
# 是否是测试环境 |
||||
|
VITE_isDevelopment=false |
||||
|
|
||||
|
|
||||
|
# 积木报表请求路径 |
||||
|
VITE_JMREPORT_BASE_URL='http://172.22.32.8:90' |
@ -0,0 +1,12 @@ |
|||||
|
|
||||
|
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api |
||||
|
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api |
||||
|
|
||||
|
# 租户配置 |
||||
|
VITE_TENANT='[{"text":"长春1379","value":1},{"text":"成都1397","value":2},{"text":"长春2379","value":3}]' |
||||
|
|
||||
|
# 是否是测试环境 |
||||
|
VITE_isDevelopment=true |
||||
|
|
||||
|
# 积木报表请求路径 |
||||
|
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310' |
@ -0,0 +1,7 @@ |
|||||
|
# 设置基础镜像 |
||||
|
FROM win-nginx |
||||
|
|
||||
|
WORKDIR /opt/sfms3.0-uniapp |
||||
|
COPY nginx.conf /usr/local/nginx/conf/nginx.conf |
||||
|
# 将dist/build/h5/文件中的内容复制到 /opt/sfms3.0-uniapp 这个目录下面 |
||||
|
COPY dist/build/h5/ /opt/sfms3.0-uniapp |
@ -0,0 +1,7 @@ |
|||||
|
# 设置基础镜像 |
||||
|
FROM win-nginx |
||||
|
|
||||
|
WORKDIR /opt/sfms3.0-uniapp |
||||
|
COPY nginx_prod.conf /usr/local/nginx/conf/nginx.conf |
||||
|
# 将dist/build/h5/文件中的内容复制到 /opt/sfms3.0-uniapp 这个目录下面 |
||||
|
COPY dist/build/h5/ /opt/sfms3.0-uniapp |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,35 @@ |
|||||
|
{ |
||||
|
|
||||
|
"name": "TestModule", |
||||
|
|
||||
|
"id": "TestModule", |
||||
|
|
||||
|
"version": "1.0.0", |
||||
|
|
||||
|
"description": "打印", |
||||
|
|
||||
|
"_dp_type": "nativeplugin", |
||||
|
|
||||
|
"_dp_nativeplugin": { |
||||
|
|
||||
|
"android": { |
||||
|
|
||||
|
"integrateType": "aar", |
||||
|
|
||||
|
"plugins": [ |
||||
|
|
||||
|
{ |
||||
|
|
||||
|
"type": "module", |
||||
|
"name": "TestModule", |
||||
|
"class": "io.dcloud.uniplugin.TestModule" |
||||
|
|
||||
|
} |
||||
|
|
||||
|
] |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
user root; |
||||
|
worker_processes 2; |
||||
|
|
||||
|
events { |
||||
|
worker_connections 1024; |
||||
|
} |
||||
|
|
||||
|
http { |
||||
|
include mime.types; |
||||
|
charset utf-8,gbk; |
||||
|
default_type application/octet-stream; |
||||
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
||||
|
'$status $body_bytes_sent "$http_referer" ' |
||||
|
'"$http_user_agent" "$http_x_forwarded_for" "$request_time $upstream_response_time"'; |
||||
|
|
||||
|
proxy_cache_path /opt/nginx_cache/ levels=1:2 keys_zone=my_zone:10m inactive=300s max_size=5g; |
||||
|
access_log logs/access.log main; |
||||
|
sendfile on; |
||||
|
#tcp_nopush on; |
||||
|
keepalive_timeout 600s; |
||||
|
client_max_body_size 200m; |
||||
|
gzip on; |
||||
|
gzip_min_length 10k; |
||||
|
gzip_comp_level 9; |
||||
|
gzip_buffers 4 16k; |
||||
|
gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png; |
||||
|
gzip_vary on; |
||||
|
gzip_disable "MSIE [1-6]\."; |
||||
|
upstream sfms3.0 { |
||||
|
server localhost:25310 weight=10 max_fails=3 fail_timeout=10s; |
||||
|
} |
||||
|
server { |
||||
|
listen 25302; |
||||
|
server_name_in_redirect off; |
||||
|
server_name _; |
||||
|
location /api/ { |
||||
|
proxy_pass http://sfms3.0/; |
||||
|
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; |
||||
|
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for; |
||||
|
proxy_set_header Host $http_host; |
||||
|
proxy_set_header X-Real-IP $remote_addr; |
||||
|
proxy_set_header X-Forwarded-For $http_x_forwarded_for; |
||||
|
} |
||||
|
location / { |
||||
|
proxy_cache my_zone; |
||||
|
proxy_cache_valid 200 304 12h; |
||||
|
proxy_cache_key $host$uri$is_args$args; |
||||
|
try_files $uri $uri/ /index.html; |
||||
|
root /opt/sfms3.0-uniapp; |
||||
|
index index.html index.htm; |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,57 @@ |
|||||
|
user root; |
||||
|
worker_processes 2; |
||||
|
|
||||
|
events { |
||||
|
worker_connections 1024; |
||||
|
} |
||||
|
|
||||
|
http { |
||||
|
include mime.types; |
||||
|
charset utf-8,gbk; |
||||
|
default_type application/octet-stream; |
||||
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
||||
|
'$status $body_bytes_sent "$http_referer" ' |
||||
|
'"$http_user_agent" "$http_x_forwarded_for" "$request_time $upstream_response_time"'; |
||||
|
|
||||
|
proxy_cache_path /opt/nginx_cache/ levels=1:2 keys_zone=my_zone:10m inactive=300s max_size=5g; |
||||
|
access_log logs/access.log main; |
||||
|
sendfile on; |
||||
|
#tcp_nopush on; |
||||
|
keepalive_timeout 600s; |
||||
|
client_max_body_size 200m; |
||||
|
gzip on; |
||||
|
gzip_min_length 10k; |
||||
|
gzip_comp_level 9; |
||||
|
gzip_buffers 4 16k; |
||||
|
gzip_types text/plain application/javascript text/css application/xml text/javascript image/jpeg image/gif image/png; |
||||
|
gzip_vary on; |
||||
|
gzip_disable "MSIE [1-6]\."; |
||||
|
upstream sfms3.0 { |
||||
|
server localhost:90 weight=10 max_fails=3 fail_timeout=10s; |
||||
|
} |
||||
|
server { |
||||
|
listen 81; |
||||
|
server_name_in_redirect off; |
||||
|
server_name _; |
||||
|
location /api/ { |
||||
|
proxy_pass http://sfms3.0/; |
||||
|
proxy_next_upstream http_500 http_502 http_503 http_504 error timeout invalid_header; |
||||
|
proxy_set_header X-Forwared-For $proxy_add_x_forwarded_for; |
||||
|
proxy_set_header Host $http_host; |
||||
|
proxy_set_header X-Real-IP $remote_addr; |
||||
|
proxy_set_header X-Forwarded-For $http_x_forwarded_for; |
||||
|
} |
||||
|
location /profile/ { |
||||
|
alias /opt/profile/; |
||||
|
index index.html index.htm; |
||||
|
} |
||||
|
location / { |
||||
|
proxy_cache my_zone; |
||||
|
proxy_cache_valid 200 304 12h; |
||||
|
proxy_cache_key $host$uri$is_args$args; |
||||
|
try_files $uri $uri/ /index.html; |
||||
|
root /opt/sfms3.0-uniapp; |
||||
|
index index.html index.htm; |
||||
|
} |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,196 @@ |
|||||
|
function getLocalFilePath(path) { |
||||
|
if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf('_downloads') === 0) { |
||||
|
return path |
||||
|
} |
||||
|
if (path.indexOf('file://') === 0) { |
||||
|
return path |
||||
|
} |
||||
|
if (path.indexOf('/storage/emulated/0/') === 0) { |
||||
|
return path |
||||
|
} |
||||
|
if (path.indexOf('/') === 0) { |
||||
|
var localFilePath = plus.io.convertAbsoluteFileSystem(path) |
||||
|
if (localFilePath !== path) { |
||||
|
return localFilePath |
||||
|
} else { |
||||
|
path = path.substr(1) |
||||
|
} |
||||
|
} |
||||
|
return '_www/' + path |
||||
|
} |
||||
|
|
||||
|
function dataUrlToBase64(str) { |
||||
|
var array = str.split(',') |
||||
|
return array[array.length - 1] |
||||
|
} |
||||
|
|
||||
|
var index = 0 |
||||
|
function getNewFileId() { |
||||
|
return Date.now() + String(index++) |
||||
|
} |
||||
|
|
||||
|
function biggerThan(v1, v2) { |
||||
|
var v1Array = v1.split('.') |
||||
|
var v2Array = v2.split('.') |
||||
|
var update = false |
||||
|
for (var index = 0; index < v2Array.length; index++) { |
||||
|
var diff = v1Array[index] - v2Array[index] |
||||
|
if (diff !== 0) { |
||||
|
update = diff > 0 |
||||
|
break |
||||
|
} |
||||
|
} |
||||
|
return update |
||||
|
} |
||||
|
|
||||
|
export async function pathToBase64(path) { |
||||
|
return await new Promise(async function(resolve, reject) { |
||||
|
if (typeof window === 'object' && 'document' in window) { |
||||
|
if (typeof FileReader === 'function') { |
||||
|
var xhr =await new XMLHttpRequest() |
||||
|
xhr.open('GET', path, true) |
||||
|
xhr.responseType = 'blob' |
||||
|
xhr.onload = function() { |
||||
|
if (this.status === 200) { |
||||
|
let fileReader = new FileReader() |
||||
|
fileReader.onload = function(e) { |
||||
|
resolve(e.target.result) |
||||
|
} |
||||
|
fileReader.onerror = reject |
||||
|
fileReader.readAsDataURL(this.response) |
||||
|
} |
||||
|
} |
||||
|
xhr.onerror = reject |
||||
|
xhr.send() |
||||
|
return |
||||
|
} |
||||
|
var canvas = document.createElement('canvas') |
||||
|
var c2x = canvas.getContext('2d') |
||||
|
var img = new Image |
||||
|
img.onload = function() { |
||||
|
canvas.width = img.width |
||||
|
canvas.height = img.height |
||||
|
c2x.drawImage(img, 0, 0) |
||||
|
resolve(canvas.toDataURL()) |
||||
|
canvas.height = canvas.width = 0 |
||||
|
} |
||||
|
img.onerror = reject |
||||
|
img.src = path |
||||
|
return |
||||
|
} |
||||
|
if (typeof plus === 'object') { |
||||
|
plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) { |
||||
|
entry.file(function(file) { |
||||
|
var fileReader = new plus.io.FileReader() |
||||
|
fileReader.onload = function(data) { |
||||
|
resolve(data.target.result) |
||||
|
} |
||||
|
fileReader.onerror = function(error) { |
||||
|
reject(error) |
||||
|
} |
||||
|
fileReader.readAsDataURL(file) |
||||
|
}, function(error) { |
||||
|
reject(error) |
||||
|
}) |
||||
|
}, function(error) { |
||||
|
reject(error) |
||||
|
}) |
||||
|
return |
||||
|
} |
||||
|
if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) { |
||||
|
wx.getFileSystemManager().readFile({ |
||||
|
filePath: path, |
||||
|
encoding: 'base64', |
||||
|
success: function(res) { |
||||
|
resolve('data:image/png;base64,' + res.data) |
||||
|
}, |
||||
|
fail: function(error) { |
||||
|
reject(error) |
||||
|
} |
||||
|
}) |
||||
|
return |
||||
|
} |
||||
|
reject(new Error('not support')) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export function base64ToPath(base64) { |
||||
|
return new Promise(function(resolve, reject) { |
||||
|
if (typeof window === 'object' && 'document' in window) { |
||||
|
base64 = base64.split(',') |
||||
|
var type = base64[0].match(/:(.*?);/)[1] |
||||
|
var str = atob(base64[1]) |
||||
|
var n = str.length |
||||
|
var array = new Uint8Array(n) |
||||
|
while (n--) { |
||||
|
array[n] = str.charCodeAt(n) |
||||
|
} |
||||
|
return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], { type: type }))) |
||||
|
} |
||||
|
var extName = base64.split(',')[0].match(/data\:\S+\/(\S+);/) |
||||
|
if (extName) { |
||||
|
extName = extName[1] |
||||
|
} else { |
||||
|
reject(new Error('base64 error')) |
||||
|
} |
||||
|
var fileName = getNewFileId() + '.' + extName |
||||
|
if (typeof plus === 'object') { |
||||
|
var basePath = '_doc' |
||||
|
var dirPath = 'uniapp_temp' |
||||
|
var filePath = basePath + '/' + dirPath + '/' + fileName |
||||
|
if (!biggerThan(plus.os.name === 'Android' ? '1.9.9.80627' : '1.9.9.80472', plus.runtime.innerVersion)) { |
||||
|
plus.io.resolveLocalFileSystemURL(basePath, function(entry) { |
||||
|
entry.getDirectory(dirPath, { |
||||
|
create: true, |
||||
|
exclusive: false, |
||||
|
}, function(entry) { |
||||
|
entry.getFile(fileName, { |
||||
|
create: true, |
||||
|
exclusive: false, |
||||
|
}, function(entry) { |
||||
|
entry.createWriter(function(writer) { |
||||
|
writer.onwrite = function() { |
||||
|
resolve(filePath) |
||||
|
} |
||||
|
writer.onerror = reject |
||||
|
writer.seek(0) |
||||
|
writer.writeAsBinary(dataUrlToBase64(base64)) |
||||
|
}, reject) |
||||
|
}, reject) |
||||
|
}, reject) |
||||
|
}, reject) |
||||
|
return |
||||
|
} |
||||
|
var bitmap = new plus.nativeObj.Bitmap(fileName) |
||||
|
bitmap.loadBase64Data(base64, function() { |
||||
|
bitmap.save(filePath, {}, function() { |
||||
|
bitmap.clear() |
||||
|
resolve(filePath) |
||||
|
}, function(error) { |
||||
|
bitmap.clear() |
||||
|
reject(error) |
||||
|
}) |
||||
|
}, function(error) { |
||||
|
bitmap.clear() |
||||
|
reject(error) |
||||
|
}) |
||||
|
return |
||||
|
} |
||||
|
if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) { |
||||
|
var filePath = wx.env.USER_DATA_PATH + '/' + fileName |
||||
|
wx.getFileSystemManager().writeFile({ |
||||
|
filePath: filePath, |
||||
|
data: dataUrlToBase64(base64), |
||||
|
encoding: 'base64', |
||||
|
success: function() { |
||||
|
resolve(filePath) |
||||
|
}, |
||||
|
fail: function(error) { |
||||
|
reject(error) |
||||
|
} |
||||
|
}) |
||||
|
return |
||||
|
} |
||||
|
reject(new Error('not support')) |
||||
|
}) |
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,4 @@ |
|||||
|
export const overPagePrint="overPage_print" |
||||
|
export const overPageTemplate="overPage_Template" |
||||
|
//3分钟刷新
|
||||
|
export const planRefreshTime=3*60*1000 |
@ -1,83 +1,151 @@ |
|||||
import { |
import { |
||||
calc |
calc |
||||
} from '@/common/calc' |
} from '@/common/calc' |
||||
|
|
||||
import { Decimal } from 'decimal.js';//引入
|
import { |
||||
export function getDataSource(subList) { |
Decimal |
||||
let items = []; |
} from 'decimal.js'; //引入
|
||||
subList.forEach(detail => { |
|
||||
var item = items.find(r => |
|
||||
r.itemCode == detail.itemCode) |
|
||||
if (item == undefined) { |
|
||||
item = createItemInfo(detail); |
|
||||
let newDetail = createDetailInfo(detail); //
|
|
||||
item.subList.push(newDetail); |
|
||||
items.push(item) |
|
||||
} else { |
|
||||
item.qty = calc.add(item.qty, detail.qty) |
|
||||
let newDetail = createDetailInfo(detail); //
|
|
||||
item.subList.push(newDetail); |
|
||||
} |
|
||||
}) |
|
||||
return items; |
|
||||
} |
|
||||
|
|
||||
export function createItemInfo(detail) { |
export function getTreeDataSource(dataList) { |
||||
let item = { |
let items = []; |
||||
itemCode: detail.itemCode, |
|
||||
itemName: detail.itemName, |
let parentList = dataList.filter(r => r.parentPackingNumber == null || r |
||||
stdPackQty: Number(detail.stdPackQty) || undefined, |
.parentPackingNumber == ''); |
||||
stdPackUnit: detail.stdPackUnit, |
let childList = dataList.filter(r => r.parentPackingNumber != '' && r.parentPackingNumber != null); |
||||
qty: Number(detail.qty), |
|
||||
handleQty: 0, |
parentList.forEach(detail => { |
||||
uom: detail.uom, |
var item = items.find(r => |
||||
subList: [] |
r.itemCode == detail.itemCode) |
||||
|
if (item == undefined) { |
||||
|
item = createItemInfo(detail); |
||||
|
let newDetail = createDetailInfo(detail); //
|
||||
|
item.subList.push(newDetail); |
||||
|
items.push(item) |
||||
|
} else { |
||||
|
item.qty = calc.add(item.qty, detail.qty) |
||||
|
let newDetail = createDetailInfo(detail); //
|
||||
|
item.subList.push(newDetail); |
||||
} |
} |
||||
return item; |
}) |
||||
} |
|
||||
|
|
||||
export function createDetailInfo(data) { |
if (childList.length > 0) { |
||||
data.scaned = false; |
items.forEach(r => |
||||
// data.record = {};
|
r.subList.forEach(s => { |
||||
let detail = data; |
s.packList = childList.filter(c => c.parentPackingNumber == s.packingNumber) |
||||
return detail; |
s.packList.forEach(pac => { |
||||
|
pac.scaned = false; |
||||
|
pac.scanDate = new Date(); |
||||
|
}) |
||||
|
}) |
||||
|
) |
||||
} |
} |
||||
|
|
||||
//根据明细创建记录
|
return items; |
||||
export function createRecordInfo(detail, balance) { |
} |
||||
var record = {} |
|
||||
// let record = JSON.parse(JSON.stringify(detail));
|
export function getDataSource(subList) { |
||||
//克隆对象,深度克隆,防止双向绑定同一个变量
|
let items = []; |
||||
Object.assign(record, detail) |
subList.forEach(detail => { |
||||
detail.scaned = true; |
var item = items.find(r => |
||||
detail.balance = balance; |
r.itemCode == detail.itemCode) |
||||
detail.recommendInventoryStatus = detail.inventoryStatus; |
if (item == undefined) { |
||||
detail.inventoryStatus = balance.inventoryStatus; |
item = createItemInfo(detail); |
||||
record.qty = Number(balance.qty); |
let newDetail = createDetailInfo(detail); //
|
||||
return record; |
item.subList.push(newDetail); |
||||
|
items.push(item) |
||||
|
} else { |
||||
|
item.qty = calc.add(item.qty, detail.qty) |
||||
|
let newDetail = createDetailInfo(detail); //
|
||||
|
item.subList.push(newDetail); |
||||
|
} |
||||
|
}) |
||||
|
return items; |
||||
|
} |
||||
|
|
||||
|
export function createItemInfo(detail) { |
||||
|
let item = { |
||||
|
itemCode: detail.itemCode, |
||||
|
itemName: detail.itemName, |
||||
|
packQty: Number(detail.packQty) || undefined, |
||||
|
packUnit: detail.packUnit, |
||||
|
qty: Number(detail.qty), |
||||
|
handleQty: 0, |
||||
|
uom: detail.uom, |
||||
|
subList: [] |
||||
} |
} |
||||
|
return item; |
||||
|
} |
||||
|
|
||||
|
export function createDetailInfo(data) { |
||||
|
data.scaned = false; |
||||
|
data.scanDate = new Date(); |
||||
|
let detail = data; |
||||
|
detail.packList = []; |
||||
|
return detail; |
||||
|
} |
||||
|
|
||||
|
//根据明细创建记录
|
||||
|
export function createRecordInfo(detail, balance) { |
||||
|
var record = {} |
||||
|
// let record = JSON.parse(JSON.stringify(detail));
|
||||
|
//克隆对象,深度克隆,防止双向绑定同一个变量
|
||||
|
Object.assign(record, detail) |
||||
|
detail.scaned = true; |
||||
|
detail.balance = balance; |
||||
|
detail.recommendInventoryStatus = detail.inventoryStatus; |
||||
|
detail.inventoryStatus = balance.inventoryStatus; |
||||
|
record.qty = Number(balance.qty); |
||||
|
return record; |
||||
|
} |
||||
|
|
||||
//计算实际数量
|
//计算实际数量
|
||||
export function calcHandleQty(detailSource) { |
export function calcHandleQty(detailSource) { |
||||
for (let item of detailSource) { |
for (let item of detailSource) { |
||||
item.handleQty = new Decimal(0).toNumber(); |
item.handleQty = new Decimal(0).toNumber(); |
||||
item.qty = new Decimal(0).toNumber(); |
item.qty = new Decimal(0).toNumber(); |
||||
for (let detail of item.subList) { |
for (let detail of item.subList) { |
||||
if (detail != undefined && detail.scaned) { |
if (detail != undefined) { |
||||
item.handleQty = calc.add(item.handleQty,detail.handleQty); |
if (detail.scaned) { |
||||
item.qty = calc.add(item.qty,detail.qty); |
item.handleQty = calc.add(item.handleQty, detail.handleQty); |
||||
} |
} |
||||
|
item.qty = calc.add(item.qty, detail.qty); |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
} |
||||
|
|
||||
|
export function calcTreeHandleQty(detailSource) { |
||||
|
for (let item of detailSource) { |
||||
|
item.handleQty = new Decimal(0).toNumber(); |
||||
|
|
||||
export function getScanCount(subList) { |
for (let detail of item.subList) { |
||||
let items = subList.filter(r => { |
if (detail != undefined && detail.scaned) { |
||||
if (r.scaned) { |
if (detail.packList.length > 0) { |
||||
return r; |
detail.handleQty = new Decimal(0).toNumber(); |
||||
|
for (let pack of detail.packList) { |
||||
|
if (pack != undefined && pack.scaned) { |
||||
|
detail.handleQty = calc.add(detail.handleQty, pack.handleQty); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
item.handleQty = calc.add(item.handleQty, detail.handleQty); |
||||
} |
} |
||||
}) |
} |
||||
let scanCount = items != null ? items.length : 0; |
|
||||
return scanCount; |
|
||||
} |
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
export function getScanCount(subList) { |
||||
|
let items = subList.filter(r => { |
||||
|
if (r.scaned) { |
||||
|
return r; |
||||
|
} |
||||
|
}) |
||||
|
let scanCount = items != null ? items.length : 0; |
||||
|
return scanCount; |
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
// 防止处理多次点击
|
||||
|
function noMultipleClicks(methods, info) { |
||||
|
// methods是需要点击后需要执行的函数, info是点击需要传的参数
|
||||
|
let that = this; |
||||
|
if (that.noClick) { |
||||
|
// 第一次点击
|
||||
|
that.noClick= false; |
||||
|
if(info && info !== '') { |
||||
|
// info是执行函数需要传的参数
|
||||
|
methods(info); |
||||
|
} else { |
||||
|
methods(); |
||||
|
} |
||||
|
let timer = setTimeout(()=> { |
||||
|
that.noClick= true; |
||||
|
clearTimeout(timer) |
||||
|
}, 2000) |
||||
|
} else { |
||||
|
// 这里是重复点击的判断
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// 节流函数
|
||||
|
const throttle = (fn, t,_this) => { |
||||
|
console.log('throttle') |
||||
|
return ()=> { |
||||
|
if (!_this.timer) { |
||||
|
_this.timer = setTimeout(()=>{ |
||||
|
console.log('fn') |
||||
|
//·清空定时器
|
||||
|
_this.timer = null |
||||
|
}, t) |
||||
|
fn() |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//导出
|
||||
|
export default { |
||||
|
noMultipleClicks,//禁止多次点击
|
||||
|
throttle |
||||
|
} |
After Width: | Height: | Size: 42 KiB |
@ -0,0 +1,416 @@ |
|||||
|
<template> |
||||
|
<view class="kk-printer"> |
||||
|
<view class="kk-printer-btn" @tap="handlePrintTap"> |
||||
|
{{isPrinting?printingText:defaultText}} |
||||
|
</view> |
||||
|
<view class="kk-shadow" :class="isShowSearch?'show':''" @tap="handleSearchClose"> |
||||
|
<view class="kk-modal" @tap.stop="doNothing"> |
||||
|
<view class="kk-search-device"> |
||||
|
<view class="kk-filter-wrap"> |
||||
|
<view class="filter-title">根据SRRI过滤设备</view> |
||||
|
<slider @change="handleSRRIChange" max='-20' min='-100' value="-95" show-value/> |
||||
|
</view> |
||||
|
<view class="kk-filter-wrap"> |
||||
|
<view class="filter-title">根据蓝牙名过滤</view> |
||||
|
<input type="text" placeholder-class="kk-placeholder-class" placeholder="请输入蓝牙名字或设备ID搜索" v-model="filterName" /> |
||||
|
</view> |
||||
|
<view class="kk-btn-wrap"> |
||||
|
<view class="kk-btn-item confirm-btn" @tap="searchBtnTap" v-if="!isSearching"> |
||||
|
搜索设备 |
||||
|
</view> |
||||
|
<view class="kk-btn-item confirm-btn" v-else> |
||||
|
搜索中... |
||||
|
</view> |
||||
|
<view class="kk-btn-item" @tap="stopSearchBtnTap"> |
||||
|
停止搜索 |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="kk-devices-wrap"> |
||||
|
<view class="empty-wrap" v-if="filterDeviceList.length <= 0"> |
||||
|
<view class="empty-icon"></view> |
||||
|
<view class="empty-text">~ 无可搜索到的设备 ~</view> |
||||
|
</view> |
||||
|
<view class="" v-else> |
||||
|
<view class="kk-devices-item" v-for="(item,index) in filterDeviceList" :key="index" @tap="handleConnectDevice(item)"> |
||||
|
<view class="name"> |
||||
|
<text>设备名称:</text> |
||||
|
<text>{{item.name?item.name:'未命名'}}</text> |
||||
|
</view> |
||||
|
<view class="rssi"> |
||||
|
<text>信号强度:</text> |
||||
|
<text>({{Math.max(0, item.RSSI + 100)}}%)</text> |
||||
|
</view> |
||||
|
<view class="deviceid"> |
||||
|
<text>设备ID:</text> |
||||
|
<text>{{item.deviceId}}</text> |
||||
|
</view> |
||||
|
<view class="advmac" v-if="item.advMac"> |
||||
|
<text>advMac:</text> |
||||
|
<text>{{item.advMac}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import * as gbk from '@/components/kk-printer/utils/printUtil-GBK.js'; |
||||
|
import * as blesdk from './utils/bluetoolth'; |
||||
|
import * as util from './utils/util.js'; |
||||
|
export default { |
||||
|
data(){ |
||||
|
return{ |
||||
|
//是否正在打印 |
||||
|
isPrinting:false, |
||||
|
//是否正在搜索设备 |
||||
|
isSearching:false, |
||||
|
//是否显示蓝牙列表 |
||||
|
isShowSearch:false, |
||||
|
//按蓝牙名过滤 |
||||
|
filterName:'', |
||||
|
//按信号过滤 |
||||
|
filterRSSI:-95, |
||||
|
//设备列表 |
||||
|
devicesList:[], |
||||
|
//连接的设备ID |
||||
|
deviceId:'', |
||||
|
//根据设备ID获取的服务 |
||||
|
services:'', |
||||
|
//获取特征值时返回的三要素 |
||||
|
serviceId: '', |
||||
|
writeId: '', |
||||
|
readId: '' |
||||
|
} |
||||
|
}, |
||||
|
props:{ |
||||
|
//按钮默认文字 |
||||
|
defaultText:{ |
||||
|
type:String, |
||||
|
default:'打印' |
||||
|
}, |
||||
|
//按钮打印中的文字 |
||||
|
printingText:{ |
||||
|
type:String, |
||||
|
default:'打印中...' |
||||
|
}, |
||||
|
bufferData:{ |
||||
|
type:String, |
||||
|
require:true |
||||
|
} |
||||
|
}, |
||||
|
computed:{ |
||||
|
mapFilterRSSI(){ |
||||
|
return (0 - this.filterRSSI) |
||||
|
}, |
||||
|
filterDeviceList(){ |
||||
|
let devices = this.devicesList; |
||||
|
let name = this.filterName; |
||||
|
let rssi = this.filterRSSI; |
||||
|
console.log(devices,name,rssi) |
||||
|
//按RSSI过滤 |
||||
|
let filterDevices1 = devices.filter((item)=>{ |
||||
|
return item.RSSI > rssi |
||||
|
}) |
||||
|
console.log(filterDevices1) |
||||
|
// 按名字过滤 |
||||
|
let filterDevices2 |
||||
|
if(name!=''){ |
||||
|
filterDevices2 = filterDevices1.filter((item)=>{ |
||||
|
return (item.name.indexOf(name) >= 0 || item.deviceId.indexOf(name) >= 0) |
||||
|
}) |
||||
|
}else{ |
||||
|
filterDevices2 = filterDevices1 |
||||
|
} |
||||
|
// 根据广播数据提取MAC地址 |
||||
|
for (let i = 0; i < filterDevices2.length;i++) { |
||||
|
if (filterDevices2[i].hasOwnProperty('advertisData')){ |
||||
|
if (filterDevices2[i].advertisData.byteLength == 8) { |
||||
|
filterDevices2[i].advMac = util.buf2hex(filterDevices2[i].advertisData.slice(2, 7)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return filterDevices2 |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
|
||||
|
}, |
||||
|
beforeDestroy(){ |
||||
|
this.stopSearchBtnTap(); |
||||
|
}, |
||||
|
methods:{ |
||||
|
doNothing(){ |
||||
|
return; |
||||
|
}, |
||||
|
//点击打印按钮 |
||||
|
handlePrintTap(){ |
||||
|
console.log(11) |
||||
|
//打开蓝牙适配器 |
||||
|
blesdk.openBlue().then((res)=>{ |
||||
|
console.log(99,res) |
||||
|
//获取已连接设备 |
||||
|
blesdk.getConnectedBluetoothDevices().then((res)=>{ |
||||
|
//若没有已连接设备,弹框搜索设备 |
||||
|
console.log(66,res,this.deviceId,this.serviceId,this.writeId,this.bufferData,this.onPrintSuccess) |
||||
|
if(res.devices.length == 0){ |
||||
|
this.isShowSearch = true |
||||
|
}else{ |
||||
|
let datalen=20; |
||||
|
if (plus.os.name != 'Android') |
||||
|
{ |
||||
|
datalen=180; |
||||
|
} |
||||
|
this.isPrinting = true; |
||||
|
this.$emit('onPrint'); |
||||
|
this.$nextTick(()=>{ |
||||
|
console.log(1,this.bufferData) |
||||
|
if(this.bufferData!=''){ |
||||
|
let buffer = gbk.strToGBKByte(this.bufferData) |
||||
|
console.log(2,buffer) |
||||
|
let opt = { |
||||
|
deviceId: this.deviceId, |
||||
|
serviceId: this.serviceId, |
||||
|
characteristicId: this.writeId, |
||||
|
value:buffer, |
||||
|
lasterSuccess: this.onPrintSuccess, |
||||
|
onceLength:datalen |
||||
|
} |
||||
|
console.log(3,opt) |
||||
|
blesdk.sendDataToDevice(opt); |
||||
|
this.isPrinting = false; |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}).catch((err)=>{ |
||||
|
console.log(88,err) |
||||
|
blesdk.catchToast(err); |
||||
|
}) |
||||
|
}).catch((err)=>{ |
||||
|
console.log(77,err) |
||||
|
blesdk.catchToast(err); |
||||
|
}) |
||||
|
}, |
||||
|
onGetDevice(res){ |
||||
|
this.devicesList = res; |
||||
|
}, |
||||
|
handleSearchClose(){ |
||||
|
this.isShowSearch = false |
||||
|
}, |
||||
|
handleSRRIChange(e){ |
||||
|
this.filterRSSI = e.detail.value |
||||
|
}, |
||||
|
//开始搜索设备 |
||||
|
searchBtnTap(){ |
||||
|
blesdk.startBluetoothDevicesDiscovery(); |
||||
|
this.isSearching = true; |
||||
|
blesdk.onfindBlueDevices(this.onGetDevice) |
||||
|
}, |
||||
|
//停止搜索设备 |
||||
|
stopSearchBtnTap(){ |
||||
|
blesdk.stopBlueDevicesDiscovery(); |
||||
|
this.isSearching = false; |
||||
|
}, |
||||
|
//点击连接设备 |
||||
|
handleConnectDevice(device){ |
||||
|
|
||||
|
let deviceId = device.deviceId; |
||||
|
let name = device.name; |
||||
|
this.deviceId = deviceId; |
||||
|
console.log('deviceId',this.deviceId) |
||||
|
// uni.setStorageSync('k_curDeviceID',deviceId); |
||||
|
// uni.setStorageSync('k_curDeviceName',name); |
||||
|
uni.onBLEConnectionStateChange((res)=>{ |
||||
|
console.log('连接',res) |
||||
|
if(res.connected){ |
||||
|
plus.nativeUI.toast('设备'+ res.deviceId + '已连接',{ |
||||
|
verticalAlign:'center' |
||||
|
}) |
||||
|
}else{ |
||||
|
plus.nativeUI.toast('设备'+ res.deviceId + '已断开连接',{ |
||||
|
verticalAlign:'center' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
blesdk.createBLEConnection(deviceId, this.onConnectSuccess, this.onConnectFail); |
||||
|
}, |
||||
|
onConnectSuccess(res){ |
||||
|
this.stopSearchBtnTap() |
||||
|
blesdk.getBLEDeviceServices(this.deviceId, this.onGetServicesSuccess, this.onGetServicesFail); |
||||
|
}, |
||||
|
onConnectFail(err){ |
||||
|
console.log('链接失败',err) |
||||
|
}, |
||||
|
onGetServicesSuccess(res){ |
||||
|
console.log('获取服务',res) |
||||
|
this.services = res.serviceId; |
||||
|
blesdk.getDeviceCharacteristics(this.deviceId, this.services, this.onGetCharacterSuccess, this.onGetCharacterFail); |
||||
|
}, |
||||
|
onGetServicesFail(err){ |
||||
|
console.log('获取服务失败') |
||||
|
}, |
||||
|
onGetCharacterSuccess(res){ |
||||
|
console.log('获取特征值成功',res) |
||||
|
this.serviceId = res.serviceId; |
||||
|
this.writeId = res.writeId; |
||||
|
this.readId = res.readId; |
||||
|
this.isShowSearch = false; |
||||
|
}, |
||||
|
onGetCharacterFail(err){ |
||||
|
console.log('特征值获取失败') |
||||
|
}, |
||||
|
onPrintSuccess(){ |
||||
|
this.isPrinting = false; |
||||
|
console.log('打印成功') |
||||
|
this.$emit('onPrintSuccess') |
||||
|
}, |
||||
|
onPrintFail(){ |
||||
|
console.log('打印失败') |
||||
|
this.isPrinting = false; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.kk-printer{ |
||||
|
width:100%; |
||||
|
height:100%; |
||||
|
&-btn{ |
||||
|
width:100%; |
||||
|
height:100%; |
||||
|
text-align: center; |
||||
|
line-height: 50px; |
||||
|
} |
||||
|
.kk-shadow{ |
||||
|
display: none; |
||||
|
&.show{ |
||||
|
display: block; |
||||
|
width:100vw; |
||||
|
height:100vh; |
||||
|
background: rgba(0,0,0,0.4); |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
.kk-modal{ |
||||
|
width:680upx; |
||||
|
height: 80%; |
||||
|
padding:24upx; |
||||
|
box-sizing: border-box; |
||||
|
overflow-y: auto; |
||||
|
border-radius: 20upx; |
||||
|
background: #ffffff; |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
.kk-search-device{ |
||||
|
width:100%; |
||||
|
height: 100%; |
||||
|
.kk-filter-wrap{ |
||||
|
width:100%; |
||||
|
height: 160upx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: flex-start; |
||||
|
align-items: flex-start; |
||||
|
.filter-title{ |
||||
|
line-height: 70upx; |
||||
|
font-size: 30upx; |
||||
|
color: #999999; |
||||
|
} |
||||
|
&>slider{ |
||||
|
width:90%; |
||||
|
height: 90upx; |
||||
|
} |
||||
|
&>input{ |
||||
|
padding:0 20upx; |
||||
|
box-sizing: border-box; |
||||
|
border-radius: 10upx; |
||||
|
height: 90upx; |
||||
|
width:100%; |
||||
|
border: 1upx solid #ebebeb; |
||||
|
} |
||||
|
} |
||||
|
.kk-btn-wrap{ |
||||
|
width:100%; |
||||
|
height: 140upx; |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
&>view{ |
||||
|
flex:1 1 auto; |
||||
|
height: 100upx; |
||||
|
line-height: 100upx; |
||||
|
border-radius: 16upx; |
||||
|
text-align: center; |
||||
|
color:#ffffff; |
||||
|
&.confirm-btn{ |
||||
|
background: #007AFF; |
||||
|
margin-right:30upx; |
||||
|
} |
||||
|
&:nth-last-child(1){ |
||||
|
background: #DD524D; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
.kk-devices-wrap{ |
||||
|
height: calc(100% - 460upx); |
||||
|
overflow-y:auto; |
||||
|
padding:10upx 20upx; |
||||
|
box-sizing: border-box; |
||||
|
border: 1upx solid #ebebeb; |
||||
|
box-sizing: border-box; |
||||
|
border-radius: 20upx; |
||||
|
.empty-wrap{ |
||||
|
width:100%; |
||||
|
height: 100%; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
.empty-icon{ |
||||
|
width:268upx; |
||||
|
height: 240upx; |
||||
|
background: url('./empty-icon.png') no-repeat; |
||||
|
background-size:100% 100%; |
||||
|
margin-bottom: 26upx; |
||||
|
} |
||||
|
.empty-text{ |
||||
|
width: 100%; |
||||
|
line-height: 50upx; |
||||
|
font-size: 30upx; |
||||
|
text-align: center; |
||||
|
color: #999999; |
||||
|
} |
||||
|
} |
||||
|
.kk-devices-item{ |
||||
|
width:100%; |
||||
|
border-bottom: 1upx solid #ebebeb; |
||||
|
padding:10upx 0; |
||||
|
box-sizing: border-box; |
||||
|
&:nth-last-child(1){ |
||||
|
border-bottom: none; |
||||
|
} |
||||
|
&>view{ |
||||
|
width:100%; |
||||
|
font-size: 30upx; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
.kk-placeholder-class{ |
||||
|
font-size: 30upx; |
||||
|
color:#999999; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,402 @@ |
|||||
|
var CHAR_TILDE = 126; |
||||
|
var CODE_FNC1 = 102; |
||||
|
|
||||
|
var SET_STARTA = 103; |
||||
|
var SET_STARTB = 104; |
||||
|
var SET_STARTC = 105; |
||||
|
var SET_SHIFT = 98; |
||||
|
var SET_CODEA = 101; |
||||
|
var SET_CODEB = 100; |
||||
|
var SET_STOP = 106; |
||||
|
|
||||
|
|
||||
|
var REPLACE_CODES = { |
||||
|
CHAR_TILDE: CODE_FNC1 //~ corresponds to FNC1 in GS1-128 standard
|
||||
|
} |
||||
|
|
||||
|
var CODESET = { |
||||
|
ANY: 1, |
||||
|
AB: 2, |
||||
|
A: 3, |
||||
|
B: 4, |
||||
|
C: 5 |
||||
|
}; |
||||
|
|
||||
|
function getBytes(str) { |
||||
|
var bytes = []; |
||||
|
for (var i = 0; i < str.length; i++) { |
||||
|
bytes.push(str.charCodeAt(i)); |
||||
|
} |
||||
|
return bytes; |
||||
|
} |
||||
|
|
||||
|
exports.code128 = function (ctx, text, width, height) { |
||||
|
|
||||
|
width = parseInt(width); |
||||
|
|
||||
|
height = parseInt(height); |
||||
|
|
||||
|
var codes = stringToCode128(text); |
||||
|
|
||||
|
var g = new Graphics(ctx, width, height); |
||||
|
|
||||
|
var barWeight = g.area.width / ((codes.length - 3) * 11 + 35); |
||||
|
|
||||
|
var x = g.area.left; |
||||
|
var y = g.area.top; |
||||
|
for (var i = 0; i < codes.length; i++) { |
||||
|
var c = codes[i]; |
||||
|
//two bars at a time: 1 black and 1 white
|
||||
|
for (var bar = 0; bar < 8; bar += 2) { |
||||
|
var barW = PATTERNS[c][bar] * barWeight; |
||||
|
// var barH = height - y - this.border;
|
||||
|
var barH = height - y; |
||||
|
var spcW = PATTERNS[c][bar + 1] * barWeight; |
||||
|
|
||||
|
//no need to draw if 0 width
|
||||
|
if (barW > 0) { |
||||
|
g.fillFgRect(x, y, barW, barH); |
||||
|
} |
||||
|
|
||||
|
x += barW + spcW; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
ctx.draw(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
function stringToCode128(text) { |
||||
|
|
||||
|
var barc = { |
||||
|
currcs: CODESET.C |
||||
|
}; |
||||
|
|
||||
|
var bytes = getBytes(text); |
||||
|
//decide starting codeset
|
||||
|
var index = bytes[0] == CHAR_TILDE ? 1 : 0; |
||||
|
|
||||
|
var csa1 = bytes.length > 0 ? codeSetAllowedFor(bytes[index++]) : CODESET.AB; |
||||
|
var csa2 = bytes.length > 0 ? codeSetAllowedFor(bytes[index++]) : CODESET.AB; |
||||
|
barc.currcs = getBestStartSet(csa1, csa2); |
||||
|
barc.currcs = perhapsCodeC(bytes, barc.currcs); |
||||
|
|
||||
|
//if no codeset changes this will end up with bytes.length+3
|
||||
|
//start, checksum and stop
|
||||
|
var codes = new Array(); |
||||
|
|
||||
|
switch (barc.currcs) { |
||||
|
case CODESET.A: |
||||
|
codes.push(SET_STARTA); |
||||
|
break; |
||||
|
case CODESET.B: |
||||
|
codes.push(SET_STARTB); |
||||
|
break; |
||||
|
default: |
||||
|
codes.push(SET_STARTC); |
||||
|
break; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
for (var i = 0; i < bytes.length; i++) { |
||||
|
var b1 = bytes[i]; //get the first of a pair
|
||||
|
//should we translate/replace
|
||||
|
if (b1 in REPLACE_CODES) { |
||||
|
codes.push(REPLACE_CODES[b1]); |
||||
|
i++ //jump to next
|
||||
|
b1 = bytes[i]; |
||||
|
} |
||||
|
|
||||
|
//get the next in the pair if possible
|
||||
|
var b2 = bytes.length > (i + 1) ? bytes[i + 1] : -1; |
||||
|
|
||||
|
codes = codes.concat(codesForChar(b1, b2, barc.currcs)); |
||||
|
//code C takes 2 chars each time
|
||||
|
if (barc.currcs == CODESET.C) i++; |
||||
|
} |
||||
|
|
||||
|
//calculate checksum according to Code 128 standards
|
||||
|
var checksum = codes[0]; |
||||
|
for (var weight = 1; weight < codes.length; weight++) { |
||||
|
checksum += (weight * codes[weight]); |
||||
|
} |
||||
|
codes.push(checksum % 103); |
||||
|
|
||||
|
codes.push(SET_STOP); |
||||
|
|
||||
|
//encoding should now be complete
|
||||
|
return codes; |
||||
|
|
||||
|
function getBestStartSet(csa1, csa2) { |
||||
|
//tries to figure out the best codeset
|
||||
|
//to start with to get the most compact code
|
||||
|
var vote = 0; |
||||
|
vote += csa1 == CODESET.A ? 1 : 0; |
||||
|
vote += csa1 == CODESET.B ? -1 : 0; |
||||
|
vote += csa2 == CODESET.A ? 1 : 0; |
||||
|
vote += csa2 == CODESET.B ? -1 : 0; |
||||
|
//tie goes to B due to my own predudices
|
||||
|
return vote > 0 ? CODESET.A : CODESET.B; |
||||
|
} |
||||
|
|
||||
|
function perhapsCodeC(bytes, codeset) { |
||||
|
for (var i = 0; i < bytes.length; i++) { |
||||
|
var b = bytes[i] |
||||
|
if ((b < 48 || b > 57) && b != CHAR_TILDE) |
||||
|
return codeset; |
||||
|
} |
||||
|
return CODESET.C; |
||||
|
} |
||||
|
|
||||
|
//chr1 is current byte
|
||||
|
//chr2 is the next byte to process. looks ahead.
|
||||
|
function codesForChar(chr1, chr2, currcs) { |
||||
|
var result = []; |
||||
|
var shifter = -1; |
||||
|
|
||||
|
if (charCompatible(chr1, currcs)) { |
||||
|
if (currcs == CODESET.C) { |
||||
|
if (chr2 == -1) { |
||||
|
shifter = SET_CODEB; |
||||
|
currcs = CODESET.B; |
||||
|
} |
||||
|
else if ((chr2 != -1) && !charCompatible(chr2, currcs)) { |
||||
|
//need to check ahead as well
|
||||
|
if (charCompatible(chr2, CODESET.A)) { |
||||
|
shifter = SET_CODEA; |
||||
|
currcs = CODESET.A; |
||||
|
} |
||||
|
else { |
||||
|
shifter = SET_CODEB; |
||||
|
currcs = CODESET.B; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
else { |
||||
|
//if there is a next char AND that next char is also not compatible
|
||||
|
if ((chr2 != -1) && !charCompatible(chr2, currcs)) { |
||||
|
//need to switch code sets
|
||||
|
switch (currcs) { |
||||
|
case CODESET.A: |
||||
|
shifter = SET_CODEB; |
||||
|
currcs = CODESET.B; |
||||
|
break; |
||||
|
case CODESET.B: |
||||
|
shifter = SET_CODEA; |
||||
|
currcs = CODESET.A; |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
else { |
||||
|
//no need to shift code sets, a temporary SHIFT will suffice
|
||||
|
shifter = SET_SHIFT; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//ok some type of shift is nessecary
|
||||
|
if (shifter != -1) { |
||||
|
result.push(shifter); |
||||
|
result.push(codeValue(chr2)); |
||||
|
} |
||||
|
else { |
||||
|
if (currcs == CODESET.C) { |
||||
|
//include next as well
|
||||
|
result.push(codeValue(chr1, chr2)); |
||||
|
} |
||||
|
else { |
||||
|
result.push(codeValue(chr1)); |
||||
|
} |
||||
|
} |
||||
|
barc.currcs = currcs; |
||||
|
|
||||
|
return result; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//reduce the ascii code to fit into the Code128 char table
|
||||
|
function codeValue(chr1, chr2) { |
||||
|
if (typeof chr2 == "undefined") { |
||||
|
return chr1 >= 32 ? chr1 - 32 : chr1 + 64; |
||||
|
} |
||||
|
else { |
||||
|
return parseInt(String.fromCharCode(chr1) + String.fromCharCode(chr2)); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
function charCompatible(chr, codeset) { |
||||
|
var csa = codeSetAllowedFor(chr); |
||||
|
if (csa == CODESET.ANY) return true; |
||||
|
//if we need to change from current
|
||||
|
if (csa == CODESET.AB) return true; |
||||
|
if (csa == CODESET.A && codeset == CODESET.A) return true; |
||||
|
if (csa == CODESET.B && codeset == CODESET.B) return true; |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
function codeSetAllowedFor(chr) { |
||||
|
if (chr >= 48 && chr <= 57) { |
||||
|
//0-9
|
||||
|
return CODESET.ANY; |
||||
|
} |
||||
|
else if (chr >= 32 && chr <= 95) { |
||||
|
//0-9 A-Z
|
||||
|
return CODESET.AB; |
||||
|
} |
||||
|
else { |
||||
|
//if non printable
|
||||
|
return chr < 32 ? CODESET.A : CODESET.B; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
var Graphics = function(ctx, width, height) { |
||||
|
|
||||
|
this.width = width; |
||||
|
this.height = height; |
||||
|
this.quiet = Math.round(this.width / 40); |
||||
|
|
||||
|
this.border_size = 0; |
||||
|
this.padding_width = 0; |
||||
|
|
||||
|
this.area = { |
||||
|
width : width - this.padding_width * 2 - this.quiet * 2, |
||||
|
height: height - this.border_size * 2, |
||||
|
top : this.border_size - 4, |
||||
|
left : this.padding_width + this.quiet |
||||
|
}; |
||||
|
|
||||
|
this.ctx = ctx; |
||||
|
this.fg = "#000000"; |
||||
|
this.bg = "#ffffff"; |
||||
|
|
||||
|
// fill background
|
||||
|
this.fillBgRect(0,0, width, height); |
||||
|
|
||||
|
// fill center to create border
|
||||
|
this.fillBgRect(0, this.border_size, width, height - this.border_size * 2); |
||||
|
} |
||||
|
|
||||
|
//use native color
|
||||
|
Graphics.prototype._fillRect = function(x, y, width, height, color) { |
||||
|
this.ctx.setFillStyle(color) |
||||
|
this.ctx.fillRect(x, y, width, height) |
||||
|
} |
||||
|
|
||||
|
Graphics.prototype.fillFgRect = function(x,y, width, height) { |
||||
|
this._fillRect(x, y, width, height, this.fg); |
||||
|
} |
||||
|
|
||||
|
Graphics.prototype.fillBgRect = function(x,y, width, height) { |
||||
|
this._fillRect(x, y, width, height, this.bg); |
||||
|
} |
||||
|
|
||||
|
var PATTERNS = [ |
||||
|
[2, 1, 2, 2, 2, 2, 0, 0], // 0
|
||||
|
[2, 2, 2, 1, 2, 2, 0, 0], // 1
|
||||
|
[2, 2, 2, 2, 2, 1, 0, 0], // 2
|
||||
|
[1, 2, 1, 2, 2, 3, 0, 0], // 3
|
||||
|
[1, 2, 1, 3, 2, 2, 0, 0], // 4
|
||||
|
[1, 3, 1, 2, 2, 2, 0, 0], // 5
|
||||
|
[1, 2, 2, 2, 1, 3, 0, 0], // 6
|
||||
|
[1, 2, 2, 3, 1, 2, 0, 0], // 7
|
||||
|
[1, 3, 2, 2, 1, 2, 0, 0], // 8
|
||||
|
[2, 2, 1, 2, 1, 3, 0, 0], // 9
|
||||
|
[2, 2, 1, 3, 1, 2, 0, 0], // 10
|
||||
|
[2, 3, 1, 2, 1, 2, 0, 0], // 11
|
||||
|
[1, 1, 2, 2, 3, 2, 0, 0], // 12
|
||||
|
[1, 2, 2, 1, 3, 2, 0, 0], // 13
|
||||
|
[1, 2, 2, 2, 3, 1, 0, 0], // 14
|
||||
|
[1, 1, 3, 2, 2, 2, 0, 0], // 15
|
||||
|
[1, 2, 3, 1, 2, 2, 0, 0], // 16
|
||||
|
[1, 2, 3, 2, 2, 1, 0, 0], // 17
|
||||
|
[2, 2, 3, 2, 1, 1, 0, 0], // 18
|
||||
|
[2, 2, 1, 1, 3, 2, 0, 0], // 19
|
||||
|
[2, 2, 1, 2, 3, 1, 0, 0], // 20
|
||||
|
[2, 1, 3, 2, 1, 2, 0, 0], // 21
|
||||
|
[2, 2, 3, 1, 1, 2, 0, 0], // 22
|
||||
|
[3, 1, 2, 1, 3, 1, 0, 0], // 23
|
||||
|
[3, 1, 1, 2, 2, 2, 0, 0], // 24
|
||||
|
[3, 2, 1, 1, 2, 2, 0, 0], // 25
|
||||
|
[3, 2, 1, 2, 2, 1, 0, 0], // 26
|
||||
|
[3, 1, 2, 2, 1, 2, 0, 0], // 27
|
||||
|
[3, 2, 2, 1, 1, 2, 0, 0], // 28
|
||||
|
[3, 2, 2, 2, 1, 1, 0, 0], // 29
|
||||
|
[2, 1, 2, 1, 2, 3, 0, 0], // 30
|
||||
|
[2, 1, 2, 3, 2, 1, 0, 0], // 31
|
||||
|
[2, 3, 2, 1, 2, 1, 0, 0], // 32
|
||||
|
[1, 1, 1, 3, 2, 3, 0, 0], // 33
|
||||
|
[1, 3, 1, 1, 2, 3, 0, 0], // 34
|
||||
|
[1, 3, 1, 3, 2, 1, 0, 0], // 35
|
||||
|
[1, 1, 2, 3, 1, 3, 0, 0], // 36
|
||||
|
[1, 3, 2, 1, 1, 3, 0, 0], // 37
|
||||
|
[1, 3, 2, 3, 1, 1, 0, 0], // 38
|
||||
|
[2, 1, 1, 3, 1, 3, 0, 0], // 39
|
||||
|
[2, 3, 1, 1, 1, 3, 0, 0], // 40
|
||||
|
[2, 3, 1, 3, 1, 1, 0, 0], // 41
|
||||
|
[1, 1, 2, 1, 3, 3, 0, 0], // 42
|
||||
|
[1, 1, 2, 3, 3, 1, 0, 0], // 43
|
||||
|
[1, 3, 2, 1, 3, 1, 0, 0], // 44
|
||||
|
[1, 1, 3, 1, 2, 3, 0, 0], // 45
|
||||
|
[1, 1, 3, 3, 2, 1, 0, 0], // 46
|
||||
|
[1, 3, 3, 1, 2, 1, 0, 0], // 47
|
||||
|
[3, 1, 3, 1, 2, 1, 0, 0], // 48
|
||||
|
[2, 1, 1, 3, 3, 1, 0, 0], // 49
|
||||
|
[2, 3, 1, 1, 3, 1, 0, 0], // 50
|
||||
|
[2, 1, 3, 1, 1, 3, 0, 0], // 51
|
||||
|
[2, 1, 3, 3, 1, 1, 0, 0], // 52
|
||||
|
[2, 1, 3, 1, 3, 1, 0, 0], // 53
|
||||
|
[3, 1, 1, 1, 2, 3, 0, 0], // 54
|
||||
|
[3, 1, 1, 3, 2, 1, 0, 0], // 55
|
||||
|
[3, 3, 1, 1, 2, 1, 0, 0], // 56
|
||||
|
[3, 1, 2, 1, 1, 3, 0, 0], // 57
|
||||
|
[3, 1, 2, 3, 1, 1, 0, 0], // 58
|
||||
|
[3, 3, 2, 1, 1, 1, 0, 0], // 59
|
||||
|
[3, 1, 4, 1, 1, 1, 0, 0], // 60
|
||||
|
[2, 2, 1, 4, 1, 1, 0, 0], // 61
|
||||
|
[4, 3, 1, 1, 1, 1, 0, 0], // 62
|
||||
|
[1, 1, 1, 2, 2, 4, 0, 0], // 63
|
||||
|
[1, 1, 1, 4, 2, 2, 0, 0], // 64
|
||||
|
[1, 2, 1, 1, 2, 4, 0, 0], // 65
|
||||
|
[1, 2, 1, 4, 2, 1, 0, 0], // 66
|
||||
|
[1, 4, 1, 1, 2, 2, 0, 0], // 67
|
||||
|
[1, 4, 1, 2, 2, 1, 0, 0], // 68
|
||||
|
[1, 1, 2, 2, 1, 4, 0, 0], // 69
|
||||
|
[1, 1, 2, 4, 1, 2, 0, 0], // 70
|
||||
|
[1, 2, 2, 1, 1, 4, 0, 0], // 71
|
||||
|
[1, 2, 2, 4, 1, 1, 0, 0], // 72
|
||||
|
[1, 4, 2, 1, 1, 2, 0, 0], // 73
|
||||
|
[1, 4, 2, 2, 1, 1, 0, 0], // 74
|
||||
|
[2, 4, 1, 2, 1, 1, 0, 0], // 75
|
||||
|
[2, 2, 1, 1, 1, 4, 0, 0], // 76
|
||||
|
[4, 1, 3, 1, 1, 1, 0, 0], // 77
|
||||
|
[2, 4, 1, 1, 1, 2, 0, 0], // 78
|
||||
|
[1, 3, 4, 1, 1, 1, 0, 0], // 79
|
||||
|
[1, 1, 1, 2, 4, 2, 0, 0], // 80
|
||||
|
[1, 2, 1, 1, 4, 2, 0, 0], // 81
|
||||
|
[1, 2, 1, 2, 4, 1, 0, 0], // 82
|
||||
|
[1, 1, 4, 2, 1, 2, 0, 0], // 83
|
||||
|
[1, 2, 4, 1, 1, 2, 0, 0], // 84
|
||||
|
[1, 2, 4, 2, 1, 1, 0, 0], // 85
|
||||
|
[4, 1, 1, 2, 1, 2, 0, 0], // 86
|
||||
|
[4, 2, 1, 1, 1, 2, 0, 0], // 87
|
||||
|
[4, 2, 1, 2, 1, 1, 0, 0], // 88
|
||||
|
[2, 1, 2, 1, 4, 1, 0, 0], // 89
|
||||
|
[2, 1, 4, 1, 2, 1, 0, 0], // 90
|
||||
|
[4, 1, 2, 1, 2, 1, 0, 0], // 91
|
||||
|
[1, 1, 1, 1, 4, 3, 0, 0], // 92
|
||||
|
[1, 1, 1, 3, 4, 1, 0, 0], // 93
|
||||
|
[1, 3, 1, 1, 4, 1, 0, 0], // 94
|
||||
|
[1, 1, 4, 1, 1, 3, 0, 0], // 95
|
||||
|
[1, 1, 4, 3, 1, 1, 0, 0], // 96
|
||||
|
[4, 1, 1, 1, 1, 3, 0, 0], // 97
|
||||
|
[4, 1, 1, 3, 1, 1, 0, 0], // 98
|
||||
|
[1, 1, 3, 1, 4, 1, 0, 0], // 99
|
||||
|
[1, 1, 4, 1, 3, 1, 0, 0], // 100
|
||||
|
[3, 1, 1, 1, 4, 1, 0, 0], // 101
|
||||
|
[4, 1, 1, 1, 3, 1, 0, 0], // 102
|
||||
|
[2, 1, 1, 4, 1, 2, 0, 0], // 103
|
||||
|
[2, 1, 1, 2, 1, 4, 0, 0], // 104
|
||||
|
[2, 1, 1, 2, 3, 2, 0, 0], // 105
|
||||
|
[2, 3, 3, 1, 1, 1, 2, 0] // 106
|
||||
|
] |
||||
|
|
@ -0,0 +1,723 @@ |
|||||
|
/** |
||||
|
* @export |
||||
|
* @param {string} name 微信api的名称 ,如 uniAsyncPromise("getSystemInfo",options) |
||||
|
* @param {object} options 除了success 和 fail 的其他参数 |
||||
|
* @returns |
||||
|
*/ |
||||
|
export function uniAsyncPromise(name, options) { |
||||
|
return new Promise((resolve, reject) => { |
||||
|
uni[name]({ |
||||
|
...(options || {}), |
||||
|
// ...options,
|
||||
|
success: (res) => { |
||||
|
resolve(res); |
||||
|
}, |
||||
|
fail: (err) => { |
||||
|
reject(err); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
//微信小程序向蓝牙打印机发送数据进行打印的坑:
|
||||
|
//小程序api向蓝牙打印机发送数据打印,发送的任何内容都应该要转成二进制数据,而且蓝牙打印的文本编码是GBK的,发送中文需转成GBK编码再转成二进制数据发送
|
||||
|
//发送打印机指令也要转成二进制数据发送
|
||||
|
//蓝牙打印机一次接收的二级制数据有限制,不同的系统不同的蓝牙设备限制可能不同,微信建议一次20个字节,需做递归分包发送
|
||||
|
//发送完要打印的内容后,一定要发送一个打印的指令才能顺利打印 (有些指令就不需要)
|
||||
|
|
||||
|
//一、初始化蓝牙、开始检索蓝牙设备
|
||||
|
// { allowDuplicatesKey: true, interval: 500}
|
||||
|
export function openBlue() { |
||||
|
return uniAsyncPromise('openBluetoothAdapter') |
||||
|
} |
||||
|
|
||||
|
export function startBluetoothDevicesDiscovery(option) { |
||||
|
console.log('开始蓝牙扫描'); |
||||
|
uniAsyncPromise('startBluetoothDevicesDiscovery', option).then((res) => { |
||||
|
console.log('正在搜寻蓝牙设备', res); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
export function getConnectedBluetoothDevices(option) { |
||||
|
console.log('开始获取已连接设备'); |
||||
|
return uniAsyncPromise('getConnectedBluetoothDevices', option) |
||||
|
} |
||||
|
//二、
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @export |
||||
|
* @param {function} getDevices uni.getBluetoothDevices的监听回调函数 |
||||
|
*/ |
||||
|
export function onfindBlueDevices(getDevices) { |
||||
|
//监听寻找到新设备的事件
|
||||
|
uni.onBluetoothDeviceFound((devices)=>{ |
||||
|
//获取在蓝牙模块生效期间所有已发现的蓝牙设备
|
||||
|
uniAsyncPromise('getBluetoothDevices').then((res) => { |
||||
|
getDevices && getDevices(res.devices); |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @export |
||||
|
* @param {function} stopBlueDevicesDiscovery 关闭蓝牙扫描 |
||||
|
*/ |
||||
|
export function stopBlueDevicesDiscovery() { |
||||
|
//监听寻找到新设备的事件
|
||||
|
console.log('停止蓝牙扫描'); |
||||
|
return uniAsyncPromise('stopBluetoothDevicesDiscovery').then((res) => { |
||||
|
console.log('停止搜寻蓝牙设备', res); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
//三、连接蓝牙设备
|
||||
|
/** |
||||
|
* @export |
||||
|
* @param {function} createBLEConnection |
||||
|
* @param {number} deviceId 蓝牙设备id |
||||
|
*/ |
||||
|
export function createBLEConnection(deviceId, sucess, fail) { |
||||
|
//连接蓝牙设备
|
||||
|
console.log('连接蓝牙设备', deviceId); |
||||
|
uniAsyncPromise("createBLEConnection", { |
||||
|
deviceId |
||||
|
}) |
||||
|
.then(res => { |
||||
|
//连接成功可选择停止搜索蓝牙
|
||||
|
//stopBlueDevicesDiscovery();
|
||||
|
console.log('连接成功'); |
||||
|
sucess && sucess({ |
||||
|
res: res, |
||||
|
}); |
||||
|
}) |
||||
|
.catch(res => { |
||||
|
console.log('连接设备异常' + res); |
||||
|
fail && fail({ |
||||
|
res: res, |
||||
|
}); |
||||
|
}) |
||||
|
/*.finally(res=>{ |
||||
|
console.log('连接成功'); |
||||
|
sucess && sucess({ |
||||
|
res: res, |
||||
|
}); |
||||
|
});*/ |
||||
|
} |
||||
|
|
||||
|
export function closeBLEConnection(deviceId) { |
||||
|
console.log('断开蓝牙设备', deviceId); |
||||
|
uniAsyncPromise("closeBLEConnection", { |
||||
|
deviceId |
||||
|
}) |
||||
|
.then(res => { |
||||
|
console.log('BLEDisconnect complete', res); |
||||
|
}) |
||||
|
.catch(res => { |
||||
|
console.log('断开设备异常' + res); |
||||
|
}) |
||||
|
/*.finally(res=>{ |
||||
|
console.log('BLEDisconnect complete', res); |
||||
|
}); */ |
||||
|
} |
||||
|
|
||||
|
//四、连接成功后, 获取蓝牙设备的service服务
|
||||
|
// uniAsyncPromise("getBLEDeviceServices",{deviceId:""}).then(res=>{})
|
||||
|
export function getBLEDeviceServices(deviceId, success, fail) { |
||||
|
console.log('获取ServiceId', deviceId); |
||||
|
//加延迟避免取不到service
|
||||
|
setTimeout(()=>{ |
||||
|
uniAsyncPromise("getBLEDeviceServices", { |
||||
|
deviceId:deviceId |
||||
|
}) |
||||
|
.then(res => { |
||||
|
console.log('服务', res); |
||||
|
success && success({ |
||||
|
serviceId: res.services, |
||||
|
}); |
||||
|
}) |
||||
|
.catch((res) => { |
||||
|
//getBLEDeviceServices(deviceId, success, fail);
|
||||
|
console.log('获取ServiceId异常' + res); |
||||
|
fail && fail({ |
||||
|
res: res, |
||||
|
}); |
||||
|
}); |
||||
|
},1000) |
||||
|
} |
||||
|
|
||||
|
//五、获取的service服务可能有多个,递归获取特征值(最后要用的是能读,能写,能监听的那个值的uuid作为特征值id)
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @export |
||||
|
* @param {number} deviceId 蓝牙设备id |
||||
|
* @param {array} services uniAsyncPromise("getBLEDeviceServices",{deviceId:""}).then(res=>{})获取的res.services |
||||
|
* @param {function} success 成功取得有用特征值uuid的回调函数 |
||||
|
*/ |
||||
|
export function getDeviceCharacteristics(deviceId, services, success, fail) { |
||||
|
//services = services.slice(0);
|
||||
|
console.log('获取Characteristics', deviceId, services); |
||||
|
if (services.length) { |
||||
|
const serviceId = services.shift().uuid; |
||||
|
console.log('ServceID ', serviceId); |
||||
|
uniAsyncPromise('getBLEDeviceCharacteristics', { |
||||
|
deviceId, |
||||
|
serviceId, |
||||
|
}) |
||||
|
.then((res) => { |
||||
|
console.log('getBLEDeviceCharacteristics', deviceId, serviceId, res); |
||||
|
let finished = false; |
||||
|
let write = false; |
||||
|
let notify = false; |
||||
|
let indicate = false; |
||||
|
var readId; |
||||
|
var writeId; |
||||
|
//有斑马品牌的一款打印机中res.characteristics的所有uuid都是相同的,找所有的properties存在(notify || indicate) && write这种情况就说明这个uuid是可用的(不确保所有的打印机都能用这种方式取得uuid,在主要测试得凯盛诺打印机res.characteristic只有一个uuid,所以也能用这个方式)
|
||||
|
for (var i = 0; i < res.characteristics.length; i++) { |
||||
|
if (!notify) { |
||||
|
notify = res.characteristics[i].properties.notify; |
||||
|
if (notify) readId = res.characteristics[i].uuid; |
||||
|
} |
||||
|
if (!indicate) { |
||||
|
indicate = res.characteristics[i].properties.indicate; |
||||
|
if (indicate) readId = res.characteristics[i].uuid; |
||||
|
} |
||||
|
if (!write) { |
||||
|
write = res.characteristics[i].properties.write; |
||||
|
writeId = res.characteristics[i].uuid; |
||||
|
} |
||||
|
if ((notify || indicate) && write) { |
||||
|
/* 获取蓝牙特征值uuid */ |
||||
|
success && |
||||
|
success({ |
||||
|
serviceId, |
||||
|
writeId: writeId, |
||||
|
readId: readId, |
||||
|
}); |
||||
|
finished = true; |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (!finished) { |
||||
|
getDeviceCharacteristics(deviceId, services, success, fail); |
||||
|
} |
||||
|
}) |
||||
|
.catch((res) => { |
||||
|
getDeviceCharacteristics(deviceId, services, success, fail); |
||||
|
}); |
||||
|
} else { |
||||
|
fail && fail(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//六、启动notify 蓝牙监听功能 然后使用 uni.onBLECharacteristicValueChange用来监听蓝牙设备传递数据
|
||||
|
/** |
||||
|
* @export |
||||
|
* @param {object} options |
||||
|
* { |
||||
|
deviceId,//蓝牙设备id
|
||||
|
serviceId,//服务id
|
||||
|
characteristicId,//可用特征值uuid
|
||||
|
} |
||||
|
* @param {function} onChange 监听蓝牙设备传递数据回调函数 |
||||
|
*/ |
||||
|
export function onGetBLECharacteristicValueChange(options, onChange = function() {}) { |
||||
|
console.log('deviceId ', options.deviceId); |
||||
|
console.log('serviceId ', options.serviceId); |
||||
|
console.log('characteristicId ', options.characteristicId); |
||||
|
uniAsyncPromise('notifyBLECharacteristicValueChange', { |
||||
|
state: true, |
||||
|
...options, |
||||
|
}).then((res) => { |
||||
|
console.log('onBLECharacteristicValueChange '); |
||||
|
uni.onBLECharacteristicValueChange(onChange); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
//七、发送数据(递归分包发送)
|
||||
|
/** |
||||
|
* @export |
||||
|
* @param {object} options |
||||
|
* { |
||||
|
deviceId, |
||||
|
serviceId, |
||||
|
characteristicId, |
||||
|
value [ArrayBuffer], |
||||
|
lasterSuccess, |
||||
|
onceLength |
||||
|
} |
||||
|
*/ |
||||
|
|
||||
|
export function sendDataToDevice(options) { |
||||
|
let byteLength = options.value.byteLength; |
||||
|
//这里默认一次20个字节发送
|
||||
|
const speed = options.onceLength; //20;
|
||||
|
console.log("send data 20"); |
||||
|
console.log(options); |
||||
|
if (byteLength > 0) { |
||||
|
uniAsyncPromise('writeBLECharacteristicValue', { |
||||
|
...options, |
||||
|
value: options.value.slice(0, byteLength > speed ? speed : byteLength), |
||||
|
}) |
||||
|
.then((res) => { |
||||
|
if (byteLength > speed) { |
||||
|
sendDataToDevice({ |
||||
|
...options, |
||||
|
value: options.value.slice(speed, byteLength), |
||||
|
}); |
||||
|
} else { |
||||
|
options.lasterSuccess && options.lasterSuccess(); |
||||
|
} |
||||
|
}) |
||||
|
.catch((res) => { |
||||
|
console.log(res); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
export function charToArrayBuffer(str) { |
||||
|
var out = new ArrayBuffer(str.length); |
||||
|
var uint8 = new Uint8Array(out); |
||||
|
var strs = str.split(''); |
||||
|
for (var i = 0; i < strs.length; i++) { |
||||
|
uint8[i] = strs[i].charCodeAt(); |
||||
|
} |
||||
|
return uint8; |
||||
|
} |
||||
|
export function charToArray(str) { |
||||
|
var arr = []; |
||||
|
var strs = str.split(''); |
||||
|
for (var i = 0; i < strs.length; i++) { |
||||
|
arr[i] = strs[i].charCodeAt(); |
||||
|
} |
||||
|
return arr; |
||||
|
} |
||||
|
//打印二维码
|
||||
|
/** |
||||
|
* @export |
||||
|
* @param {object} options |
||||
|
* { |
||||
|
deviceId, |
||||
|
serviceId, |
||||
|
characteristicId, |
||||
|
value,//ArrayBuffer:二维码的数据
|
||||
|
} |
||||
|
*/ |
||||
|
export function printQR(options) { |
||||
|
//打印二维码的十进制指令data:
|
||||
|
let data = [29, 107, 97, 7, 4, options.value.byteLength, 0]; |
||||
|
sendDataToDevice({ |
||||
|
...options, |
||||
|
value: new Uint8Array(data).buffer, |
||||
|
lasterSuccess: () => { |
||||
|
//指令发送成功后,发送二维码的数据
|
||||
|
sendDataToDevice(options); |
||||
|
}, |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function grayPixle(pix) { |
||||
|
return pix[0] * 0.299 + pix[1] * 0.587 + pix[2] * 0.114; |
||||
|
} |
||||
|
|
||||
|
export function overwriteImageData(data) { |
||||
|
let sendWidth = data.width, |
||||
|
sendHeight = data.height; |
||||
|
const threshold = data.threshold || 180; |
||||
|
let sendImageData = new ArrayBuffer((sendWidth * sendHeight) / 8); |
||||
|
sendImageData = new Uint8Array(sendImageData); |
||||
|
let pix = data.imageData; |
||||
|
const part = []; |
||||
|
let index = 0; |
||||
|
for (let i = 0; i < pix.length; i += 32) { |
||||
|
//横向每8个像素点组成一个字节(8位二进制数)。
|
||||
|
for (let k = 0; k < 8; k++) { |
||||
|
const grayPixle1 = grayPixle(pix.slice(i + k * 4, i + k * 4 + (4 - 1))); |
||||
|
//阈值调整
|
||||
|
if (grayPixle1 > threshold) { |
||||
|
//灰度值大于threshold位 白色 为第k位0不打印
|
||||
|
part[k] = 0; |
||||
|
} else { |
||||
|
part[k] = 1; |
||||
|
} |
||||
|
} |
||||
|
let temp = 0; |
||||
|
for (let a = 0; a < part.length; a++) { |
||||
|
temp += part[a] * Math.pow(2, part.length - 1 - a); |
||||
|
} |
||||
|
//开始不明白以下算法什么意思,了解了字节才知道,一个字节是8位的二进制数,part这个数组存的0和1就是二进制的0和1,传输到打印的位图数据的一个字节是0-255之间的十进制数,以下是用权相加法转十进制数,理解了这个就用上面的for循环替代了
|
||||
|
// const temp =
|
||||
|
// part[0] * 128 +
|
||||
|
// part[1] * 64 +
|
||||
|
// part[2] * 32 +
|
||||
|
// part[3] * 16 +
|
||||
|
// part[4] * 8 +
|
||||
|
// part[5] * 4 +
|
||||
|
// part[6] * 2 +
|
||||
|
// part[7] * 1;
|
||||
|
sendImageData[index++] = temp; |
||||
|
} |
||||
|
return { |
||||
|
array: Array.from(sendImageData), |
||||
|
width: sendWidth / 8, |
||||
|
height: sendHeight, |
||||
|
}; |
||||
|
} |
||||
|
/** |
||||
|
* printImage |
||||
|
* @param {object} opt |
||||
|
* { |
||||
|
deviceId,//蓝牙设备id
|
||||
|
serviceId,//服务id
|
||||
|
characteristicId,//可用特征值uuid
|
||||
|
lasterSuccess , //最后完成的回调
|
||||
|
} |
||||
|
*/ |
||||
|
export function printImage(opt = {}, imageInfo = {}) { |
||||
|
let arr = imageInfo.array, |
||||
|
width = imageInfo.width; |
||||
|
const writeArray = []; |
||||
|
const xl = width % 256; |
||||
|
const xh = width / 256; |
||||
|
//分行发送图片数据,用的十进制指令
|
||||
|
const command = [29, 118, 48, 0, xl, xh, 1, 0]; //1D 76 30 00 w h
|
||||
|
const enter = [13, 10]; |
||||
|
for (let i = 0; i < arr.length / width; i++) { |
||||
|
const subArr = arr.slice(i * width, i * width + width); |
||||
|
const tempArr = command.concat(subArr); |
||||
|
writeArray.push(new Uint8Array(tempArr)); |
||||
|
} |
||||
|
writeArray.push(new Uint8Array(enter)); |
||||
|
//console.log(writeArray);
|
||||
|
const print = (options, writeArray) => { |
||||
|
if (writeArray.length) { |
||||
|
console.log("send"); |
||||
|
sendDataToDevice({ |
||||
|
...options, |
||||
|
value: writeArray.shift().buffer, |
||||
|
lasterSuccess: () => { |
||||
|
if (writeArray.length) { |
||||
|
print(options, writeArray); |
||||
|
} else { |
||||
|
options.lasterSuccess && options.lasterSuccess(); |
||||
|
} |
||||
|
}, |
||||
|
}); |
||||
|
} |
||||
|
}; |
||||
|
console.log("start print"); |
||||
|
print(opt, writeArray); |
||||
|
} |
||||
|
|
||||
|
/* 16hex insert 0 */ |
||||
|
function Hex2Str(num) { |
||||
|
if (num.toString(16).length < 2) return "0" + num.toString(16); |
||||
|
else |
||||
|
return num.toString(16); |
||||
|
} |
||||
|
/*****CPCL指令接口****/ |
||||
|
|
||||
|
/** |
||||
|
* 配置项如下 |
||||
|
* |
||||
|
* width: 标签纸的宽度,单位像素點 |
||||
|
* height: 标签纸的高度,单位像素點 |
||||
|
* 8像素=1mm |
||||
|
* printNum: 打印张数,默认为1 |
||||
|
* rotation:页面整体旋转 1-90度 2-180度 3-270度 其他-不旋转 |
||||
|
*/ |
||||
|
export function CreatCPCLPage(width, height, printNum, rotation = 0, offset = 0) { |
||||
|
var strCmd = '! ' + offset + ' 200 200 ' + height + ' ' + printNum + '\n'; |
||||
|
strCmd += "PAGE-WIDTH " + width + '\n'; |
||||
|
if (rotation == 1) |
||||
|
strCmd += "ZPROTATE90\n"; |
||||
|
else if (rotation == 2) |
||||
|
strCmd += "ZPROTATE180\n"; |
||||
|
else if (rotation == 3) |
||||
|
strCmd += "ZPROTATE270\n"; |
||||
|
else |
||||
|
strCmd += "ZPROTATE0\n"; |
||||
|
return strCmd; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 打印文字 |
||||
|
* x: 文字方块左上角X座标,单位dot |
||||
|
* y: 文字方块左上角Y座标,单位dot |
||||
|
* fontName,fontSize: 字体,取值: 參考文檔 |
||||
|
* rotation: 旋转 1-90度 2-180度 3-270度 其他-不旋转 |
||||
|
* content: 文字内容 |
||||
|
*/ |
||||
|
export function addCPCLText(x, y, fontName, fontSize, rotation, content) { |
||||
|
//console.log(fontName,fontSize,rotation, content);
|
||||
|
var strCmd = ''; |
||||
|
if (rotation == 1) { |
||||
|
strCmd += 'T90 '; |
||||
|
} |
||||
|
if (rotation == 2) { |
||||
|
strCmd += 'T180 '; |
||||
|
} |
||||
|
if (rotation == 3) { |
||||
|
strCmd += 'T270 '; |
||||
|
} else { |
||||
|
strCmd += 'T '; |
||||
|
} |
||||
|
strCmd += fontName + ' ' + fontSize + ' ' + x + ' ' + y + ' ' + content + '\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 打印一维码 |
||||
|
* |
||||
|
* x: 文字方块左上角X座标,单位dot |
||||
|
* y: 文字方块左上角Y座标,单位dot |
||||
|
* codeType: 条码类型,取值为128、UPCA、UPCA2、UPCA5、UPCE、UPCE2、UPC5、EAN13、EAN13+2、EAN13+5、 |
||||
|
* EAN8、EAN8+2、EAN8+5、39、39C、F39、F39C、93、CODABAR、CODABAR16、ITF、I2OF5 |
||||
|
* h: 条码高度,单位dot |
||||
|
* rotation: 顺时针旋转角度,取值如下: |
||||
|
* - 0 不旋转 |
||||
|
* - 1 顺时针旋转90度 |
||||
|
* |
||||
|
* narrow: 窄条码比例因子(dot) 取值: 參考文檔 |
||||
|
* wide: 宽条码比例因子(dot) 取值: 參考文檔 |
||||
|
* content: 文字内容 |
||||
|
* |
||||
|
*/ |
||||
|
export function addCPCLBarCode(x, y, codeType, h, rotation, narrow, wide, content) { |
||||
|
var strCmd = ''; |
||||
|
if (rotation == 0) |
||||
|
strCmd += 'B '; |
||||
|
else |
||||
|
strCmd += 'VB '; |
||||
|
strCmd += codeType + ' ' + narrow + ' ' + wide + ' ' + h + ' ' + x + ' ' + y + ' ' + content + '\n' |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 打印二维码 |
||||
|
* |
||||
|
* x: 文字方块左上角X座标,单位dot |
||||
|
* y: 文字方块左上角Y座标,单位dot |
||||
|
* level: 错误纠正能力等级,取值为L(7%)、M(15%)、Q(25%)、H(30%) |
||||
|
* ver: 1-10 版本,根据内容调整以获取合适容量 |
||||
|
* scale: 1-10 放大倍数 |
||||
|
* content: 文字内容 |
||||
|
* |
||||
|
*/ |
||||
|
export function addCPCLQRCode(x, y, level, ver, scale, content) { |
||||
|
var strCmd = 'B QR ' + x + ' ' + y + ' M ' + ver + ' U ' + scale + '\n' + level + 'A,' + content + '\n'; |
||||
|
strCmd += 'ENDQR\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 放大指令 |
||||
|
* scaleX: 横向放大倍数 1,2,3等整数 |
||||
|
* scaleY: 纵向放大倍数 1,2,3等整数 |
||||
|
*/ |
||||
|
export function addCPCLSETMAG(scaleX, scaleY) { |
||||
|
var strCmd = 'SETMAG ' + scaleX + ' ' + scaleY + '\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 对齐指令 0-左对齐 1-右对齐 2-居中 |
||||
|
*/ |
||||
|
export function addCPCLLocation(set) { |
||||
|
var strCmd = ''; |
||||
|
if (set == 1) { |
||||
|
strCmd += 'RIGHT\n'; |
||||
|
} else if (set == 2) { |
||||
|
strCmd += 'CENTER\n'; |
||||
|
} else { |
||||
|
strCmd += 'LEFT\n'; |
||||
|
} |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 反白线 x0,y0,x1,y1,width |
||||
|
*/ |
||||
|
export function addCPCLInverseLine(x0, y0, x1, y1, width) { |
||||
|
var strCmd = 'IL ' + x0 + ' ' + y0 + ' ' + x1 + ' ' + y1 + ' ' + width + '\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 画线 x0,y0,x1,y1,width |
||||
|
*/ |
||||
|
export function addCPCLLine(x0, y0, x1, y1, width) { |
||||
|
var strCmd = 'L ' + x0 + ' ' + y0 + ' ' + x1 + ' ' + y1 + ' ' + width + '\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 画框 x0,y0,x1,y1,width |
||||
|
*/ |
||||
|
export function addCPCLBox(x0, y0, x1, y1, width) { |
||||
|
var strCmd = 'BOX ' + x0 + ' ' + y0 + ' ' + x1 + ' ' + y1 + ' ' + width + '\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 字体加粗 |
||||
|
*/ |
||||
|
export function addCPCLSETBOLD(bold) { |
||||
|
var strCmd = 'SETBOLD ' + bold + '\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 字体下划线 |
||||
|
*/ |
||||
|
export function addCPCLUNDERLINE(c) { |
||||
|
var strCmd = 'UNDERLINE '; |
||||
|
if (c) strCmd += 'ON\n'; |
||||
|
else if (c) strCmd += 'OFF\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 水印打印灰度等级 0-255 |
||||
|
*/ |
||||
|
export function addCPCLBACKGROUND(level) { |
||||
|
var strCmd = 'BACKGROUND '; |
||||
|
if (level > 255 || level < 0) level = 255; |
||||
|
strCmd += level + '\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 打印水印文字 |
||||
|
* x: 文字方块左上角X座标,单位dot |
||||
|
* y: 文字方块左上角Y座标,单位dot |
||||
|
* fontName,fontSize: 字体,取值: 參考文檔 |
||||
|
* rotation: 旋转 1-90度 2-180度 3-270度 其他-不旋转 |
||||
|
* content: 文字内容 |
||||
|
*/ |
||||
|
export function addCPCLBKVText(x, y, fontName, fontSize, rotation, content) { |
||||
|
//console.log(fontName,fontSize,rotation, content);
|
||||
|
var strCmd = ''; |
||||
|
if (rotation == 1) { |
||||
|
strCmd += 'BKT90 '; |
||||
|
} |
||||
|
if (rotation == 2) { |
||||
|
strCmd += 'BKT180 '; |
||||
|
} |
||||
|
if (rotation == 3) { |
||||
|
strCmd += 'BKT270 '; |
||||
|
} else { |
||||
|
strCmd += 'BKT '; |
||||
|
} |
||||
|
strCmd += fontName + ' ' + fontSize + ' ' + x + ' ' + y + ' ' + content + '\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 标签缝隙定位指令 |
||||
|
*/ |
||||
|
export function addCPCLGAP() { |
||||
|
var strCmd = 'GAP-SENSE\nFORM\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 标签右黑标检测指令 |
||||
|
*/ |
||||
|
export function addCPCLSENSE() { |
||||
|
var strCmd = 'BAR-SENSE\nFORM\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 标签左黑标检测指令 |
||||
|
*/ |
||||
|
export function addCPCLSENSELEFT() { |
||||
|
var strCmd = 'BAR-SENSE LEFT\nFORM\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 打印指令 |
||||
|
*/ |
||||
|
export function addCPCLPrint() { |
||||
|
var strCmd = 'PRINT\n'; |
||||
|
return strCmd; |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* 图片打印指令 |
||||
|
* x: 文字方块左上角X座标,单位dot |
||||
|
* y: 文字方块左上角Y座标,单位dot |
||||
|
* data{ |
||||
|
threshold,//0/1提取的灰度级
|
||||
|
width,//图像宽度
|
||||
|
height,//图像高度
|
||||
|
imageData , //图像数据
|
||||
|
} |
||||
|
*/ |
||||
|
export function addCPCLImageCmd(x, y, data) { |
||||
|
var strImgCmd = ''; |
||||
|
const threshold = data.threshold || 180; |
||||
|
let myBitmapWidth = data.width, |
||||
|
myBitmapHeight = data.height; |
||||
|
let len = parseInt((myBitmapWidth + 7) / 8); //一行的数据长度
|
||||
|
//console.log('len=',len);
|
||||
|
//console.log('myBitmapWidth=',myBitmapWidth);
|
||||
|
//console.log('myBitmapHeight=',myBitmapHeight);
|
||||
|
let ndata = 0; |
||||
|
let i = 0; |
||||
|
let j = 0; |
||||
|
let sendImageData = new ArrayBuffer(len * myBitmapHeight); |
||||
|
sendImageData = new Uint8Array(sendImageData); |
||||
|
let pix = data.imageData; |
||||
|
console.log('pix=', pix); |
||||
|
|
||||
|
for (i = 0; i < myBitmapHeight; i++) { |
||||
|
for (j = 0; j < len; j++) { |
||||
|
sendImageData[ndata + j] = 0; |
||||
|
} |
||||
|
for (j = 0; j < myBitmapWidth; j++) { |
||||
|
const grayPixle1 = grayPixle(pix.slice((i * myBitmapWidth + j) * 4, (i * myBitmapWidth + j) * 4 + 3)); |
||||
|
if (grayPixle1 < threshold) |
||||
|
sendImageData[ndata + parseInt(j / 8)] |= (0x80 >> (j % 8)); |
||||
|
|
||||
|
} |
||||
|
ndata += len; |
||||
|
} |
||||
|
//console.log('sendImageData=',sendImageData);
|
||||
|
//CPCL指令图片数据
|
||||
|
strImgCmd += 'EG ' + len + ' ' + myBitmapHeight + ' ' + x + ' ' + y + ' '; |
||||
|
for (i = 0; i < sendImageData.length; i++) { |
||||
|
strImgCmd += Hex2Str(sendImageData[i]); |
||||
|
} |
||||
|
strImgCmd += '\n'; |
||||
|
//console.log(strImgCmd);
|
||||
|
return strImgCmd; |
||||
|
} |
||||
|
/** |
||||
|
* toast显示捕获的蓝牙异常 |
||||
|
*/ |
||||
|
export function catchToast(err) { |
||||
|
const errMsg = { |
||||
|
10000: '未初始化蓝牙模块', |
||||
|
10001: '蓝牙未打开', |
||||
|
10002: '没有找到指定设备', |
||||
|
10003: '连接失败', |
||||
|
10004: '没有找到指定服务', |
||||
|
10005: '没有找到指定特征值', |
||||
|
10006: '当前连接已断开', |
||||
|
10007: '当前特征值不支持此操作', |
||||
|
10008: '系统上报异常', |
||||
|
10009: '系统版本低于 4.3 不支持BLE' |
||||
|
}; |
||||
|
let coode = err.errCode ? err.errCode.toString() : ''; |
||||
|
let msg = errMsg[coode]; |
||||
|
plus.nativeUI.toast(msg || coode, { |
||||
|
align: 'center', |
||||
|
verticalAlign: 'center' |
||||
|
}); |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
var barcode = require('./barcode'); |
||||
|
var qrcode = require('./qrcode'); |
||||
|
|
||||
|
function convert_length(length) { |
||||
|
return Math.round(wx.getSystemInfoSync().windowWidth * length / 750); |
||||
|
} |
||||
|
|
||||
|
function barc(id, code, width, height) { |
||||
|
barcode.code128(wx.createCanvasContext(id), code, convert_length(width), convert_length(height)) |
||||
|
} |
||||
|
|
||||
|
function qrc(id, code, width, height) { |
||||
|
qrcode.api.draw(code, { |
||||
|
ctx: wx.createCanvasContext(id), |
||||
|
width: convert_length(width), |
||||
|
height: convert_length(height) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
module.exports = { |
||||
|
barcode: barc, |
||||
|
qrcode: qrc |
||||
|
} |
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,778 @@ |
|||||
|
var QR = (function () { |
||||
|
|
||||
|
// alignment pattern
|
||||
|
var adelta = [ |
||||
|
0, 11, 15, 19, 23, 27, 31, // force 1 pat
|
||||
|
16, 18, 20, 22, 24, 26, 28, 20, 22, 24, 24, 26, 28, 28, 22, 24, 24, |
||||
|
26, 26, 28, 28, 24, 24, 26, 26, 26, 28, 28, 24, 26, 26, 26, 28, 28 |
||||
|
]; |
||||
|
|
||||
|
// version block
|
||||
|
var vpat = [ |
||||
|
0xc94, 0x5bc, 0xa99, 0x4d3, 0xbf6, 0x762, 0x847, 0x60d, |
||||
|
0x928, 0xb78, 0x45d, 0xa17, 0x532, 0x9a6, 0x683, 0x8c9, |
||||
|
0x7ec, 0xec4, 0x1e1, 0xfab, 0x08e, 0xc1a, 0x33f, 0xd75, |
||||
|
0x250, 0x9d5, 0x6f0, 0x8ba, 0x79f, 0xb0b, 0x42e, 0xa64, |
||||
|
0x541, 0xc69 |
||||
|
]; |
||||
|
|
||||
|
// final format bits with mask: level << 3 | mask
|
||||
|
var fmtword = [ |
||||
|
0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976, //L
|
||||
|
0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0, //M
|
||||
|
0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed, //Q
|
||||
|
0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b //H
|
||||
|
]; |
||||
|
|
||||
|
// 4 per version: number of blocks 1,2; data width; ecc width
|
||||
|
var eccblocks = [ |
||||
|
1, 0, 19, 7, 1, 0, 16, 10, 1, 0, 13, 13, 1, 0, 9, 17, |
||||
|
1, 0, 34, 10, 1, 0, 28, 16, 1, 0, 22, 22, 1, 0, 16, 28, |
||||
|
1, 0, 55, 15, 1, 0, 44, 26, 2, 0, 17, 18, 2, 0, 13, 22, |
||||
|
1, 0, 80, 20, 2, 0, 32, 18, 2, 0, 24, 26, 4, 0, 9, 16, |
||||
|
1, 0, 108, 26, 2, 0, 43, 24, 2, 2, 15, 18, 2, 2, 11, 22, |
||||
|
2, 0, 68, 18, 4, 0, 27, 16, 4, 0, 19, 24, 4, 0, 15, 28, |
||||
|
2, 0, 78, 20, 4, 0, 31, 18, 2, 4, 14, 18, 4, 1, 13, 26, |
||||
|
2, 0, 97, 24, 2, 2, 38, 22, 4, 2, 18, 22, 4, 2, 14, 26, |
||||
|
2, 0, 116, 30, 3, 2, 36, 22, 4, 4, 16, 20, 4, 4, 12, 24, |
||||
|
2, 2, 68, 18, 4, 1, 43, 26, 6, 2, 19, 24, 6, 2, 15, 28, |
||||
|
4, 0, 81, 20, 1, 4, 50, 30, 4, 4, 22, 28, 3, 8, 12, 24, |
||||
|
2, 2, 92, 24, 6, 2, 36, 22, 4, 6, 20, 26, 7, 4, 14, 28, |
||||
|
4, 0, 107, 26, 8, 1, 37, 22, 8, 4, 20, 24, 12, 4, 11, 22, |
||||
|
3, 1, 115, 30, 4, 5, 40, 24, 11, 5, 16, 20, 11, 5, 12, 24, |
||||
|
5, 1, 87, 22, 5, 5, 41, 24, 5, 7, 24, 30, 11, 7, 12, 24, |
||||
|
5, 1, 98, 24, 7, 3, 45, 28, 15, 2, 19, 24, 3, 13, 15, 30, |
||||
|
1, 5, 107, 28, 10, 1, 46, 28, 1, 15, 22, 28, 2, 17, 14, 28, |
||||
|
5, 1, 120, 30, 9, 4, 43, 26, 17, 1, 22, 28, 2, 19, 14, 28, |
||||
|
3, 4, 113, 28, 3, 11, 44, 26, 17, 4, 21, 26, 9, 16, 13, 26, |
||||
|
3, 5, 107, 28, 3, 13, 41, 26, 15, 5, 24, 30, 15, 10, 15, 28, |
||||
|
4, 4, 116, 28, 17, 0, 42, 26, 17, 6, 22, 28, 19, 6, 16, 30, |
||||
|
2, 7, 111, 28, 17, 0, 46, 28, 7, 16, 24, 30, 34, 0, 13, 24, |
||||
|
4, 5, 121, 30, 4, 14, 47, 28, 11, 14, 24, 30, 16, 14, 15, 30, |
||||
|
6, 4, 117, 30, 6, 14, 45, 28, 11, 16, 24, 30, 30, 2, 16, 30, |
||||
|
8, 4, 106, 26, 8, 13, 47, 28, 7, 22, 24, 30, 22, 13, 15, 30, |
||||
|
10, 2, 114, 28, 19, 4, 46, 28, 28, 6, 22, 28, 33, 4, 16, 30, |
||||
|
8, 4, 122, 30, 22, 3, 45, 28, 8, 26, 23, 30, 12, 28, 15, 30, |
||||
|
3, 10, 117, 30, 3, 23, 45, 28, 4, 31, 24, 30, 11, 31, 15, 30, |
||||
|
7, 7, 116, 30, 21, 7, 45, 28, 1, 37, 23, 30, 19, 26, 15, 30, |
||||
|
5, 10, 115, 30, 19, 10, 47, 28, 15, 25, 24, 30, 23, 25, 15, 30, |
||||
|
13, 3, 115, 30, 2, 29, 46, 28, 42, 1, 24, 30, 23, 28, 15, 30, |
||||
|
17, 0, 115, 30, 10, 23, 46, 28, 10, 35, 24, 30, 19, 35, 15, 30, |
||||
|
17, 1, 115, 30, 14, 21, 46, 28, 29, 19, 24, 30, 11, 46, 15, 30, |
||||
|
13, 6, 115, 30, 14, 23, 46, 28, 44, 7, 24, 30, 59, 1, 16, 30, |
||||
|
12, 7, 121, 30, 12, 26, 47, 28, 39, 14, 24, 30, 22, 41, 15, 30, |
||||
|
6, 14, 121, 30, 6, 34, 47, 28, 46, 10, 24, 30, 2, 64, 15, 30, |
||||
|
17, 4, 122, 30, 29, 14, 46, 28, 49, 10, 24, 30, 24, 46, 15, 30, |
||||
|
4, 18, 122, 30, 13, 32, 46, 28, 48, 14, 24, 30, 42, 32, 15, 30, |
||||
|
20, 4, 117, 30, 40, 7, 47, 28, 43, 22, 24, 30, 10, 67, 15, 30, |
||||
|
19, 6, 118, 30, 18, 31, 47, 28, 34, 34, 24, 30, 20, 61, 15, 30 |
||||
|
]; |
||||
|
|
||||
|
// Galois field log table
|
||||
|
var glog = [ |
||||
|
0xff, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b, |
||||
|
0x04, 0x64, 0xe0, 0x0e, 0x34, 0x8d, 0xef, 0x81, 0x1c, 0xc1, 0x69, 0xf8, 0xc8, 0x08, 0x4c, 0x71, |
||||
|
0x05, 0x8a, 0x65, 0x2f, 0xe1, 0x24, 0x0f, 0x21, 0x35, 0x93, 0x8e, 0xda, 0xf0, 0x12, 0x82, 0x45, |
||||
|
0x1d, 0xb5, 0xc2, 0x7d, 0x6a, 0x27, 0xf9, 0xb9, 0xc9, 0x9a, 0x09, 0x78, 0x4d, 0xe4, 0x72, 0xa6, |
||||
|
0x06, 0xbf, 0x8b, 0x62, 0x66, 0xdd, 0x30, 0xfd, 0xe2, 0x98, 0x25, 0xb3, 0x10, 0x91, 0x22, 0x88, |
||||
|
0x36, 0xd0, 0x94, 0xce, 0x8f, 0x96, 0xdb, 0xbd, 0xf1, 0xd2, 0x13, 0x5c, 0x83, 0x38, 0x46, 0x40, |
||||
|
0x1e, 0x42, 0xb6, 0xa3, 0xc3, 0x48, 0x7e, 0x6e, 0x6b, 0x3a, 0x28, 0x54, 0xfa, 0x85, 0xba, 0x3d, |
||||
|
0xca, 0x5e, 0x9b, 0x9f, 0x0a, 0x15, 0x79, 0x2b, 0x4e, 0xd4, 0xe5, 0xac, 0x73, 0xf3, 0xa7, 0x57, |
||||
|
0x07, 0x70, 0xc0, 0xf7, 0x8c, 0x80, 0x63, 0x0d, 0x67, 0x4a, 0xde, 0xed, 0x31, 0xc5, 0xfe, 0x18, |
||||
|
0xe3, 0xa5, 0x99, 0x77, 0x26, 0xb8, 0xb4, 0x7c, 0x11, 0x44, 0x92, 0xd9, 0x23, 0x20, 0x89, 0x2e, |
||||
|
0x37, 0x3f, 0xd1, 0x5b, 0x95, 0xbc, 0xcf, 0xcd, 0x90, 0x87, 0x97, 0xb2, 0xdc, 0xfc, 0xbe, 0x61, |
||||
|
0xf2, 0x56, 0xd3, 0xab, 0x14, 0x2a, 0x5d, 0x9e, 0x84, 0x3c, 0x39, 0x53, 0x47, 0x6d, 0x41, 0xa2, |
||||
|
0x1f, 0x2d, 0x43, 0xd8, 0xb7, 0x7b, 0xa4, 0x76, 0xc4, 0x17, 0x49, 0xec, 0x7f, 0x0c, 0x6f, 0xf6, |
||||
|
0x6c, 0xa1, 0x3b, 0x52, 0x29, 0x9d, 0x55, 0xaa, 0xfb, 0x60, 0x86, 0xb1, 0xbb, 0xcc, 0x3e, 0x5a, |
||||
|
0xcb, 0x59, 0x5f, 0xb0, 0x9c, 0xa9, 0xa0, 0x51, 0x0b, 0xf5, 0x16, 0xeb, 0x7a, 0x75, 0x2c, 0xd7, |
||||
|
0x4f, 0xae, 0xd5, 0xe9, 0xe6, 0xe7, 0xad, 0xe8, 0x74, 0xd6, 0xf4, 0xea, 0xa8, 0x50, 0x58, 0xaf |
||||
|
]; |
||||
|
|
||||
|
// Galios field exponent table
|
||||
|
var gexp = [ |
||||
|
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26, |
||||
|
0x4c, 0x98, 0x2d, 0x5a, 0xb4, 0x75, 0xea, 0xc9, 0x8f, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, |
||||
|
0x9d, 0x27, 0x4e, 0x9c, 0x25, 0x4a, 0x94, 0x35, 0x6a, 0xd4, 0xb5, 0x77, 0xee, 0xc1, 0x9f, 0x23, |
||||
|
0x46, 0x8c, 0x05, 0x0a, 0x14, 0x28, 0x50, 0xa0, 0x5d, 0xba, 0x69, 0xd2, 0xb9, 0x6f, 0xde, 0xa1, |
||||
|
0x5f, 0xbe, 0x61, 0xc2, 0x99, 0x2f, 0x5e, 0xbc, 0x65, 0xca, 0x89, 0x0f, 0x1e, 0x3c, 0x78, 0xf0, |
||||
|
0xfd, 0xe7, 0xd3, 0xbb, 0x6b, 0xd6, 0xb1, 0x7f, 0xfe, 0xe1, 0xdf, 0xa3, 0x5b, 0xb6, 0x71, 0xe2, |
||||
|
0xd9, 0xaf, 0x43, 0x86, 0x11, 0x22, 0x44, 0x88, 0x0d, 0x1a, 0x34, 0x68, 0xd0, 0xbd, 0x67, 0xce, |
||||
|
0x81, 0x1f, 0x3e, 0x7c, 0xf8, 0xed, 0xc7, 0x93, 0x3b, 0x76, 0xec, 0xc5, 0x97, 0x33, 0x66, 0xcc, |
||||
|
0x85, 0x17, 0x2e, 0x5c, 0xb8, 0x6d, 0xda, 0xa9, 0x4f, 0x9e, 0x21, 0x42, 0x84, 0x15, 0x2a, 0x54, |
||||
|
0xa8, 0x4d, 0x9a, 0x29, 0x52, 0xa4, 0x55, 0xaa, 0x49, 0x92, 0x39, 0x72, 0xe4, 0xd5, 0xb7, 0x73, |
||||
|
0xe6, 0xd1, 0xbf, 0x63, 0xc6, 0x91, 0x3f, 0x7e, 0xfc, 0xe5, 0xd7, 0xb3, 0x7b, 0xf6, 0xf1, 0xff, |
||||
|
0xe3, 0xdb, 0xab, 0x4b, 0x96, 0x31, 0x62, 0xc4, 0x95, 0x37, 0x6e, 0xdc, 0xa5, 0x57, 0xae, 0x41, |
||||
|
0x82, 0x19, 0x32, 0x64, 0xc8, 0x8d, 0x07, 0x0e, 0x1c, 0x38, 0x70, 0xe0, 0xdd, 0xa7, 0x53, 0xa6, |
||||
|
0x51, 0xa2, 0x59, 0xb2, 0x79, 0xf2, 0xf9, 0xef, 0xc3, 0x9b, 0x2b, 0x56, 0xac, 0x45, 0x8a, 0x09, |
||||
|
0x12, 0x24, 0x48, 0x90, 0x3d, 0x7a, 0xf4, 0xf5, 0xf7, 0xf3, 0xfb, 0xeb, 0xcb, 0x8b, 0x0b, 0x16, |
||||
|
0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x00 |
||||
|
]; |
||||
|
|
||||
|
// Working buffers:
|
||||
|
// data input and ecc append, image working buffer, fixed part of image, run lengths for badness
|
||||
|
var strinbuf=[], eccbuf=[], qrframe=[], framask=[], rlens=[]; |
||||
|
// Control values - width is based on version, last 4 are from table.
|
||||
|
var version, width, neccblk1, neccblk2, datablkw, eccblkwid; |
||||
|
var ecclevel = 2; |
||||
|
// set bit to indicate cell in qrframe is immutable. symmetric around diagonal
|
||||
|
function setmask(x, y) |
||||
|
{ |
||||
|
var bt; |
||||
|
if (x > y) { |
||||
|
bt = x; |
||||
|
x = y; |
||||
|
y = bt; |
||||
|
} |
||||
|
// y*y = 1+3+5...
|
||||
|
bt = y; |
||||
|
bt *= y; |
||||
|
bt += y; |
||||
|
bt >>= 1; |
||||
|
bt += x; |
||||
|
framask[bt] = 1; |
||||
|
} |
||||
|
|
||||
|
// enter alignment pattern - black to qrframe, white to mask (later black frame merged to mask)
|
||||
|
function putalign(x, y) |
||||
|
{ |
||||
|
var j; |
||||
|
|
||||
|
qrframe[x + width * y] = 1; |
||||
|
for (j = -2; j < 2; j++) { |
||||
|
qrframe[(x + j) + width * (y - 2)] = 1; |
||||
|
qrframe[(x - 2) + width * (y + j + 1)] = 1; |
||||
|
qrframe[(x + 2) + width * (y + j)] = 1; |
||||
|
qrframe[(x + j + 1) + width * (y + 2)] = 1; |
||||
|
} |
||||
|
for (j = 0; j < 2; j++) { |
||||
|
setmask(x - 1, y + j); |
||||
|
setmask(x + 1, y - j); |
||||
|
setmask(x - j, y - 1); |
||||
|
setmask(x + j, y + 1); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//========================================================================
|
||||
|
// Reed Solomon error correction
|
||||
|
// exponentiation mod N
|
||||
|
function modnn(x) |
||||
|
{ |
||||
|
while (x >= 255) { |
||||
|
x -= 255; |
||||
|
x = (x >> 8) + (x & 255); |
||||
|
} |
||||
|
return x; |
||||
|
} |
||||
|
|
||||
|
var genpoly = []; |
||||
|
|
||||
|
// Calculate and append ECC data to data block. Block is in strinbuf, indexes to buffers given.
|
||||
|
function appendrs(data, dlen, ecbuf, eclen) |
||||
|
{ |
||||
|
var i, j, fb; |
||||
|
|
||||
|
for (i = 0; i < eclen; i++) |
||||
|
strinbuf[ecbuf + i] = 0; |
||||
|
for (i = 0; i < dlen; i++) { |
||||
|
fb = glog[strinbuf[data + i] ^ strinbuf[ecbuf]]; |
||||
|
if (fb != 255) /* fb term is non-zero */ |
||||
|
for (j = 1; j < eclen; j++) |
||||
|
strinbuf[ecbuf + j - 1] = strinbuf[ecbuf + j] ^ gexp[modnn(fb + genpoly[eclen - j])]; |
||||
|
else |
||||
|
for( j = ecbuf ; j < ecbuf + eclen; j++ ) |
||||
|
strinbuf[j] = strinbuf[j + 1]; |
||||
|
strinbuf[ ecbuf + eclen - 1] = fb == 255 ? 0 : gexp[modnn(fb + genpoly[0])]; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//========================================================================
|
||||
|
// Frame data insert following the path rules
|
||||
|
|
||||
|
// check mask - since symmetrical use half.
|
||||
|
function ismasked(x, y) |
||||
|
{ |
||||
|
var bt; |
||||
|
if (x > y) { |
||||
|
bt = x; |
||||
|
x = y; |
||||
|
y = bt; |
||||
|
} |
||||
|
bt = y; |
||||
|
bt += y * y; |
||||
|
bt >>= 1; |
||||
|
bt += x; |
||||
|
return framask[bt]; |
||||
|
} |
||||
|
|
||||
|
//========================================================================
|
||||
|
// Apply the selected mask out of the 8.
|
||||
|
function applymask(m) |
||||
|
{ |
||||
|
var x, y, r3x, r3y; |
||||
|
|
||||
|
switch (m) { |
||||
|
case 0: |
||||
|
for (y = 0; y < width; y++) |
||||
|
for (x = 0; x < width; x++) |
||||
|
if (!((x + y) & 1) && !ismasked(x, y)) |
||||
|
qrframe[x + y * width] ^= 1; |
||||
|
break; |
||||
|
case 1: |
||||
|
for (y = 0; y < width; y++) |
||||
|
for (x = 0; x < width; x++) |
||||
|
if (!(y & 1) && !ismasked(x, y)) |
||||
|
qrframe[x + y * width] ^= 1; |
||||
|
break; |
||||
|
case 2: |
||||
|
for (y = 0; y < width; y++) |
||||
|
for (r3x = 0, x = 0; x < width; x++, r3x++) { |
||||
|
if (r3x == 3) |
||||
|
r3x = 0; |
||||
|
if (!r3x && !ismasked(x, y)) |
||||
|
qrframe[x + y * width] ^= 1; |
||||
|
} |
||||
|
break; |
||||
|
case 3: |
||||
|
for (r3y = 0, y = 0; y < width; y++, r3y++) { |
||||
|
if (r3y == 3) |
||||
|
r3y = 0; |
||||
|
for (r3x = r3y, x = 0; x < width; x++, r3x++) { |
||||
|
if (r3x == 3) |
||||
|
r3x = 0; |
||||
|
if (!r3x && !ismasked(x, y)) |
||||
|
qrframe[x + y * width] ^= 1; |
||||
|
} |
||||
|
} |
||||
|
break; |
||||
|
case 4: |
||||
|
for (y = 0; y < width; y++) |
||||
|
for (r3x = 0, r3y = ((y >> 1) & 1), x = 0; x < width; x++, r3x++) { |
||||
|
if (r3x == 3) { |
||||
|
r3x = 0; |
||||
|
r3y = !r3y; |
||||
|
} |
||||
|
if (!r3y && !ismasked(x, y)) |
||||
|
qrframe[x + y * width] ^= 1; |
||||
|
} |
||||
|
break; |
||||
|
case 5: |
||||
|
for (r3y = 0, y = 0; y < width; y++, r3y++) { |
||||
|
if (r3y == 3) |
||||
|
r3y = 0; |
||||
|
for (r3x = 0, x = 0; x < width; x++, r3x++) { |
||||
|
if (r3x == 3) |
||||
|
r3x = 0; |
||||
|
if (!((x & y & 1) + !(!r3x | !r3y)) && !ismasked(x, y)) |
||||
|
qrframe[x + y * width] ^= 1; |
||||
|
} |
||||
|
} |
||||
|
break; |
||||
|
case 6: |
||||
|
for (r3y = 0, y = 0; y < width; y++, r3y++) { |
||||
|
if (r3y == 3) |
||||
|
r3y = 0; |
||||
|
for (r3x = 0, x = 0; x < width; x++, r3x++) { |
||||
|
if (r3x == 3) |
||||
|
r3x = 0; |
||||
|
if (!(((x & y & 1) + (r3x && (r3x == r3y))) & 1) && !ismasked(x, y)) |
||||
|
qrframe[x + y * width] ^= 1; |
||||
|
} |
||||
|
} |
||||
|
break; |
||||
|
case 7: |
||||
|
for (r3y = 0, y = 0; y < width; y++, r3y++) { |
||||
|
if (r3y == 3) |
||||
|
r3y = 0; |
||||
|
for (r3x = 0, x = 0; x < width; x++, r3x++) { |
||||
|
if (r3x == 3) |
||||
|
r3x = 0; |
||||
|
if (!(((r3x && (r3x == r3y)) + ((x + y) & 1)) & 1) && !ismasked(x, y)) |
||||
|
qrframe[x + y * width] ^= 1; |
||||
|
} |
||||
|
} |
||||
|
break; |
||||
|
} |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
// Badness coefficients.
|
||||
|
var N1 = 3, N2 = 3, N3 = 40, N4 = 10; |
||||
|
|
||||
|
// Using the table of the length of each run, calculate the amount of bad image
|
||||
|
// - long runs or those that look like finders; called twice, once each for X and Y
|
||||
|
function badruns(length) |
||||
|
{ |
||||
|
var i; |
||||
|
var runsbad = 0; |
||||
|
for (i = 0; i <= length; i++) |
||||
|
if (rlens[i] >= 5) |
||||
|
runsbad += N1 + rlens[i] - 5; |
||||
|
// BwBBBwB as in finder
|
||||
|
for (i = 3; i < length - 1; i += 2) |
||||
|
if (rlens[i - 2] == rlens[i + 2] |
||||
|
&& rlens[i + 2] == rlens[i - 1] |
||||
|
&& rlens[i - 1] == rlens[i + 1] |
||||
|
&& rlens[i - 1] * 3 == rlens[i] |
||||
|
// white around the black pattern? Not part of spec
|
||||
|
&& (rlens[i - 3] == 0 // beginning
|
||||
|
|| i + 3 > length // end
|
||||
|
|| rlens[i - 3] * 3 >= rlens[i] * 4 || rlens[i + 3] * 3 >= rlens[i] * 4) |
||||
|
) |
||||
|
runsbad += N3; |
||||
|
return runsbad; |
||||
|
} |
||||
|
|
||||
|
// Calculate how bad the masked image is - blocks, imbalance, runs, or finders.
|
||||
|
function badcheck() |
||||
|
{ |
||||
|
var x, y, h, b, b1; |
||||
|
var thisbad = 0; |
||||
|
var bw = 0; |
||||
|
|
||||
|
// blocks of same color.
|
||||
|
for (y = 0; y < width - 1; y++) |
||||
|
for (x = 0; x < width - 1; x++) |
||||
|
if ((qrframe[x + width * y] && qrframe[(x + 1) + width * y] |
||||
|
&& qrframe[x + width * (y + 1)] && qrframe[(x + 1) + width * (y + 1)]) // all black
|
||||
|
|| !(qrframe[x + width * y] || qrframe[(x + 1) + width * y] |
||||
|
|| qrframe[x + width * (y + 1)] || qrframe[(x + 1) + width * (y + 1)])) // all white
|
||||
|
thisbad += N2; |
||||
|
|
||||
|
// X runs
|
||||
|
for (y = 0; y < width; y++) { |
||||
|
rlens[0] = 0; |
||||
|
for (h = b = x = 0; x < width; x++) { |
||||
|
if ((b1 = qrframe[x + width * y]) == b) |
||||
|
rlens[h]++; |
||||
|
else |
||||
|
rlens[++h] = 1; |
||||
|
b = b1; |
||||
|
bw += b ? 1 : -1; |
||||
|
} |
||||
|
thisbad += badruns(h); |
||||
|
} |
||||
|
|
||||
|
// black/white imbalance
|
||||
|
if (bw < 0) |
||||
|
bw = -bw; |
||||
|
|
||||
|
var big = bw; |
||||
|
var count = 0; |
||||
|
big += big << 2; |
||||
|
big <<= 1; |
||||
|
while (big > width * width) |
||||
|
big -= width * width, count++; |
||||
|
thisbad += count * N4; |
||||
|
|
||||
|
// Y runs
|
||||
|
for (x = 0; x < width; x++) { |
||||
|
rlens[0] = 0; |
||||
|
for (h = b = y = 0; y < width; y++) { |
||||
|
if ((b1 = qrframe[x + width * y]) == b) |
||||
|
rlens[h]++; |
||||
|
else |
||||
|
rlens[++h] = 1; |
||||
|
b = b1; |
||||
|
} |
||||
|
thisbad += badruns(h); |
||||
|
} |
||||
|
return thisbad; |
||||
|
} |
||||
|
|
||||
|
function genframe(instring) |
||||
|
{ |
||||
|
var x, y, k, t, v, i, j, m; |
||||
|
|
||||
|
// find the smallest version that fits the string
|
||||
|
t = instring.length; |
||||
|
version = 0; |
||||
|
do { |
||||
|
version++; |
||||
|
k = (ecclevel - 1) * 4 + (version - 1) * 16; |
||||
|
neccblk1 = eccblocks[k++]; |
||||
|
neccblk2 = eccblocks[k++]; |
||||
|
datablkw = eccblocks[k++]; |
||||
|
eccblkwid = eccblocks[k]; |
||||
|
k = datablkw * (neccblk1 + neccblk2) + neccblk2 - 3 + (version <= 9); |
||||
|
if (t <= k) |
||||
|
break; |
||||
|
} while (version < 40); |
||||
|
|
||||
|
// FIXME - insure that it fits insted of being truncated
|
||||
|
width = 17 + 4 * version; |
||||
|
|
||||
|
// allocate, clear and setup data structures
|
||||
|
v = datablkw + (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2; |
||||
|
for( t = 0; t < v; t++ ) |
||||
|
eccbuf[t] = 0; |
||||
|
strinbuf = instring.slice(0); |
||||
|
|
||||
|
for( t = 0; t < width * width; t++ ) |
||||
|
qrframe[t] = 0; |
||||
|
|
||||
|
for( t = 0 ; t < (width * (width + 1) + 1) / 2; t++) |
||||
|
framask[t] = 0; |
||||
|
|
||||
|
// insert finders - black to frame, white to mask
|
||||
|
for (t = 0; t < 3; t++) { |
||||
|
k = 0; |
||||
|
y = 0; |
||||
|
if (t == 1) |
||||
|
k = (width - 7); |
||||
|
if (t == 2) |
||||
|
y = (width - 7); |
||||
|
qrframe[(y + 3) + width * (k + 3)] = 1; |
||||
|
for (x = 0; x < 6; x++) { |
||||
|
qrframe[(y + x) + width * k] = 1; |
||||
|
qrframe[y + width * (k + x + 1)] = 1; |
||||
|
qrframe[(y + 6) + width * (k + x)] = 1; |
||||
|
qrframe[(y + x + 1) + width * (k + 6)] = 1; |
||||
|
} |
||||
|
for (x = 1; x < 5; x++) { |
||||
|
setmask(y + x, k + 1); |
||||
|
setmask(y + 1, k + x + 1); |
||||
|
setmask(y + 5, k + x); |
||||
|
setmask(y + x + 1, k + 5); |
||||
|
} |
||||
|
for (x = 2; x < 4; x++) { |
||||
|
qrframe[(y + x) + width * (k + 2)] = 1; |
||||
|
qrframe[(y + 2) + width * (k + x + 1)] = 1; |
||||
|
qrframe[(y + 4) + width * (k + x)] = 1; |
||||
|
qrframe[(y + x + 1) + width * (k + 4)] = 1; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// alignment blocks
|
||||
|
if (version > 1) { |
||||
|
t = adelta[version]; |
||||
|
y = width - 7; |
||||
|
for (;;) { |
||||
|
x = width - 7; |
||||
|
while (x > t - 3) { |
||||
|
putalign(x, y); |
||||
|
if (x < t) |
||||
|
break; |
||||
|
x -= t; |
||||
|
} |
||||
|
if (y <= t + 9) |
||||
|
break; |
||||
|
y -= t; |
||||
|
putalign(6, y); |
||||
|
putalign(y, 6); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// single black
|
||||
|
qrframe[8 + width * (width - 8)] = 1; |
||||
|
|
||||
|
// timing gap - mask only
|
||||
|
for (y = 0; y < 7; y++) { |
||||
|
setmask(7, y); |
||||
|
setmask(width - 8, y); |
||||
|
setmask(7, y + width - 7); |
||||
|
} |
||||
|
for (x = 0; x < 8; x++) { |
||||
|
setmask(x, 7); |
||||
|
setmask(x + width - 8, 7); |
||||
|
setmask(x, width - 8); |
||||
|
} |
||||
|
|
||||
|
// reserve mask-format area
|
||||
|
for (x = 0; x < 9; x++) |
||||
|
setmask(x, 8); |
||||
|
for (x = 0; x < 8; x++) { |
||||
|
setmask(x + width - 8, 8); |
||||
|
setmask(8, x); |
||||
|
} |
||||
|
for (y = 0; y < 7; y++) |
||||
|
setmask(8, y + width - 7); |
||||
|
|
||||
|
// timing row/col
|
||||
|
for (x = 0; x < width - 14; x++) |
||||
|
if (x & 1) { |
||||
|
setmask(8 + x, 6); |
||||
|
setmask(6, 8 + x); |
||||
|
} |
||||
|
else { |
||||
|
qrframe[(8 + x) + width * 6] = 1; |
||||
|
qrframe[6 + width * (8 + x)] = 1; |
||||
|
} |
||||
|
|
||||
|
// version block
|
||||
|
if (version > 6) { |
||||
|
t = vpat[version - 7]; |
||||
|
k = 17; |
||||
|
for (x = 0; x < 6; x++) |
||||
|
for (y = 0; y < 3; y++, k--) |
||||
|
if (1 & (k > 11 ? version >> (k - 12) : t >> k)) { |
||||
|
qrframe[(5 - x) + width * (2 - y + width - 11)] = 1; |
||||
|
qrframe[(2 - y + width - 11) + width * (5 - x)] = 1; |
||||
|
} |
||||
|
else { |
||||
|
setmask(5 - x, 2 - y + width - 11); |
||||
|
setmask(2 - y + width - 11, 5 - x); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// sync mask bits - only set above for white spaces, so add in black bits
|
||||
|
for (y = 0; y < width; y++) |
||||
|
for (x = 0; x <= y; x++) |
||||
|
if (qrframe[x + width * y]) |
||||
|
setmask(x, y); |
||||
|
|
||||
|
// convert string to bitstream
|
||||
|
// 8 bit data to QR-coded 8 bit data (numeric or alphanum, or kanji not supported)
|
||||
|
v = strinbuf.length; |
||||
|
|
||||
|
// string to array
|
||||
|
for( i = 0 ; i < v; i++ ) |
||||
|
eccbuf[i] = strinbuf.charCodeAt(i); |
||||
|
strinbuf = eccbuf.slice(0); |
||||
|
|
||||
|
// calculate max string length
|
||||
|
x = datablkw * (neccblk1 + neccblk2) + neccblk2; |
||||
|
if (v >= x - 2) { |
||||
|
v = x - 2; |
||||
|
if (version > 9) |
||||
|
v--; |
||||
|
} |
||||
|
|
||||
|
// shift and repack to insert length prefix
|
||||
|
i = v; |
||||
|
if (version > 9) { |
||||
|
strinbuf[i + 2] = 0; |
||||
|
strinbuf[i + 3] = 0; |
||||
|
while (i--) { |
||||
|
t = strinbuf[i]; |
||||
|
strinbuf[i + 3] |= 255 & (t << 4); |
||||
|
strinbuf[i + 2] = t >> 4; |
||||
|
} |
||||
|
strinbuf[2] |= 255 & (v << 4); |
||||
|
strinbuf[1] = v >> 4; |
||||
|
strinbuf[0] = 0x40 | (v >> 12); |
||||
|
} |
||||
|
else { |
||||
|
strinbuf[i + 1] = 0; |
||||
|
strinbuf[i + 2] = 0; |
||||
|
while (i--) { |
||||
|
t = strinbuf[i]; |
||||
|
strinbuf[i + 2] |= 255 & (t << 4); |
||||
|
strinbuf[i + 1] = t >> 4; |
||||
|
} |
||||
|
strinbuf[1] |= 255 & (v << 4); |
||||
|
strinbuf[0] = 0x40 | (v >> 4); |
||||
|
} |
||||
|
// fill to end with pad pattern
|
||||
|
i = v + 3 - (version < 10); |
||||
|
while (i < x) { |
||||
|
strinbuf[i++] = 0xec; |
||||
|
// buffer has room if (i == x) break;
|
||||
|
strinbuf[i++] = 0x11; |
||||
|
} |
||||
|
|
||||
|
// calculate and append ECC
|
||||
|
|
||||
|
// calculate generator polynomial
|
||||
|
genpoly[0] = 1; |
||||
|
for (i = 0; i < eccblkwid; i++) { |
||||
|
genpoly[i + 1] = 1; |
||||
|
for (j = i; j > 0; j--) |
||||
|
genpoly[j] = genpoly[j] |
||||
|
? genpoly[j - 1] ^ gexp[modnn(glog[genpoly[j]] + i)] : genpoly[j - 1]; |
||||
|
genpoly[0] = gexp[modnn(glog[genpoly[0]] + i)]; |
||||
|
} |
||||
|
for (i = 0; i <= eccblkwid; i++) |
||||
|
genpoly[i] = glog[genpoly[i]]; // use logs for genpoly[] to save calc step
|
||||
|
|
||||
|
// append ecc to data buffer
|
||||
|
k = x; |
||||
|
y = 0; |
||||
|
for (i = 0; i < neccblk1; i++) { |
||||
|
appendrs(y, datablkw, k, eccblkwid); |
||||
|
y += datablkw; |
||||
|
k += eccblkwid; |
||||
|
} |
||||
|
for (i = 0; i < neccblk2; i++) { |
||||
|
appendrs(y, datablkw + 1, k, eccblkwid); |
||||
|
y += datablkw + 1; |
||||
|
k += eccblkwid; |
||||
|
} |
||||
|
// interleave blocks
|
||||
|
y = 0; |
||||
|
for (i = 0; i < datablkw; i++) { |
||||
|
for (j = 0; j < neccblk1; j++) |
||||
|
eccbuf[y++] = strinbuf[i + j * datablkw]; |
||||
|
for (j = 0; j < neccblk2; j++) |
||||
|
eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))]; |
||||
|
} |
||||
|
for (j = 0; j < neccblk2; j++) |
||||
|
eccbuf[y++] = strinbuf[(neccblk1 * datablkw) + i + (j * (datablkw + 1))]; |
||||
|
for (i = 0; i < eccblkwid; i++) |
||||
|
for (j = 0; j < neccblk1 + neccblk2; j++) |
||||
|
eccbuf[y++] = strinbuf[x + i + j * eccblkwid]; |
||||
|
strinbuf = eccbuf; |
||||
|
|
||||
|
// pack bits into frame avoiding masked area.
|
||||
|
x = y = width - 1; |
||||
|
k = v = 1; // up, minus
|
||||
|
/* inteleaved data and ecc codes */ |
||||
|
m = (datablkw + eccblkwid) * (neccblk1 + neccblk2) + neccblk2; |
||||
|
for (i = 0; i < m; i++) { |
||||
|
t = strinbuf[i]; |
||||
|
for (j = 0; j < 8; j++, t <<= 1) { |
||||
|
if (0x80 & t) |
||||
|
qrframe[x + width * y] = 1; |
||||
|
do { // find next fill position
|
||||
|
if (v) |
||||
|
x--; |
||||
|
else { |
||||
|
x++; |
||||
|
if (k) { |
||||
|
if (y != 0) |
||||
|
y--; |
||||
|
else { |
||||
|
x -= 2; |
||||
|
k = !k; |
||||
|
if (x == 6) { |
||||
|
x--; |
||||
|
y = 9; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
else { |
||||
|
if (y != width - 1) |
||||
|
y++; |
||||
|
else { |
||||
|
x -= 2; |
||||
|
k = !k; |
||||
|
if (x == 6) { |
||||
|
x--; |
||||
|
y -= 8; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
v = !v; |
||||
|
} while (ismasked(x, y)); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// save pre-mask copy of frame
|
||||
|
strinbuf = qrframe.slice(0); |
||||
|
t = 0; // best
|
||||
|
y = 30000; // demerit
|
||||
|
// for instead of while since in original arduino code
|
||||
|
// if an early mask was "good enough" it wouldn't try for a better one
|
||||
|
// since they get more complex and take longer.
|
||||
|
for (k = 0; k < 8; k++) { |
||||
|
applymask(k); // returns black-white imbalance
|
||||
|
x = badcheck(); |
||||
|
if (x < y) { // current mask better than previous best?
|
||||
|
y = x; |
||||
|
t = k; |
||||
|
} |
||||
|
if (t == 7) |
||||
|
break; // don't increment i to a void redoing mask
|
||||
|
qrframe = strinbuf.slice(0); // reset for next pass
|
||||
|
} |
||||
|
if (t != k) // redo best mask - none good enough, last wasn't t
|
||||
|
applymask(t); |
||||
|
|
||||
|
// add in final mask/ecclevel bytes
|
||||
|
y = fmtword[t + ((ecclevel - 1) << 3)]; |
||||
|
// low byte
|
||||
|
for (k = 0; k < 8; k++, y >>= 1) |
||||
|
if (y & 1) { |
||||
|
qrframe[(width - 1 - k) + width * 8] = 1; |
||||
|
if (k < 6) |
||||
|
qrframe[8 + width * k] = 1; |
||||
|
else |
||||
|
qrframe[8 + width * (k + 1)] = 1; |
||||
|
} |
||||
|
// high byte
|
||||
|
for (k = 0; k < 7; k++, y >>= 1) |
||||
|
if (y & 1) { |
||||
|
qrframe[8 + width * (width - 7 + k)] = 1; |
||||
|
if (k) |
||||
|
qrframe[(6 - k) + width * 8] = 1; |
||||
|
else |
||||
|
qrframe[7 + width * 8] = 1; |
||||
|
} |
||||
|
|
||||
|
// return image
|
||||
|
return qrframe; |
||||
|
} |
||||
|
|
||||
|
var _canvas = null, |
||||
|
_size = null; |
||||
|
|
||||
|
var api = { |
||||
|
|
||||
|
get ecclevel () { |
||||
|
return ecclevel; |
||||
|
}, |
||||
|
|
||||
|
set ecclevel (val) { |
||||
|
ecclevel = val; |
||||
|
}, |
||||
|
|
||||
|
get size () { |
||||
|
return _size; |
||||
|
}, |
||||
|
|
||||
|
set size (val) { |
||||
|
_size = val |
||||
|
}, |
||||
|
|
||||
|
get canvas () { |
||||
|
return _canvas; |
||||
|
}, |
||||
|
|
||||
|
set canvas (el) { |
||||
|
_canvas = el; |
||||
|
}, |
||||
|
|
||||
|
getFrame: function (string) { |
||||
|
return genframe(string); |
||||
|
}, |
||||
|
|
||||
|
draw: function (string, canvas, size, ecc) { |
||||
|
|
||||
|
ecclevel = ecc || ecclevel; |
||||
|
canvas = canvas || _canvas; |
||||
|
|
||||
|
if (!canvas) { |
||||
|
console.warn('No canvas provided to draw QR code in!') |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
size = size || _size || Math.min(canvas.width, canvas.height); |
||||
|
|
||||
|
var frame = genframe(string), |
||||
|
ctx = canvas.ctx, |
||||
|
px = Math.round(size / (width + 8)); |
||||
|
|
||||
|
var roundedSize = px * (width + 8), |
||||
|
offset = Math.floor((size - roundedSize) / 2); |
||||
|
|
||||
|
size = roundedSize; |
||||
|
|
||||
|
ctx.clearRect(0, 0, canvas.width, canvas.height); |
||||
|
ctx.setFillStyle('#000000'); |
||||
|
|
||||
|
for (var i = 0; i < width; i++) { |
||||
|
for (var j = 0; j < width; j++) { |
||||
|
if (frame[j * width + i]) { |
||||
|
ctx.fillRect(px * (4 + i) + offset, px * (4 + j) + offset, px, px); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
ctx.draw(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
module.exports = { |
||||
|
api: api |
||||
|
} |
||||
|
|
||||
|
})() |
@ -0,0 +1,171 @@ |
|||||
|
//const gbk = require('./gbk.js');
|
||||
|
//console.log("sasas" + gbk);
|
||||
|
const formatTime = date => { |
||||
|
const year = date.getFullYear() |
||||
|
const month = date.getMonth() + 1 |
||||
|
const day = date.getDate() |
||||
|
const hour = date.getHours() |
||||
|
const minute = date.getMinutes() |
||||
|
const second = date.getSeconds() |
||||
|
|
||||
|
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') |
||||
|
} |
||||
|
|
||||
|
const formatNumber = n => { |
||||
|
n = n.toString() |
||||
|
return n[1] ? n : '0' + n |
||||
|
} |
||||
|
|
||||
|
/* |
||||
|
const hexStringToBuff = str => { //str='中国:WXHSH'
|
||||
|
const buffer = new ArrayBuffer((sumStrLength(str)) * 4) |
||||
|
const dataView = new DataView(buffer) |
||||
|
var data = str.toString(); |
||||
|
var p = 0; //ArrayBuffer 偏移量
|
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
if (isCN(data[i])) { //是中文
|
||||
|
//调用GBK 转码
|
||||
|
var t = gbk.encode(data[i]); |
||||
|
for (var j = 0; j < 2; j++) { |
||||
|
//var code = t[j * 2] + t[j * 2 + 1];
|
||||
|
var code = t[j * 3 + 1] + t[j * 3 + 2]; |
||||
|
var temp = parseInt(code, 16) |
||||
|
//var temp = strToHexCharCode(code);
|
||||
|
dataView.setUint8(p++, temp) |
||||
|
} |
||||
|
} else { |
||||
|
var temp = data.charCodeAt(i); |
||||
|
dataView.setUint8(p++, temp) |
||||
|
} |
||||
|
} |
||||
|
return buffer; |
||||
|
} |
||||
|
*/ |
||||
|
function toUnicode(s) { |
||||
|
var str = ""; |
||||
|
for (var i = 0; i < s.length; i++) { |
||||
|
str += "\\u" + s.charCodeAt(i).toString(16) + "\t"; |
||||
|
} |
||||
|
return str; |
||||
|
} |
||||
|
|
||||
|
function strToHexCharCode(str) { |
||||
|
if (str === "") |
||||
|
return ""; |
||||
|
var hexCharCode = []; |
||||
|
hexCharCode.push("0x"); |
||||
|
for (var i = 0; i < str.length; i++) { |
||||
|
hexCharCode.push((str.charCodeAt(i)).toString(16)); |
||||
|
} |
||||
|
return hexCharCode.join(""); |
||||
|
} |
||||
|
|
||||
|
function sumStrLength(str) { |
||||
|
var length = 0; |
||||
|
var data = str.toString(); |
||||
|
for (var i = 0; i < data.length; i++) { |
||||
|
if (isCN(data[i])) { //是中文
|
||||
|
length += 2; |
||||
|
} else { |
||||
|
length += 1; |
||||
|
} |
||||
|
} |
||||
|
return length; |
||||
|
} |
||||
|
|
||||
|
function isCN(str) { |
||||
|
if (/^[\u3220-\uFA29]+$/.test(str)) { |
||||
|
return true; |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//汉字转码
|
||||
|
export function hexStringToArrayBuffer(str) { |
||||
|
const buffer = new ArrayBuffer((str.length / 2) + 1) |
||||
|
const dataView = new DataView(buffer) |
||||
|
for (var i = 0; i < str.length / 2; i++) { |
||||
|
var temp = parseInt(str[i * 2] + str[i * 2 + 1], 16) |
||||
|
dataView.setUint8(i, temp) |
||||
|
} |
||||
|
dataView.setUint8((str.length / 2), 0x0a) |
||||
|
return buffer; |
||||
|
} |
||||
|
|
||||
|
//返回八位数组
|
||||
|
function subString(str) { |
||||
|
var arr = []; |
||||
|
if (str.length > 8) { //大于8
|
||||
|
for (var i = 0; |
||||
|
(i * 8) < str.length; i++) { |
||||
|
var temp = str.substring(i * 8, 8 * i + 8); |
||||
|
arr.push(temp) |
||||
|
} |
||||
|
return arr; |
||||
|
} else { |
||||
|
return str |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//不带有汉字
|
||||
|
function hexStringToArrayBufferstr(str) { |
||||
|
let val = "" |
||||
|
for (let i = 0; i < str.length; i++) { |
||||
|
if (val === '') { |
||||
|
val = str.charCodeAt(i).toString(16) |
||||
|
} else { |
||||
|
val += ',' + str.charCodeAt(i).toString(16) |
||||
|
} |
||||
|
} |
||||
|
val += "," + "0x0a"; |
||||
|
console.log(val) |
||||
|
// 将16进制转化为ArrayBuffer
|
||||
|
return new Uint8Array(val.match(/[\da-f]{2}/gi).map(function(h) { |
||||
|
return parseInt(h, 16) |
||||
|
})).buffer |
||||
|
} |
||||
|
|
||||
|
export function ab2hex(buffer) { |
||||
|
let hexArr = Array.prototype.map.call( |
||||
|
new Uint8Array(buffer), |
||||
|
function (bit) { |
||||
|
return ('00' + bit.toString(16)).slice(-2) |
||||
|
}) |
||||
|
return hexArr.join(''); |
||||
|
} |
||||
|
|
||||
|
// ArrayBuffer转为字符串,参数为ArrayBuffer对象
|
||||
|
export function ab2str(buf) { |
||||
|
return String.fromCharCode.apply(null, new Uint8Array(buf)); |
||||
|
} |
||||
|
|
||||
|
// 字符串转为ArrayBuffer对象,参数为字符串
|
||||
|
export function str2ab(str) { |
||||
|
var buf = new ArrayBuffer(str.length+1); // 补充/0
|
||||
|
var bufView = new Uint8Array(buf); |
||||
|
for (var i = 0, strLen = str.length; i < strLen; i++) { |
||||
|
bufView[i] = str.charCodeAt(i); |
||||
|
} |
||||
|
return buf; |
||||
|
} |
||||
|
|
||||
|
export function send0X0A() { |
||||
|
const buffer = new ArrayBuffer(1) |
||||
|
const dataView = new DataView(buffer) |
||||
|
dataView.setUint8(0, 0x0a) |
||||
|
return buffer; |
||||
|
} |
||||
|
|
||||
|
export function buf2hex(buffer) { |
||||
|
return Array.prototype.map.call(new Uint8Array(buffer), x => ('00' + x.toString(16)).slice(-2)).join(''); |
||||
|
} |
||||
|
|
||||
|
// module.exports = {
|
||||
|
// hexStringToArrayBuffer: hexStringToArrayBuffer,
|
||||
|
// send0X0A: send0X0A,
|
||||
|
// ab2hex: ab2hex,
|
||||
|
// str2ab: str2ab,
|
||||
|
// ab2str: ab2str,
|
||||
|
// buf2hex: buf2hex
|
||||
|
// }
|
@ -0,0 +1,84 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> |
||||
|
<title></title> |
||||
|
<script src="../../api/img-to-base64.js"></script> |
||||
|
<script type="text/javascript"> |
||||
|
document.addEventListener('plusready', function() { |
||||
|
//console.log("所有plus api都应该在此事件发生后调用,否则会出现plus is undefined。") |
||||
|
|
||||
|
|
||||
|
}); |
||||
|
|
||||
|
</script> |
||||
|
<style> |
||||
|
.box { |
||||
|
font-size: 14px; |
||||
|
display: flex; |
||||
|
margin-top: 60px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.left { |
||||
|
border-top: 1px solid #b1b1b1; |
||||
|
border-left: 1px solid #b1b1b1; |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.left-item { |
||||
|
display: flex; |
||||
|
} |
||||
|
.bold-font{ |
||||
|
font-weight: bold; |
||||
|
font-size: 28rpx; |
||||
|
} |
||||
|
|
||||
|
.label { |
||||
|
border-bottom: 1px solid #b1b1b1; |
||||
|
border-right: 1px solid #b1b1b1; |
||||
|
width: 60px; |
||||
|
padding: 0px 5px; |
||||
|
height: 58px; |
||||
|
line-height: 58px; |
||||
|
} |
||||
|
|
||||
|
.value { |
||||
|
border-bottom: 1px solid #b1b1b1; |
||||
|
border-right: 1px solid #b1b1b1; |
||||
|
padding: 0px 5px; |
||||
|
height: 58px; |
||||
|
flex: 1; |
||||
|
width: 0px; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
word-break: break-all; |
||||
|
} |
||||
|
|
||||
|
.right { |
||||
|
width: 300px; |
||||
|
} |
||||
|
|
||||
|
.image { |
||||
|
width: calc(100% - 1px); |
||||
|
height: 176px; |
||||
|
border-bottom: 1px solid #b1b1b1; |
||||
|
border-top: 1px solid #b1b1b1; |
||||
|
border-right: 1px solid #b1b1b1; |
||||
|
} |
||||
|
|
||||
|
.image img { |
||||
|
width: 172px; |
||||
|
height: 172px; |
||||
|
border: 1px solid #b1b1b1; |
||||
|
/* width: calc(100% - 4px); |
||||
|
height: calc(100% - 4px); */ |
||||
|
margin: 1px; |
||||
|
} |
||||
|
</style> |
||||
|
</head> |
||||
|
<body> |
||||
|
mainBody |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,131 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> |
||||
|
<title></title> |
||||
|
<script src="../../api/img-to-base64.js"></script> |
||||
|
<script type="text/javascript"> |
||||
|
document.addEventListener('plusready', function() { |
||||
|
//console.log("所有plus api都应该在此事件发生后调用,否则会出现plus is undefined。") |
||||
|
|
||||
|
|
||||
|
}); |
||||
|
</script> |
||||
|
<style> |
||||
|
.box { |
||||
|
font-size: 13px; |
||||
|
/* padding: 10px; */ |
||||
|
border: 1px solid #dedede; |
||||
|
} |
||||
|
|
||||
|
.left { |
||||
|
border-top: 1px solid #b1b1b1; |
||||
|
border-left: 1px solid #b1b1b1; |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.left-item { |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.label { |
||||
|
border-bottom: 1px solid #b1b1b1; |
||||
|
border-right: 1px solid #b1b1b1; |
||||
|
width: 60px; |
||||
|
padding: 0px 5px; |
||||
|
height: 30px; |
||||
|
line-height: 30px; |
||||
|
} |
||||
|
|
||||
|
.value { |
||||
|
border-bottom: 1px solid #b1b1b1; |
||||
|
border-right: 1px solid #b1b1b1; |
||||
|
padding: 0px 5px; |
||||
|
height: 30px; |
||||
|
flex: 1; |
||||
|
width: 0px; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
word-wrap: break-word; |
||||
|
} |
||||
|
|
||||
|
.right { |
||||
|
width: 200px; |
||||
|
} |
||||
|
|
||||
|
.image { |
||||
|
width: 100%; |
||||
|
height: 202px; |
||||
|
border-bottom: 1px solid #b1b1b1; |
||||
|
border-top: 1px solid #b1b1b1; |
||||
|
border-right: 1px solid #b1b1b1; |
||||
|
} |
||||
|
|
||||
|
.image img { |
||||
|
width: calc(100% - 4px); |
||||
|
height: calc(100% - 4px); |
||||
|
margin: 2px; |
||||
|
} |
||||
|
|
||||
|
.mb-kw { |
||||
|
border-bottom: 1px solid #dedede; |
||||
|
padding: 10px; |
||||
|
font-size: 15px; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.mb-kw div { |
||||
|
font-weight: bold; |
||||
|
font-size: 23px; |
||||
|
text-align: center; |
||||
|
} |
||||
|
|
||||
|
.mb-bo { |
||||
|
display: flex; |
||||
|
} |
||||
|
|
||||
|
.mb-bo .mb-left { |
||||
|
flex: 1 |
||||
|
} |
||||
|
|
||||
|
.mb-bo .mb-left .mb-text { |
||||
|
padding: 10px; |
||||
|
} |
||||
|
|
||||
|
.mb-bo .mb-left .mb-text:nth-child(1) { |
||||
|
border-bottom: 1px solid #dedede; |
||||
|
} |
||||
|
|
||||
|
.mb-bo .mb-left .mb-text div { |
||||
|
font-weight: bold; |
||||
|
font-size: 16px; |
||||
|
text-align: center; |
||||
|
} |
||||
|
|
||||
|
.mb-bo .mb-right { |
||||
|
padding: 10px; |
||||
|
width: 230px; |
||||
|
border-left: 1px solid #dedede; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.mb-bo .mb-right .mb-text { |
||||
|
|
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.mb-bo .mb-right .mb-text div { |
||||
|
font-weight: bold; |
||||
|
font-size: 20px; |
||||
|
text-align: center; |
||||
|
width: 100%; |
||||
|
} |
||||
|
</style> |
||||
|
</head> |
||||
|
<body> |
||||
|
mainBody |
||||
|
|
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,78 @@ |
|||||
|
<!-- 采购收货打印指引单 --> |
||||
|
<!DOCTYPE html> |
||||
|
<html> |
||||
|
<head> |
||||
|
<meta charset="utf-8"> |
||||
|
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> |
||||
|
<title></title> |
||||
|
<script src="../../api/img-to-base64.js"></script> |
||||
|
<script type="text/javascript"> |
||||
|
document.addEventListener('plusready', function() { |
||||
|
//console.log("所有plus api都应该在此事件发生后调用,否则会出现plus is undefined。") |
||||
|
|
||||
|
|
||||
|
}); |
||||
|
</script> |
||||
|
<style> |
||||
|
.box { |
||||
|
font-size: 13px; |
||||
|
/* padding: 10px; */ |
||||
|
} |
||||
|
|
||||
|
.mb-kw { |
||||
|
border-top: 1px solid #dedede; |
||||
|
border-left: 1px solid #dedede; |
||||
|
border-right: 1px solid #dedede; |
||||
|
font-size: 15px; |
||||
|
display: flex; |
||||
|
align-items: center |
||||
|
} |
||||
|
|
||||
|
.top1 th { |
||||
|
font-weight: bold; |
||||
|
font-size: 13px; |
||||
|
padding: 10px; |
||||
|
text-align: left; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
table { |
||||
|
border-collapse: collapse; |
||||
|
border: 1px solid #dedede; |
||||
|
/* 设置表格的边框 */ |
||||
|
width: 100% |
||||
|
} |
||||
|
th{ |
||||
|
font-weight: bold; |
||||
|
font-size: 13px; |
||||
|
padding: 10px; |
||||
|
} |
||||
|
td{ |
||||
|
padding: 10px; |
||||
|
|
||||
|
} |
||||
|
td:nth-child(2n){ |
||||
|
width:calc(50% - 100px); |
||||
|
} |
||||
|
td:nth-child(2n+1){ |
||||
|
width:80px; |
||||
|
} |
||||
|
.relative{ |
||||
|
margin-bottom: 10px; |
||||
|
position: relative; |
||||
|
} |
||||
|
|
||||
|
.q{ |
||||
|
position: absolute; |
||||
|
left: 50%; |
||||
|
top:50%; |
||||
|
font-size: 160px; |
||||
|
transform: translate(-50% ,-50%); |
||||
|
color: rgba(0, 0, 0, 0.1); |
||||
|
} |
||||
|
</style> |
||||
|
</head> |
||||
|
<body> |
||||
|
mainBody |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,37 @@ |
|||||
|
<template> |
||||
|
<view class="card_view "> |
||||
|
<text class="card_level">{{title}}</text> |
||||
|
<text class="card_big_content" style="font-size: 40rpx;">{{getPriorityName1()}}</text> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import {getPriorityName} from '@/common/directory.js'; |
||||
|
export default { |
||||
|
components: { |
||||
|
}, |
||||
|
data() { |
||||
|
return {} |
||||
|
}, |
||||
|
props: { |
||||
|
priority: { |
||||
|
type: Number, |
||||
|
default:2 |
||||
|
}, |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: '优先级' |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
methods:{ |
||||
|
getPriorityName1(){ |
||||
|
return getPriorityName(this.priority) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,39 @@ |
|||||
|
<template> |
||||
|
<view class="card_view"> |
||||
|
<text class="card_light ">{{title}}</text> |
||||
|
<text class="card_content ">{{lightCode}}</text> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
components: { |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
lightCode: { |
||||
|
type: String, |
||||
|
default: '' |
||||
|
}, |
||||
|
title: |
||||
|
{ |
||||
|
type:String, |
||||
|
default: '灯码' |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,163 @@ |
|||||
|
<template> |
||||
|
<view class="" style="background-color: #fff;"> |
||||
|
<uni-collapse ref="collapse"> |
||||
|
<uni-collapse-item :open="true"> |
||||
|
<template v-slot:title> |
||||
|
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" |
||||
|
:isShowPackUnit="true"></itemCompareQty> |
||||
|
</template> |
||||
|
<package-list :dataContent="dataContent.subList" |
||||
|
:isEdit="settingParam.allowModifyQty=='TRUE'" |
||||
|
:settingParam="settingParam" |
||||
|
@collapseChange="collapseChange" |
||||
|
@updateData="updateData" :isShowStatus="isShowStatus" |
||||
|
></package-list> |
||||
|
</uni-collapse-item> |
||||
|
</uni-collapse> |
||||
|
|
||||
|
<recommend-qty-edit ref=" receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> |
||||
|
</recommend-qty-edit> |
||||
|
<comMessage ref="message"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' |
||||
|
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue' |
||||
|
import receiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue' |
||||
|
import pack from '@/mycomponents/balance/pack.vue' |
||||
|
import detailList from '@/mycomponents/detail/detailList.vue' |
||||
|
import packageList from '@/mycomponents/package/packageList.vue' |
||||
|
|
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getPurchaseReceiptOption |
||||
|
} from '@/common/array.js'; |
||||
|
|
||||
|
export default { |
||||
|
emits: ["updateData"], |
||||
|
components: { |
||||
|
itemCompareQty, |
||||
|
recommend, |
||||
|
recommendQtyEdit, |
||||
|
jobDetailPopup, |
||||
|
receiptDetailInfoPopup, |
||||
|
detailList, |
||||
|
packageList |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
locationAreaTypeList: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
showItem: {}, |
||||
|
editItem: { |
||||
|
record: { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
locatonItem: {}, |
||||
|
detailOptions: [], |
||||
|
scanOptions: [] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
if (this.detailOptions.length == 0) { |
||||
|
this.detailOptions = getDetailOption(); |
||||
|
} |
||||
|
if (this.scanOptions.length == 0) { |
||||
|
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam |
||||
|
.allowModifyLocation) |
||||
|
} |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
|
||||
|
updated() { |
||||
|
console.log('updated') |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
collapseChange(){ |
||||
|
setTimeout(() => { |
||||
|
this.resizeCollapse(); |
||||
|
}, 500) |
||||
|
}, |
||||
|
|
||||
|
resizeCollapse() { |
||||
|
this.$nextTick(r => { |
||||
|
this.$refs.collapse.resize() |
||||
|
}); |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
refreshCollapse() { |
||||
|
this.$nextTick(r => { |
||||
|
this.$refs.collapse.forEach(r => { |
||||
|
r.childrens.forEach(i => { |
||||
|
i.init(); |
||||
|
}) |
||||
|
r.resize(); |
||||
|
}) |
||||
|
}); |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
|
||||
|
swipeClick(e, item) { |
||||
|
if (e.content.text == "编辑") { |
||||
|
this.edit(item) |
||||
|
} else if (e.content.text == "移除") { |
||||
|
this.remove(item) |
||||
|
} |
||||
|
}, |
||||
|
edit(item) { |
||||
|
this.editItem = item; |
||||
|
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty); |
||||
|
}, |
||||
|
remove(item) { |
||||
|
this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
item.scaned = false |
||||
|
item.handleQty = null |
||||
|
this.$forceUpdate() |
||||
|
this.$emit('remove', item) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
confirm(qty) { |
||||
|
this.editItem.handleQty = qty; |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
updateData(){ |
||||
|
this.$emit('updateData') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,146 @@ |
|||||
|
<template> |
||||
|
<view class="" v-for="(item,index) in dataContent" :key="item.id"> |
||||
|
<uni-collapse ref="collapse" @change=""> |
||||
|
<uni-collapse-item :open="true"> |
||||
|
<template v-slot:title> |
||||
|
<recommend :detail="item" :isShowLocation="false" :isShowFromLocation="false"></recommend> |
||||
|
</template> |
||||
|
<view v-for="(pack,index) in item.packList" :key="pack.id" style="margin-left: 20px;"> |
||||
|
<recommend :detail="pack" :isShowLocation="false" :isShowFromLocation="false" |
||||
|
:isShowToLocation="false" :isShowBatch="false"></recommend> |
||||
|
</view> |
||||
|
</uni-collapse-item> |
||||
|
</uni-collapse> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
|
||||
|
<script> |
||||
|
import container from '@/mycomponents/container/container.vue' |
||||
|
import pack from '@/mycomponents/balance/pack.vue' |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import toLocation from '@/mycomponents/balance/toLocation.vue' |
||||
|
import batch from '@/mycomponents/balance/batch.vue' |
||||
|
import recommendQty from '@/mycomponents/qty/recommendQty.vue' |
||||
|
import compareQty from '@/mycomponents/qty/compareQty.vue' |
||||
|
import config from '@/static/config.js' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
container, |
||||
|
pack, |
||||
|
location, |
||||
|
toLocation, |
||||
|
batch, |
||||
|
recommendQty, |
||||
|
compareQty, |
||||
|
recommend |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
isShowContainer: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowBatch: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowFromLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowToLocation: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
|
||||
|
locationTitle: { |
||||
|
type: String, |
||||
|
default: '库位' |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
copy() { |
||||
|
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
||||
|
var content = "HPQ;V1.0;I" + this.detail.itemCode + ";P" + this.detail.packingNumber + ";B" + this.detail |
||||
|
.batch + ";Q" + this.detail.qty |
||||
|
// #ifdef H5 |
||||
|
this.$copyText(content).then( |
||||
|
res => { |
||||
|
uni.showToast({ |
||||
|
title: '复制采购标签成功', |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
} |
||||
|
) |
||||
|
// #endif |
||||
|
// #ifndef H5 |
||||
|
uni.setClipboardData({ |
||||
|
data: content, |
||||
|
success: () => { |
||||
|
uni.showToast({ |
||||
|
title: '复制采购标签成功' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
// #endif |
||||
|
}, |
||||
|
copyPro() { |
||||
|
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
||||
|
var content = "HMQ;V1.0;I" + this.detail.itemCode + ";P" + this.detail.packingNumber + ";B" + this.detail |
||||
|
.batch + ";Q" + this.detail.qty |
||||
|
// #ifdef H5 |
||||
|
this.$copyText(content).then( |
||||
|
res => { |
||||
|
uni.showToast({ |
||||
|
title: '复制制品标签成功', |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
} |
||||
|
) |
||||
|
// #endif |
||||
|
// #ifndef H5 |
||||
|
uni.setClipboardData({ |
||||
|
data: content, |
||||
|
success: () => { |
||||
|
uni.showToast({ |
||||
|
title: '复制制品标签成功' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
// #endif |
||||
|
}, |
||||
|
isDevlement() { |
||||
|
return config.isDevelopment; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,149 @@ |
|||||
|
<template> |
||||
|
<uni-popup ref="popup"> |
||||
|
<view class="maskbox" @tap="maskClick"></view> |
||||
|
<view class="uni-flex uni-column " |
||||
|
style="background-color: white;width: 100%; height:auto;padding: 20rpx;z-index: 99;position: relative; border-radius: 10rpx;"> |
||||
|
<view class="uni-flex" style="justify-content: center; font-size: 35rpx; font-weight: bold;" > |
||||
|
筛选条件 |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex " style=" flex-direction: column; width: 100%;margin-top: 10rpx;"> |
||||
|
<view class="" style="font-size: 35rpx; margin-bottom: 10rpx;"> |
||||
|
库位 |
||||
|
</view> |
||||
|
<u-input style="margin-left: 0rpx;" confirmType="search" v-model="locationCode" :border="true" |
||||
|
placeholder="请输入库位" :focus="true"/> |
||||
|
</view> |
||||
|
<view class="" style="font-size: 35rpx; margin-top: 10rpx; margin-bottom: 10rpx;"> |
||||
|
库存状态 : |
||||
|
<uni-data-checkbox mode="tag" multiple v-model="state" :localdata="stateList"></uni-data-checkbox> |
||||
|
</view> |
||||
|
<view class="" style="margin-top: 30rpx; margin-left: 30rpx; margin-right: 30rpx;"> |
||||
|
<button type="primary" size="default" @click="confirm">确认</button> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</view> |
||||
|
</uni-popup> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getTodayDate |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
import { |
||||
|
getInventoryStatusList |
||||
|
} from '@/common/directory.js'; |
||||
|
|
||||
|
import winScanJobNumber from "@/mycomponents/scan/winScanJobNumber.vue" |
||||
|
import winScanAsnNumber from "@/mycomponents/scan/winScanAsnNumber.vue" |
||||
|
|
||||
|
export default { |
||||
|
emits: [ |
||||
|
"onConfirmClick" |
||||
|
], |
||||
|
components: { |
||||
|
winScanJobNumber, |
||||
|
winScanAsnNumber |
||||
|
}, |
||||
|
|
||||
|
props: { |
||||
|
checkedToday: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
checkedWaitTask: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
otherTitle: { |
||||
|
type: String, |
||||
|
default: "" |
||||
|
}, |
||||
|
isShowAsn: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
isShowJob: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowFromLocationCode: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
isShowProductionLineCode: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
productionline: { |
||||
|
type: Array, |
||||
|
default: [] |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
dataContent: {}, |
||||
|
checkedTodayModel: false, |
||||
|
checkedWaitModel: false, |
||||
|
stateList: [], |
||||
|
state:[], |
||||
|
locationCode:"" |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
}, |
||||
|
mounted() {}, |
||||
|
methods: { |
||||
|
// 点击遮罩 |
||||
|
maskClick() { |
||||
|
// 如果不允许点击遮罩,直接返回 |
||||
|
this.closeScanPopup(); |
||||
|
}, |
||||
|
openFilter() { |
||||
|
this.stateList =getInventoryStatusList() |
||||
|
this.stateList.forEach(res=>{ |
||||
|
res.text =res.label |
||||
|
}) |
||||
|
this.$refs['popup'].open("right"); |
||||
|
}, |
||||
|
closeScanPopup() { |
||||
|
this.$refs.popup.close() |
||||
|
}, |
||||
|
switchChangeToday(isOn) { |
||||
|
|
||||
|
let creationTime = ''; |
||||
|
if (isOn) { |
||||
|
creationTime = getTodayDate(); |
||||
|
} |
||||
|
|
||||
|
this.$emit("switchChangeToday", isOn, creationTime) |
||||
|
this.closeScanPopup() |
||||
|
}, |
||||
|
|
||||
|
scanNumberClick() { |
||||
|
this.$refs.scanNumber.openScanPopup(); |
||||
|
}, |
||||
|
|
||||
|
scanOtherClick() { |
||||
|
this.$refs.scanAsnNumber.openScanPopup(); |
||||
|
}, |
||||
|
|
||||
|
confirm() { |
||||
|
this.$emit("onConfirmClick", this.locationCode,this.state) |
||||
|
this.closeScanPopup(); |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style lang="scss"> |
||||
|
.maskbox { |
||||
|
position: fixed; |
||||
|
top: 0; |
||||
|
left: 0; |
||||
|
width: 100vw; |
||||
|
height: 100vh; |
||||
|
z-index: 0; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,47 @@ |
|||||
|
<template> |
||||
|
<!-- style="margin-top: 10rpx;margin-bottom: 10rpx;" class="uni-flex uni-row space-between u-col-center" --> |
||||
|
<view class="task_item" style="margin-left: 15rpx; margin-right: 15rpx;"> |
||||
|
<view class="uni-flex u-col" style="flex-direction: column;"> |
||||
|
<view class="uni-flex uni-row u-col-center"> |
||||
|
<text style="font-size: 32rpx;" >承接人: {{dataContent.acceptUserName}}</text> |
||||
|
</view> |
||||
|
<view class="uni-flex uni-row u-col-center"> |
||||
|
<text style="font-size: 32rpx;" class="center">承接时间 : {{formatDate(dataContent.acceptTime)}}</text> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
dateFormat |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
|
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
}; |
||||
|
}, |
||||
|
watch: {}, |
||||
|
|
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
formatDate: function(val) { |
||||
|
return dateFormat(val) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
</style> |
@ -0,0 +1,41 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<view class="task_card"> |
||||
|
<jobTopAsn :dataContent="dataContent"></jobTopAsn> |
||||
|
<slot></slot> |
||||
|
<view class='split_line'></view> |
||||
|
<job-bottom :dataContent="dataContent"></job-bottom> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import jobTopAsn from '@/mycomponents/job/jobTopAsn.vue' |
||||
|
import jobBottom from '@/mycomponents/job/jobBottom.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
jobTopAsn, |
||||
|
jobBottom, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,88 @@ |
|||||
|
<template> |
||||
|
<view class="task_item"> |
||||
|
<view class="task_text" style="border-top: 1px solid #dedede;padding-top: 20rpx;margin-top: 20rpx;"> |
||||
|
<!-- 主子表拆分,没有数量了 --> |
||||
|
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="false" |
||||
|
></itemCompareQty> |
||||
|
<!-- :objTextStyle="{'fontWeight':'bold','fontSize':'40rpx'}" --> |
||||
|
<div class="u-p-l-10"> |
||||
|
<pack v-if="isShowPack && dataContent.packingNumber!=null" :packingCode="dataContent.packingNumber"> |
||||
|
</pack> |
||||
|
<batch v-if="isShowBatch && dataContent.batch!=null" :batch="dataContent.batch"></batch> |
||||
|
<view class="u-flex u-row-between"> |
||||
|
<location v-if="isShowFromLocation&&dataContent.fromLocationCode" title="来源库位" :locationCode="dataContent.fromLocationCode"> |
||||
|
</location> |
||||
|
<level title="优先级" :priority="dataContent.priority" v-if="dataContent.priority !== '' && dataContent.priority !== undefined && dataContent.priority !== null "> |
||||
|
</level> |
||||
|
</view> |
||||
|
|
||||
|
<to-location v-if="isShowToLocation" title="目标库位" :locationCode="dataContent.toLocationCode||dataContent.locationCode"> |
||||
|
</to-location> |
||||
|
|
||||
|
</div> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import pack from '@/mycomponents/balance/pack.vue' |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import toLocation from '@/mycomponents/balance/toLocation.vue' |
||||
|
import batch from '@/mycomponents/balance/batch.vue' |
||||
|
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
||||
|
import level from '@/mycomponents/balance/level.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
pack, |
||||
|
location, |
||||
|
toLocation, |
||||
|
batch, |
||||
|
itemCompareQty, |
||||
|
level |
||||
|
}, |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
|
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: {} |
||||
|
}, |
||||
|
isShowContainer: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowBatch: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowFromLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowToLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowDeliverType: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
methods: { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
|
||||
|
</style> |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue