Skip to content

Commit bee568e

Browse files
committed
Add error
1 parent 5266cf0 commit bee568e

File tree

7 files changed

+88
-6
lines changed

7 files changed

+88
-6
lines changed

src/components/navigation.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<a class="nav-list" href="../blog/blog" :class="{ 'router-link-active' : blog }">博文</a>
1111
</div>
1212
<div @click="showNav">
13-
<a class="nav-list" href="https://weibo.com/3090183841/profile?topnav=1&wvr=6&is_all=1">微博</a>
13+
<a class="nav-list" href="../error/error?id=1" :class="{ 'router-link-active' : error == 'weibo' }">微博</a>
1414
</div>
1515
<div @click="showNav">
16-
<a class="nav-list" href="https://github.com/overxue">GitHub</a>
16+
<a class="nav-list" href="../error/error?id=2" :class="{ 'router-link-active' : error == 'github' }">GitHub</a>
1717
</div>
1818
<div @click="showNav">
1919
<a class="nav-list" href="../me/me" :class="{ 'router-link-active' : me }">关于我</a>
@@ -36,6 +36,7 @@
3636
export default {
3737
props: [
3838
'blog',
39+
'error',
3940
'me'
4041
],
4142
data () {

src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ app.$mount()
1010
export default {
1111
// 这个字段走 app.json
1212
config: {
13-
pages: ['pages/blog/blog', 'pages/blogdetail/blogdetail', 'pages/me/me', '^pages/homepage/homepage'], // 页面前带有 ^ 符号的,会被编译成首页,其他页面可以选填,我们会自动把 webpack entry 里面的入口页面加进去
13+
pages: ['^pages/homepage/homepage', 'pages/blog/blog', 'pages/blogdetail/blogdetail', 'pages/me/me', 'pages/error/error'], // 页面前带有 ^ 符号的,会被编译成首页,其他页面可以选填,我们会自动把 webpack entry 里面的入口页面加进去
1414
window: {
1515
backgroundTextStyle: 'light',
1616
navigationBarBackgroundColor: '#fff',

src/pages/blog/blog.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
},
8585
methods: {
8686
showgun () {
87+
console.log('111')
8788
this.show = !this.show
8889
},
8990
_getCategory () {

src/pages/error/error.vue

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<template>
2+
<div class="error">
3+
<navigation :error="number" @show="showgun"></navigation>
4+
<div class="page">
5+
<div class="page-item">
6+
<div class="xianzhi">由于小程序限制跳转至外部网页,您可以通过以下网址访问。</div>
7+
<div class="message" @click="copy(message)">{{message}} <span style="color: #95a5a6">(点我复制)</span></div>
8+
</div>
9+
<v-footer></v-footer>
10+
</div>
11+
</div>
12+
</template>
13+
14+
<script type="text/ecmascript-6">
15+
import Footer from '@/components/footer'
16+
import Navigation from '@/components/navigation'
17+
18+
export default {
19+
data () {
20+
return {
21+
message: '',
22+
number: ''
23+
}
24+
},
25+
mounted () {
26+
if (parseInt(this.$root.$mp.query.id) === 1) {
27+
this.message = 'https://weibo.com/u/3090183841?is_hot=1'
28+
this.number = 'weibo'
29+
} else {
30+
this.message = 'https://github.com/overxue'
31+
this.number = 'github'
32+
}
33+
},
34+
methods: {
35+
copy (message) {
36+
wx.setClipboardData({
37+
data: message,
38+
success: function () {
39+
wx.showToast({
40+
title: '复制成功',
41+
icon: 'success',
42+
duration: 2000
43+
})
44+
}
45+
})
46+
}
47+
},
48+
components: {
49+
'v-footer': Footer,
50+
Navigation
51+
}
52+
}
53+
</script>
54+
55+
<style scoped lang="stylus" rel="stylesheet/stylus">
56+
.error
57+
position:relative
58+
min-height:100%
59+
margin:0
60+
padding:0
61+
.page
62+
padding: 10px
63+
.page-item
64+
margin-top: 200px
65+
color: #24292e
66+
.xianzhi
67+
text-align: center
68+
line-height: 1.2
69+
.message
70+
color: deepskyblue
71+
margin-top: 20px
72+
font-size: 14px
73+
text-align: center
74+
</style>

src/pages/error/main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Vue from 'vue'
2+
import App from './error'
3+
4+
const app = new Vue(App)
5+
app.$mount()

src/pages/homepage/homepage.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<a class="tab-link" href="../blog/blog">Blog</a>
1212
</li>
1313
<li class="tab-item">
14-
<a class="tab-link" href="https://weibo.com/3090183841/profile?topnav=1&wvr=6&is_all=1">Weibo</a>
14+
<a class="tab-link" href="../error/error?id=1">Weibo</a>
1515
</li>
1616
<li class="tab-item">
17-
<a class="tab-link" href="https://github.com/overxue">GitHub</a>
17+
<a class="tab-link" href="../error/error?id=2">GitHub</a>
1818
</li>
1919
<li class="tab-item">
2020
<a class="tab-link" href="../me/me">About Me</a>

src/pages/me/me.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="me" :class="{'detail': show}">
33
<navigation :me="1" @show="showgun"></navigation>
4-
<div class="page" ref="aboutme">
4+
<div class="page">
55
<div class="blog-detail">
66
<div class="blog-detail-contaner">
77
<div class="header">
@@ -27,6 +27,7 @@
2727
<li>从17年开始搭建博客,希望这件事可以一直坚持下去!</li>
2828
<li>这里不仅是我的技术分享,也是我人生路的记载!</li>
2929
<li>这个博客其实帮助不了你什么,除了能让你变得跟我一样帅!</li>
30+
<li>web端博客地址:<span style="color: deepskyblue">www.overxue.com</span></li>
3031
<li>认真生活,认真扯淡!</li>
3132
<li>完。</li>
3233
</ul>

0 commit comments

Comments
 (0)