diff --git a/src/api/form.ts b/src/api/form.ts new file mode 100644 index 0000000..33c8960 --- /dev/null +++ b/src/api/form.ts @@ -0,0 +1,21 @@ +import { api, apiAuth } from './instance' + +export const sendJoinSZTeamForm = async ({ + discordId, + joinTeam, + content, +}: { + discordId: string + joinTeam: string + content: string +}) => { + return await apiAuth({ + method: 'POST', + url: `/website/joinSZTeamForm`, + data: { + discordId, + joinTeam, + content, + }, + }) +} diff --git a/src/components/BaseButton.vue b/src/components/BaseButton.vue index f242b7c..779e6c2 100644 --- a/src/components/BaseButton.vue +++ b/src/components/BaseButton.vue @@ -1,36 +1,43 @@ \ No newline at end of file + diff --git a/src/utils/helper.ts b/src/utils/helper.ts index ed69bbe..545e059 100644 --- a/src/utils/helper.ts +++ b/src/utils/helper.ts @@ -1,7 +1,7 @@ import { get } from 'lodash-es' import { useAppStore } from '@/stores/app' import dayjs from 'dayjs' -import { h } from 'vue' +import { h, type Component, type Ref } from 'vue' import { NIcon } from 'naive-ui' export const getHost = (hostName: string) => { @@ -31,3 +31,12 @@ export const renderIcon = (icon: Component, props: any = null) => { }) } } + +export const checkForm = async (formRef: any) => { + return new Promise((resolve) => { + formRef.validate((errors: any) => { + if (errors) return resolve(false) + resolve(true) + }) + }) +} diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue index ad2ca9a..0e2e8d4 100644 --- a/src/views/Home/Home.vue +++ b/src/views/Home/Home.vue @@ -31,6 +31,6 @@ import Topic from './components/Topic/Topic.vue' } .section-max-w { - @apply max-w-[800px] px-[50px] m-auto; + @apply max-w-[800px] viewPx m-auto; } diff --git a/src/views/Home/components/TeamIntro/TeamIntro.vue b/src/views/Home/components/TeamIntro/TeamIntro.vue index 15cfc1d..c656241 100644 --- a/src/views/Home/components/TeamIntro/TeamIntro.vue +++ b/src/views/Home/components/TeamIntro/TeamIntro.vue @@ -1,5 +1,5 @@