@10yun/cv-mobile-ui 0.4.11 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/MessageBox.js +2 -2
- package/plugins/MessageTip.js +4 -4
- package/plugins/request.js +54 -39
- package/plugins/storage.js +1 -4
- package/plugins/utils.js +13 -0
- package/ui-cv/cv-draw-barcode/barcode.js +225 -202
- package/ui-cv/cv-draw-barcode/barcodes/Barcode.js +14 -17
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128.js +202 -164
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128A.js +58 -35
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128B.js +58 -36
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128C.js +58 -34
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128_AUTO.js +50 -41
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/auto.js +43 -57
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/constants.js +71 -30
- package/ui-cv/cv-draw-barcode/barcodes/CODE128/index.js +11 -29
- package/ui-cv/cv-draw-barcode/barcodes/CODE39/index.js +150 -77
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN.js +122 -90
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN13.js +169 -111
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN2.js +77 -56
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN5.js +84 -60
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN8.js +133 -74
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/UPC.js +174 -156
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/UPCE.js +220 -174
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/constants.js +80 -21
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/encoder.js +18 -24
- package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/index.js +15 -39
- package/ui-cv/cv-draw-barcode/barcodes/GenericBarcode/index.js +80 -55
- package/ui-cv/cv-draw-barcode/barcodes/ITF/ITF.js +99 -69
- package/ui-cv/cv-draw-barcode/barcodes/ITF/ITF14.js +73 -45
- package/ui-cv/cv-draw-barcode/barcodes/ITF/constants.js +8 -8
- package/ui-cv/cv-draw-barcode/barcodes/ITF/index.js +6 -18
- package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI.js +86 -66
- package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI10.js +40 -33
- package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI1010.js +41 -35
- package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI11.js +42 -33
- package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI1110.js +37 -35
- package/ui-cv/cv-draw-barcode/barcodes/MSI/checksums.js +22 -25
- package/ui-cv/cv-draw-barcode/barcodes/MSI/index.js +13 -34
- package/ui-cv/cv-draw-barcode/barcodes/codabar/index.js +120 -90
- package/ui-cv/cv-draw-barcode/barcodes/common.js +0 -0
- package/ui-cv/cv-draw-barcode/barcodes/index.js +32 -33
- package/ui-cv/cv-draw-barcode/barcodes/index.tmp.js +32 -33
- package/ui-cv/cv-draw-barcode/barcodes/pharmacode/index.js +93 -71
- package/ui-cv/cv-draw-barcode/cv-draw-barcode.vue +4 -4
- package/ui-cv/cv-icons/icons/default-icons.js +132 -0
- package/ui-cv/cv-icons/icons/icons-action.js +72 -0
- package/ui-cv/cv-icons/icons/icons-arrow.js +46 -0
- package/ui-cv/cv-icons/icons/icons-base.js +89 -0
- package/ui-cv/cv-icons/icons/icons-mall.js +34 -0
- package/ui-cv/cv-icons/icons/icons-media.js +44 -0
- package/ui-cv/cv-icons/icons/icons-order.js +33 -0
- package/ui-cv/cv-icons/icons/icons-people.js +46 -0
- package/ui-cv/cv-icons/icons/icons-status.js +32 -0
- package/ui-cv/cv-icons/icons/icons-wallet.js +15 -0
- package/ui-cv/cv-icons/icons.js +14 -13
- package/ui-cv/cv-lists-base/cv-lists-base.vue +0 -2
- package/ui-cv/cv-tab-lists/cv-tab-lists.vue +0 -2
- package/ui-uni/u-charts/u-charts.js +1093 -744
- package/ui-uni/uni-list/uni-refresh.wxs +1 -1
- package/ui-uni/uni-swipe-action-item/index.wxs +6 -6
|
@@ -1,105 +1,178 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { BarcodeFunc } from '../Barcode.js';
|
|
2
|
+
|
|
3
|
+
var _createClass = (function () {
|
|
4
|
+
function defineProperties(target, props) {
|
|
5
|
+
for (var i = 0; i < props.length; i++) {
|
|
6
|
+
var descriptor = props[i];
|
|
7
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
8
|
+
descriptor.configurable = true;
|
|
9
|
+
if ('value' in descriptor) descriptor.writable = true;
|
|
10
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return function (Constructor, protoProps, staticProps) {
|
|
14
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
15
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
16
|
+
return Constructor;
|
|
17
|
+
};
|
|
18
|
+
})();
|
|
19
|
+
|
|
20
|
+
function _classCallCheck(instance, Constructor) {
|
|
21
|
+
if (!(instance instanceof Constructor)) {
|
|
22
|
+
throw new TypeError('Cannot call a class as a function');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
17
25
|
|
|
18
|
-
function _possibleConstructorReturn(self, call) {
|
|
26
|
+
function _possibleConstructorReturn(self, call) {
|
|
27
|
+
if (!self) {
|
|
28
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
29
|
+
}
|
|
30
|
+
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
|
|
31
|
+
}
|
|
19
32
|
|
|
20
|
-
function _inherits(subClass, superClass) {
|
|
33
|
+
function _inherits(subClass, superClass) {
|
|
34
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
|
35
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
|
36
|
+
}
|
|
37
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
38
|
+
constructor: { value: subClass, enumerable: false, writable: true, configurable: true }
|
|
39
|
+
});
|
|
40
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : (subClass.__proto__ = superClass);
|
|
41
|
+
} // Encoding documentation:
|
|
21
42
|
// https://en.wikipedia.org/wiki/Code_39#Encoding
|
|
22
43
|
|
|
23
|
-
var CODE39 = function (_Barcode) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
44
|
+
var CODE39 = (function (_Barcode) {
|
|
45
|
+
_inherits(CODE39, _Barcode);
|
|
46
|
+
|
|
47
|
+
function CODE39(data, options) {
|
|
48
|
+
_classCallCheck(this, CODE39);
|
|
49
|
+
|
|
50
|
+
data = data.toUpperCase();
|
|
51
|
+
|
|
52
|
+
// Calculate mod43 checksum if enabled
|
|
53
|
+
if (options.mod43) {
|
|
54
|
+
data += getCharacter(mod43checksum(data));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return _possibleConstructorReturn(this, (CODE39.__proto__ || Object.getPrototypeOf(CODE39)).call(this, data, options));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
_createClass(CODE39, [
|
|
61
|
+
{
|
|
62
|
+
key: 'encode',
|
|
63
|
+
value: function encode() {
|
|
64
|
+
// First character is always a *
|
|
65
|
+
var result = getEncoding('*');
|
|
66
|
+
|
|
67
|
+
// Take every character and add the binary representation to the result
|
|
68
|
+
for (var i = 0; i < this.data.length; i++) {
|
|
69
|
+
result += getEncoding(this.data[i]) + '0';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Last character is always a *
|
|
73
|
+
result += getEncoding('*');
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
data: result,
|
|
77
|
+
text: this.text
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
key: 'valid',
|
|
83
|
+
value: function valid() {
|
|
84
|
+
return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/) !== -1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
]);
|
|
88
|
+
|
|
89
|
+
return CODE39;
|
|
90
|
+
})(BarcodeFunc);
|
|
67
91
|
|
|
68
92
|
// All characters. The position in the array is the (checksum) value
|
|
69
93
|
|
|
70
|
-
|
|
71
|
-
|
|
94
|
+
var characters = [
|
|
95
|
+
'0',
|
|
96
|
+
'1',
|
|
97
|
+
'2',
|
|
98
|
+
'3',
|
|
99
|
+
'4',
|
|
100
|
+
'5',
|
|
101
|
+
'6',
|
|
102
|
+
'7',
|
|
103
|
+
'8',
|
|
104
|
+
'9',
|
|
105
|
+
'A',
|
|
106
|
+
'B',
|
|
107
|
+
'C',
|
|
108
|
+
'D',
|
|
109
|
+
'E',
|
|
110
|
+
'F',
|
|
111
|
+
'G',
|
|
112
|
+
'H',
|
|
113
|
+
'I',
|
|
114
|
+
'J',
|
|
115
|
+
'K',
|
|
116
|
+
'L',
|
|
117
|
+
'M',
|
|
118
|
+
'N',
|
|
119
|
+
'O',
|
|
120
|
+
'P',
|
|
121
|
+
'Q',
|
|
122
|
+
'R',
|
|
123
|
+
'S',
|
|
124
|
+
'T',
|
|
125
|
+
'U',
|
|
126
|
+
'V',
|
|
127
|
+
'W',
|
|
128
|
+
'X',
|
|
129
|
+
'Y',
|
|
130
|
+
'Z',
|
|
131
|
+
'-',
|
|
132
|
+
'.',
|
|
133
|
+
' ',
|
|
134
|
+
'$',
|
|
135
|
+
'/',
|
|
136
|
+
'+',
|
|
137
|
+
'%',
|
|
138
|
+
'*'
|
|
139
|
+
];
|
|
72
140
|
|
|
73
141
|
// The decimal representation of the characters, is converted to the
|
|
74
142
|
// corresponding binary with the getEncoding function
|
|
75
|
-
var encodings = [
|
|
143
|
+
var encodings = [
|
|
144
|
+
20957, 29783, 23639, 30485, 20951, 29813, 23669, 20855, 29789, 23645, 29975, 23831, 30533, 22295, 30149, 24005, 21623, 29981,
|
|
145
|
+
23837, 22301, 30023, 23879, 30545, 22343, 30161, 24017, 21959, 30065, 23921, 22385, 29015, 18263, 29141, 17879, 29045, 18293,
|
|
146
|
+
17783, 29021, 18269, 17477, 17489, 17681, 20753, 35770
|
|
147
|
+
];
|
|
76
148
|
|
|
77
149
|
// Get the binary representation of a character by converting the encodings
|
|
78
150
|
// from decimal to binary
|
|
79
151
|
function getEncoding(character) {
|
|
80
|
-
|
|
152
|
+
return getBinary(characterValue(character));
|
|
81
153
|
}
|
|
82
154
|
|
|
83
155
|
function getBinary(characterValue) {
|
|
84
|
-
|
|
156
|
+
return encodings[characterValue].toString(2);
|
|
85
157
|
}
|
|
86
158
|
|
|
87
159
|
function getCharacter(characterValue) {
|
|
88
|
-
|
|
160
|
+
return characters[characterValue];
|
|
89
161
|
}
|
|
90
162
|
|
|
91
163
|
function characterValue(character) {
|
|
92
|
-
|
|
164
|
+
return characters.indexOf(character);
|
|
93
165
|
}
|
|
94
166
|
|
|
95
167
|
function mod43checksum(data) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
168
|
+
var checksum = 0;
|
|
169
|
+
for (var i = 0; i < data.length; i++) {
|
|
170
|
+
checksum += characterValue(data[i]);
|
|
171
|
+
}
|
|
100
172
|
|
|
101
|
-
|
|
102
|
-
|
|
173
|
+
checksum = checksum % 43;
|
|
174
|
+
return checksum;
|
|
103
175
|
}
|
|
104
|
-
|
|
105
|
-
|
|
176
|
+
export default {
|
|
177
|
+
CODE39: CODE39
|
|
178
|
+
};
|
|
@@ -1,92 +1,124 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import _constants from './constants.js';
|
|
2
|
+
import { BarcodeFunc } from '../Barcode.js';
|
|
3
|
+
import { encoderFunc } from './encoder.js';
|
|
4
|
+
|
|
5
|
+
var _createClass = (function () {
|
|
6
|
+
function defineProperties(target, props) {
|
|
7
|
+
for (var i = 0; i < props.length; i++) {
|
|
8
|
+
var descriptor = props[i];
|
|
9
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
10
|
+
descriptor.configurable = true;
|
|
11
|
+
if ('value' in descriptor) descriptor.writable = true;
|
|
12
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return function (Constructor, protoProps, staticProps) {
|
|
16
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
17
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
18
|
+
return Constructor;
|
|
19
|
+
};
|
|
20
|
+
})();
|
|
21
|
+
|
|
22
|
+
function _classCallCheck(instance, Constructor) {
|
|
23
|
+
if (!(instance instanceof Constructor)) {
|
|
24
|
+
throw new TypeError('Cannot call a class as a function');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function _possibleConstructorReturn(self, call) {
|
|
29
|
+
if (!self) {
|
|
30
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
31
|
+
}
|
|
32
|
+
return call && (typeof call === 'object' || typeof call === 'function') ? call : self;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function _inherits(subClass, superClass) {
|
|
36
|
+
if (typeof superClass !== 'function' && superClass !== null) {
|
|
37
|
+
throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);
|
|
38
|
+
}
|
|
39
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
40
|
+
constructor: { value: subClass, enumerable: false, writable: true, configurable: true }
|
|
41
|
+
});
|
|
42
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : (subClass.__proto__ = superClass);
|
|
43
|
+
}
|
|
26
44
|
|
|
27
45
|
// Base class for EAN8 & EAN13
|
|
28
|
-
var EAN = function (_Barcode) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
46
|
+
var EAN = (function (_Barcode) {
|
|
47
|
+
_inherits(EAN, _Barcode);
|
|
48
|
+
|
|
49
|
+
function EAN(data, options) {
|
|
50
|
+
_classCallCheck(this, EAN);
|
|
51
|
+
|
|
52
|
+
// Make sure the font is not bigger than the space between the guard bars
|
|
53
|
+
var _this = _possibleConstructorReturn(this, (EAN.__proto__ || Object.getPrototypeOf(EAN)).call(this, data, options));
|
|
54
|
+
|
|
55
|
+
_this.fontSize = !options.flat && options.fontSize > options.width * 10 ? options.width * 10 : options.fontSize;
|
|
56
|
+
|
|
57
|
+
// Make the guard bars go down half the way of the text
|
|
58
|
+
_this.guardHeight = options.height + _this.fontSize / 2 + options.textMargin;
|
|
59
|
+
return _this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
_createClass(EAN, [
|
|
63
|
+
{
|
|
64
|
+
key: 'encode',
|
|
65
|
+
value: function encode() {
|
|
66
|
+
return this.options.flat ? this.encodeFlat() : this.encodeGuarded();
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: 'leftText',
|
|
71
|
+
value: function leftText(from, to) {
|
|
72
|
+
return this.text.substr(from, to);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
key: 'leftEncode',
|
|
77
|
+
value: function leftEncode(data, structure) {
|
|
78
|
+
return (0, encoderFunc)(data, structure);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
key: 'rightText',
|
|
83
|
+
value: function rightText(from, to) {
|
|
84
|
+
return this.text.substr(from, to);
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
key: 'rightEncode',
|
|
89
|
+
value: function rightEncode(data, structure) {
|
|
90
|
+
return (0, encoderFunc)(data, structure);
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: 'encodeGuarded',
|
|
95
|
+
value: function encodeGuarded() {
|
|
96
|
+
var textOptions = { fontSize: this.fontSize };
|
|
97
|
+
var guardOptions = { height: this.guardHeight };
|
|
98
|
+
|
|
99
|
+
return [
|
|
100
|
+
{ data: _constants.SIDE_BIN, options: guardOptions },
|
|
101
|
+
{ data: this.leftEncode(), text: this.leftText(), options: textOptions },
|
|
102
|
+
{ data: _constants.MIDDLE_BIN, options: guardOptions },
|
|
103
|
+
{ data: this.rightEncode(), text: this.rightText(), options: textOptions },
|
|
104
|
+
{ data: _constants.SIDE_BIN, options: guardOptions }
|
|
105
|
+
];
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
key: 'encodeFlat',
|
|
110
|
+
value: function encodeFlat() {
|
|
111
|
+
var data = [_constants.SIDE_BIN, this.leftEncode(), _constants.MIDDLE_BIN, this.rightEncode(), _constants.SIDE_BIN];
|
|
112
|
+
|
|
113
|
+
return {
|
|
114
|
+
data: data.join(''),
|
|
115
|
+
text: this.text
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
]);
|
|
120
|
+
|
|
121
|
+
return EAN;
|
|
122
|
+
})(BarcodeFunc);
|
|
123
|
+
|
|
124
|
+
export default EAN;
|