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";
|
||||
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) =>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
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 |