ai-chat-bot-interface 1.0.6 → 1.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-chat-bot-interface",
3
3
  "private": false,
4
- "version": "1.0.6",
4
+ "version": "1.0.7",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "description": "A AI chat bot interface. (private)",
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="(data) => handleCardTap(data, comp)"/>
48
- <plan-card v-if="comp.showType === 'plan'" @select="handleCardTap({ type: 'match'}, comp)" />
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'})" />
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
+ <div ref="endTarget" style="height: 100px;"/>
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 }, info) => {
389
+ const handleCardTap = ({type}) => {
390
390
  switch (type) {
391
391
  case 'change':
392
392
  chatConv({code: '換一套菜品', text: '換一套菜品'});
@@ -395,14 +395,14 @@ const handleCardTap = ({ type }, info) => {
395
395
  chatConv({code: '請用以上方案為我配餐', text: '請用以上方案為我配餐'});
396
396
  break;
397
397
  default:
398
- Emits('call', { type, info });
398
+ Emits('call', { type });
399
399
  }
400
400
  };
401
401
 
402
402
  const scrollToEnd = () => {
403
- // nextTick(() => {
404
- // endTarget.value.scrollIntoView();
405
- // });
403
+ nextTick(() => {
404
+ endTarget.value.scrollIntoView();
405
+ });
406
406
  };
407
407
  </script>
408
408
 
@@ -11,8 +11,8 @@
11
11
  </div>
12
12
  </template>
13
13
  <div class="btn_group">
14
- <div class="btn btn_1" @click.stop="handleBtn('ship_order')">配送下单</div>
15
- <div class="btn btn_2" @click.stop="handleBtn('pick_order')">自取下单</div>
14
+ <!-- <div class="btn btn_1" @click.stop="handleBtn('change')">換一套菜品</div>-->
15
+ <div class="btn btn_2" @click.stop="handleBtn('order')">去下單</div>
16
16
  </div>
17
17
  </div>
18
18
 
@@ -69,7 +69,7 @@ const handleBtn = (type) => {
69
69
 
70
70
  &_group {
71
71
  display: grid;
72
- grid-template-columns: 1fr 1fr;
72
+ grid-template-columns: 1fr;
73
73
  grid-column-gap: 10px;
74
74
  margin-top: 20px;
75
75
  }
@@ -0,0 +1,43 @@
1
+ <script setup>
2
+ import { ref } from 'vue'
3
+
4
+ defineProps({
5
+ msg: String,
6
+ })
7
+
8
+ const count = ref(0)
9
+ </script>
10
+
11
+ <template>
12
+ <h1>{{ msg }}</h1>
13
+
14
+ <div class="card">
15
+ <button type="button" @click="count++">count is {{ count }}</button>
16
+ <p>
17
+ Edit
18
+ <code>components/HelloWorld.vue</code> to test HMR
19
+ </p>
20
+ </div>
21
+
22
+ <p>
23
+ Check out
24
+ <a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
25
+ >create-vue</a
26
+ >, the official Vue + Vite starter
27
+ </p>
28
+ <p>
29
+ Learn more about IDE Support for Vue in the
30
+ <a
31
+ href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
32
+ target="_blank"
33
+ >Vue Docs Scaling up Guide</a
34
+ >.
35
+ </p>
36
+ <p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
37
+ </template>
38
+
39
+ <style scoped>
40
+ .read-the-docs {
41
+ color: #888;
42
+ }
43
+ </style>