@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
package/package.json
CHANGED
package/plugins/MessageBox.js
CHANGED
|
@@ -39,8 +39,8 @@ MessageBox['confirm'] = (content, title) => {
|
|
|
39
39
|
title: title || '提示',
|
|
40
40
|
content: String(content || '') || '??',
|
|
41
41
|
confirmText: '确定',
|
|
42
|
-
showCancel:
|
|
43
|
-
cancelText:
|
|
42
|
+
showCancel: true,
|
|
43
|
+
cancelText: '取消',
|
|
44
44
|
success: function (modalRes) {
|
|
45
45
|
if (modalRes.confirm) {
|
|
46
46
|
res(modalRes);
|
package/plugins/MessageTip.js
CHANGED
|
@@ -13,7 +13,7 @@ const MessageTip = function (options) {
|
|
|
13
13
|
|
|
14
14
|
let setting = {
|
|
15
15
|
title: options.message || '提示',
|
|
16
|
-
duration: options.duration ||
|
|
16
|
+
duration: options.duration || 1200,
|
|
17
17
|
icon: typeIcon || 'none',
|
|
18
18
|
mask: true
|
|
19
19
|
};
|
|
@@ -33,9 +33,9 @@ const MessageTip = function (options) {
|
|
|
33
33
|
MessageTip['info'] = (title, duration, icon) => {
|
|
34
34
|
uni.showToast({
|
|
35
35
|
title: title || '提示',
|
|
36
|
-
duration: duration ||
|
|
37
|
-
icon: icon || 'none'
|
|
38
|
-
mask: true
|
|
36
|
+
duration: duration || 1200,
|
|
37
|
+
icon: icon || 'none'
|
|
38
|
+
// mask: true
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
// 成功提示
|
package/plugins/request.js
CHANGED
|
@@ -12,7 +12,12 @@ function confirmEnding(str, target) {
|
|
|
12
12
|
}
|
|
13
13
|
return false;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
function _hideUniapp() {
|
|
16
|
+
uni.hideLoading();
|
|
17
|
+
uni.hideToast();
|
|
18
|
+
uni.hideNavigationBarLoading();
|
|
19
|
+
uni.stopPullDownRefresh();
|
|
20
|
+
}
|
|
16
21
|
function showErrorMsg(msg) {
|
|
17
22
|
uni.hideLoading();
|
|
18
23
|
uni.hideToast();
|
|
@@ -58,10 +63,13 @@ class RequestClass {
|
|
|
58
63
|
|
|
59
64
|
this.headers = Object.assign({}, {}, options.headers || {});
|
|
60
65
|
|
|
66
|
+
this.canshuOpt = {};
|
|
67
|
+
|
|
68
|
+
/* 新创建 axios 实例配置 */
|
|
61
69
|
this.creSett = Object.assign(
|
|
62
70
|
{},
|
|
63
71
|
{
|
|
64
|
-
timeout: 5000, // request timeout
|
|
72
|
+
timeout: options.timeout || 5000, // request timeout
|
|
65
73
|
// 表示跨域请求时是否需要使用凭证;
|
|
66
74
|
// 开启withCredentials后,服务器才能拿到你的cookie
|
|
67
75
|
// 当然后端服务器也要设置允许你获取你开启了才有用
|
|
@@ -100,14 +108,28 @@ class RequestClass {
|
|
|
100
108
|
}
|
|
101
109
|
/**
|
|
102
110
|
* 设置header参数
|
|
111
|
+
* @param {Object} options
|
|
112
|
+
* @returns {Class} this
|
|
103
113
|
*/
|
|
114
|
+
setDefHeaders(options) {
|
|
115
|
+
this.headers = Object.assign({}, this.headers, options || {});
|
|
116
|
+
this.reqObj.defaults.headers = this.headers;
|
|
117
|
+
return this;
|
|
118
|
+
}
|
|
104
119
|
setHeaders(options) {
|
|
105
120
|
this.headers = Object.assign({}, this.headers, options || {});
|
|
106
121
|
return this;
|
|
107
122
|
}
|
|
108
123
|
/**
|
|
109
|
-
* 设置
|
|
124
|
+
* 设置requests参数
|
|
125
|
+
* @param {Object} options
|
|
126
|
+
* @returns {Class} this
|
|
110
127
|
*/
|
|
128
|
+
setDefRequests(options) {
|
|
129
|
+
this.requests = Object.assign({}, this.requests, options || {});
|
|
130
|
+
this.reqObj.defaults.requests = this.requests;
|
|
131
|
+
return this;
|
|
132
|
+
}
|
|
111
133
|
setRequests(options) {
|
|
112
134
|
this.requests = Object.assign({}, this.requests, options || {});
|
|
113
135
|
return this;
|
|
@@ -116,46 +138,40 @@ class RequestClass {
|
|
|
116
138
|
* 设置响应
|
|
117
139
|
*/
|
|
118
140
|
setResponse(apiResData) {
|
|
119
|
-
var apiResStatus = apiResData.status ||
|
|
141
|
+
var apiResStatus = apiResData.status || -1;
|
|
120
142
|
// 这里根据后端提供的数据进行对应的处理
|
|
121
143
|
switch (apiResStatus) {
|
|
122
144
|
// 没有凭证,请登录
|
|
123
145
|
case '100101':
|
|
124
146
|
case 100101:
|
|
125
|
-
|
|
126
|
-
uni.stopPullDownRefresh();
|
|
147
|
+
_hideUniapp();
|
|
127
148
|
this.storeHandle.dispatch('storeUser/ssLogout', false);
|
|
128
149
|
this.jumpHandle.jumpsLogin();
|
|
129
150
|
break;
|
|
130
151
|
// 无效凭证,请重新登录
|
|
131
152
|
case '100102':
|
|
132
153
|
case 100102:
|
|
133
|
-
|
|
134
|
-
uni.stopPullDownRefresh();
|
|
154
|
+
_hideUniapp();
|
|
135
155
|
this.storeHandle.dispatch('storeUser/ssLogout', false);
|
|
136
156
|
this.jumpHandle.jumpsLogin();
|
|
137
157
|
break;
|
|
138
158
|
// 凭证过期,请重新登录
|
|
139
159
|
case '100103':
|
|
140
160
|
case 100103:
|
|
141
|
-
|
|
142
|
-
uni.stopPullDownRefresh();
|
|
161
|
+
_hideUniapp();
|
|
143
162
|
this.storeHandle.dispatch('storeUser/ssLogout', false);
|
|
144
163
|
this.jumpHandle.jumpsLogin();
|
|
145
164
|
return;
|
|
146
165
|
break;
|
|
147
166
|
// 无效凭证,请重新登录
|
|
148
167
|
case '100109':
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
this.storeHandle.dispatch('storeUser/ssLogout', false);
|
|
153
|
-
this.jumpHandle.jumpsLogin();
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
154
171
|
break;
|
|
155
172
|
case '8002':
|
|
156
173
|
case 8002: // uni.login 微信注册
|
|
157
|
-
|
|
158
|
-
uni.stopPullDownRefresh();
|
|
174
|
+
_hideUniapp();
|
|
159
175
|
this.jumpHandle.jumpsLogin();
|
|
160
176
|
break;
|
|
161
177
|
case '13001':
|
|
@@ -177,18 +193,14 @@ class RequestClass {
|
|
|
177
193
|
case '200':
|
|
178
194
|
case 200:
|
|
179
195
|
// if (apiResData.length == 0) {
|
|
180
|
-
//
|
|
181
|
-
// title: "已经是全部数据了~",
|
|
182
|
-
// icon: "none"
|
|
183
|
-
// })
|
|
196
|
+
//
|
|
184
197
|
// }
|
|
185
198
|
return apiResData;
|
|
186
199
|
break;
|
|
187
200
|
// 默认错误
|
|
188
201
|
default:
|
|
189
202
|
// clearTimeout(time);
|
|
190
|
-
|
|
191
|
-
uni.hideLoading();
|
|
203
|
+
_hideUniapp();
|
|
192
204
|
var apiResMsg = apiResData.msg || '';
|
|
193
205
|
if (apiResMsg == 'Unknown') {
|
|
194
206
|
apiResMsg = '';
|
|
@@ -301,14 +313,8 @@ class RequestClass {
|
|
|
301
313
|
}
|
|
302
314
|
return _this.setResponse(apiResData);
|
|
303
315
|
} else if (uniRes[1].statusCode == 502) {
|
|
304
|
-
uni.hideNavigationBarLoading();
|
|
305
|
-
uni.hideToast();
|
|
306
|
-
uni.hideLoading();
|
|
307
316
|
} else {
|
|
308
|
-
|
|
309
|
-
uni.hideToast();
|
|
310
|
-
uni.hideLoading();
|
|
311
|
-
|
|
317
|
+
_hideUniapp();
|
|
312
318
|
if (type == 'POST') {
|
|
313
319
|
uni.showModal({
|
|
314
320
|
content: '加载错误!请稍后重试',
|
|
@@ -325,17 +331,17 @@ class RequestClass {
|
|
|
325
331
|
}
|
|
326
332
|
})
|
|
327
333
|
.catch(function (uniRes) {
|
|
334
|
+
_hideUniapp();
|
|
328
335
|
console.log('--catch--', uniRes);
|
|
329
|
-
|
|
330
|
-
uni.hideLoading();
|
|
336
|
+
// MessageTip.info('网络繁忙,请稍后再试');
|
|
331
337
|
// uni.showModal({
|
|
332
|
-
//
|
|
333
|
-
//
|
|
334
|
-
//
|
|
335
|
-
//
|
|
336
|
-
//
|
|
337
|
-
//
|
|
338
|
-
//
|
|
338
|
+
// content: '请求超时!请检查网络',
|
|
339
|
+
// showCancel: false,
|
|
340
|
+
// success: function (res) {
|
|
341
|
+
// if (res.confirm) {
|
|
342
|
+
// console.log('用户点击确定');
|
|
343
|
+
// }
|
|
344
|
+
// }
|
|
339
345
|
// });
|
|
340
346
|
});
|
|
341
347
|
}
|
|
@@ -394,6 +400,15 @@ class RequestClass {
|
|
|
394
400
|
let argumentsArr = arguments;
|
|
395
401
|
return this.unifyApi('url', 'DELETE', argumentsArr);
|
|
396
402
|
}
|
|
403
|
+
/* 文件上传通用 */
|
|
404
|
+
flagUpload() {
|
|
405
|
+
let argumentsArr = arguments;
|
|
406
|
+
return this.unifyApi('flag', 'UPLOAD', argumentsArr);
|
|
407
|
+
}
|
|
408
|
+
urlUpload() {
|
|
409
|
+
let argumentsArr = arguments;
|
|
410
|
+
return this.unifyApi('url', 'UPLOAD', argumentsArr);
|
|
411
|
+
}
|
|
397
412
|
/* 图片上传通用 */
|
|
398
413
|
flagUpImg() {
|
|
399
414
|
let argumentsArr = arguments;
|
package/plugins/storage.js
CHANGED
package/plugins/utils.js
ADDED