You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
57 lines
1.4 KiB
<view class="my-music">
|
|
<view class="tabs">
|
|
<view
|
|
class="tab-item {{currentTab === 'liked' ? 'active' : ''}}"
|
|
bindtap="switchTab"
|
|
data-tab="liked"
|
|
>
|
|
<text class="tab-text">我喜欢的音乐</text>
|
|
<text class="tab-count">{{likedSongs.length}}首</text>
|
|
</view>
|
|
<view
|
|
class="tab-item {{currentTab === 'recent' ? 'active' : ''}}"
|
|
bindtap="switchTab"
|
|
data-tab="recent"
|
|
>
|
|
<text class="tab-text">最近播放</text>
|
|
<text class="tab-count">{{recentPlayed.length}}首</text>
|
|
</view>
|
|
</view>
|
|
|
|
<scroll-view
|
|
scroll-y
|
|
class="content-scroll"
|
|
enable-flex
|
|
enhanced
|
|
show-scrollbar="{{false}}"
|
|
bounces="{{true}}"
|
|
>
|
|
<view wx:if="{{loading}}" class="loading">
|
|
<text>加载中...</text>
|
|
</view>
|
|
|
|
<block wx:else>
|
|
<view wx:if="{{currentTab === 'liked'}}">
|
|
<song-list
|
|
songs="{{likedSongs}}"
|
|
bind:play="handlePlay"
|
|
/>
|
|
</view>
|
|
|
|
<view wx:if="{{currentTab === 'recent'}}">
|
|
<song-list
|
|
songs="{{recentPlayed}}"
|
|
bind:play="handlePlay"
|
|
/>
|
|
</view>
|
|
|
|
<view wx:if="{{!likedSongs.length && !recentPlayed.length}}" class="empty">
|
|
<text>暂无音乐</text>
|
|
</view>
|
|
|
|
<view class="bottom-space"></view>
|
|
</block>
|
|
</scroll-view>
|
|
|
|
<player-bar id="player-bar" musicApi="{{musicApi}}" />
|
|
</view> |