提交 4deab78d 作者: Hao

add

父级 a0cdee9d
......@@ -8,19 +8,12 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
AutomaticPrompt: typeof import('./src/components/AutomaticPrompt.vue')['default']
ElAside: typeof import('element-plus/es')['ElAside']
ElButton: typeof import('element-plus/es')['ElButton']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElFooter: typeof import('element-plus/es')['ElFooter']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElMain: typeof import('element-plus/es')['ElMain']
ElOption: typeof import('element-plus/es')['ElOption']
ElSelect: typeof import('element-plus/es')['ElSelect']
EmotionComponent: typeof import('./src/components/EmotionComponent.vue')['default']
IndexComponent: typeof import('./src/components/IndexComponent.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
......
......@@ -46,7 +46,7 @@
</div>
<emotion
v-if="showEmotion"
style="position: absolute; top: calc(100% - 465px); background: #fff;"
style="position: absolute; top:-220px;left:19px; background: #fff;"
:height="200"
@emotion="handleEmotion"
/>
......@@ -136,6 +136,7 @@ const getFileObject = (url: any, oFile: any) => {
const emit = defineEmits(['updateState'])
watch(inputVal, async (newValue) => {
if (!newValue) elAutocomplete.value.innerHTML = ''
// else elAutocomplete.value.innerHTML = newValue
emit('updateState', newValue)
})
// 去文本粘贴
......@@ -248,6 +249,7 @@ const cursorIn = function () {
defineExpose({
setState(res: any) {
inputVal.value = res
elAutocomplete.value.innerHTML = res
},
getState() {
return inputVal.value
......
......@@ -94,6 +94,8 @@ function websocketclose(e: any) {
console.log("连接关闭");
clearInterval(HeartbeatTime);
useUserStore().disconnect(); // 修改连接状态
connectMsg(callBack)
}
// 数据发送
......
......@@ -60,11 +60,13 @@
<div class="bubble official-box">
<div class="bubble-title">You may want to know:</div>
<ul>
<li class="bubble-h1">
How to quickly inquire about products?
</li>
<li class="bubble-h1">
How to quickly contact sellers?
<li
class="bubble-h1"
@click="setChatMessage(item.text)"
v-for="(item,index) in wantMessage"
:key="index"
>
{{ item.text }}
</li>
</ul>
</div>
......@@ -411,7 +413,14 @@ const ruleForm = ref({
otherRequirements: '',
EmailAddress: '',
})
const wantMessage = [
{
text: 'How to quickly contact sellers?',
},
{
text: 'How to quickly inquire about products?',
},
]
//进入页面直接发送请求从后端获取热点数据
onMounted(async () => {
getKfCodeInfo()
......@@ -428,7 +437,7 @@ function getKfCodeInfo() {
if (code == 200) {
const chatInfo = {
clientId: routeParams.supplierId || new Date().getTime(),
serviceId: data || routeParams.priceId || routeParams.supplierId,
serviceId: data,
}
store.setChatInfo(chatInfo)
connectMsg(getCheckMesssages)
......@@ -475,7 +484,7 @@ const vShrink: Directive<HTMLElement, boolean | Props> = {
function getCheckMesssages() {
let query = {
sessionId: `${store.chatInfo.serviceId}-${store.chatInfo.clientId}`,
sessionId: `${store.chatInfo.clientId}-${store.chatInfo.serviceId}`,
}
checkMesssages(query).then(({ code, data, description }) => {
data = data || []
......@@ -487,8 +496,7 @@ function getCheckMesssages() {
item.userImg = '/assets/img/user.png'
item.time = moment(item.createTime).format('HH:MM')
})
console.log(data, 'data')
messages.value = data.reverse()
messages.value = data
})
}
//设置style的属性值
......@@ -662,7 +670,11 @@ const handleButtonClick = () => {
sendData(msg.trim(), 0)
automaticPromptRef.value.setState('')
}
function setChatMessage(text){
console.log(text,'text')
automaticPromptRef.value.setState(text)
// automaticPromptRef.value.elAutocomplete = item
}
const sendData = (msg, msgType) => {
let data = {
content: msg,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -10,7 +10,7 @@
this.resizeTo(800,600);
this.focus();
</script> -->
<script type="module" crossorigin src="/assets/index.23cf875b.js"></script>
<script type="module" crossorigin src="/assets/index.2985ec2a.js"></script>
<link rel="modulepreload" crossorigin href="/assets/vendor.d471d1e7.js">
<link rel="stylesheet" href="/assets/index.5aee5cd9.css">
</head>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论