ai-chat-bot-interface 1.7.0 → 1.7.2
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 +110 -32
- package/src/components/DishesCard.vue +4 -0
- package/src/components/DishesList.vue +2 -1
package/package.json
CHANGED
package/src/ChatUi.vue
CHANGED
|
@@ -151,7 +151,8 @@
|
|
|
151
151
|
v-if="isAnswering && index === historyList.length - 1"
|
|
152
152
|
class="loading_row"
|
|
153
153
|
>
|
|
154
|
-
Ai
|
|
154
|
+
Ai努力生成中...
|
|
155
|
+
<loading-icon2 />
|
|
155
156
|
</div>
|
|
156
157
|
</div>
|
|
157
158
|
</div>
|
|
@@ -381,14 +382,101 @@ onMounted(async () => {
|
|
|
381
382
|
});
|
|
382
383
|
|
|
383
384
|
const handleFirstMsg = async () => {
|
|
384
|
-
const
|
|
385
|
+
const presetList = [
|
|
386
|
+
{
|
|
387
|
+
params: {
|
|
388
|
+
planType: '03', // 03保持,01减肥
|
|
389
|
+
profileInfo: {
|
|
390
|
+
birthday: '20010101',
|
|
391
|
+
motion: '01',
|
|
392
|
+
sex: '2',
|
|
393
|
+
weight: '50',
|
|
394
|
+
height: '160',
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
msg: `本食谱为通用版${props.firstMsg}示例,依据以下女性常规身体数据制定:
|
|
385
398
|
性别:女;
|
|
386
399
|
年龄:25岁;
|
|
387
400
|
身高:160cm;
|
|
388
|
-
体重:
|
|
401
|
+
体重:50kg;
|
|
402
|
+
日常运动水平:久坐;
|
|
403
|
+
口味偏好及饮食禁忌:无;
|
|
404
|
+
如需定制贴合个人情况的专属方案,请前往完善个人身体数据,获取个性化定制食谱。`,
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
params: {
|
|
408
|
+
planType: '03',
|
|
409
|
+
profileInfo: {
|
|
410
|
+
birthday: '20010101',
|
|
411
|
+
motion: '01',
|
|
412
|
+
sex: '1',
|
|
413
|
+
weight: '65',
|
|
414
|
+
height: '170',
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
msg: `本食谱为通用版${props.firstMsg}示例,依据以下男性常规身体数据制定:
|
|
418
|
+
性别:男;
|
|
419
|
+
年龄:25岁;
|
|
420
|
+
身高:170cm;
|
|
421
|
+
体重:65kg;
|
|
389
422
|
日常运动水平:久坐;
|
|
390
423
|
口味偏好及饮食禁忌:无;
|
|
391
|
-
|
|
424
|
+
如需定制贴合个人情况的专属方案,请前往完善个人身体数据,获取个性化定制食谱。`,
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
params: {
|
|
428
|
+
planType: '01',
|
|
429
|
+
profileInfo: {
|
|
430
|
+
birthday: '19910101',
|
|
431
|
+
motion: '01',
|
|
432
|
+
sex: '2',
|
|
433
|
+
weight: '65',
|
|
434
|
+
height: '160',
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
msg: `本食谱为通用版${props.firstMsg}示例,依据以下女性常规身体数据制定:
|
|
438
|
+
性别:女;
|
|
439
|
+
年龄:35岁;
|
|
440
|
+
身高:160cm;
|
|
441
|
+
体重:65kg;
|
|
442
|
+
日常运动水平:久坐;
|
|
443
|
+
口味偏好及饮食禁忌:无;
|
|
444
|
+
如需定制贴合个人情况的专属方案,请前往完善个人身体数据,获取个性化定制食谱。`,
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
params: {
|
|
448
|
+
planType: '01',
|
|
449
|
+
profileInfo: {
|
|
450
|
+
birthday: '19910101',
|
|
451
|
+
motion: '01',
|
|
452
|
+
sex: '1',
|
|
453
|
+
weight: '75',
|
|
454
|
+
height: '170',
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
msg: `本食谱为通用版${props.firstMsg}示例,依据以下男性常规身体数据制定:
|
|
458
|
+
性别:男;
|
|
459
|
+
年龄:35岁;
|
|
460
|
+
身高:170cm;
|
|
461
|
+
体重:75kg;
|
|
462
|
+
日常运动水平:久坐;
|
|
463
|
+
口味偏好及饮食禁忌:无;
|
|
464
|
+
如需定制贴合个人情况的专属方案,请前往完善个人身体数据,获取个性化定制食谱。`,
|
|
465
|
+
},
|
|
466
|
+
];
|
|
467
|
+
const categoryMap = {
|
|
468
|
+
'01': '早餐',
|
|
469
|
+
'02': '午餐',
|
|
470
|
+
'03': '晚餐',
|
|
471
|
+
'04': '加餐',
|
|
472
|
+
};
|
|
473
|
+
let p = localStorage.getItem('preset_point') || 0;
|
|
474
|
+
p++;
|
|
475
|
+
if (p >= presetList.length) {
|
|
476
|
+
p = 0;
|
|
477
|
+
}
|
|
478
|
+
const curInfo = presetList[p];
|
|
479
|
+
const perMsg = curInfo.msg;
|
|
392
480
|
|
|
393
481
|
historyList.value = [
|
|
394
482
|
{
|
|
@@ -404,40 +492,30 @@ const handleFirstMsg = async () => {
|
|
|
404
492
|
|
|
405
493
|
const res = await post('/api/cn.weis.api.Food/bdGeneralTemp', {
|
|
406
494
|
method: 'bdGeneralTemp',
|
|
407
|
-
params: [{}],
|
|
495
|
+
params: [{ ...curInfo.params }],
|
|
408
496
|
token: props.postToken,
|
|
409
497
|
});
|
|
498
|
+
|
|
410
499
|
if (res.errCode === 0 && res.obj) {
|
|
411
|
-
|
|
500
|
+
let str = '';
|
|
501
|
+
(res.obj.planDetails || []).forEach(
|
|
502
|
+
(item) =>
|
|
503
|
+
(str += `${categoryMap[item.category]}
|
|
504
|
+
热量:${item.totalKcal}kcal
|
|
505
|
+
碳水:${item.carbohydrateTotal}g
|
|
506
|
+
蛋白质:${item.proteinTotal}g
|
|
507
|
+
脂肪:${item.fatTotal}g\n\n`),
|
|
508
|
+
);
|
|
509
|
+
|
|
510
|
+
const resMsg = `您的身高:${
|
|
511
|
+
curInfo.params.profileInfo.height
|
|
512
|
+
}cm 年龄:25 岁 体重:${curInfo.params.profileInfo.weight}kg 性别:${
|
|
513
|
+
curInfo.params.profileInfo.sex === '2' ? '女' : '男'
|
|
514
|
+
} 日常运动水平:久坐
|
|
412
515
|
|
|
413
516
|
根据您的身体状况,给您推荐的饮食方案如下
|
|
414
517
|
——————————————————
|
|
415
|
-
|
|
416
|
-
早餐
|
|
417
|
-
热量:375kcal
|
|
418
|
-
碳水:46.9g
|
|
419
|
-
蛋白质:18.8g
|
|
420
|
-
脂肪:12.5g
|
|
421
|
-
|
|
422
|
-
午餐
|
|
423
|
-
热量:525kcal
|
|
424
|
-
碳水:65.6g
|
|
425
|
-
蛋白质:26.3g
|
|
426
|
-
脂肪:17.5g
|
|
427
|
-
|
|
428
|
-
晚餐
|
|
429
|
-
热量:450kcal
|
|
430
|
-
碳水:56.3g
|
|
431
|
-
蛋白质:22.5g
|
|
432
|
-
脂肪:15g
|
|
433
|
-
|
|
434
|
-
加餐
|
|
435
|
-
热量:150kcal
|
|
436
|
-
碳水:26.3g
|
|
437
|
-
蛋白质:3.8g
|
|
438
|
-
脂肪:3.3g
|
|
439
|
-
|
|
440
|
-
——————————————————`;
|
|
518
|
+
${str}——————————————————`;
|
|
441
519
|
|
|
442
520
|
historyList.value.push({
|
|
443
521
|
conversation_id: '',
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
<div v-show="!isOpen" class="switch_open" @click.stop="switchOpen">
|
|
23
23
|
<span>查看菜谱详情</span><arrow-right class="icon" />
|
|
24
24
|
</div>
|
|
25
|
+
<div class="title">制作工艺</div>
|
|
26
|
+
<div v-if="makeCraft.makeVideosUrl">
|
|
27
|
+
<video :src="makeCraft.makeVideosUrl" width="100%" controls="true" />
|
|
28
|
+
</div>
|
|
25
29
|
<img :src="makeCraft.craftUrl" width="100%" alt="craft" />
|
|
26
30
|
<!-- <div class="tips">
|
|
27
31
|
<span class="star">*</span
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
v-if="isMini"
|
|
29
29
|
style="font-size: 10px; line-height: 16px; color: #f16868"
|
|
30
30
|
>
|
|
31
|
-
温馨提示:维小饭AI
|
|
31
|
+
温馨提示:维小饭AI健康食谱为日常膳食调理方案,不能替代药物治疗或专业医疗建议。如有疾病,请及时就医并遵医嘱。<br />
|
|
32
|
+
<strong>半价惊喜,下单即得!</strong>
|
|
32
33
|
</div>
|
|
33
34
|
<div v-if="isMini" class="btn_group">
|
|
34
35
|
<div class="btn btn_1" @click.stop="handleBtn('personalForm')">
|