@10yun/cv-mobile-ui 0.5.61 → 0.5.62
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/uni-extend.js +109 -0
- package/ui-cv/components/cv-dialog-bottom/cv-dialog-bottom.vue +71 -47
- package/ui-cv/components/cv-dialog-full/cv-dialog-full.vue +20 -17
- package/ui-cv/components/cv-upload-avatar/cv-upload-avatar.vue +0 -1
- package/ui-cv/components/cv-upload-image/cv-upload-image.vue +0 -1
- package/uview-plus/changelog-v2.md +77 -6
- package/uview-plus/changelog-wu.md +41 -14
- package/uview-plus/changelog.md +375 -59
- package/{plugins/uni-richText.js → uview-plus/libs/ctocode/richText.js} +28 -31
- package/uview-plus/package-wu.json +5 -37
- package/uview-plus/package.json +13 -14
- package/plugins/tui-validation.js +0 -279
- package/plugins/uni-scanCode.js +0 -76
- package/plugins/uni-socket.js +0 -174
- package/plugins/uniMap.js +0 -48
- package/plugins/utils.js +0 -13
- package/uview-plus/changelog-wu-tool.md +0 -21
- package/uview-plus/package-wu-tool.json +0 -84
|
@@ -46,36 +46,33 @@ var GRT = [
|
|
|
46
46
|
['th', 'border-right:1px solid #F2F3F4; border-bottom:1px solid #F2F3F4;'],
|
|
47
47
|
['td', 'border-right:1px solid #F2F3F4; border-bottom:1px solid #F2F3F4; padding-left:5px;']
|
|
48
48
|
];
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
export function cc_richtext_format(html) {
|
|
50
|
+
html = html || '';
|
|
51
|
+
if (html == '') {
|
|
52
|
+
return '';
|
|
53
|
+
}
|
|
54
|
+
html = html.replace(/<pre.*pre>?/gis, function (word) {
|
|
55
|
+
word = word.replace(/[\n]/gi, '<br />');
|
|
56
|
+
word = word.replace(/ /gi, '<span style="padding-left:2em;"></span>');
|
|
57
|
+
return word.replace(/[\t]/gi, '<span style="padding-left:2em;"></span>');
|
|
58
|
+
});
|
|
59
|
+
html = html.replace(
|
|
60
|
+
/<pre/gi,
|
|
61
|
+
'<p style="font-size:1em; margin:12px 0; line-height:1.2em; background:#F6F7F8; border-radius:5px; padding:8px 4%; width:92%;"'
|
|
62
|
+
);
|
|
63
|
+
html = html.replace(/<\/pre/gi, '</p');
|
|
64
|
+
for (let i = 0; i < GRT.length; i++) {
|
|
65
|
+
graceRichTextReg = new RegExp('<' + GRT[i][0] + '>|<' + GRT[i][0] + ' (.*?)>', 'gi');
|
|
66
|
+
html = html.replace(graceRichTextReg, function (word) {
|
|
67
|
+
// 分析 dom 上是否带有 style=""
|
|
68
|
+
if (word.indexOf('style=') != -1) {
|
|
69
|
+
var regIn = new RegExp('<' + GRT[i][0] + '(.*?)style="(.*?)"(.*?)(/?)>', 'gi');
|
|
70
|
+
return word.replace(regIn, '<' + GRT[i][0] + '$1style="$2 ' + GRT[i][1] + '"$3$4>');
|
|
71
|
+
} else {
|
|
72
|
+
var regIn = new RegExp('<' + GRT[i][0] + '(.*?)(/?)>', 'gi');
|
|
73
|
+
return word.replace(regIn, '<' + GRT[i][0] + '$1 style="' + GRT[i][1] + '$2">');
|
|
74
|
+
}
|
|
60
75
|
});
|
|
61
|
-
html = html.replace(
|
|
62
|
-
/<pre/gi,
|
|
63
|
-
'<p style="font-size:1em; margin:12px 0; line-height:1.2em; background:#F6F7F8; border-radius:5px; padding:8px 4%; width:92%;"'
|
|
64
|
-
);
|
|
65
|
-
html = html.replace(/<\/pre/gi, '</p');
|
|
66
|
-
for (let i = 0; i < GRT.length; i++) {
|
|
67
|
-
graceRichTextReg = new RegExp('<' + GRT[i][0] + '>|<' + GRT[i][0] + ' (.*?)>', 'gi');
|
|
68
|
-
html = html.replace(graceRichTextReg, function (word) {
|
|
69
|
-
// 分析 dom 上是否带有 style=""
|
|
70
|
-
if (word.indexOf('style=') != -1) {
|
|
71
|
-
var regIn = new RegExp('<' + GRT[i][0] + '(.*?)style="(.*?)"(.*?)(/?)>', 'gi');
|
|
72
|
-
return word.replace(regIn, '<' + GRT[i][0] + '$1style="$2 ' + GRT[i][1] + '"$3$4>');
|
|
73
|
-
} else {
|
|
74
|
-
var regIn = new RegExp('<' + GRT[i][0] + '(.*?)(/?)>', 'gi');
|
|
75
|
-
return word.replace(regIn, '<' + GRT[i][0] + '$1 style="' + GRT[i][1] + '$2">');
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
return html;
|
|
80
76
|
}
|
|
81
|
-
|
|
77
|
+
return html;
|
|
78
|
+
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "u--ui",
|
|
3
|
-
"displayName": "u-ui如虎添翼 之兼容vue3+2、app、h5
|
|
3
|
+
"displayName": "u-ui如虎添翼 之兼容vue3+2、app、h5、小程序等多端,无论平台,一致体验。工具库 全面兼容小程序、nvue、vue3",
|
|
4
4
|
"version": "1.1.5",
|
|
5
|
-
"description": "u-ui 是 全面兼容多端的uni-app生态框架,基于
|
|
6
|
-
"keywords": [
|
|
7
|
-
"u-ui,",
|
|
8
|
-
"wuui,",
|
|
9
|
-
"ui框架,",
|
|
10
|
-
"uni-app,",
|
|
11
|
-
"nvue"
|
|
12
|
-
],
|
|
5
|
+
"description": "u-ui 是 全面兼容多端的uni-app生态框架,基于vue3和nvue开发。丰富UI组件库,集成工具库,简单高效。无论平台,一致体验。选择我们,开发更轻松!",
|
|
6
|
+
"keywords": ["u-ui,", "wuui,", "ui框架,", "uni-app,", "nvue", "工具库", "多端全兼容"],
|
|
13
7
|
"repository": "",
|
|
14
8
|
"engines": {
|
|
15
9
|
"HBuilderX": "^3.5.4"
|
|
@@ -35,33 +29,7 @@
|
|
|
35
29
|
"npmurl": ""
|
|
36
30
|
},
|
|
37
31
|
"uni_modules": {
|
|
38
|
-
"dependencies": [
|
|
39
|
-
"u-calendar",
|
|
40
|
-
"u-sku",
|
|
41
|
-
"u-image",
|
|
42
|
-
"u-button",
|
|
43
|
-
"u-icon",
|
|
44
|
-
"u-loading-icon",
|
|
45
|
-
"u-row",
|
|
46
|
-
"u-link",
|
|
47
|
-
"u-text",
|
|
48
|
-
"u-number-box",
|
|
49
|
-
"u-transition",
|
|
50
|
-
"u-input",
|
|
51
|
-
"u-code",
|
|
52
|
-
"u-navbar",
|
|
53
|
-
"u-status-bar",
|
|
54
|
-
"u-safe-bottom",
|
|
55
|
-
"u-radio",
|
|
56
|
-
"u-checkbox",
|
|
57
|
-
"u-textarea",
|
|
58
|
-
"u-gap",
|
|
59
|
-
"u-cell",
|
|
60
|
-
"u-app-update",
|
|
61
|
-
"u-popup",
|
|
62
|
-
"u-overlay",
|
|
63
|
-
"u-action-sheet"
|
|
64
|
-
],
|
|
32
|
+
"dependencies": [],
|
|
65
33
|
"encrypt": [],
|
|
66
34
|
"platforms": {
|
|
67
35
|
"cloud": {
|
|
@@ -109,4 +77,4 @@
|
|
|
109
77
|
}
|
|
110
78
|
}
|
|
111
79
|
}
|
|
112
|
-
}
|
|
80
|
+
}
|
package/uview-plus/package.json
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "uview-plus",
|
|
3
2
|
"name": "uview-plus",
|
|
4
3
|
"displayName": "零云®uview-plus3.0重磅发布,全面的Vue3鸿蒙跨端移动组件库,组件丰富维护更新稳定。",
|
|
5
4
|
"version": "3.6.17",
|
|
6
5
|
"description": "零云®uview-plus已兼容vue3支持多语言,120+全面的组件和便捷的工具会让您信手拈来。近期新增拖动排序、条码、图片裁剪、下拉刷新、虚拟列表、签名、Markdown等。",
|
|
7
6
|
"keywords": [
|
|
8
|
-
"uview",
|
|
9
|
-
"uview-plus",
|
|
10
|
-
"ui",
|
|
11
7
|
"echarts",
|
|
12
8
|
"ui",
|
|
9
|
+
"uview",
|
|
10
|
+
"uview-plus",
|
|
13
11
|
"可视化设计"
|
|
14
|
-
],
|
|
15
|
-
"main": "index.js",
|
|
12
|
+
],
|
|
16
13
|
"repository": "https://github.com/ijry/uview-plus",
|
|
14
|
+
"main": "index.js",
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"registry": "https://registry.npmjs.org/"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"clipboard": "^2.0.11",
|
|
20
|
+
"dayjs": "^1.11.3"
|
|
21
|
+
},
|
|
17
22
|
"engines": {
|
|
18
23
|
"HBuilderX": "^3.1.0",
|
|
19
24
|
"uni-app": "^4.66",
|
|
@@ -42,6 +47,7 @@
|
|
|
42
47
|
"i18n": "√",
|
|
43
48
|
"widescreen": "x"
|
|
44
49
|
},
|
|
50
|
+
"id": "uview-plus",
|
|
45
51
|
"uni_modules": {
|
|
46
52
|
"dependencies": [],
|
|
47
53
|
"encrypt": [],
|
|
@@ -100,12 +106,5 @@
|
|
|
100
106
|
}
|
|
101
107
|
}
|
|
102
108
|
}
|
|
103
|
-
},
|
|
104
|
-
"dependencies": {
|
|
105
|
-
"clipboard": "^2.0.11",
|
|
106
|
-
"dayjs": "^1.11.3"
|
|
107
|
-
},
|
|
108
|
-
"publishConfig": {
|
|
109
|
-
"registry": "https://registry.npmjs.org/"
|
|
110
109
|
}
|
|
111
|
-
}
|
|
110
|
+
}
|
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 表单验证
|
|
3
|
-
* @author echo.
|
|
4
|
-
* @version 1.5.0
|
|
5
|
-
**/
|
|
6
|
-
|
|
7
|
-
function _isNullOrEmpty(value) {
|
|
8
|
-
return value === null || value === '' || value === undefined ? true : false;
|
|
9
|
-
}
|
|
10
|
-
function _isMobile(value) {
|
|
11
|
-
return /^(?:13\d|14\d|15\d|16\d|17\d|18\d|19\d)\d{5}(\d{3}|\*{3})$/.test(value);
|
|
12
|
-
}
|
|
13
|
-
function _isEmail(value) {
|
|
14
|
-
return /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(value);
|
|
15
|
-
}
|
|
16
|
-
function _isCarNo(value) {
|
|
17
|
-
// 新能源车牌
|
|
18
|
-
const xreg =
|
|
19
|
-
/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
|
|
20
|
-
// 旧车牌
|
|
21
|
-
const creg =
|
|
22
|
-
/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
|
|
23
|
-
if (value.length === 7) {
|
|
24
|
-
return creg.test(value);
|
|
25
|
-
} else if (value.length === 8) {
|
|
26
|
-
return xreg.test(value);
|
|
27
|
-
} else {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function _isIdCard(value) {
|
|
32
|
-
let idCard = value;
|
|
33
|
-
if (idCard.length == 15) {
|
|
34
|
-
return __isValidityBrithBy15IdCard;
|
|
35
|
-
} else if (idCard.length == 18) {
|
|
36
|
-
let arrIdCard = idCard.split('');
|
|
37
|
-
if (__isValidityBrithBy18IdCard(idCard) && __isTrueValidateCodeBy18IdCard(arrIdCard)) {
|
|
38
|
-
return true;
|
|
39
|
-
} else {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function __isTrueValidateCodeBy18IdCard(arrIdCard) {
|
|
47
|
-
let sum = 0;
|
|
48
|
-
let Wi = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1];
|
|
49
|
-
let ValideCode = [1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2];
|
|
50
|
-
if (arrIdCard[17].toLowerCase() == 'x') {
|
|
51
|
-
arrIdCard[17] = 10;
|
|
52
|
-
}
|
|
53
|
-
for (let i = 0; i < 17; i++) {
|
|
54
|
-
sum += Wi[i] * arrIdCard[i];
|
|
55
|
-
}
|
|
56
|
-
let valCodePosition = sum % 11;
|
|
57
|
-
if (arrIdCard[17] == ValideCode[valCodePosition]) {
|
|
58
|
-
return true;
|
|
59
|
-
} else {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
function __isValidityBrithBy18IdCard(idCard18) {
|
|
64
|
-
let year = idCard18.substring(6, 10);
|
|
65
|
-
let month = idCard18.substring(10, 12);
|
|
66
|
-
let day = idCard18.substring(12, 14);
|
|
67
|
-
let temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day));
|
|
68
|
-
if (
|
|
69
|
-
temp_date.getFullYear() != parseFloat(year) ||
|
|
70
|
-
temp_date.getMonth() != parseFloat(month) - 1 ||
|
|
71
|
-
temp_date.getDate() != parseFloat(day)
|
|
72
|
-
) {
|
|
73
|
-
return false;
|
|
74
|
-
} else {
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function __isValidityBrithBy15IdCard(idCard15) {
|
|
79
|
-
let year = idCard15.substring(6, 8);
|
|
80
|
-
let month = idCard15.substring(8, 10);
|
|
81
|
-
let day = idCard15.substring(10, 12);
|
|
82
|
-
let temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day));
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
temp_date.getYear() != parseFloat(year) ||
|
|
86
|
-
temp_date.getMonth() != parseFloat(month) - 1 ||
|
|
87
|
-
temp_date.getDate() != parseFloat(day)
|
|
88
|
-
) {
|
|
89
|
-
return false;
|
|
90
|
-
} else {
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function _isAmount(value) {
|
|
95
|
-
//金额,只允许保留两位小数
|
|
96
|
-
return /^([0-9]*[.]?[0-9])[0-9]{0,1}$/.test(value);
|
|
97
|
-
}
|
|
98
|
-
function _isNum(value) {
|
|
99
|
-
//只能为数字
|
|
100
|
-
return /^[0-9]+$/.test(value);
|
|
101
|
-
}
|
|
102
|
-
function _isChinese(value) {
|
|
103
|
-
let reg = /.*[\u4e00-\u9fa5]+.*$/;
|
|
104
|
-
return value !== '' && reg.test(value) && !form._isSpecial(value) && !form._isEmoji(value);
|
|
105
|
-
}
|
|
106
|
-
function _isEnglish(value) {
|
|
107
|
-
return /^[a-zA-Z]*$/.test(value);
|
|
108
|
-
}
|
|
109
|
-
function _isEnAndNo(value) {
|
|
110
|
-
//8~20位数字和字母组合
|
|
111
|
-
return /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$/.test(value);
|
|
112
|
-
}
|
|
113
|
-
function _isEnOrNo(value) {
|
|
114
|
-
//英文或者数字
|
|
115
|
-
let reg = /.*[\u4e00-\u9fa5]+.*$/;
|
|
116
|
-
let result = true;
|
|
117
|
-
if (reg.test(value) || form._isSpecial(value) || form._isEmoji(value)) {
|
|
118
|
-
result = false;
|
|
119
|
-
}
|
|
120
|
-
return result;
|
|
121
|
-
}
|
|
122
|
-
function _isSpecial(value) {
|
|
123
|
-
//是否包含特殊字符
|
|
124
|
-
let regEn = /[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im,
|
|
125
|
-
regCn = /[·!#¥(——):;“”‘、,|《。》?、【】[\]]/im;
|
|
126
|
-
if (regEn.test(value) || regCn.test(value)) {
|
|
127
|
-
return true;
|
|
128
|
-
}
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
function _isEmoji(value) {
|
|
132
|
-
//是否包含表情
|
|
133
|
-
return /\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F]/g.test(value);
|
|
134
|
-
}
|
|
135
|
-
function _isDate(value) {
|
|
136
|
-
//2019-10-12
|
|
137
|
-
const reg =
|
|
138
|
-
/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/;
|
|
139
|
-
return reg.test(value);
|
|
140
|
-
}
|
|
141
|
-
function _isUrl(value) {
|
|
142
|
-
return /^((https?|ftp|file):\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/.test(value);
|
|
143
|
-
}
|
|
144
|
-
function _isSame(value1, value2) {
|
|
145
|
-
return value1 === value2;
|
|
146
|
-
}
|
|
147
|
-
function _isRange(value, range1, range2) {
|
|
148
|
-
if (!range1 && range1 != 0 && !range2 && range2 != 0) {
|
|
149
|
-
return true;
|
|
150
|
-
} else if (!range1 && range1 != 0) {
|
|
151
|
-
return value <= range2;
|
|
152
|
-
} else if (!range2 && range2 != 0) {
|
|
153
|
-
return value >= range1;
|
|
154
|
-
} else {
|
|
155
|
-
return value >= range1 && value <= range2;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
function _minLength(value, min) {
|
|
159
|
-
return value.length >= Number(min);
|
|
160
|
-
}
|
|
161
|
-
function _maxLength(value, max) {
|
|
162
|
-
return value.length <= Number(max);
|
|
163
|
-
}
|
|
164
|
-
const form = {
|
|
165
|
-
//非必填情况下,如果值为空,则不进行校验
|
|
166
|
-
//当出现错误时返回错误消息,否则返回空即为验证通过
|
|
167
|
-
/*
|
|
168
|
-
formData:Object 表单对象。{key:value,key:value},key==rules.name
|
|
169
|
-
rules: Array [{name:name,rule:[],msg:[]},{name:name,rule:[],msg:[]}]
|
|
170
|
-
name:name 属性=> 元素的名称
|
|
171
|
-
rule:字符串数组 ["required","isMobile","isEmail","isCarNo","isIdCard","isAmount","isNum","isChinese","isEnglish",isEnAndNo","isSpecial","isEmoji",""isDate","isUrl","isSame:key","range:[1,9]","minLength:9","maxLength:Number"]
|
|
172
|
-
msg:数组 []。 与数组 rule 长度相同,对应的错误提示信息
|
|
173
|
-
*/
|
|
174
|
-
validation: function (formData, rules) {
|
|
175
|
-
for (let item of rules) {
|
|
176
|
-
let key = item.name;
|
|
177
|
-
let rule = item.rule;
|
|
178
|
-
let msgArr = item.msg;
|
|
179
|
-
if (!key || !rule || rule.length === 0 || !msgArr || msgArr.length === 0) {
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
for (let i = 0, length = rule.length; i < length; i++) {
|
|
183
|
-
let ruleItem = rule[i];
|
|
184
|
-
let msg = msgArr[i];
|
|
185
|
-
if (!ruleItem) {
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
if (!ruleItem || !msg || (!~rule.indexOf('required') && formData[key].toString().length === 0)) {
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
//数据处理
|
|
192
|
-
let value = null;
|
|
193
|
-
if (~ruleItem.indexOf(':')) {
|
|
194
|
-
let temp = ruleItem.split(':');
|
|
195
|
-
ruleItem = temp[0];
|
|
196
|
-
value = temp[1];
|
|
197
|
-
}
|
|
198
|
-
let isError = false;
|
|
199
|
-
switch (ruleItem) {
|
|
200
|
-
case 'required':
|
|
201
|
-
isError = _isNullOrEmpty(formData[key]);
|
|
202
|
-
break;
|
|
203
|
-
case 'isMobile':
|
|
204
|
-
isError = !_isMobile(formData[key]);
|
|
205
|
-
break;
|
|
206
|
-
case 'isEmail':
|
|
207
|
-
isError = !_isEmail(formData[key]);
|
|
208
|
-
break;
|
|
209
|
-
case 'isCarNo':
|
|
210
|
-
isError = !_isCarNo(formData[key]);
|
|
211
|
-
break;
|
|
212
|
-
case 'isIdCard':
|
|
213
|
-
isError = !_isIdCard(formData[key]);
|
|
214
|
-
break;
|
|
215
|
-
case 'isAmount':
|
|
216
|
-
isError = !_isAmount(formData[key]);
|
|
217
|
-
break;
|
|
218
|
-
case 'isNum':
|
|
219
|
-
isError = !_isNum(formData[key]);
|
|
220
|
-
break;
|
|
221
|
-
case 'isChinese':
|
|
222
|
-
isError = !_isChinese(formData[key]);
|
|
223
|
-
break;
|
|
224
|
-
case 'isEnglish':
|
|
225
|
-
isError = !_isEnglish(formData[key]);
|
|
226
|
-
break;
|
|
227
|
-
case 'isEnAndNo':
|
|
228
|
-
isError = !_isEnAndNo(formData[key]);
|
|
229
|
-
break;
|
|
230
|
-
case 'isEnOrNo':
|
|
231
|
-
isError = !_isEnOrNo(formData[key]);
|
|
232
|
-
break;
|
|
233
|
-
case 'isSpecial':
|
|
234
|
-
isError = _isSpecial(formData[key]);
|
|
235
|
-
break;
|
|
236
|
-
case 'isEmoji':
|
|
237
|
-
isError = _isEmoji(formData[key]);
|
|
238
|
-
break;
|
|
239
|
-
case 'isDate':
|
|
240
|
-
isError = !_isDate(formData[key]);
|
|
241
|
-
break;
|
|
242
|
-
case 'isUrl':
|
|
243
|
-
isError = !_isUrl(formData[key]);
|
|
244
|
-
break;
|
|
245
|
-
case 'isSame':
|
|
246
|
-
isError = !_isSame(formData[key], formData[value]);
|
|
247
|
-
break;
|
|
248
|
-
case 'range':
|
|
249
|
-
let range = null;
|
|
250
|
-
try {
|
|
251
|
-
range = JSON.parse(value);
|
|
252
|
-
if (range.length <= 1) {
|
|
253
|
-
throw new Error('range值传入有误!');
|
|
254
|
-
}
|
|
255
|
-
} catch (e) {
|
|
256
|
-
return 'range值传入有误!';
|
|
257
|
-
}
|
|
258
|
-
isError = !_isRange(formData[key], range[0], range[1]);
|
|
259
|
-
break;
|
|
260
|
-
case 'minLength':
|
|
261
|
-
isError = !_minLength(formData[key], value);
|
|
262
|
-
break;
|
|
263
|
-
case 'maxLength':
|
|
264
|
-
isError = !_maxLength(formData[key], value);
|
|
265
|
-
break;
|
|
266
|
-
default:
|
|
267
|
-
break;
|
|
268
|
-
}
|
|
269
|
-
if (isError) {
|
|
270
|
-
return msg;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
return '';
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
export default {
|
|
278
|
-
validation: form.validation
|
|
279
|
-
};
|
package/plugins/uni-scanCode.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
function scanCodeFunc() {
|
|
2
|
-
// #ifdef H5
|
|
3
|
-
uni.showToast({
|
|
4
|
-
title: 'h5不支持扫码'
|
|
5
|
-
});
|
|
6
|
-
// #endif
|
|
7
|
-
// #ifndef H5
|
|
8
|
-
|
|
9
|
-
// #ifdef APP-PLUS
|
|
10
|
-
var icon = plus.nativeObj.View.getViewById('icon0');
|
|
11
|
-
if (icon) {
|
|
12
|
-
setTimeout(function () {
|
|
13
|
-
icon.hide();
|
|
14
|
-
}, 5);
|
|
15
|
-
uni.setTabBarItem({
|
|
16
|
-
index: 0,
|
|
17
|
-
selectedIconPath: '/static/a2.png'
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
// #endif
|
|
21
|
-
|
|
22
|
-
return new Promise((resolve, reject) => {
|
|
23
|
-
uni.scanCode({
|
|
24
|
-
scanType: ['qrCode'],
|
|
25
|
-
success: function (res) {
|
|
26
|
-
// uni.showModal({
|
|
27
|
-
// title: '提示',
|
|
28
|
-
// showCancel: false,
|
|
29
|
-
// content:'条码内容:' + res.result
|
|
30
|
-
// });
|
|
31
|
-
console.log('条码类型:' + res.scanType);
|
|
32
|
-
console.log('条码内容:' + res.result);
|
|
33
|
-
|
|
34
|
-
let codeRes = res.result;
|
|
35
|
-
|
|
36
|
-
// 模拟扫码成功
|
|
37
|
-
// let codeRes="type=1&&qr_code=b9ed77aa9b17df6cc0683ea4088970ec&&time=1556091878";
|
|
38
|
-
|
|
39
|
-
codeRes = codeRes.toString();
|
|
40
|
-
let jianche = codeRes.slice(0, 5);
|
|
41
|
-
|
|
42
|
-
if (jianche == 'type=') {
|
|
43
|
-
let resArr = codeRes.split('&&');
|
|
44
|
-
|
|
45
|
-
let ustypeArr = resArr[0].split('=');
|
|
46
|
-
let ustype = ustypeArr[1]; //用户类型
|
|
47
|
-
let usQrArr = resArr[1].split('=');
|
|
48
|
-
let usQr = usQrArr[1]; //扫码结果
|
|
49
|
-
return resolve({
|
|
50
|
-
resArr: resArr,
|
|
51
|
-
ustype: ustype,
|
|
52
|
-
usQrArr: usQrArr,
|
|
53
|
-
usQr: usQr
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
uni.showToast({
|
|
57
|
-
title: '不是该应用的二维码',
|
|
58
|
-
icon: 'none'
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
complete: function (res) {
|
|
63
|
-
console.log('scancomplete');
|
|
64
|
-
},
|
|
65
|
-
fail: (res) => {
|
|
66
|
-
reject(res.result);
|
|
67
|
-
console.log('failfailfailfailfailfailfailfailfailfailfail');
|
|
68
|
-
uni.showToast({
|
|
69
|
-
title: res.result
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
// #endif
|
|
76
|
-
}
|