DetailSonglist.vue 3.3 KB
Newer Older
Z
Zachary 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<template>
  <div class="mod_songlist">
    <ul class="songlist__header">
      <li class="songlist__edit songlist__edit--check sprite">
        <input type="checkbox" class="songlist__checkbox js_check_all" />
      </li>
      <li class="songlist__header_name">歌曲</li>
      <li class="songlist__header_author">歌手</li>
      <li class="songlist__header_album" v-if="listType == 'playlist'">专辑</li>
      <li class="songlist__header_time">时长</li>
    </ul>

    <ul class="songlist__list">
      <li v-for="(song, idx) in songs" :key="song.id">
        <div
          class="songlist__item"
          :claa="(idx + 1) % 2 == 0 ? 'songlist__item--even' : ''"
        >
          <div class="songlist__edit songlist__edit--check sprite">
            <input type="checkbox" class="songlist__checkbox" />
          </div>
          <div class="songlist__number">{{ idx + 1 }}</div>
          <div class="songlist__songname">
            <span class="songlist__songname_txt">
Z
Zachary 已提交
25
              <a :title="song.name" @click="gotoSongDetail(song.id)">
Z
Zachary 已提交
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
                {{ song.name }}<span class="songlist__song_txt"></span>
              </a>
            </span>

            <!-- mod list menu -->
            <mod-list-menu :song="song" />
          </div>

          <div class="songlist__artist">
            <a
              class="singer_name"
              :title="song.artistsText"
              @click="gotoSongerDetail(song.artists[0].id)"
            >
              {{ song.artistsText }}
            </a>
          </div>
          <div class="songlist__album" v-if="listType == 'playlist'">
            <a
              class="album_name"
              :title="song.albumName"
              @click="gotoAlbumDetail(song.albumId)"
            >
              {{ song.albumName }}
            </a>
          </div>
          <div class="songlist__time">{{ song.durationText }}</div>
          <div class="songlist__other"></div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
import ModListMenu from "components/common/ModListMenu";
Z
Zachary 已提交
62 63 64 65 66
import {
  gotoSongDetail,
  gotoSongerDetail,
  gotoAlbumDetail,
} from "common/utils";
Z
Zachary 已提交
67 68 69 70 71 72 73 74 75 76 77 78
export default {
  props: {
    songs: {
      type: Array,
      default: [],
    },
    listType: {
      type: String,
      default: "",
    },
  },
  methods: {
Z
Zachary 已提交
79 80 81
    gotoSongDetail,
    gotoSongerDetail,
    gotoAlbumDetail,
Z
Zachary 已提交
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
  },
  components: {
    ModListMenu,
  },
};
</script>

<style scoped>
li,
ol,
p,
td,
th,
ul {
  margin: 0;
  margin-right: 0px;
  padding: 0;
}
.songlist__header {
  background-color: #fbfbfd;
}
.songlist__header,
.songlist__item {
  position: relative;
  padding-left: 46px;
  padding-right: 95px;
}
/*overwrite*/
.songlist__songname {
  line-height: 50px;
  height: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/*overwrite*/
.songlist__album,
.songlist__artist,
.songlist__header_album,
.songlist__header_author {
  float: left;
  padding-left: 15px;
  width: 25.5%;
  box-sizing: border-box;
}
/*overwrite*/
.songlist__album,
.songlist__artist,
.songlist__number,
.songlist__other,
.songlist__time {
  line-height: 50px;
  height: 50px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.songlist__item--even {
  background-color: rgba(0, 0, 0, 0.01);
}
a:hover {
  color: #31c27c;
}
</style>