index.vue
3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<script lang="ts" setup name="BuyIt">
import { ElNotification } from 'element-plus'
const isActived = ref(true)
setTimeout(() => {
isActived.value = false
}, 5000)
onMounted(() => {
ElNotification({
type: 'success',
title: '温馨提示',
dangerouslyUseHTMLString: true,
message: `
<p>当前访问的是<b>基础版</b> (Vue3)</p>
<p>你可以点<a href="https://hooray.gitee.io/fantastic-admin-pro-example/" target="_blank"><b>这里</b></a>访问专业版 (Vue3)</p>
`,
position: 'bottom-right',
duration: 5000,
})
setTimeout(() => {
ElNotification({
type: 'info',
title: '「 专业版限时优惠 」',
dangerouslyUseHTMLString: true,
message: `
<p>原价 1099.00 元,现价 <b style="font-size: 18px; color: #ff4400;">899.00</b> 元!点击立即<a href="https://hooray.gitee.io/fantastic-admin/buy.html" target="_blank">去购买</a>!</p>
`,
position: 'bottom-right',
duration: 0,
})
}, 0)
})
function open(url: string) {
window.open(url, '_blank')
}
</script>
<template>
<div class="buy-it" :class="{ actived: isActived }">
<div class="item" @click="open(`https://hooray.gitee.io/fantastic-admin/buy.html`)" v-preReClick>
<el-icon>
<svg-icon name="fixed-right-buy" />
</el-icon>
<span class="title">购买<br>专业版</span>
</div>
<div class="item" @click="open('https://gitee.com/hooray/fantastic-admin/')" v-preReClick>
<el-icon>
<svg-icon name="fixed-right-code" />
</el-icon>
<span class="title">下载<br>基础版</span>
</div>
<div class="item" @click="open(`https://hooray.gitee.io/fantastic-admin/`)" v-preReClick>
<el-icon>
<svg-icon name="fixed-right-doc" />
</el-icon>
<span class="title">开发<br>文档</span>
</div>
<div class="item" @click="open(`https://hooray.gitee.io/fantastic-admin/support.html`)" v-preReClick>
<el-icon>
<svg-icon name="fixed-right-chat" />
</el-icon>
<span class="title">技术<br>支持</span>
</div>
</div>
</template>
<style lang="scss" scoped>
.buy-it {
position: fixed;
z-index: 10;
right: -58px;
top: 50%;
transform: translateY(-50%);
width: 70px;
display: flex;
flex-direction: column;
transition: right 0.3s;
&.actived,
&:hover {
right: 0;
}
.item {
display: flex;
flex-direction: column;
justify-content: center;
height: 70px;
text-align: center;
color: #fff;
border-bottom: 1px solid #fff;
transition: 0.3s;
opacity: 0.7;
cursor: pointer;
&:hover {
opacity: 1;
}
&:first-child {
border-top-left-radius: 5px;
}
&:last-child {
border-bottom-left-radius: 5px;
border-bottom: 0;
}
&:nth-child(1) {
background-color: #ff4200;
}
&:nth-child(2) {
background-color: #409eff;
}
&:nth-child(3) {
background-color: #0fcc1a;
}
&:nth-child(4) {
background-color: #343b42;
}
.el-icon {
display: block;
margin: 0 auto;
font-size: 20px;
}
.title {
display: inline-block;
font-size: 12px;
}
}
}
</style>