22 <div class =" popup" :class =" {'playMode': playModeVisible}" >
33 <!-- 播放列表 -->
44 <mt-popup class =" playListSheet" v-model =" playListVisible" position =" bottom" >
5- <div class =" playList-header" >
6- <div class =" playList-mode-btn left" @click =" clearablePlayList" >清空</div >
7- <div class =" playList-title" >播放列表<span class =" playList-count" >({{playList.length}}首)</span >
5+ <div class =" playList-container" >
6+ <div class =" playList-header" >
7+ <div class =" playList-mode-btn left" @click =" clearablePlayList" >清空</div >
8+ <div class =" playList-title" >播放列表<span class =" playList-count" >({{playList.length}}首)</span >
9+ </div >
10+ <div class =" playList-mode-btn right" :class =" handleModeIcon()" @click =" playModeVisible = true" ></div >
811 </div >
9- <div class =" playList-mode-btn right my-icon-more" @click =" playModeVisible = true" ></div >
10- </div >
11- <ul class =" playList" v-if =" playList && playList.length > 0" >
12- <li class =" playList-item" v-for =" (item, index) in playList" :key =" item.sound.id" :class =" {'playing': audio.data.sound.id === item.sound.id}" @click =" muiscChange(item)" >
13- <div class =" item-name" >
14- <!-- icon -->
15- <div class =" name-icon-container" >
16- <div class =" name-icon" :class =" audio.data.sound.id === item.sound.id ? 'my-icon-circle-play': 'smallCircle' " ></div >
12+ <ul class =" playList" v-if =" playList && playList.length > 0" >
13+ <li class =" playList-item" v-for =" (item, index) in playList" :key =" item.sound.id" :class =" {'playing': audio.data.sound.id === item.sound.id}" @click =" muiscChange(item)" >
14+ <div class =" item-name" >
15+ <!-- icon -->
16+ <div class =" name-icon-container" >
17+ <div class =" name-icon" :class =" audio.data.sound.id === item.sound.id ? 'my-icon-circle-play': 'smallCircle' " ></div >
18+ </div >
19+ <!-- 名字 -->
20+ <div class =" name-value" :class =" audio.data.sound.id === item.sound.id ? 'onPlay': '' " >{{item.sound.name}}</div >
1721 </div >
18- <!-- 名字 -->
19- <div class =" name-value" :class =" audio.data.sound.id === item.sound.id ? 'onPlay': '' " >{{item.sound.name}}</div >
20- </div >
21- <!-- 删除按钮 -->
22- <div class =" item-close my-icon-close" @click.stop =" deletePlayListItem(item, index)" ></div >
23- </li >
24- </ul >
25- <div class =" playList-nothing" v-else >什么都没有了T T~</div >
22+ <!-- 删除按钮 -->
23+ <div class =" item-close my-icon-close" @click.stop =" deletePlayListItem(item, index)" ></div >
24+ </li >
25+ </ul >
26+ <div class =" playList-nothing" v-else >什么都没有了T T~</div >
27+ </div >
2628 </mt-popup >
2729
2830 <!-- 播放模式 -->
3739</template >
3840<script >
3941import { mapState , mapMutations } from ' vuex'
40- import { ArrayOptions } from ' @/utils/playMode'
42+ import { ArrayOptions , findActiveMode } from ' @/utils/playMode'
4143export default {
4244 data () {
4345 return {
@@ -94,7 +96,11 @@ export default {
9496 this .playList .splice (index, 1 )
9597 this .SET_PLAY_LIST (this .playList )
9698 },
97- // 切换显示
99+ handleModeIcon () {
100+ const item = findActiveMode (this .playMode )
101+ return item .icon
102+ },
103+ // 切换显示(供父组件调用)
98104 toggleVisible () {
99105 this .playListVisible = ! this .playListVisible
100106 }
@@ -114,9 +120,10 @@ export default {
114120}
115121.playListSheet {
116122 width : 100% ;
117- max-height : toRem (188 );
118123 border-top : 1px solid $borderColor ;
119- margin-bottom : $musicBarHeight ;
124+ .playList-container {
125+ margin-bottom : $musicBarHeight ;
126+ }
120127 .playList-header {
121128 position : relative ;
122129 flex-center ();
0 commit comments