报告页逻辑
This commit is contained in:
@@ -27,16 +27,18 @@ export const praiseTextApi = (data) => {
|
||||
data: {
|
||||
model: 'doubao-1-5-thinking-pro-m-250428',
|
||||
messages: [
|
||||
{
|
||||
data.system_prompt ?{
|
||||
role: 'system',
|
||||
content: data.system_prompt,
|
||||
},
|
||||
}: null,
|
||||
|
||||
{
|
||||
role: 'user',
|
||||
content: data.text,
|
||||
},
|
||||
],
|
||||
].filter(i => i),
|
||||
},
|
||||
}).then(res => {
|
||||
return { data: JSON.stringify(res.data) };
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: liguigong liguigong@shopline.com
|
||||
* @Date: 2025-09-23 09:41:10
|
||||
* @LastEditors: liguigong liguigong@shopline.com
|
||||
* @LastEditTime: 2025-09-28 16:27:38
|
||||
* @LastEditTime: 2025-10-13 14:30:53
|
||||
* @FilePath: sheep/api/fittingRoom/index.js
|
||||
* @Description: 这是默认设置,可以在设置》工具》File Description中进行配置
|
||||
*/
|
||||
@@ -148,6 +148,15 @@ const FittingRoomApi = {
|
||||
});
|
||||
},
|
||||
|
||||
//发型试穿
|
||||
hairstyleTryOnApi: (data) => {
|
||||
return request({
|
||||
url: '/digital/on-record/exchange-hair',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
});
|
||||
},
|
||||
|
||||
addHairApi: (data) => {
|
||||
return request({
|
||||
url: '/userinfo/add_hair_data',
|
||||
|
||||
@@ -79,6 +79,7 @@ const fittingRoom = defineStore({
|
||||
// "createTime": 1758857790000
|
||||
});
|
||||
this.testResults = result;
|
||||
return result;
|
||||
console.log('🚀 ~ getTestResults 🐶76 ~ httpResponse: ', httpResponse.data?.list);
|
||||
},
|
||||
|
||||
@@ -95,12 +96,17 @@ const fittingRoom = defineStore({
|
||||
: httpResponse.result || [];
|
||||
},
|
||||
// 获取模特数据查询
|
||||
async getModelList(templateId = null) {
|
||||
async getModelList(modelId = undefined) {
|
||||
const httpResponse = await FittingRoomApi.getModelList({
|
||||
sex: this.sex,
|
||||
});
|
||||
let modelList = (httpResponse.result || []).slice(0, 4);
|
||||
let modelList = httpResponse.result || [];
|
||||
this.modelList = modelList;
|
||||
if (modelId) {
|
||||
this.currentModel = modelList.find((item) => item.id === modelId);
|
||||
// this.getTestResults(modelId);
|
||||
return;
|
||||
}
|
||||
this.currentModel = modelList?.[0] ?? {};
|
||||
this.getTestResults(modelList?.[0]?.id);
|
||||
},
|
||||
@@ -115,13 +121,24 @@ const fittingRoom = defineStore({
|
||||
return;
|
||||
}
|
||||
// 那改成 clothUrl 和 kuziUrl 吧,当 kuziUrl 有值时,再传个 suit: true
|
||||
const httpResponse = await FittingRoomApi.tryOnApi({
|
||||
modelId: this.currentModel.id,
|
||||
modelImageUrl: this.currentModel.fileUrl,
|
||||
clothUrl: this.currentClothes[0]?.fileUrl,
|
||||
kuziUrl: this.currentClothes?.[1]?.fileUrl ? this.currentClothes[1]?.fileUrl : undefined,
|
||||
suit: this.currentClothes?.[1]?.fileUrl ? true : undefined,
|
||||
});
|
||||
const httpResponse =
|
||||
this.tab === 6
|
||||
? await FittingRoomApi.hairstyleTryOnApi({
|
||||
modelId: this.currentModel.id,
|
||||
files: this.currentModel.fileUrl,
|
||||
isHr: true,
|
||||
hairIds: this.currentClothes[0]?.clothId,
|
||||
sex: 'female',
|
||||
})
|
||||
: await FittingRoomApi.tryOnApi({
|
||||
modelId: this.currentModel.id,
|
||||
modelImageUrl: this.currentModel.fileUrl,
|
||||
clothUrl: this.currentClothes[0]?.fileUrl,
|
||||
kuziUrl: this.currentClothes?.[1]?.fileUrl
|
||||
? this.currentClothes[1]?.fileUrl
|
||||
: undefined,
|
||||
suit: this.currentClothes?.[1]?.fileUrl ? true : undefined,
|
||||
});
|
||||
if (httpResponse.code !== 0) {
|
||||
sheep.$helper.toast(httpResponse.msg);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user