mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-17 16:05:53 +08:00
新增扫描二维码功能以及h5复制链接app中打开连接功能删除无用的node包
This commit is contained in:
@@ -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
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user