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] =?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