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