Skip to content

Commit

Permalink
优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
gzydong committed Apr 11, 2021
1 parent d6bdf41 commit dabdb39
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
Binary file added src/assets/image/aliyun-abs.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions src/components/layout/AbsModule.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<template>
<div>
<div class="abs-module" v-show="isShow">
<div class="abs-box">
<i class="el-icon-circle-close" @click="close" />
<a href="https://www.aliyun.com/1111/new?userCode=kqyyppx2">
<img src="~@/assets/image/aliyun-abs.jpg" width="300" />
</a>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
isShow: false,
}
},
created() {
if (this.getNum() <= 3) {
setTimeout(() => {
this.isShow = true
}, 1000 * 60)
}
},
methods: {
getNum() {
return parseInt(sessionStorage.getItem('ABS_BOX')) || 0
},
close() {
sessionStorage.setItem('ABS_BOX', this.getNum() + 1)
this.isShow = false
},
},
}
</script>
<style lang="less" scoped>
.abs-module {
position: fixed;
width: 300px;
height: 163.63px;
right: 20px;
top: 20px;
border-radius: 5px;
z-index: 9999;
overflow: hidden;
transition: all 2s;
animation: absfade 1000ms infinite;
.abs-box {
width: 100%;
height: 100%;
position: relative;
i {
position: absolute;
right: 10px;
top: 10px;
color: white;
cursor: pointer;
font-size: 22px;
}
}
}
@keyframes absfade {
from {
transform: scale(1);
}
50% {
transform: scale(1.02);
}
to {
transform: scale(1);
}
}
</style>
5 changes: 5 additions & 0 deletions src/views/layout/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,24 @@

<!-- 打赏组件(自行删除) -->
<RewardModule />

<!-- 广告组件(自行删除) -->
<AbsModule />
</div>
</template>
<script>
import { mapState } from 'vuex'
import UserCard from '@/components/user/UserCard'
import RewardModule from '@/components/layout/RewardModule'
import AbsModule from '@/components/layout/AbsModule'
import { ServeFindFriendApplyNum } from '@/api/contacts'
export default {
name: 'MainLayout',
components: {
UserCard,
RewardModule,
AbsModule
},
props: {
idx: {
Expand Down

0 comments on commit dabdb39

Please sign in to comment.