diff --git a/src/api/workshop.ts b/src/api/workshop.ts
index 57ec94e..9e27bb0 100644
--- a/src/api/workshop.ts
+++ b/src/api/workshop.ts
@@ -242,9 +242,44 @@ export const streamChatAddress = '/api/llm/streamChat'
* @param data.suggestion 意见和建议
*/
export function addTryOnEffectComment(data: Object) {
- return request({
- url: '/api/try-on-effects/add-comment',
- method: 'post',
- data
- })
+ return request({
+ url: '/api/try-on-effects/add-comment',
+ method: 'post',
+ data,
+ })
}
+
+/**
+ * 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 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/router/index.ts b/src/router/index.ts
index 04c585e..f5ecdf9 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -121,7 +121,7 @@ const router = createRouter({
},
{
path: '/workshop/selectStyle',
- name: 'SelectStyle',
+ name: 'selectStyle',
component: () => import('../views/Workshop/selectStyle.vue'),
meta: { verify: ()=> VerifyIDs(2) }
},
@@ -133,7 +133,7 @@ const router = createRouter({
},
{
path: '/workshop/product',
- name: 'Product',
+ name: 'product',
component: () => import('../views/Workshop/product.vue'),
meta: { verify: ()=> VerifyIDs(4) }
},
diff --git a/src/stores/modules/generate.ts b/src/stores/modules/generate.ts
index 6b50236..72bf0f4 100644
--- a/src/stores/modules/generate.ts
+++ b/src/stores/modules/generate.ts
@@ -9,7 +9,10 @@ export const useGenerateStore = defineStore({
return {
style: {
id: '',
- oldId: '' //表示从生成页面返回回来,需要调整的样式id
+ path: '',
+ taskId:'',
+ isLike: false, //是否喜欢
+ status: ''
},
styleList: [{}, {}, {}, {}],
model: {
@@ -68,7 +71,7 @@ export const useGenerateStore = defineStore({
/** 进店记录id */
visitRecordId: (state) => state.customerInfo.visitRecordId,
/** 服装id */
- styleId: (state) => state.style.id || state.style.oldId,
+ styleId: (state) => state.style.id,
/** 模特照片id */
modelPhotoId: (state) => state.model.id,
/** 原始试穿id不包含魔改id */
@@ -82,23 +85,19 @@ export const useGenerateStore = defineStore({
},
actions: {
selectStyle(data: any) {
- this.style.id = data.id
- },
- //生成后去掉id 设置oldId来修改样式
- useStyleGenerate() {
- if (!this.style.id) return
- this.style.oldId = this.style.id
- // this.style.id = ''
- },
- updateStyle(data) {
- if (data.id == this.style.oldId) {
- this.style.oldId = ''
- }
- if(data.id == this.style.id) {
- this.style.id = ''
+ this.style = {
+ ...data,
}
- console.log(this.style)
},
+ clearStyle() {
+ this.style = {
+ id: '',
+ path: '',
+ isLike: false,
+ taskId:'',
+ status: ''
+ }
+ },
//模特相关
selectModel(data: any) {
this.model.id = data.id
@@ -110,7 +109,10 @@ export const useGenerateStore = defineStore({
this.styleList = [{}, {}, {}, {}]
this.style = {
id: '',
- oldId: ''
+ path: '',
+ isLike: false,
+ taskId:'',
+ status: ''
}
this.model = {
id: ''
diff --git a/src/utils/tools.ts b/src/utils/tools.ts
index 65a05ec..eac100e 100644
--- a/src/utils/tools.ts
+++ b/src/utils/tools.ts
@@ -156,4 +156,31 @@ export async function DownloadImages(list: Array<{ url: string, name?: string }>
*/
export function encryptPassword(password: string): string {
return CryptoJS.MD5(password).toString()
+}
+
+/**
+ * 图片分享到WhatsApp
+ * @param url 图片URL
+ * @returns 无
+ */
+export async function shareImageToWhatsapp (url: string){
+ // 把图片 URL 转为 Blob
+ const blob = await fetch(url).then((res) => res.blob())
+
+ // 创建文件对象
+ const file = new File([blob], 'image.jpg', { type: 'image/jpeg' })
+
+ // 判断浏览器是否支持文件分享
+ if (navigator.canShare && navigator.canShare({ files: [file] })) {
+ await navigator.share({
+ files: [file]
+ })
+ } else {
+ // 你可以附加一些自定义文本
+ const message = 'share image ' + url
+
+ // 构造WhatsApp链接
+ const whatsappLink = `https://api.whatsapp.com/send/?text=${encodeURIComponent(message)}`
+ window.open(whatsappLink, '_blank')
+ }
}
\ No newline at end of file
diff --git a/src/views/Workshop/homeNav.vue b/src/views/Workshop/homeNav.vue
index be86596..e78924b 100644
--- a/src/views/Workshop/homeNav.vue
+++ b/src/views/Workshop/homeNav.vue
@@ -58,7 +58,7 @@ onMounted(()=>{
flowTypeList: [FlowType.H_TRYON,FlowType.H_AI],
},
{
- path: 'recommended',
+ path: 'product',
imgPath: new URL('@/assets/images/nav2.png',import.meta.url).href,
flowTypeList: [FlowType.H_OUTFIT],
},
diff --git a/src/views/Workshop/product.vue b/src/views/Workshop/product.vue
index 1eb25dc..7b867ce 100644
--- a/src/views/Workshop/product.vue
+++ b/src/views/Workshop/product.vue
@@ -1,12 +1,10 @@
- What’s your Style?
+ Outfit Result
- Select the outfit that matches you the most.
+ Refine your Look
-
-
+
+
+
+
+
+
-
+
+
+
\ No newline at end of file
diff --git a/src/views/asistant/components/GenerateLoading.vue b/src/views/asistant/components/GenerateLoading.vue
index 05c7914..f5871b1 100644
--- a/src/views/asistant/components/GenerateLoading.vue
+++ b/src/views/asistant/components/GenerateLoading.vue
@@ -4,12 +4,19 @@
-
{{ title }}
+
@@ -54,6 +131,18 @@ const props = defineProps({
font-size: 4.8rem;
letter-spacing: 0.02em;
line-height: 124%;
+ position: relative;
+}
+
+.loading-dot{
+ height: 100%;
+ aspect-ratio: 1/1;
+ background: radial-gradient(ellipse 150% 150% at center, #ffffff,rgba(255,255,255,.4), transparent);
+ border-radius: 50%;
+ position: absolute;
+ top: 50%;
+ left: 0;
+ transform: translate(-100%, -50%);
}
@keyframes rotate {
diff --git a/src/views/asistant/index.vue b/src/views/asistant/index.vue
index 91dbaa2..2acd0ca 100644
--- a/src/views/asistant/index.vue
+++ b/src/views/asistant/index.vue
@@ -3,11 +3,8 @@
-
-
-
-
-