ai-chat-bot-interface 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ChatUi.vue +9 -9
package/package.json
CHANGED
package/src/ChatUi.vue
CHANGED
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
<p class="text" v-html="conv.content"></p>
|
|
45
45
|
<div v-if="conv.extra.length && !isAnswering">
|
|
46
46
|
<template v-for="(comp, idx) in conv.extra" :key="idx">
|
|
47
|
-
<dishes-list v-if="comp.showType === 'card'" :sku-list="comp.skuList" @select="handleCardTap"/>
|
|
48
|
-
<plan-card v-if="comp.showType === 'plan'" @select="handleCardTap({ type: 'match'})" />
|
|
47
|
+
<dishes-list v-if="comp.showType === 'card'" :sku-list="comp.skuList" @select="(data) => handleCardTap(data, comp)"/>
|
|
48
|
+
<plan-card v-if="comp.showType === 'plan'" @select="handleCardTap({ type: 'match'}, comp)" />
|
|
49
49
|
</template>
|
|
50
50
|
</div>
|
|
51
51
|
</div>
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<img class="avatar" :src="avatar" alt="avatar">
|
|
62
62
|
</div>
|
|
63
63
|
</template>
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
</div>
|
|
66
66
|
<div class="cui_operate">
|
|
67
67
|
<button class="btn" @click.stop="createConv">
|
|
@@ -135,7 +135,7 @@ const props = defineProps({
|
|
|
135
135
|
|
|
136
136
|
const Emits = defineEmits(['call']);
|
|
137
137
|
|
|
138
|
-
const endTarget = ref(null);
|
|
138
|
+
// const endTarget = ref(null);
|
|
139
139
|
const inputText = ref('');
|
|
140
140
|
const botInfo = ref({});
|
|
141
141
|
|
|
@@ -386,7 +386,7 @@ const handleText = (str) => {
|
|
|
386
386
|
return str.replaceAll(/\[([^\]]+)\]\((https?:\/\/[^)]+)\)/ig, '<a href="$2" target="_blank">[$1]</a>');
|
|
387
387
|
};
|
|
388
388
|
|
|
389
|
-
const handleCardTap = ({type}) => {
|
|
389
|
+
const handleCardTap = ({ type }, info) => {
|
|
390
390
|
switch (type) {
|
|
391
391
|
case 'change':
|
|
392
392
|
chatConv({code: '換一套菜品', text: '換一套菜品'});
|
|
@@ -395,14 +395,14 @@ const handleCardTap = ({type}) => {
|
|
|
395
395
|
chatConv({code: '請用以上方案為我配餐', text: '請用以上方案為我配餐'});
|
|
396
396
|
break;
|
|
397
397
|
default:
|
|
398
|
-
Emits('call', { type });
|
|
398
|
+
Emits('call', { type, info });
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
401
|
|
|
402
402
|
const scrollToEnd = () => {
|
|
403
|
-
nextTick(() => {
|
|
404
|
-
|
|
405
|
-
});
|
|
403
|
+
// nextTick(() => {
|
|
404
|
+
// endTarget.value.scrollIntoView();
|
|
405
|
+
// });
|
|
406
406
|
};
|
|
407
407
|
</script>
|
|
408
408
|
|