GithubHelp home page GithubHelp logo

shanamaid / vue-163-music Goto Github PK

View Code? Open in Web Editor NEW
788.0 34.0 204.0 14.12 MB

【停止维护】网易云音乐web版,支持PC端常用功能,localStorage保存播放列表

Home Page: http://119.29.159.156:3000/

License: MIT License

JavaScript 59.66% HTML 0.40% Vue 39.61% CSS 0.32%
vue 163music website vuex vue-router vue-resource proxy express vue-demo music

vue-163-music's Introduction

vue-163-music(网易云音乐web版)

用vue仿写163音乐客户端版。

原计划仿写完所有页面,碍于网易的接口API有限,实现页面也有限。

不推荐手机端访问。

页面高度为670px1366 X 768分辨率及其以下按F11全屏浏览效果更佳

欢迎issueprstar or follow!我将继续开源更多有趣的项目

推荐一个React全家桶写的 追书神器

在线版

点击进入

部分效果截图

3

更多效果gif图

工具&技能

vue + vuex+ vue-router + vue-resource

express

http-proxy-middleware 一个http代理的中间件,进行http请求转发,实现跨域请求

store.js 一个非常棒的处理localStorage的轮子,原生localStorage只支持存储字符串类型,轮子进行封装后可以直接存储ArrayObjectfunctionSet等类型

animate.css css动画库

vue-slider-component 滑块组件

postman 接口测试工具

使用

git clone https://github.com/ShanaMaid/vue-163-music.git

cd vue-163-music

npm install 

# 启动api转发
node server/newapi.js


# 开发环境
npm run dev
访问 http://localhost:8080/

# 打包
npm run build

# 实际环境
cd server
node app.js
访问 http://localhost:3000/

实现功能

发现音乐

  • 个性推荐(推荐歌单中除每日歌曲推荐外,其余歌单可点击进入)

播放音乐

  • 上一曲
  • 播放
  • 暂停
  • 下一曲
  • 进度控制
  • 音量控制

音乐搜索

输入搜索关键词,回车键搜索,或者点击放大镜图标

  • 单曲(单击或双击歌曲添加至音乐播放列表,部分音乐会存在版权问题无法播放)
  • 歌手
  • 专辑
  • MV
  • 歌单(左键点击进入歌单列表)
  • 主播电台 (单期节目部分单击或双击歌曲添加至音乐播放列表,目前不存在版权问题)
  • 用户

歌单

  • 播放全部

播放列表

  • 切歌(单击切歌)
  • 删歌(鼠标悬浮在要删除的歌曲上,点击右侧小X)
  • 清空播放列表
  • 本地缓存播放列表

一些问题

通过api接口获取的mv播放量基本不准,尚未找到原因,其余类型的播放量准确

目录结构

|
|—— build 
|—— config
|—— server 服务端
| |—— app.js 服务端启动入口文件
| |—— static 打包后的资源文件
| |__ index.html 网页入口
|
|——src 资源文件
| |—— assets 组件静态资源库
| |—— components 组件库
| |—— deal  163api返回的JSON字符串解构
| |—— filters 自定义过滤器
| |—— router 路由配置
| |—— store vuex状态管理
| |—— App.vue 163SPA
| |__ main.js SPA入口
|
|__ static 静态资源目录

一些注意事项

项目中使用了网易爸爸的接口,需要使用http-proxy-middleware进行转发,开发环境下需要在config/index.js中的dev中添加下列配置即可

proxyTable: {
  '/api': {
      target: 'http://music.163.com',
      changeOrigin: true,
      headers: {
          Referer: 'http://music.163.com/'
      }
  }
}

实际环境中,服务器端配置

var express = require('express');
var proxy = require('http-proxy-middleware');

var app = express();
app.use('/static', express.static('static'));
app.use('/api', proxy({
  target: 'http://music.163.com', 
  changeOrigin: true, 
  headers: {
    Referer: 'http://music.163.com/'
  }
}
));

app.get('/', function (req, res) {
  res.sendFile(__dirname + '/index.html');
});
app.listen(3000);

对返回的数据解构js文件位于src/components/deal/目录下,比如对单曲搜索结果进行解构

single: (data) => {
  let list = []
  let count = data.result.songCount
  if (count === 0) {
    return {list, count}
  }
  for (let item of data.result.songs) {
    let singer = ''
    let {
      name,
      mp3Url,
      duration,
      id,
      album: {
        name: albumName
      }
    } = item
    for (let item of item.artists) {
      singer += item.name + ' '
    }
    list.push({name, mp3Url, duration, id, albumName, singer})
  }
  return {list, count}
}

vuex状态管理位于src/components/store目录下

vue-router路由配置管理位于src/components/router目录下

自定义过滤器位于src/components/filters/目录下

网易云音乐接口来源于http://moonlib.com/606.html

vue-163-music's People

Contributors

erdong-fe avatar shanamaid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-163-music's Issues

运行你项目的时候,安装依赖报错了,请求解决方案

These dependencies were not found:

  • strip-ansi in ./~/.2.18.0@webpack-hot-middleware/client.js?noInfo=true&reload=
    true
  • ansi-html in ./~/.2.18.0@webpack-hot-middleware/client-overlay.js
  • html-entities in ./~/.2.18.0@webpack-hot-middleware/client-overlay.js
  • babel-runtime/helpers/typeof in ./src/filters/index.js
  • babel-runtime/core-js/number/parse-int in ./src/filters/index.js, .//.6.4.1@b
    abel-loader/lib!./
    /.11.3.4@vue-loader/lib/selector.js?type=script&index=0!./src
    /components/footers.vue
  • babel-runtime/core-js/get-iterator in ./src/store/search.js, .//.6.4.1@babel-
    loader/lib!./
    /.11.3.4@vue-loader/lib/selector.js?type=script&index=0!./src/comp
    onents/playlist/home.vue and 2 others
  • babel-runtime/core-js/set in ./src/store/search.js, .//.6.4.1@babel-loader/li
    b!./
    /.11.3.4@vue-loader/lib/selector.js?type=script&index=0!./src/components/se
    arch.vue
  • babel-runtime/helpers/slicedToArray in ./src/deal/playlist.js
  • babel-runtime/helpers/toConsumableArray in .//.6.4.1@babel-loader/lib!.//.11
    .3.4@vue-loader/lib/selector.js?type=script&index=0!./src/components/search.vue
  • babel-runtime/core-js/object/keys in .//.6.4.1@babel-loader/lib!.//.11.3.4@v
    ue-loader/lib/selector.js?type=script&index=0!./src/components/search.vue

To install them, you can run: npm install --save strip-ansi ansi-html html-entit
ies babel-runtime/helpers/typeof babel-runtime/core-js/number/parse-int babel-ru
ntime/core-js/get-iterator babel-runtime/core-js/set babel-runtime/helpers/slice
dToArray babel-runtime/helpers/toConsumableArray babel-runtime/core-js/object/ke
ys

您好,请教如何实现@focus和@blur

请问您是如何实现@Focus@blur事件的,
我查看官方文档并没有两个事件的介绍,
同时我也阅读了您的源码,没有找到有自定义指令
自己尝试并没有效果😢,烦请指教指教

<span @focus="display" @blur="display" tabindex="1">向日葵与薄荷草</span>
<em @focus="display" @blur="display" tabindex="1"></em>

npm install 运行失败了

npm install

E:\vue-163-music-master>npm install
Error: ENOENT, stat 'C:\Users\Administrator\AppData\Roaming\npm'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.