@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.
Files changed (61) hide show
  1. package/package.json +1 -1
  2. package/plugins/MessageBox.js +2 -2
  3. package/plugins/MessageTip.js +4 -4
  4. package/plugins/request.js +54 -39
  5. package/plugins/storage.js +1 -4
  6. package/plugins/utils.js +13 -0
  7. package/ui-cv/cv-draw-barcode/barcode.js +225 -202
  8. package/ui-cv/cv-draw-barcode/barcodes/Barcode.js +14 -17
  9. package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128.js +202 -164
  10. package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128A.js +58 -35
  11. package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128B.js +58 -36
  12. package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128C.js +58 -34
  13. package/ui-cv/cv-draw-barcode/barcodes/CODE128/CODE128_AUTO.js +50 -41
  14. package/ui-cv/cv-draw-barcode/barcodes/CODE128/auto.js +43 -57
  15. package/ui-cv/cv-draw-barcode/barcodes/CODE128/constants.js +71 -30
  16. package/ui-cv/cv-draw-barcode/barcodes/CODE128/index.js +11 -29
  17. package/ui-cv/cv-draw-barcode/barcodes/CODE39/index.js +150 -77
  18. package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN.js +122 -90
  19. package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN13.js +169 -111
  20. package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN2.js +77 -56
  21. package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN5.js +84 -60
  22. package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/EAN8.js +133 -74
  23. package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/UPC.js +174 -156
  24. package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/UPCE.js +220 -174
  25. package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/constants.js +80 -21
  26. package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/encoder.js +18 -24
  27. package/ui-cv/cv-draw-barcode/barcodes/EAN_UPC/index.js +15 -39
  28. package/ui-cv/cv-draw-barcode/barcodes/GenericBarcode/index.js +80 -55
  29. package/ui-cv/cv-draw-barcode/barcodes/ITF/ITF.js +99 -69
  30. package/ui-cv/cv-draw-barcode/barcodes/ITF/ITF14.js +73 -45
  31. package/ui-cv/cv-draw-barcode/barcodes/ITF/constants.js +8 -8
  32. package/ui-cv/cv-draw-barcode/barcodes/ITF/index.js +6 -18
  33. package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI.js +86 -66
  34. package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI10.js +40 -33
  35. package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI1010.js +41 -35
  36. package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI11.js +42 -33
  37. package/ui-cv/cv-draw-barcode/barcodes/MSI/MSI1110.js +37 -35
  38. package/ui-cv/cv-draw-barcode/barcodes/MSI/checksums.js +22 -25
  39. package/ui-cv/cv-draw-barcode/barcodes/MSI/index.js +13 -34
  40. package/ui-cv/cv-draw-barcode/barcodes/codabar/index.js +120 -90
  41. package/ui-cv/cv-draw-barcode/barcodes/common.js +0 -0
  42. package/ui-cv/cv-draw-barcode/barcodes/index.js +32 -33
  43. package/ui-cv/cv-draw-barcode/barcodes/index.tmp.js +32 -33
  44. package/ui-cv/cv-draw-barcode/barcodes/pharmacode/index.js +93 -71
  45. package/ui-cv/cv-draw-barcode/cv-draw-barcode.vue +4 -4
  46. package/ui-cv/cv-icons/icons/default-icons.js +132 -0
  47. package/ui-cv/cv-icons/icons/icons-action.js +72 -0
  48. package/ui-cv/cv-icons/icons/icons-arrow.js +46 -0
  49. package/ui-cv/cv-icons/icons/icons-base.js +89 -0
  50. package/ui-cv/cv-icons/icons/icons-mall.js +34 -0
  51. package/ui-cv/cv-icons/icons/icons-media.js +44 -0
  52. package/ui-cv/cv-icons/icons/icons-order.js +33 -0
  53. package/ui-cv/cv-icons/icons/icons-people.js +46 -0
  54. package/ui-cv/cv-icons/icons/icons-status.js +32 -0
  55. package/ui-cv/cv-icons/icons/icons-wallet.js +15 -0
  56. package/ui-cv/cv-icons/icons.js +14 -13
  57. package/ui-cv/cv-lists-base/cv-lists-base.vue +0 -2
  58. package/ui-cv/cv-tab-lists/cv-tab-lists.vue +0 -2
  59. package/ui-uni/u-charts/u-charts.js +1093 -744
  60. package/ui-uni/uni-list/uni-refresh.wxs +1 -1
  61. package/ui-uni/uni-swipe-action-item/index.wxs +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@10yun/cv-mobile-ui",
3
- "version": "0.4.11",
3
+ "version": "0.5.1",
4
4
  "description": "十云cvjs移动端ui,适用uniapp",
5
5
  "author": "",
6
6
  "license": "Apache-2.0",
@@ -39,8 +39,8 @@ MessageBox['confirm'] = (content, title) => {
39
39
  title: title || '提示',
40
40
  content: String(content || '') || '??',
41
41
  confirmText: '确定',
42
- showCancel: showCancel || true,
43
- cancelText: cancelText || '取消',
42
+ showCancel: true,
43
+ cancelText: '取消',
44
44
  success: function (modalRes) {
45
45
  if (modalRes.confirm) {
46
46
  res(modalRes);
@@ -13,7 +13,7 @@ const MessageTip = function (options) {
13
13
 
14
14
  let setting = {
15
15
  title: options.message || '提示',
16
- duration: options.duration || 1500,
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 || 3500,
37
- icon: icon || 'none',
38
- mask: true
36
+ duration: duration || 1200,
37
+ icon: icon || 'none'
38
+ // mask: true
39
39
  });
40
40
  };
41
41
  // 成功提示
@@ -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
- * 设置header参数
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 || 0;
141
+ var apiResStatus = apiResData.status || -1;
120
142
  // 这里根据后端提供的数据进行对应的处理
121
143
  switch (apiResStatus) {
122
144
  // 没有凭证,请登录
123
145
  case '100101':
124
146
  case 100101:
125
- uni.hideToast();
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
- uni.hideToast();
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
- uni.hideToast();
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
- case 100102:
150
- uni.hideToast();
151
- uni.stopPullDownRefresh();
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
- uni.hideToast();
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
- // uni.showToast({
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
- uni.hideToast();
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
- uni.hideNavigationBarLoading();
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
- uni.hideToast();
330
- uni.hideLoading();
336
+ // MessageTip.info('网络繁忙,请稍后再试');
331
337
  // uni.showModal({
332
- // content: '请求超时!请检查网络',
333
- // showCancel: false,
334
- // success: function(res) {
335
- // if (res.confirm) {
336
- // console.log('用户点击确定')
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;
@@ -1,9 +1,6 @@
1
1
  /**
2
2
  * 缓存数据优化
3
- * var cache = require('utils/cache.js');
4
- * import cache from '../cache'
5
- * 使用方法 【
6
- *
3
+ * 使用方法
7
4
  */
8
5
 
9
6
  function get_data1(key, def) {
@@ -0,0 +1,13 @@
1
+ function uniEleOffset(selector) {
2
+ // 获取高度
3
+ return new Promise((resolve) =>
4
+ uni
5
+ .createSelectorQuery()
6
+ .in(this)
7
+ .select(selector)
8
+ .boundingClientRect((data) => resolve(data))
9
+ .exec()
10
+ );
11
+ }
12
+
13
+ export { uniEleOffset };