1
1
<template >
2
- <div id =" app" >
3
- <v-header v-show =" header" ></v-header >
4
- <div class =" container" >
5
- <transition :name =" tansitionName" mode =" out-in" >
6
- <router-view ></router-view >
7
- </transition >
8
- </div >
9
- <v-playbar v-show =" playBar" ></v-playbar >
10
-
11
- <!-- 公用组件-->
12
- <v-sidebar ></v-sidebar >
13
- <v-toast v-show =" showToast" ></v-toast >
14
- <v-loading v-show =" showPlayLoading" class =" play-loading" ></v-loading >
15
- <transition name =" fold" >
16
- <v-play v-show =" showPlay" ></v-play >
17
- </transition >
18
- </div >
2
+ <div id =" app" >
3
+ <v-header @left =" showSidebar" >
4
+ <i slot =" left-icon" class =" icon" > ; </i >
5
+ <span slot =" content" >Magic Music</span >
6
+ <router-link slot =" right-icon" to =" /search" >
7
+ <i class =" icon" > ; </i >
8
+ </router-link >
9
+ </v-header >
10
+ <v-tab ></v-tab >
11
+ <keep-alive >
12
+ <router-view ></router-view >
13
+ </keep-alive >
14
+ <v-playbar ></v-playbar >
15
+
16
+ <!-- 公用组件-->
17
+ <v-sidebar ></v-sidebar >
18
+ <v-toast v-show =" showToast" ></v-toast >
19
+ <!-- <v-loading v-show="showPlayLoading" class="play-loading"></v-loading> -->
20
+ <transition name =" fold" >
21
+ <v-play v-show =" showPlay" ></v-play >
22
+ </transition >
23
+ </div >
19
24
</template >
20
25
21
26
<script >
22
27
import header from ' @/components/header'
28
+ import tab from ' @/components/tab'
23
29
import playbar from ' @/components/playbar'
24
30
import play from ' @/components/play'
25
31
import sidebar from ' @/components/sidebar'
@@ -31,126 +37,112 @@ import { mapGetters } from 'vuex'
31
37
import api from ' ./api'
32
38
33
39
export default {
34
- name: ' app' ,
35
- components: {
36
- ' v-header' : header,
37
- ' v-playbar' : playbar,
38
- ' v-play' : play,
39
- ' v-sidebar' : sidebar,
40
- ' v-toast' : toast,
41
- ' v-loading' : loading
42
- },
43
- created () {
44
- if (! this .audioUrl ) {
45
- api .MusicUrl (this .audio [0 ].id )
46
- .then (res => {
47
- this .$store .dispatch (' setAudioUrl' , res .data [0 ].url )
48
- })
49
- }
50
- this .$store .dispatch (' getMusicInfo' , this .audio [0 ].id )
51
- },
52
- data () {
53
- return {
54
- }
55
- },
56
- computed: {
57
- playBar () {
58
- return true
59
- },
60
- header () {
61
- return this .$route .path .split (' /' )[1 ] == ' search' || this .$route .path .split (' /' )[1 ] == ' rank' ? false : true
62
- },
63
- ... mapGetters ([
64
- ' showSidebar' ,
65
- ' showToast' ,
66
- ' showPlay' ,
67
- ' audio' ,
68
- ' audioUrl' ,
69
- ' showPlayLoading'
70
- ]),
71
- tansitionName () {
72
- switch (this .$route .path ) {
73
- case ' /collection' :
74
- return ' slide-left'
75
- default :
76
- return ' slide-right'
77
- }
78
- }
79
- },
40
+ name: ' app' ,
41
+ components: {
42
+ ' v-header' : header,
43
+ ' v-tab' : tab,
44
+ ' v-playbar' : playbar,
45
+ ' v-play' : play,
46
+ ' v-sidebar' : sidebar,
47
+ ' v-toast' : toast,
48
+ ' v-loading' : loading
49
+ },
50
+ created () {
51
+ // if (!this.audioUrl) {
52
+ // api.MusicUrl(this.audio[0].id)
53
+ // .then(res => {
54
+ // this.$store.dispatch('setAudioUrl', res.data[0].url)
55
+ // })
56
+ // }
57
+ // this.$store.dispatch('getMusicInfo', this.audio[0].id)
58
+ },
59
+ data () {
60
+ return {
61
+ }
62
+ },
63
+ computed: {
64
+ header () {
65
+ return this .$route .path .split (' /' )[1 ] == ' search' || this .$route .path .split (' /' )[1 ] == ' rank' ? false : true
66
+ },
67
+ ... mapGetters ([
68
+ ' showToast' ,
69
+ ' showPlay' ,
70
+ ' audio' ,
71
+ ' audioUrl' ,
72
+ ' showPlayLoading'
73
+ ]),
74
+ },
75
+ methods: {
76
+ showSidebar () {
77
+ this .$store .dispatch (' setShowSidebar' , true )
78
+ }
79
+ }
80
80
}
81
81
</script >
82
82
83
83
<style lang="scss">
84
- @import ' ./assets/css/function' ;
84
+ @import " ./assets/css/function" ;
85
85
86
86
@font-face {
87
- font-family : ' icon' ;
88
- /* project id 277165 */
89
- src : url (' //at.alicdn.com/t/font_kmywdojzhchj8aor.eot' );
90
- src : url (' //at.alicdn.com/t/font_kmywdojzhchj8aor.eot?#iefix' ) format (' embedded-opentype' ),
91
- url (' //at.alicdn.com/t/font_kmywdojzhchj8aor.woff' ) format (' woff' ),
92
- url (' //at.alicdn.com/t/font_kmywdojzhchj8aor.ttf' ) format (' truetype' ),
93
- url (' //at.alicdn.com/t/font_kmywdojzhchj8aor.svg#iconfont' ) format (' svg' );
87
+ font-family : " icon" ;
88
+ /* project id 277165 */
89
+ src : url (" //at.alicdn.com/t/font_kmywdojzhchj8aor.eot" );
90
+ src : url (" //at.alicdn.com/t/font_kmywdojzhchj8aor.eot?#iefix" )
91
+ format (" embedded-opentype" ),
92
+ url (" //at.alicdn.com/t/font_kmywdojzhchj8aor.woff" ) format (" woff" ),
93
+ url (" //at.alicdn.com/t/font_kmywdojzhchj8aor.ttf" ) format (" truetype" ),
94
+ url (" //at.alicdn.com/t/font_kmywdojzhchj8aor.svg#iconfont" ) format (" svg" );
94
95
}
95
96
96
97
.icon {
97
- font-family : " icon" !important ;
98
- font-size : 18px ;
99
- font-style : normal ;
100
- color : #ffffff ;
98
+ font-family : " icon" !important ;
99
+ font-size : 18px ;
100
+ font-style : normal ;
101
+ color : #ffffff ;
101
102
}
102
103
103
- #app {
104
- font-family : ' Avenir' , Helvetica , Arial , sans-serif ;
105
- -webkit-font-smoothing : antialiased ;
106
- -moz-osx-font-smoothing : grayscale ;
107
- display : flex ;
108
- flex-direction : column ;
109
- height : 100% ;
110
- background : rgba (8 , 5 , 58 , 0.9 );
111
- .play-loading {
112
- top : 8rem ;
113
- z-index : 99 ;
114
- }
115
- .container {
116
- flex : 1 ;
117
- overflow : auto ;
118
- overflow-x : hidden ;
119
- }
120
- .slide-left-enter-active {
121
- animation : slideLeft .3s ;
122
- }
123
- .slide-right-enter-active {
124
- animation : slideRight .3s ;
125
- }
126
-
127
- .fold-enter-active ,
128
- .fold-leave-active {
129
- transition : transform .3s ease-in ;
130
- }
131
- .fold-enter ,
132
- .fold-leave-active {
133
- transform : translate3d (0 , 100% , 0 );
134
- }
104
+ html ,
105
+ body {
106
+ line-height : 1 ;
107
+ font-family : PingFang SC, STHeitiSC- Light, Helvetica- Light, arial , sans-serif ;
108
+ -webkit-user-select : none ;
109
+ -moz-user-select : none ;
110
+ -ms-user-select : none ;
111
+ user-select : none ;
112
+ -webkit-tap-highlight-color : transparent ;
113
+ background : rgba (8 , 5 , 58 , 0.9 );
114
+ color : #fff ;
135
115
}
136
116
137
- @keyframes slideLeft {
138
- from {
139
- transform : translate3d (100% , 0 , 0 );
140
- visibility : visible ;
141
- }
142
- to {
143
- transform : translate3d (0 , 0 , 0 );
144
- }
145
- }
117
+ #app {
118
+ font-family : " Avenir" , Helvetica , Arial , sans-serif ;
119
+ -webkit-font-smoothing : antialiased ;
120
+ -moz-osx-font-smoothing : grayscale ;
121
+ display : flex ;
122
+ flex-direction : column ;
123
+ .play-loading {
124
+ top : 8rem ;
125
+ z-index : 99 ;
126
+ }
127
+ .container {
128
+ flex : 1 ;
129
+ overflow : auto ;
130
+ overflow-x : hidden ;
131
+ }
132
+ .slide-left-enter-active {
133
+ animation : slideLeft 0.3s ;
134
+ }
135
+ .slide-right-enter-active {
136
+ animation : slideRight 0.3s ;
137
+ }
146
138
147
- @keyframes slideRight {
148
- from {
149
- transform : translate3d ( -100 % , 0 , 0 ) ;
150
- visibility : visible ;
151
- }
152
- to {
153
- transform : translate3d (0 , 0 , 0 );
154
- }
139
+ .fold-enter-active ,
140
+ .fold-leave-active {
141
+ transition : transform 0.3 s ease-in ;
142
+ }
143
+ .fold-enter ,
144
+ .fold-leave-active {
145
+ transform : translate3d (0 , 100 % , 0 );
146
+ }
155
147
}
156
148
</style >
0 commit comments