From a90841d9b9b7f7ad1cb7dbcb879efa6fa4dcf270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Mon, 24 Jan 2022 18:02:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E5=88=86=E9=92=9F=E5=90=8E=E5=A4=8D?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/user/statistics.vue | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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' + }) + } } } }