Fix(AI):[#3702]历史对话下方缺少“开启新对话”按钮,增加一个开启新对话按钮

This commit is contained in:
lifizer
2025-04-24 15:59:17 +08:00
parent 74b02ed292
commit 1636c77cfd
2 changed files with 26 additions and 0 deletions
+16
View File
@@ -136,6 +136,17 @@
}"
class="page-to-bottom"
>
<view
class="new-chat"
@click="createNewHandle"
>
<image
:src="webUrl + '/aiChat/icon-05.png'"
class="btn-icon"
mode="widthFix"
/>
开启新对话
</view>
<image
v-if="chatMessageListLength > 0 && !isScrollToBottom && !loading"
:src="webUrl + '/aiChat/down.png'"
@@ -236,6 +247,11 @@ export default {
}
})
return prompt
},
// 创建新会话
createNewHandle() {
uni.setStorageSync('addNewChat', '1')
uni.navigateBack()
}
}
}
+10
View File
@@ -21,6 +21,7 @@
:z-index="1"
@beforeleave="pageContainerBeforeleave"
>
<view style="opacity: 0;"></view>
遮罩层用于监听实体键返回
</page-container>
<view
@@ -262,6 +263,15 @@ export default {
topicList: []
}
},
onShow() {
const addNewChat = uni.getStorageSync('addNewChat') === '1'
// 从历史界面点击新增对话
if (addNewChat && this.chatNumber) {
console.log(addNewChat)
uni.removeStorageSync('addNewChat')
this.createNewHandle()
}
},
onUnload() {
this.closeWsFn()
},