ai-chat-bot-interface 1.4.7 → 1.4.9
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
package/src/App.vue
CHANGED
package/src/ChatUi.vue
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<div class="btn_group">
|
|
15
15
|
<button class="btn" @click.stop="createConv">
|
|
16
16
|
<new-chat class="icon" />
|
|
17
|
-
<span style="font-size: 14px"
|
|
17
|
+
<span style="font-size: 14px">{{ finalDefMsg.newChat }}</span>
|
|
18
18
|
</button>
|
|
19
19
|
<template v-show="false">
|
|
20
20
|
<button class="btn">
|
|
@@ -64,10 +64,12 @@
|
|
|
64
64
|
<div class="box">
|
|
65
65
|
<template v-if="conv.reasoning_content">
|
|
66
66
|
<div v-if="conv.status === 'thinking'" class="think_status">
|
|
67
|
-
<thinking-icon class="icon" />
|
|
67
|
+
<thinking-icon class="icon" />
|
|
68
|
+
{{ finalDefMsg.thinking }}
|
|
68
69
|
</div>
|
|
69
70
|
<div v-else class="think_status">
|
|
70
|
-
<ok-icon class="icon" />
|
|
71
|
+
<ok-icon class="icon" />
|
|
72
|
+
{{ finalDefMsg.thinkCompleted }}
|
|
71
73
|
</div>
|
|
72
74
|
|
|
73
75
|
<p class="think_text">
|
|
@@ -90,6 +92,7 @@
|
|
|
90
92
|
v-if="comp.showType === 'card'"
|
|
91
93
|
:sku-list="comp.skuList"
|
|
92
94
|
:is-mini="!showHeader"
|
|
95
|
+
:def-msg="finalDefMsg"
|
|
93
96
|
@select="(data) => handleCardTap(data, comp)"
|
|
94
97
|
/>
|
|
95
98
|
<plan-card
|
|
@@ -109,9 +112,7 @@
|
|
|
109
112
|
<div
|
|
110
113
|
class="cui_btn cui_btn_2"
|
|
111
114
|
@click.stop="handleCardTap({ type: 'match' }, {})"
|
|
112
|
-
>
|
|
113
|
-
用該方案配餐
|
|
114
|
-
</div>
|
|
115
|
+
>{{finalDefMsg.useSolution}}</div>
|
|
115
116
|
</div>
|
|
116
117
|
</template>
|
|
117
118
|
</template>
|
|
@@ -190,6 +191,14 @@ const msgObj = {
|
|
|
190
191
|
uploadingTips: '文件正在上傳,請稍候...',
|
|
191
192
|
matchText: '請用以上方案為我配餐',
|
|
192
193
|
matchContent: '請用以上方案為我配餐',
|
|
194
|
+
energy: '熱量',
|
|
195
|
+
protein: '蛋白質',
|
|
196
|
+
fat: '脂肪',
|
|
197
|
+
carbonwater: '碳水',
|
|
198
|
+
newChat: '新對話',
|
|
199
|
+
thinking: '思考中...',
|
|
200
|
+
thinkCompleted: '思考完成',
|
|
201
|
+
useSolution: '用該方案配餐'
|
|
193
202
|
};
|
|
194
203
|
|
|
195
204
|
const props = defineProps({
|
|
@@ -26,10 +26,14 @@ const props = defineProps({
|
|
|
26
26
|
type: Object,
|
|
27
27
|
required: true,
|
|
28
28
|
},
|
|
29
|
+
defMsg: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default: () => ({})
|
|
32
|
+
}
|
|
29
33
|
});
|
|
30
34
|
|
|
31
35
|
const subStr = computed(() => {
|
|
32
|
-
return
|
|
36
|
+
return `${props.defMsg.energy}${props.info.energy}kcal,${props.defMsg.protein}${props.info.protein}g,${props.defMsg.fat}${props.info.fat}g,${props.defMsg.carbonwater}${props.info.carbonwater}g`;
|
|
33
37
|
});
|
|
34
38
|
|
|
35
39
|
const previewImg = (url) => {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
v-for="(info, idx) in dList.getCategoryList"
|
|
16
16
|
:key="idx"
|
|
17
17
|
:info="info"
|
|
18
|
+
:def-msg="defMsg"
|
|
18
19
|
/>
|
|
19
20
|
</template>
|
|
20
21
|
</div>
|
|
@@ -51,6 +52,10 @@ const props = defineProps({
|
|
|
51
52
|
type: Boolean,
|
|
52
53
|
default: false,
|
|
53
54
|
},
|
|
55
|
+
defMsg: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: () => ({})
|
|
58
|
+
}
|
|
54
59
|
});
|
|
55
60
|
const Emits = defineEmits(['select']);
|
|
56
61
|
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
:key="index"
|
|
24
24
|
class="file_card"
|
|
25
25
|
>
|
|
26
|
-
<img class="
|
|
26
|
+
<img v-if="(item.file_type).toLocaleLowerCase().includes('pdf')" class="pdf" :src="pdfIcon" width="100%" alt="img" />
|
|
27
|
+
<img v-else class="img" :src="item.file_url" width="100%" alt="img" />
|
|
27
28
|
<div v-if="item.percent < 100" class="process">
|
|
28
29
|
<progress-ring :percent="item.percent" />
|
|
29
30
|
</div>
|
|
@@ -112,7 +113,7 @@ import AddIcon from './icons/addIcon.vue';
|
|
|
112
113
|
import CloseBorderIcon from './icons/closeBorderIcon.vue';
|
|
113
114
|
import CloseIcon from './icons/CloseIcon.vue';
|
|
114
115
|
import NewChat from './icons/newChat.vue';
|
|
115
|
-
|
|
116
|
+
const pdfIcon = 'https://prodstatic.weis1606.cn/api/smartFood/icon/pdf_icon.png';
|
|
116
117
|
const extraList = [
|
|
117
118
|
// { name: '相機', icon: CameraIcon, type: 'camera' },
|
|
118
119
|
{ name: '相冊', icon: PictureIcon, type: 'photo' },
|
|
@@ -237,10 +238,11 @@ const triggerUploadInput = () => {
|
|
|
237
238
|
|
|
238
239
|
const handleFileChange = (e) => {
|
|
239
240
|
const selFile = e.target.files[0];
|
|
240
|
-
|
|
241
|
+
console.log('=== file ===', e);
|
|
241
242
|
if (selFile) {
|
|
242
243
|
uFileList.value.push({
|
|
243
244
|
file: selFile,
|
|
245
|
+
file_type: selFile.type,
|
|
244
246
|
file_url: URL.createObjectURL(selFile),
|
|
245
247
|
size: (selFile.size / 1024).toFixed(2),
|
|
246
248
|
percent: 0,
|