ai-chat-bot-interface 1.7.8 → 1.7.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.
Files changed (55) hide show
  1. package/dist/assets/index-DQulfwi9.css +9 -0
  2. package/dist/assets/index-Dkddqe_3.js +123 -0
  3. package/{index.html → dist/index.html} +2 -1
  4. package/dist/src/index.d.ts +0 -0
  5. package/package.json +26 -5
  6. package/.prettierignore +0 -5
  7. package/.prettierrc.cjs +0 -37
  8. package/.vscode/extensions.json +0 -3
  9. package/index.js +0 -11
  10. package/src/App.vue +0 -39
  11. package/src/ChatUi.less +0 -301
  12. package/src/ChatUi.vue +0 -1087
  13. package/src/assets/styles/public.less +0 -152
  14. package/src/assets/vue.svg +0 -1
  15. package/src/components/DishesCard.vue +0 -369
  16. package/src/components/DishesList.vue +0 -218
  17. package/src/components/MarkdownPlan/MarkdownViewer.vue +0 -34
  18. package/src/components/OperateModule.less +0 -186
  19. package/src/components/OperateModule.vue +0 -392
  20. package/src/components/PlanCard.vue +0 -114
  21. package/src/components/StoreList/StoreCard.vue +0 -72
  22. package/src/components/StoreList/StoreList.vue +0 -27
  23. package/src/components/StoreList/mock.js +0 -411
  24. package/src/components/assistantReplay/assistantReplay.vue +0 -78
  25. package/src/components/icons/ArrowDown.vue +0 -26
  26. package/src/components/icons/ArrowRight.vue +0 -19
  27. package/src/components/icons/BackIcon.vue +0 -19
  28. package/src/components/icons/ClearIcon.vue +0 -18
  29. package/src/components/icons/CloseIcon.vue +0 -17
  30. package/src/components/icons/NewSessionIcon.vue +0 -20
  31. package/src/components/icons/OkIcon.vue +0 -26
  32. package/src/components/icons/SendIcon.vue +0 -22
  33. package/src/components/icons/ThinkingIcon.vue +0 -28
  34. package/src/components/icons/addIcon.vue +0 -18
  35. package/src/components/icons/cameraIcon.vue +0 -22
  36. package/src/components/icons/closeBorderIcon.vue +0 -35
  37. package/src/components/icons/fileIcon.vue +0 -18
  38. package/src/components/icons/loadingIcon.vue +0 -76
  39. package/src/components/icons/loadingIcon2.vue +0 -88
  40. package/src/components/icons/newChat.vue +0 -18
  41. package/src/components/icons/pictureIcon.vue +0 -22
  42. package/src/components/icons/processBar.vue +0 -115
  43. package/src/components/icons/progressRing.vue +0 -63
  44. package/src/components/icons/sendLoadingIcon.vue +0 -35
  45. package/src/components/icons/tagIcon.vue +0 -18
  46. package/src/components/imgeList.vue +0 -63
  47. package/src/components/personalForm/personalForm.vue +0 -634
  48. package/src/components/popup/popup.vue +0 -178
  49. package/src/main.js +0 -26
  50. package/src/style.css +0 -4
  51. package/src/utils/imagesViewer.js +0 -8
  52. package/src/utils/request.js +0 -52
  53. package/src/utils/tools.js +0 -20
  54. package/vite.config.js +0 -33
  55. /package/{public → dist}/vite.svg +0 -0
@@ -1,152 +0,0 @@
1
- @border-color: rgba(68, 83, 130, 0.25);
2
- @border-radius: 10px;
3
- @box-max: 290px;
4
- @max-width: 630px;
5
- @bg-color: #fff;
6
- @sys-bg: #f3f4f5;
7
- @user-bg: #28d465;
8
- @primary-color: #039938;
9
-
10
- .flexr {
11
- display: flex;
12
- flex-direction: row;
13
- }
14
-
15
- .flexc {
16
- display: flex;
17
- flex-direction: column;
18
- }
19
- .flexrss {
20
- .flexr();
21
- justify-content: flex-start;
22
- align-items: flex-start;
23
- }
24
- .flexrsc {
25
- .flexr();
26
- justify-content: flex-start;
27
- align-items: center;
28
- }
29
- .flexrse {
30
- .flexr();
31
- justify-content: flex-start;
32
- align-items: flex-end;
33
- }
34
- .flexrsst {
35
- .flexr();
36
- justify-content: flex-start;
37
- align-items: stretch;
38
- }
39
-
40
- .flexrbs {
41
- .flexr();
42
- justify-content: space-between;
43
- align-items: flex-start;
44
- }
45
- .flexrbc {
46
- .flexr();
47
- justify-content: space-between;
48
- align-items: center;
49
- }
50
- .flexrac {
51
- .flexr();
52
- justify-content: space-around;
53
- align-items: center;
54
- }
55
- .flexrbe {
56
- .flexr();
57
- justify-content: space-between;
58
- align-items: flex-end;
59
- }
60
- .flexrcs {
61
- .flexr();
62
- justify-content: center;
63
- align-items: flex-start;
64
- }
65
- .flexrcc {
66
- .flexr();
67
- justify-content: center;
68
- align-items: center;
69
- }
70
- .flexrce {
71
- .flexr();
72
- justify-content: center;
73
- align-items: flex-end;
74
- }
75
- .flexres {
76
- .flexr();
77
- justify-content: flex-end;
78
- align-items: flex-start;
79
- }
80
- .flexrec {
81
- .flexr();
82
- justify-content: flex-end;
83
- align-items: center;
84
- }
85
- .flexree {
86
- .flexr();
87
- justify-content: flex-end;
88
- align-items: flex-end;
89
- }
90
-
91
- .flexcss {
92
- .flexc();
93
- justify-content: flex-start;
94
- align-items: flex-start;
95
- }
96
- .flexcsc {
97
- .flexc();
98
- justify-content: flex-start;
99
- align-items: center;
100
- }
101
- .flexcse {
102
- .flexc();
103
- justify-content: flex-start;
104
- align-items: flex-end;
105
- }
106
-
107
- .flexccs {
108
- .flexc();
109
- justify-content: center;
110
- align-items: flex-start;
111
- }
112
- .flexccc {
113
- .flexc();
114
- justify-content: center;
115
- align-items: center;
116
- }
117
- .flexcce {
118
- .flexc();
119
- justify-content: center;
120
- align-items: flex-end;
121
- }
122
-
123
- .flexcbs {
124
- .flexc();
125
- justify-content: space-between;
126
- align-items: flex-start;
127
- }
128
- .flexcbc {
129
- .flexc();
130
- justify-content: space-between;
131
- align-items: center;
132
- }
133
- .flexcbe {
134
- .flexc();
135
- justify-content: space-between;
136
- align-items: flex-end;
137
- }
138
- .flexces {
139
- .flexc();
140
- justify-content: flex-end;
141
- align-items: flex-start;
142
- }
143
- .flexcec {
144
- .flexc();
145
- justify-content: flex-end;
146
- align-items: center;
147
- }
148
- .flexcee {
149
- .flexc();
150
- justify-content: flex-end;
151
- align-items: flex-end;
152
- }
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
@@ -1,369 +0,0 @@
1
- <template>
2
- <div
3
- :class="{ dishes_box: true, is_open: isOpen }"
4
- :style="{ height: panelHeight }"
5
- >
6
- <div class="dishes_wrap" @click.stop="switchOpen">
7
- <img
8
- class="img"
9
- :src="info.primaryImgUrl"
10
- alt="img"
11
- @click.stop="previewImg(info.primaryImgUrl)"
12
- />
13
- <div>
14
- <div class="name">
15
- <span>{{ info.skuname }}</span>
16
- <span>×1</span>
17
- </div>
18
- <div class="sub">{{ subStr }}</div>
19
- </div>
20
- </div>
21
- <div v-if="hasDetails" class="dishes_details" ref="contentRef">
22
- <div v-show="!isOpen" class="switch_open" @click.stop="switchOpen">
23
- <span>查看菜谱详情</span><arrow-right class="icon" />
24
- </div>
25
- <div class="title">制作工艺</div>
26
- <div v-if="makeCraft.makeVideosUrl">
27
- <video :src="makeCraft.makeVideosUrl" width="100%" controls="true" />
28
- </div>
29
- <img :src="makeCraft.craftUrl" width="100%" alt="craft" />
30
- <!-- <div class="tips">
31
- <span class="star">*</span
32
- >一份的量偏小不便制作,因而基于3份的量来介绍,食用时取一份即可
33
- </div>
34
- <div class="title">食材</div>
35
- <div class="text">
36
- {{ materialText }}
37
- </div>
38
- <div class="title">制作工艺</div>
39
- <div v-if="makeCraft.makeVideosUrl">
40
- <video :src="makeCraft.makeVideosUrl" width="100%" controls="true" />
41
- </div>
42
- <div
43
- v-for="(item, index) in makeCraft.makeCraftList"
44
- :key="index"
45
- class="step_row"
46
- >
47
- <div class="step_item">
48
- <div class="num">第{{ index + 1 }}步</div>
49
- <div class="desc">{{ item.content }}</div>
50
- </div>
51
- <div>
52
- <img
53
- v-for="(img, index) in getImageList(item.craftImg)"
54
- :key="index"
55
- :src="img"
56
- width="100%"
57
- alt="step image"
58
- />
59
- </div>
60
- </div>-->
61
- <div class="collapse_btn" @click.stop="isOpen = false">收起</div>
62
- </div>
63
- </div>
64
- </template>
65
-
66
- <script setup>
67
- import { computed, inject, nextTick, onMounted, ref } from 'vue';
68
- import { api as viewerApi } from 'v-viewer';
69
- import 'viewerjs/dist/viewer.css';
70
- import ArrowRight from './icons/ArrowRight.vue';
71
- import { post } from '../utils/request.js';
72
-
73
- const props = defineProps({
74
- info: {
75
- type: Object,
76
- required: true,
77
- },
78
- defMsg: {
79
- type: Object,
80
- default: () => ({}),
81
- },
82
- open: {
83
- type: Boolean,
84
- default: false,
85
- },
86
- });
87
- const isOpen = ref(props.open);
88
- const contentRef = ref(null); // 用于引用内容 DOM 元素
89
- const contentHeight = ref(0); // 存储内容的实际高度
90
- const makeCraft = ref([]);
91
-
92
- onMounted(async () => {
93
- if (isOpen.value) {
94
- await querySkuMakeCraft();
95
- await getContentHeight();
96
- setTimeout(() => {
97
- scrollToEnd();
98
- }, 200);
99
- }
100
- });
101
-
102
- const scrollToEnd = inject('triggerScrollToEnd');
103
- const getContentHeight = () => {
104
- return new Promise(async (resolve) => {
105
- await nextTick();
106
- const imgList = [];
107
- if (
108
- makeCraft.value.hasOwnProperty('craftUrl') &&
109
- makeCraft.value.craftUrl
110
- ) {
111
- // makeCraft.value?.makeCraftList.forEach((item) => {
112
- // const imgs = getImageList(item.craftImg);
113
- // imgList.push(...imgs);
114
- // });
115
- imgList.push(makeCraft.value.craftUrl);
116
- }
117
- if (imgList.length) {
118
- await preloadImages(imgList);
119
- await nextTick();
120
- contentHeight.value = hasDetails.value
121
- ? contentRef.value.scrollHeight
122
- : 0;
123
- if (isOpen.value) {
124
- contentHeight.value += 26;
125
- }
126
-
127
- isOpen.value = true;
128
- } else {
129
- isOpen.value = false;
130
- }
131
-
132
- resolve();
133
- });
134
- };
135
-
136
- const preloadImages = (urls) => {
137
- const promises = [];
138
- urls.forEach((url) => {
139
- const img = new Image();
140
- const promise = new Promise((resolve, reject) => {
141
- img.onload = () => resolve(img);
142
- img.onerror = () => reject(new Error(`加载${url}失败`));
143
- img.src = url;
144
- });
145
- promises.push(promise);
146
- });
147
- return Promise.all(promises);
148
- };
149
- // const Emits = defineEmits(['update:open']);
150
-
151
- const subStr = computed(() => {
152
- 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`;
153
- });
154
- const materialText = computed(() => {
155
- const list = props.info?.makeMaterialList?.map(
156
- (item) => item.material + item.usage + 'g',
157
- );
158
- return (list || []).join('、');
159
- });
160
- const hasDetails = computed(() => {
161
- return props.info.hasOwnProperty('cid') && props.info.cid;
162
- });
163
- const panelHeight = computed(() => {
164
- let h = '92px';
165
- if (hasDetails.value) {
166
- h = isOpen.value ? contentHeight.value + 66 + 'px' : '118px';
167
- }
168
- return h;
169
- });
170
-
171
- const previewImg = (url) => {
172
- viewerApi({
173
- images: [url],
174
- });
175
- };
176
-
177
- const switchOpen = async () => {
178
- if (!isOpen.value) {
179
- await querySkuMakeCraft();
180
- getContentHeight();
181
- } else {
182
- isOpen.value = false;
183
- }
184
- };
185
-
186
- const getImageList = (str) => {
187
- let list = [];
188
- try {
189
- list = JSON.parse(str);
190
- } catch (e) {
191
- console.warn('====== get image list error =======', e);
192
- }
193
-
194
- return list;
195
- };
196
-
197
- const querySkuMakeCraft = async () => {
198
- if (
199
- !(
200
- makeCraft.value.hasOwnProperty('makeCraftList') &&
201
- makeCraft.value.hasOwnProperty('makeMaterialList')
202
- )
203
- ) {
204
- const res = await post('/api/cn.weis.api.Food/makeCraft', {
205
- method: 'makeCraft',
206
- params: [{ cid: props.info.cid }],
207
- token: localStorage.getItem('postToken'),
208
- });
209
- if (res.errCode === 0 && res.obj) {
210
- makeCraft.value = { ...res.obj };
211
- }
212
- }
213
- };
214
- </script>
215
-
216
- <style scoped lang="less">
217
- @import '../assets/styles/public';
218
-
219
- .dishes {
220
- &_details {
221
- padding: 1px 10px;
222
-
223
- .switch_open {
224
- .flexrec();
225
- cursor: pointer;
226
- height: 26px;
227
- line-height: 26px;
228
- font-size: 10px;
229
- color: #666;
230
- .icon {
231
- font-size: 18px;
232
- }
233
- }
234
- .tips {
235
- vertical-align: middle;
236
- font-size: 13px;
237
- font-weight: 400;
238
- margin-top: 10px;
239
- .star {
240
- color: #ff0000;
241
- vertical-align: middle;
242
- margin-right: 0.4em;
243
- }
244
- }
245
- .title {
246
- font-weight: 600;
247
- font-size: 15px;
248
- color: #000;
249
- margin: 15px 0;
250
- }
251
- .text {
252
- font-weight: 400;
253
- font-size: 13px;
254
- color: #000;
255
- }
256
- .step {
257
- &_row {
258
- margin-bottom: 15px;
259
- }
260
- &_item {
261
- .flexrss();
262
- .num {
263
- width: 4em;
264
- color: #666;
265
- font-size: 13px;
266
- }
267
- .desc {
268
- flex: 1;
269
- font-size: 13px;
270
- color: #000;
271
- }
272
- }
273
- }
274
- .line {
275
- margin: 5px 0;
276
- border-bottom: 1px solid #fff;
277
- }
278
- .data {
279
- &_row {
280
- .flexrsc();
281
- gap: 10px;
282
- }
283
- &_item {
284
- .flexrsc();
285
- flex: 1;
286
- gap: 10px;
287
- line-height: 26px;
288
- .label {
289
- width: 72px;
290
- font-weight: 400;
291
- font-size: 13px;
292
- color: #666;
293
- }
294
- .content {
295
- flex: 1;
296
- width: 60px;
297
- font-weight: 400;
298
- font-size: 13px;
299
- color: #000;
300
- }
301
- }
302
- }
303
- .tag {
304
- padding: 0 15px;
305
- background-color: #fff;
306
- border-radius: 15px;
307
- line-height: 30px;
308
- font-weight: 400;
309
- font-size: 13px;
310
- color: #000;
311
- &_box {
312
- .flexrsc();
313
- gap: 10px;
314
- }
315
- }
316
- .collapse_btn {
317
- width: 100px;
318
- height: 32px;
319
- line-height: 32px;
320
- text-align: center;
321
- border-radius: 10px 10px 0 0;
322
- background-color: #e2e2e2;
323
- color: #999;
324
- margin: 20px auto 0;
325
- }
326
- }
327
- &_box {
328
- transition: height 100ms ease-in-out;
329
- height: 92px;
330
- background-color: #ededed;
331
- border-radius: 10px;
332
- margin: 10px 0;
333
- overflow: hidden;
334
- &.is_open {
335
- //height: auto;
336
- }
337
- }
338
- &_wrap {
339
- display: grid;
340
- grid-template-columns: 72px 1fr;
341
- grid-column-gap: 10px;
342
- background-color: @bg-color;
343
- border-radius: 10px;
344
- padding: 10px;
345
- box-sizing: border-box;
346
- min-height: 92px;
347
-
348
- .img {
349
- cursor: pointer;
350
- width: 100%;
351
- border-radius: 8px;
352
- }
353
- .name {
354
- .flexrbs();
355
- font-weight: 600;
356
- font-size: 14px;
357
- color: #000;
358
- line-height: 16px;
359
- }
360
- .sub {
361
- margin-top: 10px;
362
- font-weight: 400;
363
- font-size: 10px;
364
- color: #666;
365
- line-height: 12px;
366
- }
367
- }
368
- }
369
- </style>