|
@@ -81,15 +81,18 @@
|
|
|
})
|
|
|
},
|
|
|
copy(){
|
|
|
- uni.setClipboardData({
|
|
|
- data:this.shareRemark,
|
|
|
- success() {
|
|
|
- uni.showToast({
|
|
|
- icon:"none",
|
|
|
- title:"复制成功"
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ let textarea = document.createElement("textarea")
|
|
|
+ textarea.value = this.shareRemark
|
|
|
+ textarea.readOnly = "readOnly"
|
|
|
+ document.body.appendChild(textarea)
|
|
|
+ textarea.select() // 选中文本内容
|
|
|
+ textarea.setSelectionRange(0, this.shareRemark.length)
|
|
|
+ let result = document.execCommand("copy")
|
|
|
+ textarea.remove()
|
|
|
+ uni.showToast({
|
|
|
+ icon:"none",
|
|
|
+ title:"复制成功"
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|