|
| 1 | +<script setup lang="ts"> |
| 2 | +import { parseQuery } from 'ufo' |
| 3 | +
|
| 4 | +definePageMeta({ |
| 5 | + middleware(to) { |
| 6 | + if (!to.query.qr) { |
| 7 | + return navigateTo({ name: 'pricing' }) |
| 8 | + } |
| 9 | + }, |
| 10 | +}) |
| 11 | +
|
| 12 | +const { data: page } = await useAsyncData('pricing', () => queryCollection('pricing').first()) |
| 13 | +
|
| 14 | +useSeoMeta({ |
| 15 | + title: page.value?.title, |
| 16 | + ogTitle: page.value?.title, |
| 17 | + description: page.value?.description, |
| 18 | + ogDescription: page.value?.description, |
| 19 | +}) |
| 20 | +
|
| 21 | +defineOgImageComponent('Saas') |
| 22 | +
|
| 23 | +const route = useRoute() |
| 24 | +
|
| 25 | +const checkoutQr = computed(() => String(route.query.qr)) |
| 26 | +const checkoutInfo = computed(() => { |
| 27 | + const query = parseQuery(checkoutQr.value) |
| 28 | +
|
| 29 | + return query |
| 30 | +}) |
| 31 | +
|
| 32 | +function handleCheckStatus() { |
| 33 | + // |
| 34 | +} |
| 35 | +</script> |
| 36 | + |
| 37 | +<template> |
| 38 | + <div v-if="page"> |
| 39 | + <UPageSection |
| 40 | + :title="page.topup.title" |
| 41 | + :description="page.topup.description" |
| 42 | + > |
| 43 | + <div class="grid md:grid-cols-2 gap-4 items-start"> |
| 44 | + <div class="flex justify-center"> |
| 45 | + <img |
| 46 | + :src="String($route.query.qr)" |
| 47 | + alt="QR Code for payment" |
| 48 | + class="rounded-lg shadow-xl max-w-sm w-full" |
| 49 | + > |
| 50 | + </div> |
| 51 | + |
| 52 | + <UCard class="w-full"> |
| 53 | + <template #header> |
| 54 | + <h3 class="text-xl font-semibold leading-6 text-gray-900 dark:text-white"> |
| 55 | + {{ $t('Payment Summary') }} |
| 56 | + </h3> |
| 57 | + </template> |
| 58 | + |
| 59 | + <div class="space-y-4"> |
| 60 | + <div class="flex justify-between items-center"> |
| 61 | + <span class="text-lg font-medium text-gray-500 dark:text-gray-400">{{ $t('Bank Name') }}</span> |
| 62 | + <span class="text-lg font-semibold text-gray-900 dark:text-white">{{ checkoutInfo.bank }}</span> |
| 63 | + </div> |
| 64 | + <UDivider /> |
| 65 | + <div class="flex justify-between items-center"> |
| 66 | + <span class="text-lg font-medium text-gray-500 dark:text-gray-400">{{ $t('Amount') }}</span> |
| 67 | + <span class="text-xl font-bold text-primary-500 dark:text-primary-400">{{ checkoutInfo.amount }}</span> |
| 68 | + </div> |
| 69 | + <UDivider /> |
| 70 | + <div class="flex justify-between items-start"> |
| 71 | + <span class="text-lg font-medium text-gray-500 dark:text-gray-400">{{ $t('Description') }}</span> |
| 72 | + <span class="text-lg text-gray-700 dark:text-gray-300 text-right">{{ checkoutInfo.des }}</span> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + |
| 76 | + <template #footer> |
| 77 | + <p class="text-lg text-gray-500 dark:text-gray-400"> |
| 78 | + {{ $t('Please verify the details before proceeding with the payment.') }} |
| 79 | + </p> |
| 80 | + <div> |
| 81 | + <UButton |
| 82 | + class="w-full font-semibold mt-4" size="xl" |
| 83 | + @click="handleCheckStatus" |
| 84 | + > |
| 85 | + {{ $t('I have transfered the money! (Click here)') }} |
| 86 | + </UButton> |
| 87 | + </div> |
| 88 | + </template> |
| 89 | + </UCard> |
| 90 | + </div> |
| 91 | + </UPageSection> |
| 92 | + |
| 93 | + <UPageSection |
| 94 | + :title="page.faq.title" |
| 95 | + :description="page.faq.description" |
| 96 | + > |
| 97 | + <UPageAccordion |
| 98 | + multiple |
| 99 | + class="max-w-4xl mx-auto" |
| 100 | + :items="page.faq.items" |
| 101 | + /> |
| 102 | + </UPageSection> |
| 103 | + </div> |
| 104 | +</template> |
0 commit comments