Commit 8b30d380 by liwk

commit

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