Commit 8b30d380 by liwk

commit

1 parent 156c6726
......@@ -12,7 +12,7 @@ export default {
methods: {
wxInit() {
window.$wx = wxConfig
window.$wx.init(['shareAppMessage', 'sendChatMessage', 'getCurExternalContact'])
window.$wx.init(['shareAppMessage', 'sendChatMessage', 'getCurExternalContact', 'setClipboardData'])
},
showShareModel(i) {
let { tabIndex } = this
......
......@@ -121,16 +121,12 @@ const jumpChildrenPage = (to, params) => {
}
/**拷贝 */
const setClipboardData = data => {
let transfer = document.createElement('input')
document.body.appendChild(transfer)
transfer.value = data
transfer.focus()
transfer.select()
if (document.execCommand('copy')) document.execCommand('copy')
hideLoading()
transfer.blur()
Toast('复制成功')
document.body.removeChild(transfer)
wx.setClipboardData({
data,
success(res) {
Toast('复制成功')
}
})
}
/**接口请求时失败让用户刷新 */
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!