新增扫描二维码功能以及h5复制链接app中打开连接功能删除无用的node包

This commit is contained in:
lemon橪
2021-05-18 16:29:34 +08:00
parent 49eb30f265
commit 8fe64bd3c6
1615 changed files with 226 additions and 58539 deletions

View File

@@ -1,4 +1,4 @@
export default function h5Copy(content) {
export function h5Copy(content) {
if (!document.queryCommandSupported('copy')) {
// 不支持
@@ -15,4 +15,28 @@ export default function h5Copy(content) {
textarea.remove()
return result
}
/**
* 获取系统剪贴板内容
*/
export function getClipboardData() {
return new Promise((success, fail) => {
// #ifndef H5
uni.getClipboardData({
success: ({ data }) => success(data),
fail
})
// #endif
// #ifdef H5
try {
navigator.clipboard.readText().then(success).catch(fail)
} catch (error) {
fail(error)
}
// #endif
})
}