Skip to content

Commit d60d549

Browse files
committed
update site
1 parent 949cb6b commit d60d549

File tree

1 file changed

+39
-29
lines changed

1 file changed

+39
-29
lines changed

site/components/geektime_ads.vue

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,67 @@
11
<template>
22
<div
3-
v-show="visible"
3+
v-if="isEffective(effectiveTime)"
44
id="geektime-ads"
55
:class="isMobile ? 'geektime-ads-mobile':''"
66
>
77
<a
8-
href="https://time.geekbang.org/course/intro/163?code=KHKYcoBU6vZa8nMglg7AWfDxxi3BWrz9INAzAY3umPk%3D"
8+
href="https://time.geekbang.org/column/intro/216?utm_term=zeusH8E0I&utm_source=website&utm_medium=tangjinzhou"
99
target="_blank"
1010
>
1111
<img
1212
height="100"
13-
alt="Vue 实战教程"
14-
src="https://cdn.nlark.com/yuque/0/2019/jpeg/87084/1562230861353-assets/web-upload/2fab2df7-5cc9-4791-b344-a97da29eb400.jpeg"
15-
>
13+
alt="浏览器工作原理与实践"
14+
src="https://cdn.nlark.com/yuque/0/2019/jpeg/87084/1564994550991-assets/web-upload/fd11d2ba-7351-47d5-bf87-aa9eb2a10256.jpeg"
15+
/>
1616
</a>
1717
</div>
1818
</template>
1919

2020
<script>
21+
import moment from 'moment';
2122
export default {
2223
props: ['isMobile'],
2324
data() {
2425
return {
2526
visible: true,
27+
effectiveTime: {
28+
start: '2019-08-05 17:00:00',
29+
end: '2019-09-05 17:00:00',
30+
},
2631
};
2732
},
33+
methods: {
34+
isEffective({ start, end }) {
35+
return moment().isBetween(start, end);
36+
},
37+
},
2838
};
2939
</script>
3040

3141
<style lang="less" scoped>
32-
#geektime-ads {
33-
max-width: 280px;
34-
height: 100px;
35-
float: right;
36-
position: relative;
37-
right: 0;
38-
bottom: 0;
39-
padding: 0;
40-
overflow: hidden;
41-
z-index: 9;
42-
background-color: #fff;
43-
border-radius: 3px;
44-
font-size: 13px;
45-
background: #f5f5f5;
46-
font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
47-
}
48-
#geektime-ads.geektime-ads-mobile {
49-
width: 100%;
50-
position: relative;
51-
right: 0;
52-
bottom: 0;
53-
padding: 0;
54-
margin-bottom: 15px;
55-
}
42+
#geektime-ads {
43+
max-width: 280px;
44+
height: 100px;
45+
float: right;
46+
position: relative;
47+
right: 0;
48+
bottom: 0;
49+
padding: 0;
50+
overflow: hidden;
51+
z-index: 9;
52+
background-color: #fff;
53+
border-radius: 3px;
54+
font-size: 13px;
55+
background: #f5f5f5;
56+
font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
57+
}
58+
#geektime-ads.geektime-ads-mobile {
59+
width: 100%;
60+
position: relative;
61+
right: 0;
62+
bottom: 0;
63+
padding: 0;
64+
margin-bottom: 15px;
65+
}
5666
</style>
5767

0 commit comments

Comments
 (0)