fix payments

This commit is contained in:
Emily
2024-06-12 15:43:23 +02:00
parent b7c3ef19ba
commit 6a7143c8d4
8 changed files with 173 additions and 89 deletions

View File

@@ -6,7 +6,8 @@ export type PricingCardProp = {
features: string[],
desc: string,
active: boolean,
planId: number
planId: number,
isDowngrade: boolean
}
const props = defineProps<{ data: PricingCardProp }>();
@@ -43,10 +44,14 @@ async function onUpgradeClick() {
<div v-if="data.active" class="text-[1rem] bg-[#1f1f22] rounded-md py-2 text-center">
Current active plan
</div>
<div @click="onUpgradeClick()" v-if="!data.active"
<div @click="onUpgradeClick()" v-if="!data.active && !data.isDowngrade"
class="cursor-pointer text-[1rem] font-semibold bg-[#3a3af5] rounded-md py-2 text-center">
Upgrade
</div>
<div @click="onUpgradeClick()" v-if="!data.active && data.isDowngrade"
class="cursor-pointer text-[1rem] font-semibold bg-[#1f1f22] text-red-400 rounded-md py-2 text-center">
Downgrade
</div>
</div>
<div class="bg-gray-400 h-[1px] w-full my-4"></div>

View File

@@ -4,6 +4,8 @@ import type { PricingCardProp } from './PricingCard.vue';
const activeProject = useActiveProject();
const props = defineProps<{ currentSub: number }>();
const starterTierCardData = ref<PricingCardProp>({
title: 'STARTER',
@@ -23,6 +25,7 @@ const starterTierCardData = ref<PricingCardProp>({
dedicated server we suggest to upgrade the
plan to an higher one!`,
active: activeProject.value?.premium === false,
isDowngrade: props.currentSub > 0,
planId: 0
});
@@ -41,6 +44,7 @@ const accelerationTierCardData = ref<PricingCardProp>({
],
desc: `Your project is entering a growth phase. We simplify data analysis for you. For more support, try our Expansion plan—it's worth it!`,
active: activeProject.value?.premium_type === 1,
isDowngrade: props.currentSub > 1,
planId: 1
});
@@ -59,6 +63,7 @@ const expansionTierCardData = ref<PricingCardProp>({
],
desc: `We will support you with everything we can offer and give you the full power of our service. If you need more space and are growing, contact us for a custom offer!`,
active: activeProject.value?.premium_type === 2,
isDowngrade: props.currentSub > 2,
planId: 2
});