fix:更新ai页面

This commit is contained in:
Your Name 2026-04-10 16:10:01 +08:00
parent 88ad0d2a2b
commit aef8c8b909
3 changed files with 26 additions and 13 deletions

View File

@ -154,7 +154,7 @@
</view>
</view>
</view>
<hs-empty v-if="!messages?.length" height="20vh" />
<view v-if="loading" class="message-item ai-message">
<view class="message-avatar">
<image
@ -344,12 +344,18 @@ const scrollToBottom = () => {
//
const getHistoryMessages = async (page: number = 1) => {
const userPhone = auth.data?.user?.phone
const projectId = auth.data?.selected_house?.asset_projects_id
if (!userPhone) {
console.log('用户未登录,无法获取历史记录')
return
}
if (!projectId) {
console.log('请绑定房屋')
return
}
if (isLoadingHistory.value) {
return
}
@ -365,7 +371,8 @@ const getHistoryMessages = async (page: number = 1) => {
platform: 'property',
platform_user_id: userPhone, //userPhone
limit: pageSize.value,
offset: offset
offset: offset,
tenant_project_id: projectId
})
if (response.statusCode === 200) {

View File

@ -152,7 +152,7 @@
</view>
</view>
</view>
<hs-empty v-if="!messages?.length" height="20vh" />
<view v-if="loading" class="message-item ai-message">
<view class="message-avatar">
<image
@ -353,11 +353,16 @@ const scrollToBottom = () => {
//
const getHistoryMessages = async (page: number = 1) => {
const userPhone = auth.data?.user?.phone
const projectId = auth.data?.selected_house?.asset_projects_id
if (!userPhone) {
console.log('用户未登录,无法获取历史记录')
return
}
if (!projectId) {
console.log('请绑定房屋')
return
}
if (isLoadingHistory.value) {
return
@ -374,7 +379,8 @@ const getHistoryMessages = async (page: number = 1) => {
platform: 'property',
platform_user_id: userPhone, //userPhone
limit: pageSize.value,
offset: offset
offset: offset,
tenant_project_id: projectId
})
if (response.statusCode === 200) {

View File

@ -18,7 +18,7 @@
v-for="(i, index) in quickActions"
:key="`item_${index}`"
class="items"
@click="handleAiPage(i)"
@click="handleInputChange(i)"
>
<view class="items_center">
<image :src="`/static/svg/${i.icon}`" mode="heightFix" />
@ -54,20 +54,20 @@ import { showToast } from '@/common/libraries/naviHelper'
import { getStyleColorInfo, getStyleColorValueInfo } from '@/common/libraries/getPageConfig'
import { quickActions, QuickAction } from '@/common/libraries/public'
import userLoginStatus from '@/common/libraries/userUserLogin'
import { useWeAppAuthStore } from '@/common'
const auth = useWeAppAuthStore()
const handleAiPage = (i: QuickAction) => {
uni.navigateTo({
url: `/pages/ai/chat?message=${i?.message}`
})
}
const handleInputChange = () => {
const handleInputChange = (i?: QuickAction) => {
if (!userLoginStatus?.onBindPhone()) {
return false
}
if (!auth.data?.selected_house?.asset_projects_id) {
showToast('请绑定房屋')
return false
}
uni.navigateTo({
url: '/pages/ai/chat'
url: `/pages/ai/chat?message=${i?.message || ""}`
})
// showToast('')
}
</script>