diff --git a/src/components/user/statistics.vue b/src/components/user/statistics.vue index 311ae18..35de00f 100644 --- a/src/components/user/statistics.vue +++ b/src/components/user/statistics.vue @@ -180,7 +180,7 @@ :visible.sync="userinfo_fall" width="30%"> -

电话:{{user_info.UserName}}

+

电话:{{user_info.UserName}}    复制

微信:{{user_info.Wx}}

QQ:{{user_info.QQ}}

@@ -424,6 +424,31 @@ export default { }, dataExport () { this.$api.getDownloadFile('/course/v1/order/ExportUserConsumeStatistics', this.searchModel) + }, + copy_op(str) { + let copy = localStorage.getItem('copy'); + let now = parseInt(new Date().getTime()/1000); + let time = (now - copy); + if (time<60) { + this.$message({ + message: time+'秒后再复制', + type: 'warning' + }) + return false + } else { + const save = (e) => { + e.clipboardData.setData('text/plain', str) + e.preventDefault() + } + document.addEventListener('copy', save) + document.execCommand('copy') + document.removeEventListener('copy', save) + localStorage.setItem('copy', now); + this.$message({ + message: '复制成功', + type: 'success' + }) + } } } }