diff --git a/pages.json b/pages.json index 1d433ed6..65f68b4c 100644 --- a/pages.json +++ b/pages.json @@ -549,7 +549,10 @@ "pages": [{ "path": "index", "style": { - "navigationBarTitleText": "客服" + "navigationBarTitleText": "客服", + "app-plus": { + "softinputMode": "adjustResize" + } }, "meta": { "auth": true, diff --git a/pages/chat/components/messageList.vue b/pages/chat/components/messageList.vue index 5efccaa3..843c816e 100644 --- a/pages/chat/components/messageList.vue +++ b/pages/chat/components/messageList.vue @@ -57,7 +57,7 @@ // 计算聊天窗口高度 const chatScrollHeight = computed(() => { - const baseHeight = 'calc(100vh - 100px - ' + safeAreaInsetsBottom + ')'; + const baseHeight = 'calc(100vh - 150px - ' + safeAreaInsetsBottom + ')'; if (keyboardHeight.value > 0) { // 键盘弹起状态,减去键盘高度 return `calc(${baseHeight} - ${keyboardHeight.value}px)`; @@ -200,6 +200,7 @@ // #endif // #ifdef MP-WEIXIN + // TODO puhui999: 小程序键盘弹起还有点问题,看看怎么适配 // 微信小程序环境 uni.onKeyboardHeightChange((res) => { setKeyboardHeight(res.height); @@ -209,6 +210,10 @@ onMounted(() => { queryParams.no = 1; // 确保首次加载是第一页 + scroll.value = { + top: 0, + oldTop: 0, + } getMessageList(); setupKeyboardListeners(); }); diff --git a/pages/chat/components/messageListItem.vue b/pages/chat/components/messageListItem.vue index f0210cea..e959109a 100644 --- a/pages/chat/components/messageListItem.vue +++ b/pages/chat/components/messageListItem.vue @@ -2,6 +2,26 @@ + + + + {{ message.content }} + + + + {{ formatDate(message.createTime) }} + + + - - - - {{ formatDate(message.createTime) }} - - - - {{ message.content }} - -