提交 4deab78d 作者: Hao

add

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