From f52c21331fa71bd3ae6be41117f35cb54b076119 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期三, 03 四月 2024 19:34:01 +0800 Subject: [PATCH] 添加复制功能 --- packageBookService/pages/bookServices/detail/components/teachResource/index.js | 43 ++++++++++++++++++++++++++++--------------- 1 files changed, 28 insertions(+), 15 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/components/teachResource/index.js b/packageBookService/pages/bookServices/detail/components/teachResource/index.js index 2d69877..379bab2 100644 --- a/packageBookService/pages/bookServices/detail/components/teachResource/index.js +++ b/packageBookService/pages/bookServices/detail/components/teachResource/index.js @@ -2,11 +2,11 @@ properties: { applyState: { type: String, - value: 'none' + value: "none", }, rejectCause: { type: String, - value: '' + value: "", }, applyResourceLoading: { type: Boolean, @@ -14,31 +14,44 @@ }, deadline: { type: String, - value: '' - } + value: "", + }, }, data: { showRejectDialog: false, - confirmBtn: { content: '鐭ラ亾浜�', variant: 'base' }, + confirmBtn: { content: "鐭ラ亾浜�", variant: "base" }, }, methods: { + copy() { + wx.setClipboardData({ + data: "11", + success: function (res) { + wx.showToast({ title: "澶嶅埗鎴愬姛" }); + }, + fail: function (res) { + wx.showToast({ + title: "澶辫触", + }); + }, + }); + }, applyResource() { - var myEventDetail = {} + var myEventDetail = {}; var myEventOption = { bubbles: true, composed: true, - } // 瑙﹀彂浜嬩欢鐨勯�夐」 - this.triggerEvent('applyResource', myEventDetail, myEventOption) + }; // 瑙﹀彂浜嬩欢鐨勯�夐」 + this.triggerEvent("applyResource", myEventDetail, myEventOption); }, showDialog() { this.setData({ - showRejectDialog: true - }) + showRejectDialog: true, + }); }, closeDialog() { this.setData({ - showRejectDialog: false - }) - } - } -}) \ No newline at end of file + showRejectDialog: false, + }); + }, + }, +}); -- Gitblit v1.9.1