@10yun/cv-mobile-ui 0.5.34 → 0.5.36
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/js-sdk/QuShe-SharerPoster_3.1.8/QS-SharePoster/QRCodeAlg.js +1046 -0
- package/js-sdk/QuShe-SharerPoster_3.1.8/QS-SharePoster/QS-SharePoster.js +1309 -0
- package/js-sdk/QuShe-SharerPoster_3.1.8/QS-SharePoster/QS-SharePoster2.js +1575 -0
- package/js-sdk/QuShe-SharerPoster_3.1.8/QS-SharePoster/app.js +572 -0
- package/js-sdk/QuShe-SharerPoster_3.1.8/QS-SharePoster/app2.js +570 -0
- package/js-sdk/QuShe-SharerPoster_3.1.8/QS-SharePoster/image-tools.js +168 -0
- package/js-sdk/QuShe-SharerPoster_3.1.8/package.json +12 -0
- package/js-sdk/Sansnn-uQRCode/uqrcode.js +1295 -0
- package/js-sdk/ican-H5Api/ican-H5Api.js +669 -0
- package/package.json +1 -1
- package/ui-cv/components/cv-editor-quill/index.js +154 -133
- package/uni-ui/lib/uni-badge/uni-badge.vue +3 -1
- package/uni-ui/lib/uni-list/uni-refresh.wxs +1 -1
- package/uni-ui/lib/uni-load-more/uni-load-more.vue +3 -0
- package/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +355 -213
- package/uview-plus/components/u-button-wu/u-button-wu.vue +4 -4
- package/uview-plus/components/u-icon/u-icon2.vue +1 -1
- package/uview-plus/components/u-qrcode/qrcode.js +4 -0
- package/uview-plus/libs/ctocode/date.js +17 -0
- package/uview-plus/libs/ctocode/index.js +19 -0
|
@@ -1,147 +1,168 @@
|
|
|
1
1
|
function getLocalFilePath(path) {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
if (
|
|
3
|
+
path.indexOf('_www') === 0 ||
|
|
4
|
+
path.indexOf('_doc') === 0 ||
|
|
5
|
+
path.indexOf('_documents') === 0 ||
|
|
6
|
+
path.indexOf('_downloads') === 0
|
|
7
|
+
) {
|
|
8
|
+
return path;
|
|
9
|
+
}
|
|
10
|
+
if (path.indexOf('file://') === 0) {
|
|
11
|
+
return path;
|
|
12
|
+
}
|
|
13
|
+
if (path.indexOf('/storage/emulated/0/') === 0) {
|
|
14
|
+
return path;
|
|
15
|
+
}
|
|
16
|
+
if (path.indexOf('/') === 0) {
|
|
17
|
+
var localFilePath = plus.io.convertAbsoluteFileSystem(path);
|
|
18
|
+
if (localFilePath !== path) {
|
|
19
|
+
return localFilePath;
|
|
20
|
+
} else {
|
|
21
|
+
path = path.substr(1);
|
|
4
22
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
if (path.indexOf('/storage/emulated/0/') === 0) {
|
|
9
|
-
return path
|
|
10
|
-
}
|
|
11
|
-
if (path.indexOf('/') === 0) {
|
|
12
|
-
var localFilePath = plus.io.convertAbsoluteFileSystem(path)
|
|
13
|
-
if (localFilePath !== path) {
|
|
14
|
-
return localFilePath
|
|
15
|
-
} else {
|
|
16
|
-
path = path.substr(1)
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return '_www/' + path
|
|
23
|
+
}
|
|
24
|
+
return '_www/' + path;
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
export function pathToBase64(path) {
|
|
23
|
-
|
|
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
|
-
|
|
28
|
+
return new Promise(function (resolve, reject) {
|
|
29
|
+
if (typeof window === 'object' && 'document' in window) {
|
|
30
|
+
if (typeof FileReader === 'function') {
|
|
31
|
+
var xhr = new XMLHttpRequest();
|
|
32
|
+
xhr.open('GET', path, true);
|
|
33
|
+
xhr.responseType = 'blob';
|
|
34
|
+
xhr.onload = function () {
|
|
35
|
+
if (this.status === 200) {
|
|
36
|
+
let fileReader = new FileReader();
|
|
37
|
+
fileReader.onload = function (e) {
|
|
38
|
+
resolve(e.target.result);
|
|
39
|
+
};
|
|
40
|
+
fileReader.onerror = reject;
|
|
41
|
+
fileReader.readAsDataURL(this.response);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
xhr.onerror = reject;
|
|
45
|
+
xhr.send();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
var canvas = document.createElement('canvas');
|
|
49
|
+
var c2x = canvas.getContext('2d');
|
|
50
|
+
var img = new Image();
|
|
51
|
+
img.onload = function () {
|
|
52
|
+
canvas.width = img.width;
|
|
53
|
+
canvas.height = img.height;
|
|
54
|
+
c2x.drawImage(img, 0, 0);
|
|
55
|
+
resolve(canvas.toDataURL());
|
|
56
|
+
canvas.height = canvas.width = 0;
|
|
57
|
+
};
|
|
58
|
+
img.onerror = reject;
|
|
59
|
+
img.src = path;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (typeof plus === 'object') {
|
|
63
|
+
plus.io.resolveLocalFileSystemURL(
|
|
64
|
+
getLocalFilePath(path),
|
|
65
|
+
function (entry) {
|
|
66
|
+
entry.file(
|
|
67
|
+
function (file) {
|
|
68
|
+
var fileReader = new plus.io.FileReader();
|
|
69
|
+
fileReader.onload = function (data) {
|
|
70
|
+
resolve(data.target.result);
|
|
71
|
+
};
|
|
72
|
+
fileReader.onerror = function (error) {
|
|
73
|
+
reject(error);
|
|
74
|
+
};
|
|
75
|
+
fileReader.readAsDataURL(file);
|
|
76
|
+
},
|
|
77
|
+
function (error) {
|
|
78
|
+
reject(error);
|
|
52
79
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
80
|
+
);
|
|
81
|
+
},
|
|
82
|
+
function (error) {
|
|
83
|
+
reject(error);
|
|
56
84
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
reject(error)
|
|
70
|
-
})
|
|
71
|
-
}, function (error) {
|
|
72
|
-
reject(error)
|
|
73
|
-
})
|
|
74
|
-
return
|
|
75
|
-
}
|
|
76
|
-
if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
|
|
77
|
-
wx.getFileSystemManager().readFile({
|
|
78
|
-
filePath: path,
|
|
79
|
-
encoding: 'base64',
|
|
80
|
-
success: function (res) {
|
|
81
|
-
resolve('data:image/png;base64,' + res.data)
|
|
82
|
-
},
|
|
83
|
-
fail: function (error) {
|
|
84
|
-
reject(error)
|
|
85
|
-
}
|
|
86
|
-
})
|
|
87
|
-
return
|
|
85
|
+
);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
|
|
89
|
+
wx.getFileSystemManager().readFile({
|
|
90
|
+
filePath: path,
|
|
91
|
+
encoding: 'base64',
|
|
92
|
+
success: function (res) {
|
|
93
|
+
resolve('data:image/png;base64,' + res.data);
|
|
94
|
+
},
|
|
95
|
+
fail: function (error) {
|
|
96
|
+
reject(error);
|
|
88
97
|
}
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
});
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
reject(new Error('not support'));
|
|
102
|
+
});
|
|
91
103
|
}
|
|
92
104
|
|
|
93
105
|
export function base64ToPath(base64) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
106
|
+
return new Promise(function (resolve, reject) {
|
|
107
|
+
if (typeof window === 'object' && 'document' in window) {
|
|
108
|
+
base64 = base64.split(',');
|
|
109
|
+
var type = base64[0].match(/:(.*?);/)[1];
|
|
110
|
+
var str = atob(base64[1]);
|
|
111
|
+
var n = str.length;
|
|
112
|
+
var array = new Uint8Array(n);
|
|
113
|
+
while (n--) {
|
|
114
|
+
array[n] = str.charCodeAt(n);
|
|
115
|
+
}
|
|
116
|
+
return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], { type: type })));
|
|
117
|
+
}
|
|
118
|
+
var extName = base64.match(/data\:\S+\/(\S+);/);
|
|
119
|
+
if (extName) {
|
|
120
|
+
extName = extName[1];
|
|
121
|
+
} else {
|
|
122
|
+
reject(new Error('base64 error'));
|
|
123
|
+
}
|
|
124
|
+
var fileName = Date.now() + '.' + extName;
|
|
125
|
+
if (typeof plus === 'object') {
|
|
126
|
+
var bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now());
|
|
127
|
+
bitmap.loadBase64Data(
|
|
128
|
+
base64,
|
|
129
|
+
function () {
|
|
130
|
+
var filePath = '_doc/uniapp_temp/' + fileName;
|
|
131
|
+
bitmap.save(
|
|
132
|
+
filePath,
|
|
133
|
+
{},
|
|
134
|
+
function () {
|
|
135
|
+
bitmap.clear();
|
|
136
|
+
resolve(filePath);
|
|
137
|
+
},
|
|
138
|
+
function (error) {
|
|
139
|
+
bitmap.clear();
|
|
140
|
+
reject(error);
|
|
103
141
|
}
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
} else {
|
|
110
|
-
reject(new Error('base64 error'))
|
|
142
|
+
);
|
|
143
|
+
},
|
|
144
|
+
function (error) {
|
|
145
|
+
bitmap.clear();
|
|
146
|
+
reject(error);
|
|
111
147
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
reject(error)
|
|
127
|
-
})
|
|
128
|
-
return
|
|
129
|
-
}
|
|
130
|
-
if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
|
|
131
|
-
var filePath = wx.env.USER_DATA_PATH + '/' + fileName
|
|
132
|
-
wx.getFileSystemManager().writeFile({
|
|
133
|
-
filePath: filePath,
|
|
134
|
-
data: base64.replace(/^data:\S+\/\S+;base64,/, ''),
|
|
135
|
-
encoding: 'base64',
|
|
136
|
-
success: function () {
|
|
137
|
-
resolve(filePath)
|
|
138
|
-
},
|
|
139
|
-
fail: function (error) {
|
|
140
|
-
reject(error)
|
|
141
|
-
}
|
|
142
|
-
})
|
|
143
|
-
return
|
|
148
|
+
);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
|
|
152
|
+
var filePath = wx.env.USER_DATA_PATH + '/' + fileName;
|
|
153
|
+
wx.getFileSystemManager().writeFile({
|
|
154
|
+
filePath: filePath,
|
|
155
|
+
data: base64.replace(/^data:\S+\/\S+;base64,/, ''),
|
|
156
|
+
encoding: 'base64',
|
|
157
|
+
success: function () {
|
|
158
|
+
resolve(filePath);
|
|
159
|
+
},
|
|
160
|
+
fail: function (error) {
|
|
161
|
+
reject(error);
|
|
144
162
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
163
|
+
});
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
reject(new Error('not support'));
|
|
167
|
+
});
|
|
168
|
+
}
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
* @description 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景
|
|
13
13
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=21
|
|
14
14
|
* @property {String} text 角标内容
|
|
15
|
-
* @property {String} size = [normal|small]
|
|
15
|
+
* @property {String} size = [normal|small] Badge 大小
|
|
16
|
+
* @value normal 一般尺寸
|
|
17
|
+
* @value small 小尺寸
|
|
16
18
|
* @property {String} type = [info|primary|success|warning|error] 颜色类型
|
|
17
19
|
* @value info 灰色
|
|
18
20
|
* @value primary 蓝色
|