diff --git a/pages/chat/index.vue b/pages/chat/index.vue index 7278db6..e1c078c 100644 --- a/pages/chat/index.vue +++ b/pages/chat/index.vue @@ -118,10 +118,18 @@ {{ formatShowTime(message.sendDate) }} + + + + {{ message.message }} + + @@ -137,7 +145,11 @@ { - console.log(res, "发送消息成功"); if (res.succeed) { // 添加到消息列表 const msgUserData = { @@ -331,6 +342,14 @@ export default { // this.$nextTick(() => { // this.scrollToBottom(); // }); + } else { + // 清空输入框 + this.messageValue = ""; + // 发送失败 + uni.showToast({ + title: res.error || "发送失败", + icon: "none", + }); } }) .catch((error) => { @@ -568,6 +587,12 @@ export default { color: #999999; padding: 20rpx; } + .message-tip { + text-align: center; + font-size: 24rpx; + color: #999999; + padding-bottom: 40rpx; + } .message-left, .message-right {