|
|
|
@ -4,7 +4,7 @@ import { showToast } from 'vant' |
|
|
|
import _ from 'lodash' |
|
|
|
import _ from 'lodash' |
|
|
|
import { showImagePreview } from 'vant' |
|
|
|
import { showImagePreview } from 'vant' |
|
|
|
import xss from 'xss' |
|
|
|
import xss from 'xss' |
|
|
|
import footerBarInput from '@/components/footer-bar-input.vue' |
|
|
|
import footerBar from '@/components/footer-bar.vue' |
|
|
|
import hotQuestionNew from '@/components/hot-question-new.vue' |
|
|
|
import hotQuestionNew from '@/components/hot-question-new.vue' |
|
|
|
import welcomes from '@/components/welcomes.vue' |
|
|
|
import welcomes from '@/components/welcomes.vue' |
|
|
|
import abstract from '@/components/abstract.vue' |
|
|
|
import abstract from '@/components/abstract.vue' |
|
|
|
@ -27,6 +27,9 @@ const userId = inject('userId', ref('')) |
|
|
|
const isLostMessage = inject('isLostMessage', ref(null)) |
|
|
|
const isLostMessage = inject('isLostMessage', ref(null)) |
|
|
|
const mainContainerRef = ref(null) |
|
|
|
const mainContainerRef = ref(null) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 参考 liics/chat-main 的 tokenExist:token 获取成功后才渲染聊天主内容 |
|
|
|
|
|
|
|
const tokenExist = computed(() => Boolean(store?.token)) |
|
|
|
|
|
|
|
|
|
|
|
const historylist = ref([]) |
|
|
|
const historylist = ref([]) |
|
|
|
const pageNum = ref(1) |
|
|
|
const pageNum = ref(1) |
|
|
|
const pageSize = ref(10) |
|
|
|
const pageSize = ref(10) |
|
|
|
@ -49,8 +52,8 @@ function isImageMessage(item) { |
|
|
|
|
|
|
|
|
|
|
|
return !isTextAnswer && ( |
|
|
|
return !isTextAnswer && ( |
|
|
|
item?.message?.[0]?.type === 'image' || |
|
|
|
item?.message?.[0]?.type === 'image' || |
|
|
|
isProtocolImage || |
|
|
|
isProtocolImage || |
|
|
|
Boolean((item?.imageUrl || item?.imageKey || options.imageUrl || options.imageKey || raw.imgUrl || raw.imgKey || raw.fileKey) && !raw.msgText) |
|
|
|
Boolean((item?.imageUrl || item?.imageKey || options.imageUrl || options.imageKey || raw.imgUrl || raw.imgKey || raw.fileKey) && !raw.msgText) |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -329,17 +332,17 @@ watch( |
|
|
|
<van-icon name="warning-o" size="22px" /> |
|
|
|
<van-icon name="warning-o" size="22px" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<span v-else class="message-text" v-html="getItemHtml(item)"></span> |
|
|
|
<span v-else class="message-text" v-html="getItemHtml(item)"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="msg-item from-bot" v-if="showTyping"> |
|
|
|
<div class="msg-item from-bot" v-if="showTyping"> |
|
|
|
<div class="bubble typing"><span></span><span></span><span></span></div> |
|
|
|
<div class="bubble typing"><span></span><span></span><span></span></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
</div> --> |
|
|
|
<chatContent :historylist="chatArr" /> |
|
|
|
<chatContent :historylist="chatArr" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="chat-footer"> |
|
|
|
<div class="chat-footer"> |
|
|
|
<footer-bar-input /> |
|
|
|
<footer-bar v-if="tokenExist" :tokenExist="tokenExist" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|