vue 网易云

技术方案

github地址: https://github.com/ljlhnick/vue-wangyiyun 喜欢欢迎点个start,支持下我
技术方案:vue+vue-router+axios+typeScript+element-ui+vue-property-decorator(class方式写组件)

模块划分

歌单列表,歌单,分页,播放详情,个人资料提交

代码class编程

<script lang="ts">
import { formatDate } from "./date.js";
import TableList from "../tableList.vue";
import axios from "axios";
import { Vue, Component, Watch } from "vue-property-decorator";
@Component({
  components: {
    TableList
  },
  filters: {
    formatDate(time: Date) {
      const date = new Date(time);
      return formatDate(date, "yyyy-MM-dd");
    }
  }
})
export default class SongFirst extends Vue {
  subdesc = "";
  sheepList = [];
  totalCount = 0;
  currentPage = 1;

  created() {
    this.get();
  }

  get() {
    if (typeof this.$route.query.songId === "undefined") {
      return;
    }
    axios({
      url: "https://api.imjad.cn/cloudmusic/",
      method: "get",
      params: {
        type: "playlist",
        id: this.$route.query.songId,
        offest: this.currentPage - 1
      }
    }).then(res => {
      this.subdesc = res.data.playlist;
      this.sheepList = res.data.playlist.tracks;
      this.totalCount = res.data.playlist.trackCount;
    });
  }

  changePage(currentPage: number) {
    this.currentPage = currentPage;
    this.get();
  }

  @Watch("$route", { immediate: false, deep: false })
  pageChange() {
    this.get();
  }
}
</script>

功能图

主页
主页
歌单
歌单
播放详情
播放详情
我的(表单验证)
表单验证

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值