From 0a6104c483c8a1dad8518a3c0e581be7ec1c28f3 Mon Sep 17 00:00:00 2001 From: jscyl13849007907 <13849007907@163.com> Date: Tue, 11 Mar 2025 14:19:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subPage/chat/index.js | 61 +++++++++++++++++++++++++++++++++++++++++++++---- subPage/chat/index.wxml | 22 ++++++++++++++---- subPage/chat/index.wxss | 3 +++ 3 files changed, 78 insertions(+), 8 deletions(-) diff --git a/subPage/chat/index.js b/subPage/chat/index.js index 447f6ea..e36d460 100644 --- a/subPage/chat/index.js +++ b/subPage/chat/index.js @@ -9,8 +9,10 @@ Page({ list:[ { id:-1, - type:'text' - } + type:'text', + isUp:false, + isDown:false, + }, ] }, @@ -73,16 +75,67 @@ Page({ }, handleEvent(e){ - console.log('handleEvent',e); let that = this; that.animate(); that.setData({ eventType:e.currentTarget.dataset.type == 'input' ? 'voice':'input' }) }, + handleUp(e){ + let that = this; + that.animate(); + const list = [...that.data.list]; + const index = e.currentTarget.dataset.index; + list[index].isUp = !list[index].isUp; + that.setData({ + list: list + }); + }, + handleDown(e){ + let that = this; + that.animate(); + const list = [...that.data.list]; + const index = e.currentTarget.dataset.index; + list[index].isDown = !list[index].isDown; + that.setData({ + list: list + }); + }, + handleCopy(e){ + let that = this; + that.animate(); + const index = e.currentTarget.dataset.index; + let content = that.data.list[index].content; // 获取要复制的内容 + if(index == 0){ + content = "Hi,我是大鹏,你的智能工作助理。以后找工作不用跟老板谈了,直接来跟大鹏谈。来说说你的要求,我们开始吧…" + } + wx.setClipboardData({ + data: content, + success: function (res) { + wx.showToast({ + title: '复制成功', + icon: 'success', + duration: 2000 + }); + }, + fail: function (res) { + wx.showToast({ + title: '复制失败', + icon: 'none', + duration: 2000 + }); + } + }); + }, + handleShare(){ + let that = this; + that.animate(); + }, + + animate($type='light') { wx.vibrateShort({ type:$type }); - } + }, }) \ No newline at end of file diff --git a/subPage/chat/index.wxml b/subPage/chat/index.wxml index 48430c9..3195585 100644 --- a/subPage/chat/index.wxml +++ b/subPage/chat/index.wxml @@ -27,12 +27,26 @@ - - + + - - + + diff --git a/subPage/chat/index.wxss b/subPage/chat/index.wxss index f1910e1..2da9d94 100644 --- a/subPage/chat/index.wxss +++ b/subPage/chat/index.wxss @@ -220,4 +220,7 @@ textarea { } .g_mr_12{ margin-right: 12px; +} +.icon-active{ + color: #3578f6; } \ No newline at end of file