refactor(report): 重构报告页面 API 调用

-将 pages/report/api.js 中的 API 定义移动到 sheep/api/report/index.js
- 更新 pages/report/index.vue 中的 API 调用引用
- 删除 pages/report/api.js 中的未使用 API 定义
- 优化 sheep/api/report/index.js 中的 API 定义结构
This commit is contained in:
liguigong
2025-09-15 11:38:40 +08:00
parent 918d89eeae
commit 9802ad9812
14 changed files with 55 additions and 31 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
import { request } from "../../http/index.js";
let baseUrl = "https://llshop.zglvling.com/soapi/";
// let baseUrl = "https://test.zglvling.com/soapi/";
// const praiseTextApi = (params) =>
// request.post(baseUrl + "ai/praiseTexttwo", params);
const praiseTextApi = (params) =>
request.post(baseUrl + "ai/praiseTexttwo", params);
const userFaceInoApi = (params) =>
request.post(baseUrl + "userinfo/get_user_face_info", params);
const hairstyleListApi = (params) =>
+11 -11
View File
@@ -399,16 +399,6 @@ import {
faceList,
shengxiaoImgList,
} from "./database";
import {
praiseTextApi,
userFaceInoApi,
exchangeHairHistoryByTaskId,
wardrobeListApi,
getStyleApi,
hairStyleListApi,
addHairApi,
getHairApi,
} from "./api";
import {
uploadFormData,
downloadFile,
@@ -426,6 +416,16 @@ import CustomSwiper from "./component/CustomSwiper/CustomSwiper";
import SensoryTypes from "./component/FirstStyleType/SensoryTypes.vue";
import TypeOfMass from "./component/FirstStyleType/TypeOfMass.vue";
import Movementtype from "./component/FirstStyleType/Movementtype.vue";
import ReportApi from "../../sheep/api/report";
const {
praiseTextApi,
getStyleApi,
exchangeHairHistoryByTaskId,
wardrobeListApi,
hairStyleListApi,
addHairApi,
getHairApi,
} = ReportApi;
// if (
// typeof window !== "undefined" &&
// /MicroMessenger/i.test(navigator.userAgent)
@@ -1105,7 +1105,7 @@ const getHair = async (data) => {
return res.data;
};
const getUserFaceInfo = async () => {
userFaceInoApi({ openId: openId }).then(async (res) => {
getStyleApi({ openId: openId }).then(async (res) => {
newColorTypeList.value = reorderByValue(
colorTypeList,
res?.detail?.sj_color_type
+42 -18
View File
@@ -1,21 +1,45 @@
import request from '@/sheep/request';
const ReportApi = {
// 查询分类列表
getCategoryList: () => {
return request({
url: '/product/category/list',
method: 'GET',
});
},
// 查询分类列表,指定编号
getCategoryListByIds: (ids) => {
return request({
url: '/product/category/list-by-ids',
method: 'GET',
params: { ids },
});
},
};
export default ReportApi;
getHairApi: (data) => {
return request({
url: '/userinfo/get_hair_data', method: 'POST', data: data,
});
},
addHairApi: (data) => {
return request({
url: '/userinfo/add_hair_data', method: 'POST', data: data,
});
},
getStyleApi: (data) => {
return request({
url: '/userinfo/get_user_face_info', method: 'POST', data: data,
})
},
praiseTextApi: (data) => {
return request({
url: '/ai/praiseTexttwo', method: 'POST', data: data,
})
},
wardrobeListApi: (data) => {
return request({
url: '/wardrobe/clothes_list', method: 'POST', data: data,
})
},
exchangeHairApi: (data) => {
return request({
url: '/api/v1/test/exchangeHair', method: 'POST', data: data,
})
},
exchangeHairHistoryByTaskId: (data) => {
return request({
url: '/api/v1/test/exchangeHairHistoryByTaskId', method: 'POST', data: data,
})
},
hairStyleListApi: (data) => {
return request({
url: '/api/v1/test/getHairDetails', method: 'POST', data: data,
})
}
}
export default ReportApi
Binary file not shown.

After

Width:  |  Height:  |  Size: 477 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 498 KiB