选择风格变为生成四个,调整渐变按钮样式
This commit is contained in:
@@ -48,11 +48,11 @@ const {} = toRefs(data);
|
||||
left: 50%;
|
||||
border-radius: var(--gradientButtonBorderRadius);
|
||||
transform: translate(-50%, -50%);
|
||||
background: linear-gradient(125deg,
|
||||
#f1f1f1 0%,
|
||||
#000 40%,
|
||||
#000 65%,
|
||||
#fff 100%);
|
||||
background: linear-gradient(156deg,
|
||||
#d3d3d3 0%,
|
||||
#8a8682 40%,
|
||||
#8a8682 65%,
|
||||
#ebebeb 100%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -82,22 +82,11 @@ const {} = toRefs(data);
|
||||
</div>
|
||||
<div class="mask" v-if="item.id == select?.oldId"></div>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<!-- <div>
|
||||
<SvgIcon v-if="!item.isLike" @click.stop="setLike(item,'like')" name="noLike" size="30" />
|
||||
<SvgIcon v-else name="like" @click.stop="setLike(item,'noLike')" color="#FF4949" size="30" />
|
||||
</div> -->
|
||||
<!-- <div class="btn">
|
||||
<div>
|
||||
<SvgIcon @click.stop="updateStyle(item,index)" name="update" size="30" />
|
||||
</div>
|
||||
<!-- <div>
|
||||
<SvgIcon v-if="!item.isAdd" @click.stop="addLibrary(item,'add')" name="add" size="30" />
|
||||
<SvgIcon v-else @click.stop="addLibrary(item,'delete')" name="confirmation" size="30" />
|
||||
</div> -->
|
||||
<!-- <div>
|
||||
<SvgIcon @click.stop="deleteStyle(index)" name="delete" size="30" />
|
||||
</div> -->
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -109,7 +98,7 @@ const {} = toRefs(data);
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
> .item{
|
||||
width: calc(50% - 3.1rem / 2);
|
||||
width: calc(50% - 3.5rem / 2);
|
||||
position: relative;
|
||||
// margin-bottom: 3.3rem;
|
||||
display: flex;
|
||||
@@ -126,7 +115,7 @@ const {} = toRefs(data);
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
height: 45rem;
|
||||
margin: 2.4rem 0;
|
||||
margin: 2.3rem 0;
|
||||
background-color: #fff;
|
||||
justify-content: center;
|
||||
border: .6px solid #acacac;
|
||||
@@ -170,26 +159,26 @@ const {} = toRefs(data);
|
||||
// max-height: 50%;
|
||||
}
|
||||
}
|
||||
> .btn{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
> div{
|
||||
color: #000;
|
||||
margin-right: 1.2rem;
|
||||
border-radius: 50%;
|
||||
width: 5.2rem;
|
||||
height: 5.2rem;
|
||||
padding: 1rem;
|
||||
background-color: #fff;
|
||||
&:last-child{
|
||||
margin-right: 0rem;
|
||||
}
|
||||
&:hover{
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
// > .btn{
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// justify-content: flex-end;
|
||||
// > div{
|
||||
// color: #000;
|
||||
// margin-right: 1.2rem;
|
||||
// border-radius: 50%;
|
||||
// width: 5.2rem;
|
||||
// height: 5.2rem;
|
||||
// padding: 1rem;
|
||||
// background-color: #fff;
|
||||
// &:last-child{
|
||||
// margin-right: 0rem;
|
||||
// }
|
||||
// &:hover{
|
||||
// color: #000;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -121,7 +121,7 @@ const router = createRouter({
|
||||
{
|
||||
path: '/workshop/selectStyle',
|
||||
name: 'selectStyle',
|
||||
component: () => import('../views/Workshop/selectStyle.vue'),
|
||||
component: () => import('../views/Workshop/selectStyle/index.vue'),
|
||||
meta: { verify: () => VerifyIDs(2) }
|
||||
},
|
||||
{
|
||||
|
||||
@@ -15,7 +15,12 @@ export const useGenerateStore = defineStore({
|
||||
isLike: false, //是否喜欢
|
||||
status: ''
|
||||
},
|
||||
styleList: [{}, {}, {}, {}],
|
||||
styleList: [
|
||||
{id:'',taskId:'',status:'',path:''},
|
||||
{id:'',taskId:'',status:'',path:''},
|
||||
{id:'',taskId:'',status:'',path:''},
|
||||
{id:'',taskId:'',status:'',path:''},
|
||||
],
|
||||
model: {
|
||||
id: ''
|
||||
},
|
||||
@@ -98,6 +103,12 @@ export const useGenerateStore = defineStore({
|
||||
taskId:'',
|
||||
status: ''
|
||||
}
|
||||
this.styleList = [
|
||||
{id:'',taskId:'',status:'',path:''},
|
||||
{id:'',taskId:'',status:'',path:''},
|
||||
{id:'',taskId:'',status:'',path:''},
|
||||
{id:'',taskId:'',status:'',path:''},
|
||||
]
|
||||
},
|
||||
//模特相关
|
||||
selectModel(data: any) {
|
||||
@@ -107,7 +118,12 @@ export const useGenerateStore = defineStore({
|
||||
this.isGenerate = isGenerate
|
||||
},
|
||||
clearProductData() {
|
||||
this.styleList = [{}, {}, {}, {}]
|
||||
this.styleList = [
|
||||
{id:'',taskId:'',status:'',path:''},
|
||||
{id:'',taskId:'',status:'',path:''},
|
||||
{id:'',taskId:'',status:'',path:''},
|
||||
{id:'',taskId:'',status:'',path:''},
|
||||
]
|
||||
this.style = {
|
||||
id: '',
|
||||
path: '',
|
||||
|
||||
@@ -22,20 +22,6 @@ const navDisabledList = ref([])
|
||||
// const data = reactive({
|
||||
// })
|
||||
|
||||
const clickSwitchVIPID = ()=>{
|
||||
showConfirmDialog({
|
||||
title: 'Switch VIP ID?',
|
||||
message: 'You have unsaved changes. Your progress will be lost.',
|
||||
confirmButtonText: 'Yes',
|
||||
cancelButtonText: 'Cancel',
|
||||
})
|
||||
.then(() => {
|
||||
MyEvent.emit('clear-generate-state')
|
||||
MyEvent.emit('clearAllCache')
|
||||
router.push({ name: 'customer', query: { demo: 1 } })
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
const openFlow = (item: any)=>{
|
||||
item.click && item.click()
|
||||
const query = route.query
|
||||
|
||||
@@ -21,8 +21,11 @@
|
||||
<header-title @clickProfile="handleClickProfile" />
|
||||
<RouteCache />
|
||||
<footer-navigation v-if="notShowFooter" />
|
||||
<template>
|
||||
<profile ref="profileRef" />
|
||||
</template>
|
||||
</div>
|
||||
<profile ref="profileRef" />
|
||||
|
||||
</template>
|
||||
<style scoped lang="less">
|
||||
.workshop {
|
||||
|
||||
@@ -13,7 +13,7 @@ const props = defineProps<{
|
||||
|
||||
const userInfoStore = useUserInfoStore()
|
||||
const overallStore = useOverallStore()
|
||||
const emit = defineEmits(['view-type', 'selected-customer'])
|
||||
const emit = defineEmits(['selected-customer'])
|
||||
const show = ref(false)
|
||||
const isEdit = ref(false)
|
||||
const form = reactive({
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, reactive, toRefs, computed, ref } from "vue";
|
||||
import SelectItem from "@/components/selectStyle/selectItem.vue";
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { useGenerateStore, useUserInfoStore, useHGenerateStore } from '@/stores'
|
||||
import { showToast } from 'vant';
|
||||
@@ -9,7 +8,7 @@ import { generateRequestOutfit, getRequestOutfit, setStyleFavorite, cancelStyleF
|
||||
import { FlowType, IsHistoryFlow } from '@/types/enum'
|
||||
import GenerateLoading from '@/views/asistant/components/GenerateLoading.vue'
|
||||
import gradientButton from '@/components/gradientButton.vue'
|
||||
|
||||
import StyleListDom from '@/views/Workshop/selectStyle/styleList.vue'
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
//const props = defineProps({
|
||||
@@ -35,7 +34,10 @@ const loadingTitle = computed(()=>{
|
||||
|
||||
let data = reactive({
|
||||
select:computed(()=>generateStore.style),
|
||||
// styleList:computed(()=>generateStore.styleList),
|
||||
styleList:computed(()=>generateStore.styleList),
|
||||
})
|
||||
let dataDom = reactive({
|
||||
styleListVue:null,
|
||||
})
|
||||
|
||||
let getGenerateTime = null as any
|
||||
@@ -43,7 +45,7 @@ let getGenerateTime = null as any
|
||||
const updateStyle = ()=>{
|
||||
// generateStore.updateStyle(item)
|
||||
// data.styleList[index] = {}
|
||||
requestOutfit({num:1})
|
||||
requestOutfit({num:4})
|
||||
}
|
||||
const setLikeStyle = (likeStyle)=>{
|
||||
if(!select.value.id)return
|
||||
@@ -74,7 +76,7 @@ const toProduct = ()=>{
|
||||
}
|
||||
|
||||
const requestOutfit = async ({num})=>{
|
||||
let rv = await new Promise<void>((resolve, reject) => {
|
||||
let rv:any = await new Promise<void>((resolve, reject) => {
|
||||
if(isHistoryFlow.value){
|
||||
retrieveAndRegenerate({tryOnEffectsId:hGenerateStore.originalTryOn.id}).then((rv:any)=>{
|
||||
resolve(rv)
|
||||
@@ -96,42 +98,60 @@ const requestOutfit = async ({num})=>{
|
||||
isLoading.value = true
|
||||
generateStore.clearStyle()
|
||||
data.select.taskId = rv[0]
|
||||
rv.forEach((item,index)=>data.styleList[index].taskId = item)
|
||||
getRequestOutfitList(rv)
|
||||
}
|
||||
|
||||
const getRequestOutfitList = (generateList)=>{
|
||||
let value = {requestIDs:generateList.join(',')}
|
||||
getRequestOutfit(value).then((rv:any)=>{
|
||||
let selectIndex = rv.findIndex((item)=>item.requestId == data.select.taskId)
|
||||
if(selectIndex != -1){
|
||||
data.select.id = rv[selectIndex].id
|
||||
data.select.path = rv[selectIndex].path
|
||||
data.select.status = rv[selectIndex].status
|
||||
}
|
||||
rv.forEach((item)=>{
|
||||
data.select.id = item.id
|
||||
data.select.path = item.path
|
||||
data.select.status = item.status
|
||||
let index = data.styleList.findIndex((styleListItem)=>styleListItem?.taskId == item.requestId)
|
||||
data.styleList[index] = {
|
||||
id: item.id,
|
||||
taskId: item.requestId,
|
||||
status: item.status,
|
||||
path: item.path,
|
||||
}
|
||||
})
|
||||
|
||||
if(['RUNNING','PENDING'].includes(data.select.status)){
|
||||
// if(['SUCCEEDED'].includes(data.select.status))isLoading.value = false
|
||||
const taskIdList = data.styleList
|
||||
.filter(item => item?.taskId && item?.status !== 'SUCCEEDED')
|
||||
.map(item => item.taskId);
|
||||
if(taskIdList.length > 0){
|
||||
getGenerateTime = setTimeout(()=>{
|
||||
getRequestOutfitList([data.select.taskId])
|
||||
getRequestOutfitList(taskIdList)
|
||||
},3000)
|
||||
}else{
|
||||
isLoading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const styleListInit = ()=>{
|
||||
dataDom.styleListVue.init(data.select)
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
// generateStore.clearProductData()
|
||||
|
||||
emit('view-type', 1)
|
||||
// if(!data.styleList[0]?.id)getRequestOutfitList(0)
|
||||
if(getGenerateTime)clearTimeout(getGenerateTime)
|
||||
if(data.select.status == 'SUCCEEDED'){
|
||||
const taskIdList = data.styleList
|
||||
.filter(item => item?.taskId && item?.status !== 'SUCCEEDED')
|
||||
.map(item => item.taskId);
|
||||
if(data.select.status == 'SUCCEEDED' && taskIdList.length == 0){
|
||||
return
|
||||
}else if(!data.select?.taskId){
|
||||
requestOutfit({num:1})
|
||||
}else if(data.select.status != 'SUCCEEDED'){
|
||||
isLoading.value = true
|
||||
// let generateList = [data.styleList[0].taskId]
|
||||
getRequestOutfitList([data.select.taskId])
|
||||
requestOutfit({num:4})
|
||||
}else if(data.select.status != 'SUCCEEDED' || taskIdList.length > 0){
|
||||
if(data.select.status != 'SUCCEEDED')isLoading.value = true
|
||||
getRequestOutfitList(taskIdList)
|
||||
}
|
||||
})
|
||||
onUnmounted(()=>{
|
||||
@@ -139,6 +159,7 @@ onUnmounted(()=>{
|
||||
})
|
||||
defineExpose({})
|
||||
const { select } = toRefs(data);
|
||||
const { styleListVue } = toRefs(dataDom);
|
||||
</script>
|
||||
<template>
|
||||
<div class="selectStyle">
|
||||
@@ -155,14 +176,24 @@ const { select } = toRefs(data);
|
||||
<div class="imgBox">
|
||||
<img :src="select.path" alt="">
|
||||
</div>
|
||||
<div class="btn">
|
||||
<div class="chooseMore" @click.stop="styleListInit">
|
||||
<gradientButton>
|
||||
<template #content>
|
||||
<div class="text">
|
||||
Choose More
|
||||
</div>
|
||||
</template>
|
||||
</gradientButton>
|
||||
<div></div>
|
||||
</div>
|
||||
<!-- <div class="btn">
|
||||
<div class="like" @click.stop="setLikeStyle(select.isLike)">
|
||||
<SvgIcon :name="`love_${select.isLike?1:0}`" size="35" />
|
||||
</div>
|
||||
<div class="down" @click.stop="setDownload()">
|
||||
<SvgIcon name="download" size="35" />
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="btn">
|
||||
<div class="btnItem style1" @click.stop="updateStyle()">
|
||||
@@ -174,7 +205,6 @@ const { select } = toRefs(data);
|
||||
</span>
|
||||
Re-try
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</gradientButton>
|
||||
</div>
|
||||
@@ -185,6 +215,7 @@ const { select } = toRefs(data);
|
||||
<div class="loading-container" v-if="isLoading">
|
||||
<GenerateLoading :title="loadingTitle"/>
|
||||
</div>
|
||||
<StyleListDom ref="styleListVue"></StyleListDom>
|
||||
</template>
|
||||
<style lang="less" scoped>
|
||||
.header-title {
|
||||
@@ -235,18 +266,28 @@ const { select } = toRefs(data);
|
||||
.selectContent{
|
||||
// padding: 0 4rem;
|
||||
margin: 0 auto;
|
||||
overflow: auto;
|
||||
width: 73.7rem;
|
||||
margin-bottom: 19.4rem;
|
||||
margin-bottom: 19rem;
|
||||
> .imgBox{
|
||||
height: 73.7rem;
|
||||
width: 100%;
|
||||
margin-bottom: 4.4rem;
|
||||
margin-bottom: 5.6rem;
|
||||
> img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
> .chooseMore{
|
||||
--borderRadius: 5.4rem;
|
||||
--borderWidth: 2px;
|
||||
width: 24.8rem;
|
||||
margin: 0 auto;
|
||||
height: 7.6rem;
|
||||
.text{
|
||||
font-size: 3.1rem;
|
||||
font-family: satoshiMedium;
|
||||
}
|
||||
}
|
||||
> .btn{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
120
src/views/Workshop/selectStyle/styleList.vue
Normal file
120
src/views/Workshop/selectStyle/styleList.vue
Normal file
@@ -0,0 +1,120 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, onUnmounted, reactive, toRefs } from "vue";
|
||||
import SelectItem from "@/components/selectStyle/selectItem.vue";
|
||||
import { useGenerateStore, } from '@/stores'
|
||||
//const props = defineProps({
|
||||
//})
|
||||
//const emit = defineEmits([
|
||||
//])
|
||||
const generateStore = useGenerateStore()
|
||||
|
||||
|
||||
let data = reactive({
|
||||
showStyleList:false,
|
||||
list:computed(()=>generateStore.styleList),
|
||||
selectStyle:computed(()=>generateStore.style),
|
||||
oldSelectStyle:{} as any,
|
||||
})
|
||||
|
||||
const close = ()=>{
|
||||
showStyleList.value = false;
|
||||
}
|
||||
|
||||
const init = (item)=>{
|
||||
data.showStyleList = true
|
||||
data.oldSelectStyle = JSON.parse(JSON.stringify(item))
|
||||
}
|
||||
|
||||
const confirm = ()=>{
|
||||
if(data.selectStyle.id != data.oldSelectStyle.id){
|
||||
data.selectStyle.id = data.oldSelectStyle.id
|
||||
data.selectStyle.path = data.oldSelectStyle.path
|
||||
data.selectStyle.status = data.oldSelectStyle.status
|
||||
data.selectStyle.taskId = data.oldSelectStyle.taskId
|
||||
data.selectStyle.isLike = false
|
||||
}
|
||||
close();
|
||||
}
|
||||
|
||||
const setStyle = (item)=>{
|
||||
data.oldSelectStyle = item
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
})
|
||||
onUnmounted(()=>{
|
||||
})
|
||||
defineExpose({init})
|
||||
const {showStyleList,list,oldSelectStyle} = toRefs(data);
|
||||
</script>
|
||||
<template>
|
||||
<van-popup
|
||||
class="user-popup"
|
||||
v-model:show="showStyleList"
|
||||
round
|
||||
position="bottom"
|
||||
teleport="body"
|
||||
>
|
||||
<div class="profile">
|
||||
<div class="header">
|
||||
<span class="title">Outfit Result</span>
|
||||
<van-icon name="cross" class="close" @click="close" />
|
||||
</div>
|
||||
<div class="content">
|
||||
<SelectItem :selectList="list" :select="oldSelectStyle" @selectItem="setStyle"></SelectItem>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<div @click="confirm">Confirm</div>
|
||||
</div>
|
||||
</div>
|
||||
</van-popup>
|
||||
</template>
|
||||
<style lang="less" scoped>
|
||||
.van-popup {
|
||||
max-height: 90%;
|
||||
--van-popup-round-radius: 7.8rem;
|
||||
}
|
||||
.profile {
|
||||
margin: 11.1rem 0 5.6rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
> .header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
padding: 0 8rem 0 5.2rem;
|
||||
margin-bottom: 8rem;
|
||||
> .title {
|
||||
font-family: satoshiBold;
|
||||
font-size: 4.6rem;
|
||||
color: #181725;
|
||||
}
|
||||
> .close {
|
||||
margin-left: auto;
|
||||
font-size: 5rem;
|
||||
color: #a1a1a1;
|
||||
}
|
||||
}
|
||||
> .content{
|
||||
width: 96.2rem;
|
||||
}
|
||||
> .bottom{
|
||||
margin: 3rem 0 4rem;
|
||||
width: 100%;
|
||||
> div{
|
||||
width: 24.8rem;
|
||||
line-height: 6.7rem;
|
||||
font-family: satoshiMedium;
|
||||
font-size: 3.6rem;
|
||||
text-align: center;
|
||||
border-radius: .7rem;
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
margin-right: 4.2rem;
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -113,7 +113,7 @@ onMounted(() => {
|
||||
.loading-image {
|
||||
width: 36.4rem;
|
||||
height: 36.4rem;
|
||||
animation: rotate 1s linear infinite;
|
||||
animation: rotate 1.5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.loading-shadow {
|
||||
@@ -146,11 +146,14 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
@keyframes rotate {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
0% {
|
||||
transform: translateY(0px);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
50% {
|
||||
transform: translateY(-100px);
|
||||
}
|
||||
100% {
|
||||
transform: translateY(0px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user