diff --git a/Yi.Ai.Vue3/src/api/activationCode/index.ts b/Yi.Ai.Vue3/src/api/activationCode/index.ts new file mode 100644 index 00000000..da57f95e --- /dev/null +++ b/Yi.Ai.Vue3/src/api/activationCode/index.ts @@ -0,0 +1,5 @@ +import { post } from '@/utils/request'; + +export function redeemActivationCode(data: { code: string }) { + return post('/activationCode/Redeem', data); +} diff --git a/Yi.Ai.Vue3/src/components/ProductPackage/index.vue b/Yi.Ai.Vue3/src/components/ProductPackage/index.vue index 3639ce35..bdb4b060 100644 --- a/Yi.Ai.Vue3/src/components/ProductPackage/index.vue +++ b/Yi.Ai.Vue3/src/components/ProductPackage/index.vue @@ -142,6 +142,7 @@ function cleanupPayment() { const tabs = [ { key: 'member', label: '会员套餐' }, { key: 'token', label: '尊享Token包' }, + { key: 'activation', label: '激活码' }, ]; const benefitsData = { @@ -210,8 +211,11 @@ function selectPackage(pkg: any) { } watch(activeTab, () => { + if (activeTab.value === 'activation') { + return; + } const packages = packagesData.value[activeTab.value as 'member' | 'token']; - if (packages.length > 0) { + if (packages && packages.length > 0) { const firstPackage = packages[0]; selectedId.value = firstPackage.id; selectedPrice.value = firstPackage.price; @@ -315,6 +319,11 @@ function close() { function onClose() { emit('close'); } + +function goToActivation() { + close(); + userStore.openUserCenter('activationCode'); +}