@10yun/cv-mobile-ui 0.5.35 → 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-qrcode/qrcode.js +4 -0
- package/uview-plus/libs/ctocode/date.js +17 -0
- package/uview-plus/libs/ctocode/index.js +19 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
function getLocalFilePath(path) {
|
|
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);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return '_www/' + path;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function pathToBase64(path) {
|
|
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);
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
},
|
|
82
|
+
function (error) {
|
|
83
|
+
reject(error);
|
|
84
|
+
}
|
|
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);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
reject(new Error('not support'));
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function base64ToPath(base64) {
|
|
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);
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
},
|
|
144
|
+
function (error) {
|
|
145
|
+
bitmap.clear();
|
|
146
|
+
reject(error);
|
|
147
|
+
}
|
|
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);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
reject(new Error('not support'));
|
|
167
|
+
});
|
|
168
|
+
}
|