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 定义结构
@@ -1,8 +1,8 @@
|
|||||||
import { request } from "../../http/index.js";
|
import { request } from "../../http/index.js";
|
||||||
let baseUrl = "https://llshop.zglvling.com/soapi/";
|
let baseUrl = "https://llshop.zglvling.com/soapi/";
|
||||||
// let baseUrl = "https://test.zglvling.com/soapi/";
|
// let baseUrl = "https://test.zglvling.com/soapi/";
|
||||||
// const praiseTextApi = (params) =>
|
const praiseTextApi = (params) =>
|
||||||
// request.post(baseUrl + "ai/praiseTexttwo", params);
|
request.post(baseUrl + "ai/praiseTexttwo", params);
|
||||||
const userFaceInoApi = (params) =>
|
const userFaceInoApi = (params) =>
|
||||||
request.post(baseUrl + "userinfo/get_user_face_info", params);
|
request.post(baseUrl + "userinfo/get_user_face_info", params);
|
||||||
const hairstyleListApi = (params) =>
|
const hairstyleListApi = (params) =>
|
||||||
|
|||||||
@@ -399,16 +399,6 @@ import {
|
|||||||
faceList,
|
faceList,
|
||||||
shengxiaoImgList,
|
shengxiaoImgList,
|
||||||
} from "./database";
|
} from "./database";
|
||||||
import {
|
|
||||||
praiseTextApi,
|
|
||||||
userFaceInoApi,
|
|
||||||
exchangeHairHistoryByTaskId,
|
|
||||||
wardrobeListApi,
|
|
||||||
getStyleApi,
|
|
||||||
hairStyleListApi,
|
|
||||||
addHairApi,
|
|
||||||
getHairApi,
|
|
||||||
} from "./api";
|
|
||||||
import {
|
import {
|
||||||
uploadFormData,
|
uploadFormData,
|
||||||
downloadFile,
|
downloadFile,
|
||||||
@@ -426,6 +416,16 @@ import CustomSwiper from "./component/CustomSwiper/CustomSwiper";
|
|||||||
import SensoryTypes from "./component/FirstStyleType/SensoryTypes.vue";
|
import SensoryTypes from "./component/FirstStyleType/SensoryTypes.vue";
|
||||||
import TypeOfMass from "./component/FirstStyleType/TypeOfMass.vue";
|
import TypeOfMass from "./component/FirstStyleType/TypeOfMass.vue";
|
||||||
import Movementtype from "./component/FirstStyleType/Movementtype.vue";
|
import Movementtype from "./component/FirstStyleType/Movementtype.vue";
|
||||||
|
import ReportApi from "../../sheep/api/report";
|
||||||
|
const {
|
||||||
|
praiseTextApi,
|
||||||
|
getStyleApi,
|
||||||
|
exchangeHairHistoryByTaskId,
|
||||||
|
wardrobeListApi,
|
||||||
|
hairStyleListApi,
|
||||||
|
addHairApi,
|
||||||
|
getHairApi,
|
||||||
|
} = ReportApi;
|
||||||
// if (
|
// if (
|
||||||
// typeof window !== "undefined" &&
|
// typeof window !== "undefined" &&
|
||||||
// /MicroMessenger/i.test(navigator.userAgent)
|
// /MicroMessenger/i.test(navigator.userAgent)
|
||||||
@@ -1105,7 +1105,7 @@ const getHair = async (data) => {
|
|||||||
return res.data;
|
return res.data;
|
||||||
};
|
};
|
||||||
const getUserFaceInfo = async () => {
|
const getUserFaceInfo = async () => {
|
||||||
userFaceInoApi({ openId: openId }).then(async (res) => {
|
getStyleApi({ openId: openId }).then(async (res) => {
|
||||||
newColorTypeList.value = reorderByValue(
|
newColorTypeList.value = reorderByValue(
|
||||||
colorTypeList,
|
colorTypeList,
|
||||||
res?.detail?.sj_color_type
|
res?.detail?.sj_color_type
|
||||||
|
|||||||
@@ -1,21 +1,45 @@
|
|||||||
import request from '@/sheep/request';
|
import request from '@/sheep/request';
|
||||||
|
|
||||||
const ReportApi = {
|
const ReportApi = {
|
||||||
// 查询分类列表
|
getHairApi: (data) => {
|
||||||
getCategoryList: () => {
|
return request({
|
||||||
return request({
|
url: '/userinfo/get_hair_data', method: 'POST', data: data,
|
||||||
url: '/product/category/list',
|
});
|
||||||
method: 'GET',
|
},
|
||||||
});
|
addHairApi: (data) => {
|
||||||
},
|
return request({
|
||||||
// 查询分类列表,指定编号
|
url: '/userinfo/add_hair_data', method: 'POST', data: data,
|
||||||
getCategoryListByIds: (ids) => {
|
});
|
||||||
return request({
|
},
|
||||||
url: '/product/category/list-by-ids',
|
getStyleApi: (data) => {
|
||||||
method: 'GET',
|
return request({
|
||||||
params: { ids },
|
url: '/userinfo/get_user_face_info', method: 'POST', data: data,
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
};
|
praiseTextApi: (data) => {
|
||||||
|
return request({
|
||||||
export default ReportApi;
|
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
|
||||||
|
|||||||
|
After Width: | Height: | Size: 477 KiB |
|
After Width: | Height: | Size: 537 KiB |
|
After Width: | Height: | Size: 507 KiB |
|
After Width: | Height: | Size: 543 KiB |
|
After Width: | Height: | Size: 575 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 531 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 631 KiB |
|
After Width: | Height: | Size: 577 KiB |
|
After Width: | Height: | Size: 498 KiB |