diff --git a/app/pages/profile/index.vue b/app/pages/profile/index.vue index fb8773c..84c8935 100644 --- a/app/pages/profile/index.vue +++ b/app/pages/profile/index.vue @@ -8,9 +8,9 @@ definePageMeta({ layout: 'default', i18n: 'menu.profile', }) -const {t}=useI18n(); +const { t } = useI18n(); const router = useRouter() -const { userInfo,payment } = authStore() +const { userInfo, payment } = authStore() const showMyList = ref([]) const localState = ref({ finished: true, @@ -18,7 +18,7 @@ const localState = ref({ }) const groupByDate = (data) => { - + if (!Array.isArray(data)) return [] return Object.values(data.reduce((acc, curr) => { @@ -38,7 +38,7 @@ const fetchData = async () => { showMyList.value = groupByDate(res.data.data) } } catch (error) { - } + } } const onRefresh = async () => { @@ -48,23 +48,27 @@ const onRefresh = async () => { } const goPay = (item) => { - payment.value.leftPrice=item.leftCnyPrice - payment.value.nickName=item.nickName - payment.value.leftCurrency=item.leftCurrency - payment.value.buyUid=item.uuid - payment.value.artworkTitle=item?.auctionArtworkInfo?.artworkTitle - payment.value.auctionArtworkUuid=item?.auctionArtworkUuid - if (item.status===1){ + payment.value.leftPrice = item.leftCnyPrice + payment.value.nickName = item.nickName + payment.value.leftCurrency = item.leftCurrency + payment.value.buyUid = item.uuid + payment.value.artworkTitle = item?.auctionArtworkInfo?.artworkTitle + payment.value.auctionArtworkUuid = item?.auctionArtworkUuid + if (item.status === 1) { router.push('/signature/protocol') - }else if (item.status===4){ + } else if (item.status === 4) { router.push('/payment') } } const goDetail = (item) => router.push({ path: '/artDetail', query: { uuid: item.uuid } }) -const statusLabel={ - 1:t('payment.text4'), - 2:t('payment.text2'), - 4:t('payment.text6'), +const statusLabel = { + 1: t('payment.text4'), + 2: t('payment.text2'), + 4: t('payment.text6'), +} +const backLogin=()=>{ + localStorage.clear() + router.replace('/login') } fetchData() @@ -72,11 +76,16 @@ fetchData()