feat(fittingRoom): 实现试穿结果展示与衣服上传编辑功能
- 新增试穿结果获取与展示逻辑,支持模特切换 - 实现衣服上传和编辑功能,包括分类和长度选择 - 优化上传页面UI布局,增加确认和删除操作按钮- 调整轮播组件数据源,使用试穿结果列表 - 修复上传接口调用逻辑,支持文件上传与数据提交 - 更新请求超时时间,提升接口稳定性 - 优化分类标签显示逻辑,修复索引映射问题 - 支持从衣橱进入编辑模式,传递文件URL和ID参数 - 移除旧版图片选择器,统一使用新上传逻辑 - 修复组件间数据传递与事件绑定问题
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: liguigong liguigong@shopline.com
|
||||
* @Date: 2025-09-23 09:41:10
|
||||
* @LastEditors: liguigong liguigong@shopline.com
|
||||
* @LastEditTime: 2025-09-25 18:01:03
|
||||
* @LastEditTime: 2025-09-26 17:56:13
|
||||
* @FilePath: sheep/api/fittingRoom/index.js
|
||||
* @Description: 这是默认设置,可以在设置》工具》File Description中进行配置
|
||||
*/
|
||||
@@ -54,6 +54,43 @@ const FittingRoomApi = {
|
||||
});
|
||||
});
|
||||
},
|
||||
// 上传模特
|
||||
uploadCloth: (file, formData = {}) => {
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: baseUrl + apiPath + '/cloth/uploadClothFile',
|
||||
filePath: file,
|
||||
name: 'file',
|
||||
header: {
|
||||
Accept: '*/*',
|
||||
Authorization: getAccessToken(),
|
||||
},
|
||||
formData,
|
||||
success: (uploadFileRes) => {
|
||||
console.log('🚀 ~ success 🐶43 ~ uploadFileRes: ', uploadFileRes);
|
||||
let result = JSON.parse(uploadFileRes.data);
|
||||
if (result.error === 1) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: result.msg,
|
||||
});
|
||||
} else {
|
||||
return resolve(result);
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
console.log('上传失败:', error);
|
||||
return resolve(false);
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading();
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
getModelList: (data) => {
|
||||
return request({
|
||||
@@ -69,6 +106,34 @@ const FittingRoomApi = {
|
||||
method: 'GET',
|
||||
});
|
||||
},
|
||||
|
||||
// 获取试穿结果
|
||||
getTestResults: (data) => {
|
||||
return request({
|
||||
url: '/digital/on-record/page',
|
||||
method: 'GET',
|
||||
params: data,
|
||||
});
|
||||
},
|
||||
|
||||
// 上传或者编辑衣服
|
||||
uploadAndEditCloth: (data) => {
|
||||
return request({
|
||||
url: '/cloth/uploadCloth',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
});
|
||||
},
|
||||
|
||||
// 删除衣服
|
||||
deleteCloth: (data) => {
|
||||
return request({
|
||||
url: '/cloth/deleteCloth',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
});
|
||||
},
|
||||
|
||||
addHairApi: (data) => {
|
||||
return request({
|
||||
url: '/userinfo/add_hair_data',
|
||||
|
||||
Reference in New Issue
Block a user