diff --git a/src/api/workshop.ts b/src/api/workshop.ts
index 1032a94..9e27bb0 100644
--- a/src/api/workshop.ts
+++ b/src/api/workshop.ts
@@ -8,26 +8,26 @@ import request from '@/utils/request'
* @param data.stylist 提示词
* @param data.gender 原始试穿效果id
* @param data.num 是否重新生成 0-否,1-是
-*/
+ */
export function generateRequestOutfit(data: Object) {
- return request({
- url: '/api/style/requestOutfit',
- method: 'post',
- data,
- })
+ return request({
+ url: '/api/style/requestOutfit',
+ method: 'post',
+ data
+ })
}
/**
* 获取传达风格
* @param data 获取传达风格数据
* @param data.requestIDs 获取生成结果的taskId
-*/
+ */
export function getRequestOutfit(data: Object) {
- return request({
- url: '/api/style/getOutfitResult',
- method: 'get',
- params:data
- })
+ return request({
+ url: '/api/style/getOutfitResult',
+ method: 'get',
+ params: data
+ })
}
/**
@@ -41,13 +41,13 @@ export function getRequestOutfit(data: Object) {
* @param data.prompt 提示词
* @param data.originalTryOnId 原始试穿效果id
* @param data.isRegenerated 是否重新生成 0-否,1-是
-*/
+ */
export function generateTryOnEffect(data: Object) {
- return request({
- url: '/api/try-on-effects/generate',
- method: 'post',
- data,
- })
+ return request({
+ url: '/api/try-on-effects/generate',
+ method: 'post',
+ data
+ })
}
/**
* 生成试穿效果-演示
@@ -55,13 +55,13 @@ export function generateTryOnEffect(data: Object) {
* @param data.customerPhotoId 顾客照片id
* @param data.prompt 提示词
* @param data.tryonUrl AI魔改url
-*/
+ */
export function generateTryOnEffectDemo(data: Object) {
- return request({
- url: '/api/try-on-effects/reFace',
- method: 'post',
- data,
- })
+ return request({
+ url: '/api/try-on-effects/reFace',
+ method: 'post',
+ data
+ })
}
/** 上传图片-AI换脸
@@ -71,56 +71,111 @@ export function generateTryOnEffectDemo(data: Object) {
* @param data.file 顾客照片文件
*/
export function uploadCustomerPhoto(data: FormData) {
- return request({
- url: '/api/customer-photos/upload',
- method: 'post',
- data,
- loading: true,
- })
+ return request({
+ url: '/api/customer-photos/upload',
+ method: 'post',
+ data,
+ loading: true
+ })
}
/**
* 设置喜欢
* @param tryOnId 试穿效果id
-*/
+ */
export function setTryOnEffectFavorite(tryOnId: string | number) {
- if (!tryOnId) return Promise.reject('试穿效果id不能为空');
- return request({
- url: `/api/try-on-effects/set-favorite/${tryOnId}`,
- method: 'post',
- })
+ if (!tryOnId) return Promise.reject('试穿效果id不能为空')
+ return request({
+ url: `/api/try-on-effects/set-favorite/${tryOnId}`,
+ method: 'post'
+ })
}
/**
* 取消喜欢
* @param tryOnId 试穿效果id
-*/
+ */
export function cancelTryOnEffectFavorite(tryOnId: string | number) {
- if (!tryOnId) return Promise.reject('试穿效果id不能为空');
- return request({
- url: `/api/try-on-effects/cancel-favorite/${tryOnId}`,
- method: 'post',
- })
+ if (!tryOnId) return Promise.reject('试穿效果id不能为空')
+ return request({
+ url: `/api/try-on-effects/cancel-favorite/${tryOnId}`,
+ method: 'post'
+ })
}
/** 查询进店记录-library
* @param customerId 客户id
*/
export function getCustomerPhotos(customerId: string | number) {
- if (!customerId) return Promise.reject('客户id不能为空');
- return request({
- url: `/api/visit-records/customer/${customerId}`,
- method: 'get',
- })
+ if (!customerId) return Promise.reject('客户id不能为空')
+ return request({
+ url: `/api/visit-records/customer/${customerId}`,
+ method: 'get'
+ })
}
/** 删除进店记录-library
* @param visitRecordId 进店记录id
*/
export function deleteCustomerPhoto(visitRecordId: string | number) {
- if (!visitRecordId) return Promise.reject('进店记录id不能为空');
+ if (!visitRecordId) return Promise.reject('进店记录id不能为空')
+ return request({
+ url: `/api/visit-records/${visitRecordId}`,
+ method: 'delete'
+ // loading: true,
+ })
+}
+/** 查询收藏列表
+ * @param visitRecordId 进店记录id
+ */
+export function getTryOnEffectFavoriteList(visitRecordId: string | number) {
+ if (!visitRecordId) return Promise.reject('进店记录id不能为空')
+ return request({
+ url: `/api/try-on-effects/favorites/${visitRecordId}`,
+ method: 'get'
+ })
+}
+/** 查询某套试穿效果列表
+ * @param styleId 服装id
+ */
+export function getTryOnEffectStyleList(styleId: string | number) {
+ if (!styleId) return Promise.reject('服装id不能为空')
+ return request({
+ url: `/api/try-on-effects/style/${styleId}`,
+ method: 'get'
+ })
+}
+
+// 获取当前Sales名下的customers列表
+export interface CustomerListParams {
+ current: number
+ size: number
+ desc: boolean
+ sortField?: 'createTime'
+ sortOrder?: 'DESC' | 'ASC'
+ keyword?: string
+ startTime?: string
+ endTime?: string
+ status?: number
+ offset?: number
+ limit?: number
+}
+export const getCustomerList = (data: CustomerListParams) => {
+ return request({
+ url: '/api/customers/getAllCustomer',
+ method: 'post',
+ data
+ })
+}
+
+// 创建顾客
+export interface CreateCustomerParams {
+ nickname: string
+ vipId: string
+}
+export const createCustomer = (data: CreateCustomerParams) => {
return request({
- url: `/api/visit-records/${visitRecordId}`,
- method: 'delete',
- // loading: true,
- })
+ url: '/api/customers/createCustomer',
+ method: 'get',
+ params: data
+ })
}
// /** 查询收藏列表
@@ -162,19 +217,19 @@ export function getGenerateHistoricals(params: Object) {
interface CustomerInfo {
vipId: string
}
-export const customerCheckin = (data: CustomerInfo) => {
- return request({
- url: '/api/customers/checkIn',
- method: 'get',
- params: data,
- })
+export const customerCheckin = (data: CustomerInfo) => {
+ return request({
+ url: '/api/customers/checkIn',
+ method: 'get',
+ params: data
+ })
}
// AI对话
interface AIConversation {
- message: string
- sessionId: string | number //用户ID
- gender: 'male' | 'female' //性别
+ message: string
+ sessionId: string | number //用户ID
+ gender: 'male' | 'female' //性别
}
export const streamChatAddress = '/api/llm/streamChat'
@@ -185,11 +240,46 @@ export const streamChatAddress = '/api/llm/streamChat'
* @param data.visitRecordId 进店记录id
* @param data.customerId 顾客id
* @param data.suggestion 意见和建议
-*/
+ */
export function addTryOnEffectComment(data: Object) {
return request({
url: '/api/try-on-effects/add-comment',
method: 'post',
data,
})
-}
\ No newline at end of file
+}
+
+/**
+ * like outfit接口
+ * @param styleId 设置like的styleid
+*/
+export function setStyleFavorite(styleId: Object) {
+ return request({
+ url: `/api/style/set-favorite/${styleId}`,
+ method: 'post',
+ })
+}
+
+/**
+ * 取消like outfit接口
+ * @param styleId 取消like的styleid
+*/
+export function cancelStyleFavorite(styleId: Object) {
+ return request({
+ url: `/api/style/cancel-favorite/${styleId}`,
+ method: 'post',
+ })
+}
+
+/**
+ * try on 返推outfitId
+ * @param tryOnEffectsId tryOnId
+*/
+export function retrieveAndRegenerate(data: Object) {
+ return request({
+ url: `/api/style/retrieveAndRegenerate`,
+ method: 'get',
+ params: data,
+ })
+}
+
diff --git a/src/assets/icons/reTry.svg b/src/assets/icons/reTry.svg
new file mode 100644
index 0000000..230cd29
--- /dev/null
+++ b/src/assets/icons/reTry.svg
@@ -0,0 +1,9 @@
+
diff --git a/src/components/FooterNavigation.vue b/src/components/FooterNavigation.vue
index f9621a4..b807a97 100644
--- a/src/components/FooterNavigation.vue
+++ b/src/components/FooterNavigation.vue
@@ -25,13 +25,13 @@
})
.then(() => {
MyEvent.emit('clear-generate-state')
- MyEvent.emit('clearAllCache')
+ // MyEvent.emit('clearAllCache')
nav.path && router.push(nav.path)
})
.catch(() => {})
}
const navs = [
- { label: 'Home', icon: 'home', size: 73, path: '/workshop/home' },
+ { label: 'Home', icon: 'home', size: 73, path: '/workshop/home', on: onHome },
{ label: 'Library', icon: 'library', size: 53, path: '/workshop/library' },
// { label: 'Profile', icon: 'profile', size: 55, path: '/workshop/profile' }
]
diff --git a/src/components/gradientButton.vue b/src/components/gradientButton.vue
new file mode 100644
index 0000000..3acfb3a
--- /dev/null
+++ b/src/components/gradientButton.vue
@@ -0,0 +1,58 @@
+
+
+
-