|
|
|
@ -4,11 +4,10 @@
|
|
|
|
|
<img :src="aiIcon" class="user-icon" alt="" />
|
|
|
|
|
<!-- 内容 -->
|
|
|
|
|
<div class="message-content">
|
|
|
|
|
<div class="message-time">{{ moment().format('YYYY/MM/DD HH:mm:ss') }}</div>
|
|
|
|
|
<div class="message-time">{{ currentTime }}</div>
|
|
|
|
|
<div class="message-text">
|
|
|
|
|
<span>今天我能为您做些什么呢?</span>
|
|
|
|
|
<p>作为你的智慧伙伴,我不仅可以写文案、出点子,还可以和你聊天、回答问题。您也可以点击</p>
|
|
|
|
|
|
|
|
|
|
<div class="issue-list">
|
|
|
|
|
<div class="issue-top">
|
|
|
|
|
<div class="issue-title">下面的问题常用问题快速向我提问。</div>
|
|
|
|
@ -35,8 +34,15 @@
|
|
|
|
|
<span class="refresh">换一批</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="issue-list">
|
|
|
|
|
<div class="issue-item" @click="handlerQuerParmas(item.content)" v-for="(item, index) in list" :key="index">{{ item.content }}</div>
|
|
|
|
|
<div class="issue-list" v-if="list.length > 0">
|
|
|
|
|
<div class="issue-item" @click="handlerQuerParmas(item.content)" v-for="(item, index) in list" :key="index">
|
|
|
|
|
{{ item.content }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<n-empty description="你什么也找不到">
|
|
|
|
|
<template #extra> 可尝试提问后添加问题 </template>
|
|
|
|
|
</n-empty>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -55,36 +61,34 @@ const emit = defineEmits(['update:modelValue'])
|
|
|
|
|
|
|
|
|
|
let list = ref([])
|
|
|
|
|
let queryParams = reactive({
|
|
|
|
|
current: 1, size: 5
|
|
|
|
|
current: 1,
|
|
|
|
|
size: 5
|
|
|
|
|
})
|
|
|
|
|
const message = useMessage()
|
|
|
|
|
let total = ref(0)
|
|
|
|
|
const currentTime = moment().format('YYYY/MM/DD HH:mm:ss')
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 换一批
|
|
|
|
|
*/
|
|
|
|
|
const handlerChange = ()=>{
|
|
|
|
|
const handlerChange = () => {
|
|
|
|
|
const totalPage = total.value / queryParams.size
|
|
|
|
|
|
|
|
|
|
if(totalPage === queryParams.current){
|
|
|
|
|
if (totalPage === queryParams.current) {
|
|
|
|
|
message.warning('没有更多了!')
|
|
|
|
|
return
|
|
|
|
|
}else{
|
|
|
|
|
queryParams.current = getNonZeroRandom(totalPage);
|
|
|
|
|
} else {
|
|
|
|
|
queryParams.current = getNonZeroRandom(totalPage)
|
|
|
|
|
getList()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handlerQuerParmas = content => {
|
|
|
|
|
const handlerQuerParmas = content => {
|
|
|
|
|
emit('update:modelValue', content)
|
|
|
|
|
emit('sendMessage')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// emit('sendMessage')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getNonZeroRandom = (a)=> {
|
|
|
|
|
return Math.floor(Math.random() * a) + 1;
|
|
|
|
|
const getNonZeroRandom = a => {
|
|
|
|
|
return Math.floor(Math.random() * a) + 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const getList = async () => {
|
|
|
|
@ -99,12 +103,12 @@ const getList = async () => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(()=>{
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getList()
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.message-text {
|
|
|
|
|
span {
|
|
|
|
|
font-weight: bold;
|
|
|
|
@ -125,17 +129,22 @@ onMounted(()=>{
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 3px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.refresh {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.issue-btn:hover {
|
|
|
|
|
color: #507afc;
|
|
|
|
|
}
|
|
|
|
|
.issue-list {
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
min-height: 100px;
|
|
|
|
|
.issue-item {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
@ -144,6 +153,11 @@ onMounted(()=>{
|
|
|
|
|
background-color: #3d424d;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
}
|
|
|
|
|
.issue-item:hover {
|
|
|
|
|
color: #507afc;
|
|
|
|
|
border: 1px solid #507afc;
|
|
|
|
|
background: rgba(80, 122, 252, 0.2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|