Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/lanecarford_front
All checks were successful
git提交控制 AiDA WEB-Node.js main 分支构建部署 / build (20.19.0) (push) Has been skipped

This commit is contained in:
X1627315083
2025-12-30 13:10:53 +08:00
9 changed files with 138 additions and 22 deletions

View File

@@ -7,7 +7,9 @@
import {
getGenerateHistoricals,
setTryOnEffectFavorite,
cancelTryOnEffectFavorite
cancelTryOnEffectFavorite,
cancelStyleFavorite,
setStyleFavorite
} from '@/api/workshop'
import { useRouter } from 'vue-router'
import MyEvent from '@/utils/myEvent'
@@ -106,17 +108,22 @@
}
// 详情页
const onDetailsItem = (v) => {
if (v.isRegenerated) return
if (v.isRegenerated || !v.styleUrl) return
router.push({ query: { ...query.value, styleUrl: v.styleUrl } })
}
// 喜欢
const isLoveLoading = ref(false)
const onLoveItem = (v) => {
if (isLoveLoading.value) return
const http = v.isFavorite ? cancelTryOnEffectFavorite : setTryOnEffectFavorite
var http
if (navActive.value === 'Outfit') {
http = v.isFavorite ? cancelStyleFavorite : setStyleFavorite
} else {
http = v.isFavorite ? cancelTryOnEffectFavorite : setTryOnEffectFavorite
}
isLoveLoading.value = true
v.isFavorite = !v.isFavorite
http(v.tryOnId)
http(v.id)
.then(() => {
isLoveLoading.value = false
})
@@ -154,7 +161,10 @@
alert(`现在${isShare.value ? '可以' : '不可以'}分享`)
}
const onShareItem = (v) => {
const url = v.tryOnUrl || v.url
if (url) shareImageToWhatsapp(url)
}
const onDownloadItem = async (v) => {
if (isShare.value) {
await shareImageToWhatsapp(v.tryOnUrl)
@@ -287,9 +297,12 @@
<div @click.stop="onLoveItem(v)">
<SvgIcon :name="`love_${v.isFavorite ? '1' : '0'}`" size="27" />
</div>
<div @click.stop="onDownloadItem(v)">
<!-- <div @click.stop="onDownloadItem(v)">
<SvgIcon name="download" size="27" v-show="!v.loading" />
<van-loading color="#000" size="3rem" v-show="v.loading" />
</div> -->
<div @click.stop="onShareItem(v)">
<SvgIcon name="share" size="27" />
</div>
</div>
<div class="icon-selected" v-show="(isChooseSave || isChooseOne) && v.selected">

View File

@@ -38,7 +38,7 @@ const onContinue = ()=>{
if(!isHistoryFlow.value){
router.push({ path: 'uploadFace', query: {...query.value} })
}else{
router.push({ path: 'creation', query: {...query.value} })
router.push({ path: 'creation', query: {...query.value, active: FlowType.H_TRYON } })
}
}

View File

@@ -2,7 +2,7 @@
import { ref, reactive, onMounted, inject } from 'vue'
import router from '@/router'
import { showConfirmDialog, showToast } from 'vant'
import { useUserInfoStore, useOverallStore } from '@/stores'
import { useUserInfoStore, useOverallStore,useGenerateStore } from '@/stores'
import { LogOut } from '@/api/login'
import { getCustomerList, type CustomerListParams, customerCheckin } from '@/api/workshop'
import MyEvent from '@/utils/myEvent'
@@ -15,6 +15,8 @@
const userInfoStore = useUserInfoStore()
const overallStore = useOverallStore()
const generateStore = useGenerateStore()
const emit = defineEmits(['selected-customer'])
const show = ref(false)
const isEdit = ref(false)
@@ -187,7 +189,8 @@
customerCheckin({ nickname: selectedCustomer.name }).then((res) => {
useUserInfoStore().resetGenerateParams()
MyEvent.emit('clear-generate-state')
useUserInfoStore().setCustomerInfo(res)
useGenerateStore().setCustomerInfo(res)
router.push({ path: '/workshop/home' })
})
}
showSwitchCustomerPopup.value = false