ai-chat-bot-interface 1.6.12 → 1.6.13
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
|
@@ -148,7 +148,7 @@ const handleSelect = (item) => {
|
|
|
148
148
|
dialogInfo.value.dialogHeight = '240px';
|
|
149
149
|
dialogInfo.value.unit = item.unit;
|
|
150
150
|
dialogInfo.value.age = item.value;
|
|
151
|
-
dialogInfo.value.min =
|
|
151
|
+
dialogInfo.value.min = 6;
|
|
152
152
|
dialogInfo.value.max = 100;
|
|
153
153
|
dialogInfo.value.type = 'number';
|
|
154
154
|
break;
|
|
@@ -157,8 +157,8 @@ const handleSelect = (item) => {
|
|
|
157
157
|
dialogInfo.value.dialogHeight = '240px';
|
|
158
158
|
dialogInfo.value.unit = item.unit;
|
|
159
159
|
dialogInfo.value.height = item.value;
|
|
160
|
-
dialogInfo.value.min =
|
|
161
|
-
dialogInfo.value.max =
|
|
160
|
+
dialogInfo.value.min = 100;
|
|
161
|
+
dialogInfo.value.max = 220;
|
|
162
162
|
dialogInfo.value.type = 'digit';
|
|
163
163
|
break;
|
|
164
164
|
case 'weight':
|
|
@@ -166,8 +166,8 @@ const handleSelect = (item) => {
|
|
|
166
166
|
dialogInfo.value.dialogHeight = '240px';
|
|
167
167
|
dialogInfo.value.unit = item.unit;
|
|
168
168
|
dialogInfo.value.weight = item.value;
|
|
169
|
-
dialogInfo.value.min =
|
|
170
|
-
dialogInfo.value.max =
|
|
169
|
+
dialogInfo.value.min = 10;
|
|
170
|
+
dialogInfo.value.max = 150;
|
|
171
171
|
dialogInfo.value.type = 'digit';
|
|
172
172
|
break;
|
|
173
173
|
case 'sport':
|
|
@@ -250,17 +250,35 @@ const handleSubmit = () => {
|
|
|
250
250
|
showToast('请填写完整信息');
|
|
251
251
|
return;
|
|
252
252
|
}
|
|
253
|
+
|
|
254
|
+
const ageIdx = pfForm.value.findIndex((item) => item.key === 'age');
|
|
255
|
+
const heightIdx = pfForm.value.findIndex((item) => item.key === 'height');
|
|
256
|
+
const weightIdx = pfForm.value.findIndex((item) => item.key === 'weight');
|
|
257
|
+
|
|
258
|
+
if (pfForm.value[ageIdx].value < 6 || pfForm.value[ageIdx].value > 100) {
|
|
259
|
+
showToast('年龄需要在6-100岁');
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (
|
|
263
|
+
pfForm.value[heightIdx].value < 100 ||
|
|
264
|
+
pfForm.value[heightIdx].value > 220
|
|
265
|
+
) {
|
|
266
|
+
showToast('身高需要在100-220cm');
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
if (
|
|
270
|
+
pfForm.value[weightIdx].value < 10 ||
|
|
271
|
+
pfForm.value[weightIdx].value > 150
|
|
272
|
+
) {
|
|
273
|
+
showToast('体重需要在10-150kg');
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
|
|
253
277
|
localStorage.setItem('personalInfo', JSON.stringify(pfForm.value));
|
|
254
278
|
const msg = `性别:${pfForm.value.find((item) => item.key === 'sex').value};
|
|
255
|
-
年龄:${pfForm.value.
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
身高:${pfForm.value.find((item) => item.key === 'height').value}${
|
|
259
|
-
pfForm.value.find((item) => item.key === 'height').unit || ''
|
|
260
|
-
};
|
|
261
|
-
体重:${pfForm.value.find((item) => item.key === 'weight').value}${
|
|
262
|
-
pfForm.value.find((item) => item.key === 'weight').unit || ''
|
|
263
|
-
};
|
|
279
|
+
年龄:${pfForm.value[ageIdx].value}${pfForm.value[ageIdx].unit || ''};
|
|
280
|
+
身高:${pfForm.value[heightIdx].value}${pfForm.value[heightIdx].unit || ''};
|
|
281
|
+
体重:${pfForm.value[weightIdx].value}${pfForm.value[weightIdx].unit || ''};
|
|
264
282
|
日常运动水平:${pfForm.value.find((item) => item.key === 'sport').value};
|
|
265
283
|
口味偏好及饮食禁忌:${
|
|
266
284
|
pfForm.value.find((item) => item.key === 'taste').value
|
|
@@ -509,9 +527,10 @@ const selectSex = (item) => {
|
|
|
509
527
|
&_wrap {
|
|
510
528
|
text-align: center;
|
|
511
529
|
padding: 20px 0;
|
|
530
|
+
|
|
512
531
|
.input {
|
|
513
|
-
height:
|
|
514
|
-
line-height:
|
|
532
|
+
height: 64px;
|
|
533
|
+
line-height: 64px;
|
|
515
534
|
font-size: 36px;
|
|
516
535
|
text-align: center;
|
|
517
536
|
width: 200px;
|