copy_orderId(orderId) {
let text = orderId
let textarea = document.createElement("textarea")
textarea.value = text
textarea.readOnly = "readOnly"
document.body.appendChild(textarea)
textarea.select()
textarea.setSelectionRange(0, text.length)
uni.showToast({
title: '复制成功',
icon: 'success'
})
document.execCommand("copy")
textarea.remove()
uni.setClipboardData({
data: text,
success: () => {
uni.showToast({
title: `复制成功`,
icon: 'success'
})
}
}, true);
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28