From 3543dc1726ad39c26d973da6881e007da0407f3d Mon Sep 17 00:00:00 2001 From: jscyl13849007907 <13849007907@163.com> Date: Tue, 11 Mar 2025 09:49:44 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B6=88=E6=81=AF-chat?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 7 +++--- assets/images/chat.svg | 1 + pages/message/index.js | 10 +++++++- subPage/chat/index.js | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ subPage/chat/index.json | 3 +++ subPage/chat/index.wxml | 2 ++ subPage/chat/index.wxss | 1 + 7 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 assets/images/chat.svg create mode 100644 subPage/chat/index.js create mode 100644 subPage/chat/index.json create mode 100644 subPage/chat/index.wxml create mode 100644 subPage/chat/index.wxss diff --git a/app.json b/app.json index 3d4e2b9..0e98aaa 100644 --- a/app.json +++ b/app.json @@ -102,7 +102,8 @@ "billShowInfo/index", "systemMessage/index", "todayBill/index", - "addAddress/index" + "addAddress/index", + "chat/index" ] } ], @@ -116,8 +117,7 @@ "navigationBarTitleText": "Weixin", "navigationBarTextStyle": "black" }, - "plugins": { - }, + "plugins": {}, "tabBar": { "custom": true, "color": "#444", @@ -148,7 +148,6 @@ "pagePath": "pages/myBill/index", "text": "工单" }, - { "iconPath": "./assets/images/tabbar/user.png", "selectedIconPath": "./assets/images/tabbar/user_active.png", diff --git a/assets/images/chat.svg b/assets/images/chat.svg new file mode 100644 index 0000000..57bcfe5 --- /dev/null +++ b/assets/images/chat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pages/message/index.js b/pages/message/index.js index fb883c0..2d6dd5b 100644 --- a/pages/message/index.js +++ b/pages/message/index.js @@ -20,13 +20,21 @@ Page({ img: '../../assets/images/ptxx.svg', content: '新春祝福与品牌升级...', time: '下午 2:30', - }, { + }, + { title: '每日发单', url: '/subPage/todayBill/index', img: '../../assets/images/mrfd.svg', content: '按偏好订阅每日接收推送', time: '下午 1:30', }, + { + title: '智能匹配', + url: '/subPage/chat/index', + img: '../../assets/images/chat.svg', + content: 'AI大模型智能匹配', + time: '下午 1:30', + }, ] }, diff --git a/subPage/chat/index.js b/subPage/chat/index.js new file mode 100644 index 0000000..713565c --- /dev/null +++ b/subPage/chat/index.js @@ -0,0 +1,66 @@ +// subPage/chat/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/subPage/chat/index.json b/subPage/chat/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/subPage/chat/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/subPage/chat/index.wxml b/subPage/chat/index.wxml new file mode 100644 index 0000000..a96c7a8 --- /dev/null +++ b/subPage/chat/index.wxml @@ -0,0 +1,2 @@ + +subPage/chat/index.wxml \ No newline at end of file diff --git a/subPage/chat/index.wxss b/subPage/chat/index.wxss new file mode 100644 index 0000000..c3077a3 --- /dev/null +++ b/subPage/chat/index.wxss @@ -0,0 +1 @@ +/* subPage/chat/index.wxss */ \ No newline at end of file From 3d402393b0ecc527c83b5ff009b2c7b80e8dfef7 Mon Sep 17 00:00:00 2001 From: jscyl13849007907 <13849007907@163.com> Date: Tue, 11 Mar 2025 11:06:52 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=A7=E8=87=B4?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/iconfont/iconfont.wxss | 37 +++++++- pages/message/index.js | 4 +- subPage/chat/index.js | 20 ++++- subPage/chat/index.wxml | 38 +++++++- subPage/chat/index.wxss | 203 +++++++++++++++++++++++++++++++++++++++++- 5 files changed, 291 insertions(+), 11 deletions(-) diff --git a/assets/iconfont/iconfont.wxss b/assets/iconfont/iconfont.wxss index 12a510a..cab1aed 100644 --- a/assets/iconfont/iconfont.wxss +++ b/assets/iconfont/iconfont.wxss @@ -1,8 +1,8 @@ @font-face { - font-family: "iconfont"; /* Project id 2708790 */ - src: url('//at.alicdn.com/t/c/font_2708790_0dvih56qdt3.woff2?t=1741316773850') format('woff2'), - url('//at.alicdn.com/t/c/font_2708790_0dvih56qdt3.woff?t=1741316773850') format('woff'), - url('//at.alicdn.com/t/c/font_2708790_0dvih56qdt3.ttf?t=1741316773850') format('truetype'); + font-family: 'iconfont'; /* Project id 2708790 */ + src: url('//at.alicdn.com/t/c/font_2708790_qvphqofg7ek.woff2?t=1741660802324') format('woff2'), + url('//at.alicdn.com/t/c/font_2708790_qvphqofg7ek.woff?t=1741660802324') format('woff'), + url('//at.alicdn.com/t/c/font_2708790_qvphqofg7ek.ttf?t=1741660802324') format('truetype'); } .iconfont { @@ -13,6 +13,34 @@ -moz-osx-font-smoothing: grayscale; } +.icon-fuzhi11:before { + content: "\e606"; +} + +.icon-fenxiangfenxiangshare:before { + content: "\e697"; +} + +.icon-huatongyuyin:before { + content: "\e64d"; +} + +.icon-fasong1:before { + content: "\100c0"; +} + +.icon-weixinjianpan2:before { + content: "\e67c"; +} + +.icon-useful:before { + content: "\100c4"; +} + +.icon-un_useful:before { + content: "\100c5"; +} + .icon-file-copy:before { content: "\e7f6"; } @@ -1492,3 +1520,4 @@ .icon-xiayiye1:before { content: "\e695"; } + diff --git a/pages/message/index.js b/pages/message/index.js index 2d6dd5b..cbe12b0 100644 --- a/pages/message/index.js +++ b/pages/message/index.js @@ -29,8 +29,8 @@ Page({ time: '下午 1:30', }, { - title: '智能匹配', - url: '/subPage/chat/index', + title: '智能匹配助手', + url: '/subPage/chat/index?title=智能匹配助手', img: '../../assets/images/chat.svg', content: 'AI大模型智能匹配', time: '下午 1:30', diff --git a/subPage/chat/index.js b/subPage/chat/index.js index 713565c..062f8fa 100644 --- a/subPage/chat/index.js +++ b/subPage/chat/index.js @@ -5,14 +5,16 @@ Page({ * 页面的初始数据 */ data: { - + eventType:'input',// 底部事件类型 input 键盘输入,voice 语音输入 }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - + wx.setNavigationBarTitle({ + title: options.title, + }) }, /** @@ -62,5 +64,19 @@ Page({ */ onShareAppMessage() { + }, + + handleEvent(e){ + console.log('handleEvent',e); + let that = this; + that.animate(); + that.setData({ + eventType:e.currentTarget.dataset.type == 'input' ? 'voice':'input' + }) + }, + 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 a96c7a8..82de06e 100644 --- a/subPage/chat/index.wxml +++ b/subPage/chat/index.wxml @@ -1,2 +1,36 @@ - -subPage/chat/index.wxml \ No newline at end of file + + + 具体内容 + + + + + + + + + + + + + + + + + + + 按住 说话 + + + + + + + + + \ No newline at end of file diff --git a/subPage/chat/index.wxss b/subPage/chat/index.wxss index c3077a3..e29bafd 100644 --- a/subPage/chat/index.wxss +++ b/subPage/chat/index.wxss @@ -1 +1,202 @@ -/* subPage/chat/index.wxss */ \ No newline at end of file +.p-home-chat { + background-color: #f5f5f5; + height: 100%; +} +.p-home-chat .g_bg_f0a { + background-color: #CC463A; +} +.p-home-chat .chat-content { + width: calc(100%); + margin: 0 auto; + min-height: calc(8vh); + padding-bottom: 92px; +} +.p-home-chat .chat-content .chat-left { + padding: 0 10px; +} +.p-home-chat .chat-content .chat-left .msg { + border-radius: 12px; + line-height: 1.5; + word-break: break-all; +} +.p-home-chat .chat-content .chat-right { + padding: 0 10px; +} +.p-home-chat .chat-content .chat-right .msg { + border-radius: 12px; + line-height: 1.5; + word-break: break-all; +} +.p-home-chat .chat-operate { + position: fixed; + width: 100%; + left: 0; + bottom: 0px; + z-index: 1; + padding-top: 12px; + background-color: #f5f5f5; + padding-bottom: 24px; +} +.p-home-chat .chat-operate .m-input { + width: calc(100% - 20px); + margin: 0 auto; + border-radius: 40px; + height: 56px; + font-size: 16px; + background-color: #fff; + position: relative; +} +.p-home-chat .chat-operate .m-input .i-box{ + width: 48px; +} +.p-home-chat .chat-operate .m-input .icon{ + font-size: 22px; +} +.p-home-chat .chat-operate .m-input .right-box{ + width: 48px; +} +.p-home-chat .chat-operate .m-input .right-box .icon{ + font-size: 32px; + color: #bbb; +} +.p-home-chat .chat-operate .m-input .input-box{ + padding: 0 12px; +} +.p-home-chat .chat-operate .m-input .voice-box{ + padding: 0 12px; + width: 100%; + text-align: center; + font-size: 17px; + font-weight: 700; +} +.p-home-chat .chat-operate input { + height: 56px; +} +.p-home-chat .btn-share { + position: absolute; + right: 0; + top: 0; + z-index: 1; + width: 100%; + height: 100%; + opacity: 0; +} +.p-home-chat .longpress-top-mask { + position: fixed; + left: 0; + width: 100vw; + z-index: 99; + background-color: rgba(245, 245, 245, 0.5); + box-shadow: 0 -5px 10px rgba(245, 245, 245, 0.5); +} +.p-home-chat .longpress-bottom-mask { + position: fixed; + left: 0; + bottom: 0; + width: 100vw; + z-index: 99; + background-color: rgba(245, 245, 245, 0.5); + box-shadow: 0 -5px 10px rgba(245, 245, 245, 0.5); +} +.p-home-chat .longpress-bottom-down { + position: fixed; + left: 0; + bottom: 0; + width: 100vw; + z-index: 99; + background-color: #3578f6; + box-shadow: 0 -5px 10px rgba(245, 245, 245, 0.5); +} +@keyframes voi_animate { + 0% { + height: 50%; + background-color: #1677ff; + } + 20% { + height: 50%; + background-color: #92F7FE; + } + 50% { + height: 100%; + background-color: #1989fa; + } + 80% { + height: 50%; + background-color: #92F7FE; + } + 100% { + height: 50%; + background-color: #1677ff; + } +} +.p-home-chat .column-voice { + width: 100%; + height: 22px; + overflow: hidden; + max-width: calc(-40%); + margin: 0 auto; +} +.p-home-chat .column-voice .column-item { + width: 3px; + height: 100%; + margin-left: 6px; + border-radius: 10px; + background-color: #1677ff; + vertical-align: middle; + display: inline-block; +} +/* 容器样式 */ +.loader { + display: flex; +} +/* 单个点的样式 */ +.dot { + width: 10px; + height: 10px; + margin: 0 2px; + border-radius: 50%; + background-color: #666; + animation: dotPulse 1s infinite ease-in-out; +} +/* 动画定义 */ +@keyframes dotPulse { + 0%, + 80%, + 100% { + transform: scale(0.9); + } + 40% { + transform: scale(1.1); + } +} +/* 第二个点的延时 */ +.dot:nth-child(2) { + animation-delay: -0.33s; +} +/* 第三个点的延时 */ +.dot:nth-child(3) { + animation-delay: -0.66s; +} +textarea { + resize: none; + /* 禁止手动调整大小 */ + overflow: hidden; + /* 隐藏超出部分 */ + width: 100%; + /* 设置宽度 */ +} +.hasTopPadding { + padding-top: 8px !important; + box-sizing: content-box !important; +} +.biggerSize::after { + content: ""; + /* display: inline-block; */ + width: 60px; + height: 60px; + position: absolute; + left: 50%; + top: 50%; + z-index: 99; + transform: translate(-50%, -50%); +} \ No newline at end of file From 155c89547b6caffa8a1157b21a16bcd48af77358 Mon Sep 17 00:00:00 2001 From: jscyl13849007907 <13849007907@163.com> Date: Tue, 11 Mar 2025 13:58:41 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 4 ++- components/chat/hello.js | 66 ++++++++++++++++++++++++++++++++++++++++++++++ components/chat/hello.json | 3 +++ components/chat/hello.wxml | 15 +++++++++++ components/chat/hello.wxss | 10 +++++++ components/chat/text.js | 66 ++++++++++++++++++++++++++++++++++++++++++++++ components/chat/text.json | 3 +++ components/chat/text.wxml | 3 +++ components/chat/text.wxss | 1 + subPage/chat/index.js | 6 +++++ subPage/chat/index.json | 5 +++- subPage/chat/index.wxml | 37 +++++++++++++++++++++++++- subPage/chat/index.wxss | 21 +++++++++++++++ 13 files changed, 237 insertions(+), 3 deletions(-) create mode 100644 components/chat/hello.js create mode 100644 components/chat/hello.json create mode 100644 components/chat/hello.wxml create mode 100644 components/chat/hello.wxss create mode 100644 components/chat/text.js create mode 100644 components/chat/text.json create mode 100644 components/chat/text.wxml create mode 100644 components/chat/text.wxss diff --git a/app.json b/app.json index 0e98aaa..126b57a 100644 --- a/app.json +++ b/app.json @@ -82,7 +82,9 @@ "pages/mineJob/index", "pages/memberGroupList/index", "pages/sendCreatorCode/index", - "pages/creatorSelectPage/index" + "pages/creatorSelectPage/index", + "components/chat/text", + "components/chat/hello" ], "permission": { "scope.userLocation": { diff --git a/components/chat/hello.js b/components/chat/hello.js new file mode 100644 index 0000000..c487b98 --- /dev/null +++ b/components/chat/hello.js @@ -0,0 +1,66 @@ +// components/chat/hello.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/components/chat/hello.json b/components/chat/hello.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/components/chat/hello.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/components/chat/hello.wxml b/components/chat/hello.wxml new file mode 100644 index 0000000..560319c --- /dev/null +++ b/components/chat/hello.wxml @@ -0,0 +1,15 @@ + + + Hi,我是 + 大鹏 + ,你的智能工作助理。 + + + 以后找工作不用跟老板谈了,直接来跟 + 大鹏 + 谈。 + + + 来说说你的要求,我们开始吧… + + \ No newline at end of file diff --git a/components/chat/hello.wxss b/components/chat/hello.wxss new file mode 100644 index 0000000..d4547e0 --- /dev/null +++ b/components/chat/hello.wxss @@ -0,0 +1,10 @@ +/* components/chat/hello.wxss */ +.g_fw_600{ + font-weight: 600; +} +.g_ml_4{ + margin-left: 4px; +} +.g_mr_4{ + margin-right: 4px; +} diff --git a/components/chat/text.js b/components/chat/text.js new file mode 100644 index 0000000..d0e9935 --- /dev/null +++ b/components/chat/text.js @@ -0,0 +1,66 @@ +// components/chat/text.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/components/chat/text.json b/components/chat/text.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/components/chat/text.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/components/chat/text.wxml b/components/chat/text.wxml new file mode 100644 index 0000000..75f7497 --- /dev/null +++ b/components/chat/text.wxml @@ -0,0 +1,3 @@ + + 模拟返回纯文本内容 + \ No newline at end of file diff --git a/components/chat/text.wxss b/components/chat/text.wxss new file mode 100644 index 0000000..cd51670 --- /dev/null +++ b/components/chat/text.wxss @@ -0,0 +1 @@ +/* components/chat/text.wxss */ \ No newline at end of file diff --git a/subPage/chat/index.js b/subPage/chat/index.js index 062f8fa..447f6ea 100644 --- a/subPage/chat/index.js +++ b/subPage/chat/index.js @@ -6,6 +6,12 @@ Page({ */ data: { eventType:'input',// 底部事件类型 input 键盘输入,voice 语音输入 + list:[ + { + id:-1, + type:'text' + } + ] }, /** diff --git a/subPage/chat/index.json b/subPage/chat/index.json index 8835af0..68d7397 100644 --- a/subPage/chat/index.json +++ b/subPage/chat/index.json @@ -1,3 +1,6 @@ { - "usingComponents": {} + "usingComponents": { + "hello-panel": "../../components/chat/hello", + "text-panel": "../../components/chat/text" + } } \ No newline at end of file diff --git a/subPage/chat/index.wxml b/subPage/chat/index.wxml index 82de06e..48430c9 100644 --- a/subPage/chat/index.wxml +++ b/subPage/chat/index.wxml @@ -1,6 +1,41 @@ - 具体内容 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/subPage/chat/index.wxss b/subPage/chat/index.wxss index e29bafd..f1910e1 100644 --- a/subPage/chat/index.wxss +++ b/subPage/chat/index.wxss @@ -199,4 +199,25 @@ textarea { top: 50%; z-index: 99; transform: translate(-50%, -50%); +} + +.chat-card{ + padding: 0 10px; +} +.item-obj{ + background-color: #fff; + border-radius: 12px; + line-height: 1.5; + word-break: break-all; + padding: 10px; +} +.item-opera{ + margin-top: 10px; +} +.era-icon{ + font-size: 20px; + color: #888888; +} +.g_mr_12{ + margin-right: 12px; } \ No newline at end of file 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 4/5] =?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 From 7fb43a843e162ccfa6af40f83b951436b1bc718c Mon Sep 17 00:00:00 2001 From: jscyl13849007907 <13849007907@163.com> Date: Tue, 11 Mar 2025 15:21:52 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/chat/hello.js | 2 +- components/chat/text.js | 12 ++++++- components/chat/text.wxml | 4 +-- components/chat/text.wxss | 8 ++++- subPage/chat/index.js | 21 ++++++++++++ subPage/chat/index.wxml | 84 +++++++++++++++++++++++++---------------------- subPage/chat/index.wxss | 24 ++++++++++++-- 7 files changed, 108 insertions(+), 47 deletions(-) diff --git a/components/chat/hello.js b/components/chat/hello.js index c487b98..f11bd15 100644 --- a/components/chat/hello.js +++ b/components/chat/hello.js @@ -62,5 +62,5 @@ Page({ */ onShareAppMessage() { - } + }, }) \ No newline at end of file diff --git a/components/chat/text.js b/components/chat/text.js index d0e9935..4fa6bdf 100644 --- a/components/chat/text.js +++ b/components/chat/text.js @@ -1,5 +1,15 @@ // components/chat/text.js -Page({ +Component({ + properties: { + message: { + type: String, + value: '' + }, + color: { + type: String, + value: '' + }, + }, /** * 页面的初始数据 diff --git a/components/chat/text.wxml b/components/chat/text.wxml index 75f7497..c1705ae 100644 --- a/components/chat/text.wxml +++ b/components/chat/text.wxml @@ -1,3 +1,3 @@ - - 模拟返回纯文本内容 + + {{message}} \ No newline at end of file diff --git a/components/chat/text.wxss b/components/chat/text.wxss index cd51670..ee8a91e 100644 --- a/components/chat/text.wxss +++ b/components/chat/text.wxss @@ -1 +1,7 @@ -/* components/chat/text.wxss */ \ No newline at end of file +/* components/chat/text.wxss */ +.cblack{ + color: #000; +} +.cwhite{ + color: #fff; +} \ No newline at end of file diff --git a/subPage/chat/index.js b/subPage/chat/index.js index e36d460..8bfb273 100644 --- a/subPage/chat/index.js +++ b/subPage/chat/index.js @@ -13,6 +13,27 @@ Page({ isUp:false, isDown:false, }, + { + id:-1, + type:'text', + isUp:false, + isDown:false, + content:'测试输入框发送测试输入框发送测试输入框发送测试输入框发送' + }, + { + id:0, + type:'text', + isUp:false, + isDown:false, + content:'我是AI回复,自定义回复' + }, + { + id:1, + type:'text', + isUp:false, + isDown:false, + content:'再次发送再次发送再次发送' + }, ] }, diff --git a/subPage/chat/index.wxml b/subPage/chat/index.wxml index 3195585..93b1efb 100644 --- a/subPage/chat/index.wxml +++ b/subPage/chat/index.wxml @@ -6,48 +6,52 @@ wx:for-index="index" wx:key="{{item.id}}" > - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - diff --git a/subPage/chat/index.wxss b/subPage/chat/index.wxss index 2da9d94..dcdcde1 100644 --- a/subPage/chat/index.wxss +++ b/subPage/chat/index.wxss @@ -203,13 +203,24 @@ textarea { .chat-card{ padding: 0 10px; + margin-bottom: 10px; } -.item-obj{ +.chat-card:last-child{ + margin-bottom: 24px; +} +.bg-obj{ background-color: #fff; border-radius: 12px; line-height: 1.5; word-break: break-all; - padding: 10px; + padding: 12px; +} +.main-obj{ + background-color: #3578f6; + border-radius: 12px; + line-height: 1.5; + word-break: break-all; + padding: 12px; } .item-opera{ margin-top: 10px; @@ -223,4 +234,13 @@ textarea { } .icon-active{ color: #3578f6; +} +.g_w_all{ + width: 100%; +} +.min80{ + min-width: 80vw; +} +.max80{ + max-width: 80vw; } \ No newline at end of file