feat: fix
This commit is contained in:
@@ -122,20 +122,20 @@
|
||||
},
|
||||
{
|
||||
tip: '您更喜欢以下哪种量感类型的服装?',
|
||||
key: 'feeling_of_quantity',
|
||||
key: 'total_sense_of_quantity_t',
|
||||
options: [
|
||||
{
|
||||
label: '成熟大气款',
|
||||
label: '大量感',
|
||||
female: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754272634205753.png',
|
||||
male: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754287774865899.png',
|
||||
},
|
||||
{
|
||||
label: '适中',
|
||||
label: '中量感',
|
||||
female: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754272667530388.png',
|
||||
male: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754287797613307.png',
|
||||
},
|
||||
{
|
||||
label: '轻盈活力款',
|
||||
label: '小量感',
|
||||
female: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754272732987598.png',
|
||||
male: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754287823232319.png',
|
||||
},
|
||||
@@ -165,20 +165,20 @@
|
||||
|
||||
{
|
||||
tip: '您更喜欢以下哪种轮廓类型的服装?',
|
||||
key: 'right_and_wrong',
|
||||
key: 'straight_total_score_t',
|
||||
options: [
|
||||
{
|
||||
label: '突显女人味',
|
||||
label: '轮廓偏曲',
|
||||
female: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754272769798751.png',
|
||||
male: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754287860949325.png',
|
||||
},
|
||||
{
|
||||
label: '适中',
|
||||
label: '轮廓适中',
|
||||
female: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754272798749257.png',
|
||||
male: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754287885715958.png',
|
||||
},
|
||||
{
|
||||
label: '突显干练利落',
|
||||
label: '轮廓偏直',
|
||||
female: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754272825106455.png',
|
||||
male: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754287910169893.png',
|
||||
},
|
||||
@@ -187,15 +187,15 @@
|
||||
|
||||
{
|
||||
tip: '您更喜欢哪种设计类型的服装?',
|
||||
key: 'dynamic_and_static',
|
||||
key: 'dynamic_static_t',
|
||||
options: [
|
||||
{
|
||||
label: '简约经典',
|
||||
label: '静态型',
|
||||
female: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754272863674867.png',
|
||||
male: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754287959334463.png',
|
||||
},
|
||||
{
|
||||
label: '设计感较强的',
|
||||
label: '动态型',
|
||||
female: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754272895680965.png',
|
||||
male: 'https://oss.yz.zglvling.com/user/image/2025-08-04/1754287984354873.png',
|
||||
},
|
||||
@@ -382,11 +382,12 @@
|
||||
// purpose: 显瘦,勾勒腰线,隐藏肚腩,
|
||||
// occasion_dressing: 商务职场,隆重社交
|
||||
// })
|
||||
|
||||
const form = ref({
|
||||
color: '',
|
||||
feeling_of_quantity: '',
|
||||
right_and_wrong: '',
|
||||
dynamic_and_static: '',
|
||||
total_sense_of_quantity_t: '',
|
||||
straight_total_score_t: '',
|
||||
dynamic_static_t: '',
|
||||
somatotype: '',
|
||||
question: [],
|
||||
purpose: [],
|
||||
@@ -423,15 +424,15 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!form.value.feeling_of_quantity) {
|
||||
if (!form.value.total_sense_of_quantity_t) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!form.value.right_and_wrong) {
|
||||
if (!form.value.straight_total_score_t) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!form.value.dynamic_and_static) {
|
||||
if (!form.value.dynamic_static_t) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -464,6 +465,10 @@
|
||||
|
||||
const userInfo = await getUserInfo();
|
||||
|
||||
console.log('userInfo: -----------', userInfo);
|
||||
|
||||
console.log('form.value: ', form.value);
|
||||
|
||||
await saveUserInfo({
|
||||
...JSON.parse(userInfo.data.dataJson),
|
||||
...form.value,
|
||||
@@ -471,10 +476,12 @@
|
||||
purpose: form.value.purpose.toString(),
|
||||
occasion_dressing: form.value.occasion_dressing.toString(),
|
||||
}).then(() => {
|
||||
|
||||
uni.showLoading({
|
||||
icon: 'loading',
|
||||
title: '',
|
||||
});
|
||||
|
||||
uni.uploadFile({
|
||||
url: 'https://puton.huimeimeta.com/app-api/cloth/uploadFace',
|
||||
filePath: e.tempFilePaths[0],
|
||||
@@ -512,7 +519,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (!form.value.feeling_of_quantity) {
|
||||
if (!form.value.total_sense_of_quantity_t) {
|
||||
uni.showToast({
|
||||
title: '请选择量感类型服饰',
|
||||
icon: 'none',
|
||||
@@ -520,7 +527,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (!form.value.right_and_wrong) {
|
||||
if (!form.value.straight_total_score_t) {
|
||||
uni.showToast({
|
||||
title: '请选择轮廓类型服饰',
|
||||
icon: 'none',
|
||||
@@ -528,7 +535,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (!form.value.dynamic_and_static) {
|
||||
if (!form.value.dynamic_static_t) {
|
||||
uni.showToast({
|
||||
title: '请选择设计类型服饰',
|
||||
icon: 'none',
|
||||
@@ -568,59 +575,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const userInfo = await getUserInfo();
|
||||
console.log('userInfo: ', userInfo.data.dataJson);
|
||||
|
||||
await saveUserInfo({
|
||||
...JSON.parse(userInfo.data.dataJson),
|
||||
...form.value,
|
||||
question: form.value.question.toString(),
|
||||
purpose: form.value.purpose.toString(),
|
||||
occasion_dressing: form.value.occasion_dressing.toString(),
|
||||
}).then(() => {
|
||||
uni.chooseImage({
|
||||
count: 1, //默认9
|
||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
|
||||
sourceType: ['album', 'camera'], //从相册选择
|
||||
success: function (res) {
|
||||
console.log(JSON.stringify(res.tempFilePaths));
|
||||
|
||||
uni.showLoading({
|
||||
icon: 'loading',
|
||||
title: '',
|
||||
});
|
||||
|
||||
uni.uploadFile({
|
||||
url: 'https://puton.huimeimeta.com/app-api/cloth/uploadFace',
|
||||
filePath: res.tempFilePaths[0],
|
||||
name: 'file',
|
||||
formData: {},
|
||||
header: {
|
||||
Authorization: getAccessToken(),
|
||||
},
|
||||
success: (res) => {
|
||||
console.log('上传成功', typeof res.data);
|
||||
console.log('res.data.code: ', JSON.parse(res.data));
|
||||
|
||||
if (JSON.parse(res.data).code === 200) {
|
||||
window.location.href = `https://face-canvas.huimeimeta.com/?img=${
|
||||
JSON.parse(res.data).result.fileUrl
|
||||
}&token=${getAccessToken()}`;
|
||||
}
|
||||
},
|
||||
|
||||
complete: () => {
|
||||
uni.hideLoading();
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
fail: (fail) => {
|
||||
console.log('fail: ', fail);
|
||||
uni.showToast('上传图片报错了');
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user