Skip to content

Commit

Permalink
feat: add founder member alert
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixiaorui committed Jul 16, 2024
1 parent aaf4393 commit 904cf17
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
31 changes: 31 additions & 0 deletions apps/client/components/Alert.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<template>
<div
class="flex w-full items-center justify-between rounded-lg bg-purple-600 px-4 py-1 text-white"
v-if="showAlert"
>
<span class="font-bold"
>【邀请函】加入 Earthworm 创始会员 与我们一起成就更好的英语学习平台</span
>
<div class="flex space-x-4">
<button
class="rounded-lg bg-white px-4 font-bold text-purple-600"
@click="handleShowDetails"
>
查看详情
</button>
</div>
</div>
</template>

<script setup lang="ts">
import { ref } from "vue";
const showAlert = ref(true);
function handleShowDetails() {
window.open("https://earthworm-docs.cuixueshe.com/get-started/founding-member.html", "_blank");
showAlert.value = false;
}
</script>

<style scoped></style>
5 changes: 4 additions & 1 deletion apps/client/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
>
<div class="m-auto flex h-fit min-h-screen flex-col items-center">
<Navbar />
<Alert></Alert>
<!-- 多一层内容的横向内边距是为了和 Navbar 对齐 -->
<div class="flex w-full flex-1 px-5">
<div class="mx-auto flex w-full max-w-screen-xl flex-1">
Expand All @@ -15,4 +16,6 @@
</div>
</template>

<script setup lang="ts"></script>
<script setup lang="ts">
import Alert from "../components/Alert.vue";
</script>

0 comments on commit 904cf17

Please sign in to comment.