Skip to content

Commit 73392e2

Browse files
committed
优化页面文件引用路径 以及资源下载搜索渲染的问题
1 parent a84a62a commit 73392e2

File tree

42 files changed

+155
-253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+155
-253
lines changed

.eslintrc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module.exports = {
2727
// allow debugger during development
2828
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
2929
"no-compare-neg-zero":"off",
30-
"no-useless-escape":"off"
30+
"no-useless-escape":"off",
31+
'import/no-unresolved': 0
3132
}
3233
}

build/webpack.base.conf.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ var path = require('path')
22
var utils = require('./utils')
33
var config = require('../config')
44
var vueLoaderConfig = require('./vue-loader.conf')
5-
var webpack = require('webpack')
65

76
function resolve (dir) {
87
return path.join(__dirname, '..', dir)
@@ -26,8 +25,11 @@ module.exports = {
2625
alias: {
2726
'vue$': 'vue/dist/vue.esm.js',
2827
'@': resolve('src'),
29-
'@static': resolve('static'),
30-
'@common': resolve('src/common')
28+
'common': resolve('src/common'),
29+
'components': resolve('src/components'),
30+
'utils': resolve('src/utils'),
31+
'store': resolve('src/store'),
32+
'router': resolve('src/router')
3133
}
3234
},
3335
module: {

index.html

+16-3
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,31 @@
88
var s = document.getElementsByTagName("script")[0];
99
s.parentNode.insertBefore(hm, s);
1010
})();
11+
12+
(function(){
13+
var bp = document.createElement('script');
14+
var curProtocol = window.location.protocol.split(':')[0];
15+
if (curProtocol === 'https') {
16+
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
17+
}
18+
else {
19+
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
20+
}
21+
var s = document.getElementsByTagName("script")[0];
22+
s.parentNode.insertBefore(bp, s);
23+
})();
1124
</script>
1225

1326
<head>
1427
<meta charset="utf-8">
1528
<meta http-equiv="X-UA-Compatible" content="edge">
16-
<meta name="keywords" content="戴伟,戴伟的个人网站,戴伟的网站,David戴伟,戴维戴维,未曾遗忘的青春,芜湖戴伟,前端开发,web前端,web前端开发,前端网站">
17-
<meta name="description" content="每一行代码都有一个成为参天大树的梦想,在自己学习前端的开发过程中和大家一起分享,自己也希望在学习的过程中进步">
29+
<meta name="keywords" content="萌芽,戴伟的个人网站,未曾遗忘的青春,web前端,技术分享">
30+
<meta name="description" content="每一行代码都有一个成为参天大树的梦想,记录自己在学习前端开发过程的经历,并和大家一起分享,也希望在学习和网站的开发中进步">
1831
<meta name="AUTHOR" content="戴伟">
1932
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
2033
<link rel="shortcut icon" href="http://www.daiwei.org/index/images/logo/favicon.ico">
2134
<link rel="stylesheet" href="http://www.daiwei.org/global/css/jquery.mCustomScrollbar.css">
22-
<title>未曾遗忘的青春 | 新版本首页</title>
35+
<title>未曾遗忘的青春 | 萌芽 - web前端_技术分享_戴伟的个人网站</title>
2336
</head>
2437
<body>
2538
<div id="app"></div>

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"vue": "^2.3.3",
1717
"vue-awesome-swiper": "^2.5.4",
1818
"vue-lazyload": "^1.1.4",
19-
"vue-message": "^1.2.3",
19+
"vue-message": "^1.2.8",
2020
"vue-router": "^2.6.0"
2121
},
2222
"devDependencies": {
@@ -62,7 +62,7 @@
6262
"stylus-loader": "^3.0.1",
6363
"url-loader": "^0.5.8",
6464
"vue-loader": "^12.1.0",
65-
"vue-message": "^1.2.0",
65+
"vue-message": "^1.2.9",
6666
"vue-style-loader": "^3.0.1",
6767
"vue-template-compiler": "^2.3.3",
6868
"vuex": "^2.4.1",

src/App.vue

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
</template>
1212
<script>
1313
// import axios from 'axios'
14-
import store from './store'
15-
import fecth from './utils/fecth.js'
16-
import home from './components/home.vue'
17-
import fixedbg from './components/common/fixedbg/fixedbg.vue'
18-
import content from './components/common/content/content.vue'
19-
import pic from './components/pic/pic.vue'
20-
import loader from './components/common/loader/loader.vue'
21-
import updatetips from './components/common/updatetips/updatetips.vue'
22-
import DGlobal from '@/common/js/global.js'
14+
import store from 'store'
15+
import fecth from 'utils/fecth.js'
16+
import home from 'components/home.vue'
17+
import fixedbg from 'components/common/fixedbg/fixedbg.vue'
18+
import content from 'components/common/content/content.vue'
19+
import pic from 'components/pic/pic.vue'
20+
import loader from 'components/common/loader/loader.vue'
21+
import updatetips from 'components/common/updatetips/updatetips.vue'
22+
import DGlobal from 'common/js/global.js'
2323
// import $ from 'jquery'
2424
2525
export default {
@@ -267,7 +267,7 @@ export default {
267267
</script>
268268

269269
<style lang="stylus" rel="stylesheet/stylus">
270-
@import 'common/stylus/border-1px/index.styl'
270+
@import '~common/stylus/border-1px/index.styl'
271271
@import '/static/font-icon/style.css'
272272
audio
273273
display:none

src/common/js/Utils.js

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const Utils = {
2525
}
2626
},
2727

28+
// 一个promise 通过手机自带的设备传感器感应xyz方向的角度实现移动端背景图片视差显示效果
2829
moveImage () {
2930
const deviceVersion = Navigator.deviceVersion()
3031
return new Promise((resolve, reject) => {

src/common/stylus/global.styl

+5
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ $list_hover = rgba(0,0,0,0.2);
1414

1515
// 遮罩层背景色
1616
$mask_color = rgba(0,0,0,0.98);
17+
$mask_color_opacity = rgba(0,0,0,0.58);
18+
$mask_color_gray = rgba(122,122,122,0.3)
1719

1820
// 边框颜色
1921
$border_color = red;
2022
$border_bottom_color = rgba(255,255,255,0.1);
2123
$border_bottom_color_deep = rgba(255,255,255,0.3)
2224

25+
// box-shadow
26+
$box_s_eee = #eee
27+
2328
// active色调
2429
$active_color = red;
2530

src/components/about/about.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
</div>
7676
</template>
7777
<script>
78-
import store from './../../store'
78+
import store from 'store'
7979
export default {
8080
methods: {
8181
getRoutePath () {
@@ -115,9 +115,9 @@
115115
}
116116
</script>
117117
<style lang="stylus" rel="stylesheet/stylus">
118-
@import '../../common/response.css'
119-
@import '../../common/stylus/global.styl'
120-
@import '../../common/stylus/style.styl'
118+
@import '~common/response.css'
119+
@import '~common/stylus/global.styl'
120+
@import '~common/stylus/style.styl'
121121
.about
122122
position:fixed
123123
top:0

src/components/about/contact/contact.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default {
3333
}
3434
</script>
3535
<style lang="stylus" rel="stylesheet/stylus">
36-
@import '../../../common/stylus/global.styl'
36+
@import '~common/stylus/global.styl'
3737
.div_back
3838
position:absolute
3939
top:0

src/components/about/friendship/friendship.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<script>
1414
// import store from '../../../store'
1515
// import axios from 'axios'
16-
import fecth from './../../../utils/fecth.js'
16+
import fecth from 'utils/fecth.js'
1717
export default {
1818
data () {
1919
return {
@@ -45,7 +45,7 @@ export default {
4545
}
4646
</script>
4747
<style lang="stylus" rel="stylesheet/stylus">
48-
@import '../../../common/stylus/global.styl'
48+
@import '~common/stylus/global.styl'
4949
.div_back
5050
position:absolute
5151
top:0

src/components/about/joke/joke.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
</template>
1010
<script>
1111
// import store from '../../store'
12-
import fecth from './../../../utils/fecth.js'
13-
import jokeList from './jokeList/jokeList.vue'
12+
import fecth from 'utils/fecth.js'
13+
import jokeList from 'components/about/joke/jokeList/jokeList.vue'
1414
// import axios from 'axios'
1515
export default {
1616
data () {
@@ -40,7 +40,7 @@ export default {
4040
}
4141
</script>
4242
<style lang="stylus" rel="stylesheet/stylus">
43-
@import '../../../common/stylus/global.styl'
43+
@import '~common/stylus/global.styl'
4444
.div_back
4545
position:absolute
4646
top:0

src/components/about/me/me.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
</div>
2525
</template>
2626
<script>
27-
import store from '../../../store'
28-
import fecth from './../../../utils/fecth.js'
27+
import store from 'store'
28+
import fecth from 'utils/fecth.js'
2929
// import axios from 'axios'
3030
export default {
3131
data () {
@@ -79,7 +79,7 @@ export default {
7979
}
8080
</script>
8181
<style lang="stylus" rel="stylesheet/stylus">
82-
@import '../../../common/stylus/global.styl'
82+
@import '~common/stylus/global.styl'
8383
.div_back
8484
position:absolute
8585
top:0

src/components/about/news/news.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424
</template>
2525
<script>
26-
import fecth from './../../../utils/fecth.js'
26+
import fecth from 'utils/fecth.js'
2727
import Bscroll from 'better-scroll'
2828
export default {
2929
data () {
@@ -111,7 +111,7 @@
111111
}
112112
</script>
113113
<style lang="stylus" rel="stylesheet/stylus">
114-
@import '../../../common/stylus/global.styl'
114+
@import '~common/stylus/global.styl'
115115
.news
116116
position:fixed
117117
top:0

src/components/about/resources/audio/audio.vue

+4-5
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
</template>
1919

2020
<script>
21-
import fecth from './../../../../utils/fecth.js'
22-
const SUCCESS_NO = 200
21+
import fecth from 'utils/fecth.js'
2322
export default {
2423
data () {
2524
return {
@@ -41,7 +40,7 @@
4140
if (this.keyword !== '') {
4241
let url = 'http://www.daiwei.org/vue/server/home.php?inAjax=1&do=getResourceAudio'
4342
fecth.get(url, {'keyword': this.keyword}).then((res) => {
44-
if (SUCCESS_NO === res.data.Code) {
43+
if (res.data && res.data.ResultData) {
4544
this.audioInfo = res.data.ResultData
4645
return
4746
}
@@ -62,8 +61,8 @@
6261
</script>
6362

6463
<style lang="stylus" rel="stylesheet/stylus">
65-
@import './../../../../common/stylus/global.styl'
66-
@import './../../../../common/stylus/border-1px/index.styl'
64+
@import '~common/stylus/global.styl'
65+
@import '~common/stylus/border-1px/index.styl'
6766
.audio_download
6867
max-width: 768px
6968
margin: 0 auto

src/components/about/resources/resources.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
</script>
6060

6161
<style lang="stylus" rel="stylesheet/stylus">
62-
@import '../../../common/stylus/global.styl'
62+
@import '~common/stylus/global.styl'
6363
::-webkit-input-placeholder
6464
color:$text_color_opacity
6565
:-moz-placeholder

src/components/about/resources/video/video.vue

+4-5
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
</template>
2121

2222
<script>
23-
import fecth from './../../../../utils/fecth.js'
24-
const SUCCESS_NO = 201
23+
import fecth from 'utils/fecth.js'
2524
export default {
2625
data () {
2726
return {
@@ -43,7 +42,7 @@
4342
if (this.keyword !== '') {
4443
let url = 'http://www.daiwei.org/vue/server/home.php?inAjax=1&do=getResourceVideo'
4544
fecth.get(url, {'keyword': this.keyword}).then((res) => {
46-
if (SUCCESS_NO === res.data.Code) {
45+
if (res.data && res.data.ResultData) {
4746
this.videoInfo = res.data.ResultData
4847
return
4948
}
@@ -64,8 +63,8 @@
6463
</script>
6564

6665
<style lang="stylus" rel="stylesheet/stylus">
67-
@import './../../../../common/stylus/global.styl'
68-
@import './../../../../common/stylus/border-1px/index.styl'
66+
@import '~common/stylus/global.styl'
67+
@import '~common/stylus/border-1px/index.styl'
6968
.video_download
7069
max-width: 768px
7170
margin: 0 auto

src/components/about/suggest/suggest.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</template>
1515
<script>
1616
// import store from '../../store'
17-
import fecth from './../../../utils/fecth.js'
17+
import fecth from 'utils/fecth.js'
1818
export default {
1919
computed: {
2020
},
@@ -54,7 +54,7 @@ export default {
5454
}
5555
</script>
5656
<style lang="stylus" rel="stylesheet/stylus">
57-
@import '../../../common/stylus/global.styl'
57+
@import '~common/stylus/global.styl'
5858
.suggest
5959
position:fixed
6060
top:0

src/components/about/updateinfo/updateinfo.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
</template>
1414

1515
<script>
16-
import fecth from './../../../utils/fecth.js'
17-
import store from './../../../store'
16+
import fecth from 'utils/fecth.js'
17+
import store from 'store'
1818
export default {
1919
data () {
2020
return {
@@ -47,7 +47,7 @@
4747
</script>
4848

4949
<style lang="stylus" rel="stylesheet/stylus">
50-
@import '../../../common/stylus/global.styl'
50+
@import '~common/stylus/global.styl'
5151
.works
5252
position:fixed
5353
top:0

src/components/about/works/workList/workList.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
}
2222
</script>
2323
<style lang="stylus" rel="stylesheet/stylus">
24-
@import '../../../../common/stylus/global.styl'
25-
@import '../../../../common/stylus/border-1px/index.styl'
24+
@import '~common/stylus/global.styl'
25+
@import '~common/stylus/border-1px/index.styl'
2626
.workslist
2727
position:relative
2828
display:flex

0 commit comments

Comments
 (0)