fix: bug

This commit is contained in:
杨航
2025-09-10 09:20:23 +08:00
parent 80e24a436c
commit 94bcbfd264
2 changed files with 97 additions and 93 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ VITE_APP_BASE_H5_API_Url = 'http://25.18.122.65:7001'
# VITE_APP_BASE_H5_API_Url = 'http://25.18.122.78:9786'
# 任东
# VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.130:9601'
VITE_APP_BASE_H5_API_Url_TRAAPP = 'http://25.64.16.130:9601'
VITE_APP_BASE_H5_API_Url_TRASTUDY = 'http://25.64.16.130:9602'
# VITE_APP_BASE_H5_API_Url_TRAEXAM = 'http://25.64.16.140:9604'
+96 -92
View File
@@ -1,99 +1,103 @@
<template>
<uni-popup ref="historyPopupRef" class="popup">
<view class="history-popup-view">
<view class="history-title">
<image class="icon-image" src="@/static/images/dialog/history-icon.png" mode=""></image>
对话记录
</view>
<scroll-view class="history-list" :scroll-y="true">
<view class="history-item" v-for="item in historyList" :key="item.reqBatch" @click="chooseHistory(item)">
{{item.sseContent}}
</view>
</scroll-view>
</view>
</uni-popup>
<uni-popup ref="historyPopupRef" class="popup">
<view class="history-popup-view">
<view class="history-title">
<image class="icon-image" src="@/static/images/dialog/history-icon.png" mode=""></image>
对话记录
</view>
<scroll-view class="history-list" :scroll-y="true" @scrolltolower="scrolltolower">
<view class="history-item" v-for="item in historyList" :key="item.reqBatch" @click="chooseHistory(item)">
{{ item.sseContent }}
</view>
</scroll-view>
</view>
</uni-popup>
</template>
<script setup>
import {
ref,
reactive,
computed,
onMounted,
nextTick
} from 'vue';
import { queryAskBatchSessionPaging } from '@/api/dialog.js'
const emit = defineEmits(['showDetail'])
const historyPopupRef = ref()
const historyList = ref([])
const open = () => {
historyList.value = []
openFeedback(true)
}
const close = () => {
openFeedback()
}
const pageInfo = ref({
page: 1,
limit: 20
})
const getList = async () => {
try {
const res = await queryAskBatchSessionPaging(pageInfo.value)
historyList.value = historyList.value.concat(res.body|| [])
}catch{}finally{}
}
const openFeedback = async (status) => {
if (status) {
await getList()
historyPopupRef.value.open('left')
} else {
historyPopupRef.value.close()
}
}
const chooseHistory = (item) => {
console.log(item)
emit('showDetail',item)
}
defineExpose({
open,close
})
import { ref, reactive, computed, onMounted, nextTick } from 'vue'
import { queryAskBatchSessionPaging } from '@/api/dialog.js'
const emit = defineEmits(['showDetail'])
const historyPopupRef = ref()
const historyList = ref([])
const open = () => {
historyList.value = []
openFeedback(true)
}
const close = () => {
openFeedback()
}
const pageInfo = ref({
page: 1,
limit: 20,
total: 0
})
const getList = async () => {
try {
const res = await queryAskBatchSessionPaging(pageInfo.value)
historyList.value = historyList.value.concat(res.body || [])
pageInfo.value.total = res.total
} catch {
} finally {
}
}
const scrolltolower = () => {
// if(pageInfo.value.total <= (pageInfo.value.page * pageInfo.value.limit)) return
// pageInfo.value.page += 1
// getList()
}
const openFeedback = async status => {
if (status) {
await getList()
historyPopupRef.value.open('left')
} else {
historyPopupRef.value.close()
}
}
const chooseHistory = item => {
console.log(item)
emit('showDetail', item)
}
defineExpose({
open,
close
})
</script>
<style scoped lang="scss">
.history-popup-view{
width: 582rpx;
height: 100vh;
background-color: #fff;
padding: 40rpx;
padding-top: calc(20rpx + var(--status-bar-height));
.history-title{
height: 40rpx;
line-height: 40rpx;
padding-left: 40rpx;
position: relative;
font-size: 29rpx;
color: #000;
margin-bottom: 20rpx;
.icon-image{
position: absolute;
left:0;
height: 32rpx;
width: 32rpx;
top: 4rpx;
}
}
.history-list{
height: calc(100% - 60rpx);
.history-item{
height: 78rpx;
line-height: 78rpx;
font-size: 28rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
}
</style>
.history-popup-view {
width: 582rpx;
height: 100vh;
background-color: #fff;
padding: 40rpx;
padding-top: calc(20rpx + var(--status-bar-height));
.history-title {
height: 40rpx;
line-height: 40rpx;
padding-left: 40rpx;
position: relative;
font-size: 29rpx;
color: #000;
margin-bottom: 20rpx;
.icon-image {
position: absolute;
left: 0;
height: 32rpx;
width: 32rpx;
top: 4rpx;
}
}
.history-list {
height: calc(100% - 60rpx);
.history-item {
height: 78rpx;
line-height: 78rpx;
font-size: 28rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
}
</style>