Showing preview only (228K chars total). Download the full file or copy to clipboard to get everything.
Repository: HEternally/weChatApp-HMusic
Branch: master
Commit: b8205d1d5fd4
Files: 47
Total size: 208.3 KB
Directory structure:
gitextract_rgoq66r_/
├── README.md
├── app.js
├── app.json
├── app.wxss
├── component/
│ └── playMusic/
│ ├── playMusic.js
│ ├── playMusic.json
│ ├── playMusic.wxml
│ └── playMusic.wxss
├── pages/
│ ├── gedan/
│ │ ├── gedan.js
│ │ ├── gedan.json
│ │ ├── gedan.wxml
│ │ └── gedan.wxss
│ ├── index/
│ │ ├── index.js
│ │ ├── index.json
│ │ ├── index.wxml
│ │ └── index.wxss
│ ├── logs/
│ │ ├── logs.js
│ │ ├── logs.json
│ │ ├── logs.wxml
│ │ └── logs.wxss
│ ├── playSong/
│ │ ├── playSong.js
│ │ ├── playSong.json
│ │ ├── playSong.wxml
│ │ └── playSong.wxss
│ ├── rank/
│ │ ├── rank.js
│ │ ├── rank.json
│ │ ├── rank.wxml
│ │ └── rank.wxss
│ ├── search/
│ │ ├── search.js
│ │ ├── search.json
│ │ ├── search.wxml
│ │ └── search.wxss
│ ├── share/
│ │ ├── share.js
│ │ ├── share.json
│ │ ├── share.wxml
│ │ └── share.wxss
│ ├── singer/
│ │ ├── singer.js
│ │ ├── singer.json
│ │ ├── singer.wxml
│ │ └── singer.wxss
│ └── top/
│ ├── top.js
│ ├── top.json
│ ├── top.wxml
│ └── top.wxss
├── project.config.json
├── utils/
│ └── util.js
└── weui.wxss
================================================
FILE CONTENTS
================================================
================================================
FILE: README.md
================================================
- 歌曲来源:[QQ音乐][1]
说明
--
- 目前只有体验版,如果有兴趣的同学可以私聊我,我帮您加入,名额有限。(博客标题下方有本人的qq链接)
- 因为个人开发者无法发布在线音乐播放小程序,所以开发该小程序目的只为学习小程序开发;
- 小程序涉及到到所有歌曲资源都来源于QQ音乐,部分API由本人对QQ音乐接口进行了二次封装(我会另外再写一篇文章专门用来分享API,敬请期待)
编辑器效果展示
-------
- 因为要压缩为GIF格式,所以加快了播放速度并且画质有点差

真机截图
----
[操作视频][3]
- 推荐页面

- [歌手列表][5]

- 各大排行榜

- 搜索页面

- 歌手详情页

- 歌单(排行榜)详情页

- 播放器页面

- 分享页面

## 目前实现的功能 ##
1. 歌单
2. 电台
3. 歌曲播放
4. MV播放(最近发现QQ音乐的接口不返回MV数据了,所以这个功能暂时无法展示)
5. [歌手列表][13]
6. 排行榜
7. 歌曲歌手搜索(支持模糊查询)
8. 最近搜索记录
9. 热门搜索词条
10. 歌手详情页
11. 歌单详情页
12. 歌曲分享
13. 查看评论
14. 歌词滚动
15. 最近播放歌曲
## 接下来准备实现的功能 ##
1. 用户登录
2. 私人FM
3. 增加点赞,评论功能
4. 歌曲播放方式(随机,单曲,循环)
5. 收藏
6. 全局播放器组件
项目目录
----
![图片描述][14]
1. comment--自定义组件(播放器组件,开发中)
2. img--存放图片
3. gedan--歌单页
4. index--首页
5. logs--歌手列表页
6. playSong--播放器页
7. rank--排行榜页
8. search--搜索页
9. share--分享页
10. singer--歌手详情页
11. top--歌单详情页
12. app.js--应用程序逻辑
13. app.json--应用程序配置
14. app.wxss--应用程序公共样式
----------
**app.json**
**应用程序配置文件**
```
{
"pages": [
"pages/index/index",
"pages/logs/logs",
"pages/rank/rank",
"pages/search/search",
"pages/gedan/gedan",
"pages/playSong/playSong",
"pages/singer/singer",
"pages/top/top",
"pages/share/share"
],//页面路径列表
"requiredBackgroundModes": [
"audio"
],//需要在后台使用的能力,这里我们使用到了【音乐播放】
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "HMusic",
"navigationBarTextStyle": "black"
},//全局到默认窗口表现
"tabBar": {
"list": [
{
"pagePath": "pages/index/index",
"text": "推荐"
},
{
"pagePath": "pages/logs/logs",
"text": "歌手"
},
{
"pagePath": "pages/rank/rank",
"text": "排行榜"
},
{
"pagePath": "pages/playSong/playSong",
"text": "播放器"
}
],
"position": "top"
}//tab栏到表现,默认是放在底部,根据position,我们将其设置为顶部显示
}
```
**每个页面都有各自到配置页面,可以对各自页面进行单独对配置**
[pageName].json用于指定页面工作时,window的设置:
```
{
// 导航条背景色
"navigationBarBackgroundColor": "#fff",
// 导航条前景色(只能是white/black)
"navigationBarTextStyle": "black",
// 导航条文本
"navigationBarTitleText": "HMusic",
// 窗口背景颜色
"backgroundColor": "#fff",
// 窗口前景色
"backgroundTextStyle": "dark",
// 是否开启下拉刷新
"enablePullDownRefresh": false
}
```
**app.js应用程序逻辑**
```
// App函数是一个全局函数,用于创建应用程序对象
App({
// ========== 全局数据对象(可以整个应用程序共享) ==========
globalData: { ... },
// ========== 应用程序全局方法 ==========
method1 (p1, p2) { ... },
method2 (p1, p2) { ... },
// ========== 生命周期方法 ==========
// 应用程序启动时触发一次
onLaunch () { ... },
// 当应用程序进入前台显示状态时触发
onShow () { ... },
// 当应用程序进入后台状态时触发
onHide () { ... }
})
```
欢迎Star[GitHub][15] [博客][16]
各位看官觉得有用的请点个星星
[1]: https://y.qq.com/
[3]: https://github.com/HEternally/weChatApp-HMusic/blob/master/img/QQ20190128-110802-HD.gif
[5]: https://juejin.im/post/5b9880dee51d450e7f52d370
[13]: https://juejin.im/post/5b9880dee51d450e7f52d370
[15]: https://github.com/HEternally/weChatApp-HMusic
[16]: http://heternally.ka94.com/
================================================
FILE: app.js
================================================
//app.js
App({
onLaunch: function (options) {
var that = this;
wx.getSystemInfo({
success: function(res) {
that.globalData.system = res;
},
})
},
onShow(options){
// console.log(options)
this.globalData.scene = options.scene;
if (options.query.songid) {
var songid = [],
name = [],
shareId = wx.getStorageSync('share_id');
songid.push(parseInt(options.query.songid));
name.push(options.query.name);
if (shareId) {
// console.log(songid[0], shareId[0])
if (songid[0] != shareId[0]) {
this.globalData.changeMusic = true;
} else {
this.globalData.changeMusic = false;
}
}
wx.setStorage({
key: 'share_id',
data: songid,
});
wx.setStorage({
key: 'share_name',
data: name,
});
}
},
onHide(){
// console.log('hide')
},
globalData: {},
timestampToTime:function(time) {
//将时间戳转为日期格式
var date = new Date(time * 1000);
var Y = date.getFullYear() + '-';
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
var D = date.getDate() + ' ';
var h = date.getHours() + ':';
var m = date.getMinutes() + ':';
var s = date.getSeconds();
return Y+M+D+h+m+s;
},
gePlay:function(id,num) {
//播放歌单的全部歌曲
wx.setStorageSync('labelid', id);//将最新歌单id存入缓存
wx.request({
url: '歌单API',
data: {},
success: res => {
var Data = res.data,
code = Data.code;
if (code == 0) {
var id = Data.songids.split(','),
songlist = Data.songlist,
music_name = [];
for (var i = 0; i < id.length; i++) {
id[i] = parseInt(id[i]);
music_name.push(songlist[i].songname);
}
// for(var i =0;i<songlist.length;i++) {
// music_name.push(songlist[i].songname);
// }
wx.setStorageSync('song_id', id);//将电台随机生成的歌曲id存入缓存
wx.setStorageSync('num', num);//当前要播放歌曲的序号
wx.setStorageSync('music_name', music_name);//对应歌曲id的歌曲名称
wx.switchTab({
url: '../playSong/playSong',
})
} else {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
},
error: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
})
}
})
================================================
FILE: app.json
================================================
{
"pages": [
"pages/index/index",
"pages/logs/logs",
"pages/rank/rank",
"pages/search/search",
"pages/gedan/gedan",
"pages/playSong/playSong",
"pages/singer/singer",
"pages/top/top",
"pages/share/share"
],
"requiredBackgroundModes": [
"audio"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "HMusic",
"navigationBarTextStyle": "black"
},
"tabBar": {
"list": [
{
"pagePath": "pages/index/index",
"text": "推荐"
},
{
"pagePath": "pages/logs/logs",
"text": "歌手"
},
{
"pagePath": "pages/rank/rank",
"text": "排行榜"
},
{
"pagePath": "pages/playSong/playSong",
"text": "播放器"
}
],
"position": "top"
}
}
================================================
FILE: app.wxss
================================================
/**app.wxss**/
@import 'weui.wxss';
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
/* padding: 200rpx 0; */
box-sizing: border-box;
background:#f4f4f4;
}
.main {
width:100%;
}
.hide {
display: none;
}
.load {
position: fixed;
top:50%;
left:50%;
transform:translate(-50%,-50%);
z-index:99;
}
.load .k-line {
display: inline-block;
width: 15px;
height: 15px;
border-radius: 15px;
margin-right: 5px;
}
.load .k-line2-1 {
animation: k-loadingA 1.5s 1s infinite;
background-color: #F44336;
}
.load .k-line2-2 {
animation: k-loadingA 1.5s .5s infinite;
background-color: #E91E63;
}
.load .k-line2-3 {
animation: k-loadingA 1.5s 0s infinite;
background-color: #9C27B0;
}
/* loading动画 */
@keyframes k-loadingA {
0% {
height:15px;
}
50% {
height:35px;
}
100% {
height:15px;
}
}
page {
height:100%;
background:#f4f4f4;
}
#mask {
position:fixed;
width:100%;
height:100%;
top:0;
left:0;
background-color:#000;
opacity: 0;
z-index:99999;
}
================================================
FILE: component/playMusic/playMusic.js
================================================
// component/playMusic/playMusic.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
================================================
FILE: component/playMusic/playMusic.json
================================================
{
"component": true,
"usingComponents": {}
}
================================================
FILE: component/playMusic/playMusic.wxml
================================================
<!--component/playMusic/playMusic.wxml-->
<view class="player">
<view class="normal-player" wx:if="{{fullScreen}}">
<view class="background">
<image wx:if="{{currentSong.image}}" src="{{currentSong.image}}"></image>
</view>
<view class="top">
<view class="subtitle">{{currentSong.singer}}</view>
</view>
<view class="middle" catchtouchstart="middleTouchStart" catchtouchmove="middleTouchMove" catchtouchend="middleTouchEnd">
<view class="middle-l">
<view class="cd-wrapper">
<view class="cd play" style="animation-play-state:{{playing ? '': 'paused'}}">
<image wx:if="{{currentSong.image}}" wsrc="{{currentSong.image}}" class="image"></image>
</view>
</view>
<view class="playing-lyric-wrapper">
<view class="playing-lyric">{{playingLyric}}</view>
</view>
</view>
<scroll-view class="middle-r" scroll-y style="">
</scroll-view>
</view>
</view>
</view>
================================================
FILE: component/playMusic/playMusic.wxss
================================================
/* component/playMusic/playMusic.wxss */
================================================
FILE: pages/gedan/gedan.js
================================================
const app = getApp()
Page({
data:{},
onLoad: function (option) {
wx.showLoading({
title: '加载中',
})
let disstid = option.disstid;
this.setData({
disstid:disstid
});
this.getGeDan(disstid, 0);
wx.showShareMenu();
},
getGeDan(disstid,begin) {
//获取歌单歌曲信息,disstid为歌单id,begin为开始号码
wx.request({
url: '歌单API',
data: {},
success: res => {
wx.hideLoading();
var dataList = this.data.list,
data = res.data.cdlist[0],
songids = data.songids.split(','),
songlist = data.songlist;
if (data.cur_song_num < 15) {
this.setData({
havaMusic:false
})
} else {
this.setData({
havaMusic: true
})
}
if (dataList.songlist) {
dataList.songlist = dataList.songlist.concat(songlist);
} else {
dataList = data;
}
data.desc = data.desc.replace(/ /g,' ');
data.desc = data.desc.replace(/´/g,"'");
data.desc = data.desc.replace(/<br>/g, "\n");
for(var i = 0;i<songids.length;i++) {
songids[i] = parseInt(songids[i]);
}
this.setData({
list: dataList,
songids:songids,
begin:begin
});
this.MusicFcg(begin);
},
error: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
});
}
})
},
MusicFcg(begin) {
var data = this.data.MusicFcg;
var len = this.data.songids.length;
if (len - begin > 15) {
data.req_0.param.ids = this.data.songids.slice(begin, parseInt(begin + 15));
data.req_0.param.types = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
} else {
var ll = len - begin;
data.req_0.param.types = [];
data.req_0.param.ids = this.data.songids.slice(begin);
for (var i = 0;i<ll;i ++) {
data.req_0.param.types.push(0);
}
}
wx.request({
url: '歌曲信息API',
method:'post',
data:JSON.stringify(data),
success:res=> {
var tricks = res.data.req_0.data.tracks,
songmid = [];
for (var i =0;i<tricks.length;i++) {
songmid.push(tricks[i].mid);
}
this.setData({
songmid:songmid
});
var reqData = this.data.req_0;
reqData.req_0.param.songmid = songmid;
wx.request({
url: 'API',
method:'post',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
data: JSON.stringify(reqData),
success:res=> {
// console.log(res);
var data= res.data.req_0.data,
midurlinfo = data.midurlinfo,
pix = data.sip[0],
// musicUrl1 = [],
mUrl = this.data.musicUrl;
for (var i=0;i<midurlinfo.length;i++) {
var url = pix + midurlinfo[i].purl;
mUrl.push(url);
}
this.setData({
musicUrl:mUrl
})
// console.log(this.data.musicUrl);
},
error:req=> {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
});
}
})
},
error:req=> {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
});
}
})
},
getMoreMusic:function(){
var disstid = this.data.disstid,
begin = this.data.begin;
begin = begin + 15;
this.getGeDan(disstid,begin);
},
playAll() {
var id = this.data.disstid;
app.gePlay(id,0);
wx.setStorage({
key: 'share_id',
data: [],
})
},
musicPlay(e){
var num = e.currentTarget.dataset.num,
id = this.data.disstid;
wx.showLoading({
title: '加载中',
})
app.gePlay(id,num);
app.globalData.shouldPlay = true;
// app.globalData.unload = true;
}
})
================================================
FILE: pages/gedan/gedan.json
================================================
{}
================================================
FILE: pages/gedan/gedan.wxml
================================================
<view class="gedan">
<view class="info_box">
<view class="info_box__bd">
<view class="album">
<view class="album__media">
<image src="{{list.logo}}" class="album__cover"></image>
</view>
<view class="album__bd">
<view class="album__name">
{{list.dissname}}
</view>
<view class="author">
<image src="{{list.headurl}}" class="author__avatar"></image>
<view class="author__name">
{{list.nickname}}
</view>
</view>
<view class="album__desc">
播放量:{{list.visitnum}}
</view>
</view>
</view>
<view class="opt_box">
<view class="btn_play_all" data-id="{{disstid}}" bindtap='playAll'>
播放全部
</view>
</view>
</view>
<image src="{{list.logo}}" class="info_box__bg"></image>
</view>
<view class="wrap">
<view class="main">
<view class="count_box">
<view class="count_box__desc">
歌单 <view class="count_box__number" style="display:inline-block;">共{{list.songnum}}首</view>
</view>
</view>
<view class="qui_list">
<block wx:for="{{list.songlist}}" wx:key="{{list.songlist}}">
<view style="opacity:{{item.pay.pay_play == 1? '0.5':'1'}};" class="qui_list__item" data-songid="{{item.id}}" data-mid="{{item.album.mid}}" data-name="{{item.title}}" data-singer="{{item.singer[0].name}}" data-num="{{index}}" bindtap="musicPlay">
<view class="qui_list__bd">
<view class="qui_list__box">
<view class="qui_list__tit">
{{item.title}}
</view>
<view class="qui_list__desc">
{{item.album.title}}
</view>
</view>
</view>
</view>
</block>
</view>
<view wx:if="{{havaMusic}}" class="check_more" bindtap='getMoreMusic'>点击加载更多歌曲</view>
<view class="qui_tit">
<view class="qui_tit__text">
歌单简介
</view>
</view>
<view class="intro">
<text decode>
{{list.desc}}
</text>
</view>
</view>
</view>
</view>
================================================
FILE: pages/gedan/gedan.wxss
================================================
page {
background: #fff;
color:#777;
}
.info_box {
position: absolute;
top: 0;
left: 0;
z-index: 10;
width: 100%;
height: 480rpx;
overflow: hidden;
color: #fff;
background: #fff;
}
.info_box__bd {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 4;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
background: rgba(0,0,0,.5);
}
.album {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
-webkit-box-sizing: border-box;
width: 100%;
margin-top: 34rpx;
padding: 0 32rpx;
overflow: hidden;
}
.album__media {
position: relative;
width: 250rpx;
margin-right: 20rpx;
overflow: hidden;
}
.album__cover {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 100%;
height: 100%;
object-fit: cover;
}
.album__media::after {
content: "";
display: block;
padding-top: 100%;
}
.album__bd {
position: relative;
-webkit-box-flex: 1;
}
.album__name {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
max-height: 94rpx;
line-height: 1.3;
overflow: hidden;
font-size: 18px;
font-weight: 300;
}
.author {
display: -webkit-box;
-webkit-box-align: center;
margin-top: 16rpx;
overflow: hidden;
}
.author__avatar {
display: block;
width: 48rpx;
height: 48rpx;
margin-right: 16rpx;
border-radius: 48rpx;
}
.author__bd {
-webkit-box-flex: 1;
}
.author__name {
display: block;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 14px;
color: #fff;
}
.album__desc {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
max-height: 72rpx;
overflow: hidden;
margin-top: 16rpx;
font-size: 12px;
}
.opt_box {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 196rpx;
padding: 0 32rpx;
-webkit-transition: 1s ease-in-out;
}
.btn_play_all {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
min-width: 260rpx;
padding: 0 40rpx;
height: 80rpx;
overflow: hidden;
text-align: center;
font-size: 16px;
color: #fff;
border-radius: 40rpx;
background: #31c27c;
}
.btn_play_all::before {
content: "";
display: block;
height: 0;
width: 0;
margin-right: -6rpx;
border-color: transparent transparent transparent #fff;
border-width: 14rpx 22rpx;
border-style: solid;
border-radius: 4rpx;
}
.info_box__bg {
position: absolute;
top: 0;
left: 0;
z-index: 3;
width: 100%;
height: 100%;
object-fit: cover;
-webkit-transform: scale(1.1) translateZ(0);
-webkit-filter: blur(36px);
}
.wrap {
/* position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 2;
padding-bottom: 0; */
overflow: hidden;
}
.main {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 100%;
padding-top: 480rpx;
padding-bottom: 100rpx;
overflow: hidden;
will-change: transform;
-webkit-transform: translateZ(0);
}
.count_box {
position: relative;
display: -webkit-box;
-webkit-box-align: center;
height: 108rpx;
margin: 0 32rpx -20rpx;
}
.count_box__desc {
font-size: 14px;
}
.count_box__number {
margin-left: 10rpx;
}
.qui_list {
overflow: hidden;
}
.qui_list__item {
position: relative;
display: -webkit-box;
}
.qui_list__bd {
position: relative;
-webkit-box-flex: 1;
display: -webkit-box;
-webkit-box-align: center;
padding: 20rpx 32rpx;
overflow: hidden;
}
.qui_list__box {
-webkit-box-flex: 1;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.qui_list__tit {
font-size: 16px;
color: #000;
display: -webkit-box;
-webkit-box-align: center;
overflow: hidden;
max-width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
}
.qui_list__desc{
display: -webkit-box;
-webkit-box-align: center;
overflow: hidden;
font-size:12px;
}
.qui_list__txt {
display: block;
max-width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size:16px;
}
.check_more {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 64rpx;
margin-bottom: 30rpx;
font-size: 28rpx;
}
.qui_tit {
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 110rpx;
padding: 0 80rpx;
overflow: hidden;
text-align: center;
}
.intro {
position: relative;
margin: 0 32rpx 40rpx;
overflow: hidden;
text-align: justify;
word-wrap: break-word;
font-size: 14px;
}
================================================
FILE: pages/index/index.js
================================================
const app = getApp()
Page({
data: {
banner: [], //轮播图
radioList: [], //电台
songList: [], //歌单
loading: false, //是否加载完成
},
onLoad: function() {
wx.showShareMenu();
wx.showLoading({
title: '加载中',
});
// wx.request({
// url: '首页信息API',
// data:{},
// success:res=> {
// let data = res.data;
// var that = this;
// if (data.code == 0) {
var data = {
"data": {
"slider": [{
"linkUrl": "http://y.qq.com/w/album.html?albummid=004ZGlrw3Me8eI",
"picUrl": "http://y.gtimg.cn/music/common/upload/MUSIC_FOCUS/1155264.jpg",
"id": 19857
}, {
"linkUrl": "http://y.qq.com/w/album.html?albummid=003vVUT83SaF4l",
"picUrl": "http://y.gtimg.cn/music/common/upload/MUSIC_FOCUS/1155138.jpg",
"id": 19858
}, {
"linkUrl": "https://y.qq.com/m/digitalbum/gold/index.html?openinqqmusic=1_video=true&id=5447522&g_f=shoujijiaodian",
"picUrl": "http://y.gtimg.cn/music/common/upload/MUSIC_FOCUS/1155430.jpg",
"id": 19853
}, {
"linkUrl": "http://y.qq.com/w/album.html?albummid=000uoyVq093DIY",
"picUrl": "http://y.gtimg.cn/music/common/upload/MUSIC_FOCUS/1155139.jpg",
"id": 19859
}, {
"linkUrl": "https://y.qq.com/apg/612/index.html?ADTAG=JDT&openinqqmusic=1",
"picUrl": "http://y.gtimg.cn/music/common/upload/MUSIC_FOCUS/1155328.jpg",
"id": 19850
}],
"radioList": [{
"picUrl": "http://y.gtimg.cn/music/photo/radio/track_radio_199_13_1.jpg",
"Ftitle": "热歌",
"radioid": 199
}, {
"picUrl": "http://y.gtimg.cn/music/photo/radio/track_radio_307_13_1.jpg",
"Ftitle": "一人一首招牌歌",
"radioid": 307
}],
"songList": [{
"songListDesc": "催泪大杀器!盘点演唱会经典万人大合唱",
"picUrl": "http://p.qpic.cn/music_cover/1Fr9IFMhWDPeUzWKVEjn3QTL2eX2QziaJmaL0ZAmsvtW71ic9IDUoYzg/300?n=1",
"id": "2646688496",
"accessnum": 9927141,
"songListAuthor": "金青松",
"pic_mid": "00333So02drvak",
"album_pic_mid": ""
}, {
"songListDesc": "纳尼?这些华语歌手竟然会唱日语歌!",
"picUrl": "http://p.qpic.cn/music_cover/z8wAFqicQ1qhImeiajkrgiaR4hYM3pzsUULFnicXshFXdw9uGkm261Ex9g/300?n=1",
"id": "1144416825",
"accessnum": 675463,
"songListAuthor": "风吹草地",
"pic_mid": "0013j8zs1jRnLQ",
"album_pic_mid": ""
}, {
"songListDesc": "精选内地十大民谣歌手代表作",
"picUrl": "http://p.qpic.cn/music_cover/hVUsfUFG2DV466URqw7PT7X66OknPIhic2mKDgicawN4qThIR7yhYY1w/300?n=1",
"id": "2043041547",
"accessnum": 1295560,
"songListAuthor": "1's ヽ",
"pic_mid": "004bFmjW2PXSqF",
"album_pic_mid": "0032YJyg2yF6Dd"
}, {
"songListDesc": "2016billboard嘻哈榜",
"picUrl": "http://p.qpic.cn/music_cover/tkduvk4dwqBxwzZhsNe0nwkwyiaLHVkxtla7REsX0yNkhibOH3Bdb2og/300?n=1",
"id": "2040362185",
"accessnum": 1161101,
"songListAuthor": "CREAMSAUCEONMEBABY",
"pic_mid": "000cL0xT2csmd7",
"album_pic_mid": "001iJq1y1Uq3zV"
}, {
"songListDesc": "浮光掠影:ACG纯音乐赏析合辑",
"picUrl": "http://p.qpic.cn/music_cover/XMPAjfs5uwGZdWII3osvAvCRyNWx8Pqy5Yice41OCZlBhLtk0p0icNvg/300?n=1",
"id": "1723063372",
"accessnum": 998181,
"songListAuthor": "黎桐同",
"pic_mid": "000xFtbN1l8ye8",
"album_pic_mid": "002egQPg3DWcCS"
}, {
"songListDesc": "trip-hop单曲大推荐",
"picUrl": "http://y.gtimg.cn/music/photo_new/T005R600x600M000002CJKAY1LKpcz.jpg?n=1",
"id": "3482605622",
"accessnum": 357712,
"songListAuthor": "哑忍",
"pic_mid": "",
"album_pic_mid": "004aOQhn3PPOpK"
}]
}
},
slider = data.data.slider,
radioList = data.data.radioList,
songList = data.data.songList,
radioId = []
for (var i = 0; i < radioList.length; i++) {
radioId.push(radioList[i].radioid);
}
this.setData({
banner: slider,
radioList: radioList,
songList: songList,
loading: true
});
app.globalData.radioId = radioId;
wx.hideLoading();
// }
// },
// fail:req=> {
// wx.showToast({
// icon:'none',
// title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
// })
// }
// })
},
go_radio: function(e) {
wx.showLoading({
title: '加载中',
});
var labelid = e.currentTarget.dataset.id;
wx.request({
url: '电台API',
method: 'get',
data: {},
success: res => {
var Data = res.data,
code = Data.code;
if (code == 0) {
var radioData = Data.data,
id = [],
music_name = [];
for (var i = 0; i < radioData.length; i++) {
id.push(radioData[i].id);
music_name.push(radioData[i].name);
}
wx.setStorageSync('song_id', id); //将电台随机生成的歌曲id存入缓存
wx.setStorageSync('music_name', music_name); //将随机生成的歌曲信息存入缓存
wx.setStorageSync('num', 0); //播放第一首歌
wx.setStorageSync('labelid', labelid); //写入新的广播id
app.globalData.shouldPlay = true; //重新请求音乐接口,因为每次获取到的广播歌曲都是不同的
// app.globalData.unload = true;
wx.switchTab({
url: '../playSong/playSong',
})
} else {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
},
error: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
})
},
selectHot: function(e) {
let id = e.currentTarget.dataset.id;
wx.showLoading({
title: '加载中',
});
app.gePlay(id, 0);
},
go_search() { //跳到搜索页
wx.navigateTo({
url: '../search/search',
})
},
getGedan(e) { //跳到歌单详情页
let id = e.currentTarget.dataset.id;
//跳转到歌单页面
wx.navigateTo({
url: '../gedan/gedan?disstid=' + id,
})
}
})
================================================
FILE: pages/index/index.json
================================================
{
}
================================================
FILE: pages/index/index.wxml
================================================
<!--index.wxml-->
<view class="container">
<!-- <view style="width:100%;height:168rpx;">
<official-account bindload=""></official-account>
</view> -->
<view class="page__bd">
<view class="weui-search-bar">
<view class="weui-search-bar__form">
<view class="weui-search-bar__box">
<icon class="weui-icon-search_in-box" type="search" size="14"></icon>
<input type="text" class="weui-search-bar__input" placeholder="搜索歌曲、歌手" />
<view class="weui-icon-clear" wx:if="{{inputVal.length > 0}}">
<icon type="clear" size="14"></icon>
</view>
</view>
<label class="weui-search-bar__label" bindtap="go_search">
<icon class="weui-icon-search" type="search" size="14"></icon>
<view class="weui-search-bar__text">搜索歌曲、歌手</view>
</label>
</view>
<view class="weui-search-bar__cancel-btn" hidden="{{!inputShowed}}" bindtap="hideInput">取消</view>
</view>
</view>
<view class="main" wx:if="{{loading}}">
<!-- 轮播图 -->
<swiper class="banner" indicator-dots="true" indicator-color="rgba(255,255,255,.3)" indicator-active-color="#fff" autoplay='true' interval='2000' circular='true'>
<block wx:for="{{banner}}" wx:key="{{banner}}">
<swiper-item data-id="{{item.linkUrl}}">
<image src="{{item.picUrl}}" class="banner-image"></image>
</swiper-item>
</block>
</swiper>
<!-- 电台 -->
<view class="mod_radio_list">
<view class="list_title">电台</view>
<view class="radio_wrapper">
<block wx:for="{{radioList}}" wx:key="{{radioList}}">
<view class="radio_img" data-id="{{item.radioid}}" bindtap="go_radio">
<image class="radio_image" src="{{item.picUrl}}"></image>
<view class="radio_text">{{item.Ftitle}}</view>
<image class="radio_play" src="../../img/play.png"></image>
</view>
</block>
<view class="clearfix"></view>
</view>
</view>
<!-- 热门歌单 -->
<view class="mod_radio_list">
<view class="list_title">热门歌单</view>
<view class="radio_wrapper">
<block wx:for="{{songList}}" wx:key="{{songList}}">
<view class="radio_img" data-id="{{item.id}}" bindtap="getGedan">
<image class="radio_image" src="{{item.picUrl}}"></image>
<view class="radio_text" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{{item.songListDesc}}</view>
<view class="radio_text2">{{item.songListAuthor}}</view>
<image class="radio_icon" src="../../img/music.png"></image>
<image class="radio_play" data-id="{{item.id}}" src="../../img/play.png" catchtap='selectHot'></image>
<text class="radio_num">{{item.accessnum}}</text>
</view>
</block>
<view class="clearfix"></view>
</view>
</view>
<!-- <Music-play></Music-play> -->
</view>
</view>
================================================
FILE: pages/index/index.wxss
================================================
/**index.wxss**/
page {
width: 100%;
}
.page__bd {
width:100%;
}
.main {
width:100%;
/* margin-top:48px; */
}
.banner {
width:100%;
}
.banner .banner-image {
width:100%;
height:300rpx;
}
.mod_radio_list {
width:95%;
margin:10px;
}
.list_title {
font-size:16px;
color:#000;
margin-bottom:11px;
font-weight: normal;
}
.radio_wrapper {
overflow: hidden;
margin-right: -10px;
}
.radio_wrapper .radio_img {
position:relative;
float:left;
width:48%;
padding-right: 4px;
margin-bottom:10px;
}
.radio_wrapper .radio_img .radio_image {
width:100%;
height:410rpx;
}
.radio_wrapper .radio_img .radio_icon {
position: absolute;
width:40rpx;
height:40rpx;
left:14rpx;
bottom:100rpx;
}
.radio_wrapper .radio_img .radio_play {
position: absolute;
width:48rpx;
height:48rpx;
right:14rpx;
bottom:100rpx;
}
.radio_wrapper .radio_img .radio_text {
position:absolute;
width:90%;
height: 36px;
line-height: 18px;
bottom:0;
padding: 2px 7px 5px;
background:#fff;
font-size:14px;
white-space: normal;
word-wrap: break-word;
}
.radio_wrapper .radio_img .radio_text2 {
position:absolute;
bottom: 0;
z-index:2;
font-size:12px;
width:90%;
padding: 0 7px 5px;
white-space: normal;
word-wrap: break-word;
}
.radio_wrapper .radio_img .radio_num {
position: absolute;
color:#fff;
left:60rpx;
bottom:100rpx;
font-size:12px;
font-weight: bold;
}
.clearfix {
clear:all;
}
================================================
FILE: pages/logs/logs.js
================================================
//logs.js
const util = require('../../utils/util.js')
const app = getApp()
const TITLE_HEIGHT = 30
const ANCHOR_HEIGHT = 18
Page({
data: {
toSingerNum: '',
logs: [],
scrollTop: 0,
HOT_NAME: '热',
HOT_SINGER_LEN: 10,
listHeight: [],
currentIndex: 0,
fixedTitle: '',
fixedTop: 0,
},
onLoad: function() {
var that = this;
wx.showLoading({
title: '加载中',
})
wx.showShareMenu();
// wx.request({
// url: '歌手API',
// data: {},
// success:res=> {
var data = {
"code": 0,
"data": {
"list": [{
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "X",
"Fother_name": "Joker",
"Fsinger_id": "5062",
"Fsinger_mid": "002J4UUk29y8BY",
"Fsinger_name": "薛之谦",
"Fsinger_tag": "541,555",
"Fsort": "1",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "Jay Chou",
"Fsinger_id": "4558",
"Fsinger_mid": "0025NhlN2yWrP4",
"Fsinger_name": "周杰伦",
"Fsinger_tag": "541,555",
"Fsort": "2",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "2",
"Fattribute_3": "5",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "B",
"Fother_name": "빅뱅",
"Fsinger_id": "11733",
"Fsinger_mid": "004AlfUb0cVkN1",
"Fsinger_name": "BIGBANG (빅뱅)",
"Fsinger_tag": "645,663,676,679,694,703,710,713",
"Fsort": "3",
"Ftrend": "0",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "1",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "C",
"Fother_name": "Eason Chan",
"Fsinger_id": "143",
"Fsinger_mid": "003Nz2So3XXYek",
"Fsinger_name": "陈奕迅",
"Fsinger_tag": "555",
"Fsort": "4",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "44",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "L",
"Fother_name": "JJ Lin",
"Fsinger_id": "4286",
"Fsinger_mid": "001BLpXF2DyJe2",
"Fsinger_name": "林俊杰",
"Fsinger_tag": "541,555",
"Fsort": "5",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "0",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "A",
"Fother_name": "艾伦·沃克",
"Fsinger_id": "944940",
"Fsinger_mid": "0020PeOh4ZaCw1",
"Fsinger_name": "Alan Walker (艾伦·沃克)",
"Fsinger_tag": "",
"Fsort": "6",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "L",
"Fother_name": "Ronghao Li",
"Fsinger_id": "60505",
"Fsinger_mid": "000aHmbL2aPXWH",
"Fsinger_name": "李荣浩",
"Fsinger_tag": "",
"Fsort": "7",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "T",
"Fother_name": "",
"Fsinger_id": "34412",
"Fsinger_mid": "000zmpju02bEBm",
"Fsinger_name": "TFBOYS",
"Fsinger_tag": "",
"Fsort": "8",
"Ftrend": "1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "6",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "M",
"Fother_name": "魔力红乐团",
"Fsinger_id": "4983",
"Fsinger_mid": "001JuGrt372YIQ",
"Fsinger_name": "Maroon 5 (魔力红乐团)",
"Fsinger_tag": "644,645",
"Fsort": "9",
"Ftrend": "1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "X",
"Fother_name": "Vae Xu",
"Fsinger_id": "7221",
"Fsinger_mid": "000CK5xN3yZDJt",
"Fsinger_name": "许嵩",
"Fsinger_tag": "",
"Fsort": "10",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "1",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "G",
"Fother_name": "Gem Tang",
"Fsinger_id": "13948",
"Fsinger_mid": "001fNHEf1SFEFN",
"Fsinger_name": "G.E.M. 邓紫棋",
"Fsinger_tag": "541,555",
"Fsort": "11",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "Jason Zhang",
"Fsinger_id": "6499",
"Fsinger_mid": "002azErJ0UcDN6",
"Fsinger_name": "张杰",
"Fsinger_tag": "555",
"Fsort": "12",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "L",
"Fother_name": "",
"Fsinger_id": "204664",
"Fsinger_mid": "001SqkF53OEhdO",
"Fsinger_name": "鹿晗",
"Fsinger_tag": "",
"Fsort": "13",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "1",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "Ada Zhuang",
"Fsinger_id": "89698",
"Fsinger_mid": "003Cn3Yh16q1MO",
"Fsinger_name": "庄心妍",
"Fsinger_tag": "555",
"Fsort": "14",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "1",
"Fgenre": "0",
"Findex": "Y",
"Fother_name": "Aska Yang",
"Fsinger_id": "11608",
"Fsinger_mid": "003tMm0y0TuewY",
"Fsinger_name": "杨宗纬",
"Fsinger_tag": "555",
"Fsort": "15",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "15",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "J",
"Fother_name": "贾斯汀·比伯",
"Fsinger_id": "16257",
"Fsinger_mid": "002DYpxl3hW3EP",
"Fsinger_name": "Justin Bieber (贾斯汀·比伯)",
"Fsinger_tag": "645,710",
"Fsort": "16",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "",
"Fsinger_id": "199515",
"Fsinger_mid": "0003ZpE43ypssl",
"Fsinger_name": "张碧晨",
"Fsinger_tag": "",
"Fsort": "17",
"Ftrend": "-1",
"Ftype": "1",
"voc": "1"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "H",
"Fother_name": "",
"Fsinger_id": "163550",
"Fsinger_mid": "002Vcz8F2hpBQj",
"Fsinger_name": "华晨宇",
"Fsinger_tag": "555",
"Fsort": "18",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "1",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "Jacky Cheung",
"Fsinger_id": "174",
"Fsinger_mid": "004Be55m1SJaLk",
"Fsinger_name": "张学友",
"Fsinger_tag": "555",
"Fsort": "19",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "T",
"Fother_name": "Hebe Tian",
"Fsinger_id": "4701",
"Fsinger_mid": "001ByAsv3XCdgm",
"Fsinger_name": "田馥甄",
"Fsinger_tag": "555",
"Fsort": "20",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "2",
"Fattribute_3": "4",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "R",
"Fother_name": "ラッドウィンプス",
"Fsinger_id": "9962",
"Fsinger_mid": "000f1b6W1wzyRN",
"Fsinger_name": "RADWIMPS (ラッドウィンプス)",
"Fsinger_tag": "645,683,690,709",
"Fsort": "21",
"Ftrend": "1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "1",
"Fgenre": "0",
"Findex": "X",
"Fother_name": "Jam Hsiao",
"Fsinger_id": "13203",
"Fsinger_mid": "004bsIDK0awMOv",
"Fsinger_name": "萧敬腾",
"Fsinger_tag": "",
"Fsort": "22",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "N",
"Fother_name": "",
"Fsinger_id": "137",
"Fsinger_mid": "003LCFXH0eodXv",
"Fsinger_name": "那英",
"Fsinger_tag": "555",
"Fsort": "23",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "W",
"Fother_name": "Leehom Wang",
"Fsinger_id": "265",
"Fsinger_mid": "001JDzPT3JdvqK",
"Fsinger_name": "王力宏",
"Fsinger_tag": "541,573",
"Fsort": "24",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "Jane Zhang",
"Fsinger_id": "4607",
"Fsinger_mid": "000aw4WC2EQYTv",
"Fsinger_name": "张靓颖",
"Fsinger_tag": "555",
"Fsort": "25",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "W",
"Fother_name": "Kris Wu",
"Fsinger_id": "180646",
"Fsinger_mid": "002yeznU3VAVEV",
"Fsinger_name": "吴亦凡",
"Fsinger_tag": "",
"Fsort": "26",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "1",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "B",
"Fother_name": "",
"Fsinger_id": "2",
"Fsinger_mid": "002pUZT93gF4Cu",
"Fsinger_name": "BEYOND",
"Fsinger_tag": "541,558,569",
"Fsort": "27",
"Ftrend": "1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "L",
"Fother_name": "Yoga Lin",
"Fsinger_id": "11606",
"Fsinger_mid": "001f0VyZ1hmWZ1",
"Fsinger_name": "林宥嘉",
"Fsinger_tag": "555",
"Fsort": "28",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "1",
"Fgenre": "17",
"Findex": "N",
"Fother_name": "NZBZ",
"Fsinger_id": "69205",
"Fsinger_mid": "003ZQQb64D5317",
"Fsinger_name": "南征北战",
"Fsinger_tag": "",
"Fsort": "29",
"Ftrend": "1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "W",
"Fother_name": "Silence Wan",
"Fsinger_id": "3954",
"Fsinger_mid": "001z2JmX09LLgL",
"Fsinger_name": "汪苏泷",
"Fsinger_tag": "541,555,562",
"Fsort": "30",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "2",
"Fattribute_3": "5",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "G",
"Fother_name": "权志龙",
"Fsinger_id": "19851",
"Fsinger_mid": "000t2qd13dLpae",
"Fsinger_name": "G-DRAGON (权志龙)",
"Fsinger_tag": "646,663,666,676,679,690,705,714",
"Fsort": "31",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "S",
"Fother_name": "Sodagreen",
"Fsinger_id": "5924",
"Fsinger_mid": "000Q4W691sMvLG",
"Fsinger_name": "苏打绿",
"Fsinger_tag": "544,555,569",
"Fsort": "32",
"Ftrend": "1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "P",
"Fother_name": "",
"Fsinger_id": "4442",
"Fsinger_mid": "000mLAT42CFWNa",
"Fsinger_name": "朴树",
"Fsinger_tag": "541,555,558",
"Fsort": "33",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "W",
"Fother_name": "Faye Wong",
"Fsinger_id": "264",
"Fsinger_mid": "000GDDuQ3sGQiT",
"Fsinger_name": "王菲",
"Fsinger_tag": "555",
"Fsort": "34",
"Ftrend": "1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "K",
"Fother_name": "",
"Fsinger_id": "11761",
"Fsinger_mid": "002Sm9iK4RIsCr",
"Fsinger_name": "筷子兄弟",
"Fsinger_tag": "555",
"Fsort": "35",
"Ftrend": "-1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "M",
"Fother_name": "",
"Fsinger_id": "160022",
"Fsinger_mid": "0035kILA0ydw3j",
"Fsinger_name": "MC天佑",
"Fsinger_tag": "",
"Fsort": "36",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "1",
"Fgenre": "0",
"Findex": "M",
"Fother_name": "",
"Fsinger_id": "1045852",
"Fsinger_mid": "000WbpKa3WokLD",
"Fsinger_name": "MC魏小然",
"Fsinger_tag": "",
"Fsort": "37",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "J",
"Fother_name": "",
"Fsinger_id": "12111",
"Fsinger_mid": "004YXxql1sSr2o",
"Fsinger_name": "金志文",
"Fsinger_tag": "541,555",
"Fsort": "40",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "S",
"Fother_name": "Niko Sun",
"Fsinger_id": "22874",
"Fsinger_mid": "001oXbjs29oPul",
"Fsinger_name": "孙子涵",
"Fsinger_tag": "541,555,562",
"Fsort": "41",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "A",
"Fother_name": "黄丽玲",
"Fsinger_id": "6028",
"Fsinger_mid": "003ArN8Z0WpjTz",
"Fsinger_name": "A-Lin",
"Fsinger_tag": "555",
"Fsort": "42",
"Ftrend": "1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "X",
"Fother_name": "",
"Fsinger_id": "3376",
"Fsinger_mid": "00235pCx2tYjlq",
"Fsinger_name": "许巍",
"Fsinger_tag": "541,558",
"Fsort": "43",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "1",
"Fgenre": "0",
"Findex": "S",
"Fother_name": "Donye.S",
"Fsinger_id": "61620",
"Fsinger_mid": "004KKLWZ4320g1",
"Fsinger_name": "宋冬野",
"Fsinger_tag": "544,558",
"Fsort": "45",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "aMEI",
"Fsinger_id": "141",
"Fsinger_mid": "003JGrNQ3RjelA",
"Fsinger_name": "张惠妹",
"Fsinger_tag": "555",
"Fsort": "46",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "Steve Chou",
"Fsinger_id": "4365",
"Fsinger_mid": "004NMZuf2BLjg8",
"Fsinger_name": "周传雄",
"Fsinger_tag": "541,555",
"Fsort": "47",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "Jeff Chang",
"Fsinger_id": "167",
"Fsinger_mid": "0000mFvh1jtLcz",
"Fsinger_name": "张信哲",
"Fsinger_tag": "555",
"Fsort": "48",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Y",
"Fother_name": "",
"Fsinger_id": "944274",
"Fsinger_mid": "004coWV04C5FCV",
"Fsinger_name": "杨洋",
"Fsinger_tag": "",
"Fsort": "49",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "X",
"Fother_name": "L Xu",
"Fsinger_id": "22704",
"Fsinger_mid": "004aRKga0CXIPm",
"Fsinger_name": "徐良",
"Fsinger_tag": "541,562",
"Fsort": "50",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "1",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "C",
"Fother_name": "Jordan Chan",
"Fsinger_id": "4284",
"Fsinger_mid": "004DFS271osAwp",
"Fsinger_name": "陈小春",
"Fsinger_tag": "555",
"Fsort": "51",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Q",
"Fother_name": "Wanting Qu",
"Fsinger_id": "34703",
"Fsinger_mid": "0030RkE50nmpWC",
"Fsinger_name": "曲婉婷",
"Fsinger_tag": "",
"Fsort": "52",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "1",
"Fgenre": "0",
"Findex": "P",
"Fother_name": "",
"Fsinger_id": "1102711",
"Fsinger_mid": "003vSrlp0ujV6o",
"Fsinger_name": "鹏泊",
"Fsinger_tag": "",
"Fsort": "53",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "44",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "S",
"Fother_name": "Stefanie Sun",
"Fsinger_id": "109",
"Fsinger_mid": "001pWERg3vFgg8",
"Fsinger_name": "孙燕姿",
"Fsinger_tag": "555,558",
"Fsort": "54",
"Ftrend": "1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "6",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "W",
"Fother_name": "维兹·卡利法",
"Fsinger_id": "12978",
"Fsinger_mid": "000CQ06r24Naco",
"Fsinger_name": "Wiz Khalifa (维兹·卡利法)",
"Fsinger_tag": "644",
"Fsort": "55",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "Phil Chang",
"Fsinger_id": "168",
"Fsinger_mid": "0044wQXL0ElWF1",
"Fsinger_name": "张宇",
"Fsinger_tag": "555",
"Fsort": "56",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "G",
"Fother_name": "",
"Fsinger_id": "61959",
"Fsinger_mid": "002OfR3n1vx75j",
"Fsinger_name": "葛林",
"Fsinger_tag": "",
"Fsort": "58",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "1",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "M",
"Fother_name": "Karen Mok",
"Fsinger_id": "54",
"Fsinger_mid": "000cISVf2QqLc6",
"Fsinger_name": "莫文蔚",
"Fsinger_tag": "555",
"Fsort": "59",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "1",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "",
"Fsinger_id": "1012038",
"Fsinger_mid": "004eaDNU1nfRO0",
"Fsinger_name": "张磊",
"Fsinger_tag": "",
"Fsort": "60",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "J",
"Fother_name": "",
"Fsinger_id": "1041231",
"Fsinger_mid": "0023ni2j3F9CpN",
"Fsinger_name": "Jam",
"Fsinger_tag": "",
"Fsort": "61",
"Ftrend": "1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "N",
"Fother_name": "Milk Coffee",
"Fsinger_id": "4422",
"Fsinger_mid": "0012bj8d36Xkw1",
"Fsinger_name": "牛奶咖啡",
"Fsinger_tag": "552,555",
"Fsort": "62",
"Ftrend": "1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "W",
"Fother_name": "",
"Fsinger_id": "4604",
"Fsinger_mid": "001adLDR1SS40P",
"Fsinger_name": "汪峰",
"Fsinger_tag": "541,555,569",
"Fsort": "63",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "6",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "C",
"Fother_name": "查理·普斯",
"Fsinger_id": "39000",
"Fsinger_mid": "000jnR7q3pCzYG",
"Fsinger_name": "Charlie Puth (查理·普斯)",
"Fsinger_tag": "644",
"Fsort": "64",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "B",
"Fother_name": "",
"Fsinger_id": "4545",
"Fsinger_mid": "003LaMHm42u7qS",
"Fsinger_name": "本兮",
"Fsinger_tag": "",
"Fsort": "65",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "H",
"Fother_name": "",
"Fsinger_id": "24833",
"Fsinger_mid": "002mze3U0NYXOM",
"Fsinger_name": "胡夏",
"Fsinger_tag": "555",
"Fsort": "66",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "1",
"Fgenre": "0",
"Findex": "M",
"Fother_name": "MXD",
"Fsinger_id": "28227",
"Fsinger_mid": "003wWQBU0fHBcj",
"Fsinger_name": "马旭东",
"Fsinger_tag": "555",
"Fsort": "67",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "1",
"Fgenre": "0",
"Findex": "W",
"Fother_name": "Vai",
"Fsinger_id": "38625",
"Fsinger_mid": "001WcO2V0TLCv3",
"Fsinger_name": "威仔",
"Fsinger_tag": "",
"Fsort": "68",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "L",
"Fother_name": "",
"Fsinger_id": "11707",
"Fsinger_mid": "002xpOdd4Dh6pu",
"Fsinger_name": "李易峰",
"Fsinger_tag": "555",
"Fsort": "70",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Y",
"Fother_name": "",
"Fsinger_id": "7485",
"Fsinger_mid": "004FtTNW2b0tJi",
"Fsinger_name": "雨宗林",
"Fsinger_tag": "555",
"Fsort": "71",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "G",
"Fother_name": "Claire Guo",
"Fsinger_id": "11626",
"Fsinger_mid": "0043Zxw10txf5O",
"Fsinger_name": "郭静",
"Fsinger_tag": "555",
"Fsort": "72",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "L",
"Fother_name": "Chris Lee",
"Fsinger_id": "4615",
"Fsinger_mid": "002ZOuVm3Qn20Y",
"Fsinger_name": "李宇春",
"Fsinger_tag": "555",
"Fsort": "73",
"Ftrend": "1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "Angela Zhang",
"Fsinger_id": "224",
"Fsinger_mid": "002raUWw3PXdkT",
"Fsinger_name": "张韶涵",
"Fsinger_tag": "555",
"Fsort": "74",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "M",
"Fother_name": "MMD",
"Fsinger_id": "943468",
"Fsinger_mid": "003rJfMG3PPqWd",
"Fsinger_name": "萌萌哒天团",
"Fsinger_tag": "",
"Fsort": "75",
"Ftrend": "1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "6",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "F",
"Fother_name": "打倒男孩",
"Fsinger_id": "4868",
"Fsinger_mid": "003CKb192ggBqi",
"Fsinger_name": "Fall Out Boy (打倒男孩)",
"Fsinger_tag": "645",
"Fsort": "76",
"Ftrend": "1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "6",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "R",
"Fother_name": "蕾哈娜",
"Fsinger_id": "6966",
"Fsinger_mid": "002MiBdR19HQWx",
"Fsinger_name": "Rihanna (蕾哈娜)",
"Fsinger_tag": "710",
"Fsort": "77",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "6",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "T",
"Fother_name": "烟民二人组",
"Fsinger_id": "156095",
"Fsinger_mid": "004ABIFV1EZUAj",
"Fsinger_name": "The Chainsmokers (烟民二人组)",
"Fsinger_tag": "",
"Fsort": "78",
"Ftrend": "-1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "X",
"Fother_name": "Ann",
"Fsinger_id": "23800",
"Fsinger_mid": "001oNMzI3WznzG",
"Fsinger_name": "夏婉安",
"Fsinger_tag": "",
"Fsort": "79",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "",
"Fsinger_id": "968571",
"Fsinger_mid": "0042kZuh1dgLre",
"Fsinger_name": "周二珂",
"Fsinger_tag": "",
"Fsort": "80",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "8",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "T",
"Fother_name": "",
"Fsinger_id": "947788",
"Fsinger_mid": "000ndQx82fsq8Z",
"Fsinger_name": "Tez Cadey",
"Fsinger_tag": "",
"Fsort": "81",
"Ftrend": "0",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "6",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "E",
"Fother_name": "艾米纳姆",
"Fsinger_id": "4880",
"Fsinger_mid": "000yDAjj2TE9j8",
"Fsinger_name": "Eminem (艾米纳姆)",
"Fsinger_tag": "645,647",
"Fsort": "82",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "1",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "Hins Cheung",
"Fsinger_id": "219",
"Fsinger_mid": "003AfDK34H82GU",
"Fsinger_name": "张敬轩",
"Fsinger_tag": "541,555",
"Fsort": "83",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "1",
"Fgenre": "17",
"Findex": "Q",
"Fother_name": "",
"Fsinger_id": "1042260",
"Fsinger_mid": "0020IaUo4Vgsjk",
"Fsinger_name": "齐一",
"Fsinger_tag": "",
"Fsort": "84",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "H",
"Fother_name": "",
"Fsinger_id": "1043567",
"Fsinger_mid": "004QoDUs3jfOC6",
"Fsinger_name": "韩安旭",
"Fsinger_tag": "",
"Fsort": "85",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "L",
"Fother_name": "Sam Lee",
"Fsinger_id": "38",
"Fsinger_mid": "002seUhN1Akj7J",
"Fsinger_name": "李圣杰",
"Fsinger_tag": "555,562",
"Fsort": "86",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Z",
"Fother_name": "",
"Fsinger_id": "63938",
"Fsinger_mid": "000SJp6n49rDgl",
"Fsinger_name": "张赫宣",
"Fsinger_tag": "",
"Fsort": "87",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "2",
"Fattribute_3": "5",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "9",
"Fother_name": "防弹少年团",
"Fsinger_id": "162691",
"Fsinger_mid": "001TpDgn4SxyJn",
"Fsinger_name": "방탄소년단 (防弹少年团)",
"Fsinger_tag": "536,678,663,676",
"Fsort": "88",
"Ftrend": "1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "L",
"Fother_name": "Richael Liu",
"Fsinger_id": "161444",
"Fsinger_mid": "003bQEFA3KrvLI",
"Fsinger_name": "刘瑞琦",
"Fsinger_tag": "555",
"Fsort": "89",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "7",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "A",
"Fother_name": "阿黛尔",
"Fsinger_id": "12578",
"Fsinger_mid": "003CoxJh1zFPpx",
"Fsinger_name": "Adele (阿黛尔)",
"Fsinger_tag": "644",
"Fsort": "90",
"Ftrend": "1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "1",
"Fgenre": "0",
"Findex": "S",
"Fother_name": "",
"Fsinger_id": "1011983",
"Fsinger_mid": "001t94rh4OpQn0",
"Fsinger_name": "双笙",
"Fsinger_tag": "",
"Fsort": "91",
"Ftrend": "1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "T",
"Fother_name": "Escape Plan",
"Fsinger_id": "15514",
"Fsinger_mid": "001Yxpxc0OaUUX",
"Fsinger_name": "逃跑计划",
"Fsinger_tag": "544,569",
"Fsort": "92",
"Ftrend": "1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "2",
"Fattribute_3": "5",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "B",
"Fother_name": "",
"Fsinger_id": "1190986",
"Fsinger_mid": "003DBAjk2MMfhR",
"Fsinger_name": "BLACKPINK",
"Fsinger_tag": "",
"Fsort": "93",
"Ftrend": "0",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Y",
"Fother_name": "Jackson",
"Fsinger_id": "198135",
"Fsinger_mid": "001IoTZp19YMDG",
"Fsinger_name": "易烊千玺",
"Fsinger_tag": "",
"Fsort": "94",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "6",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "O",
"Fother_name": "猫头鹰之城",
"Fsinger_id": "12926",
"Fsinger_mid": "002a1DuK4evNsR",
"Fsinger_name": "Owl City (猫头鹰之城)",
"Fsinger_tag": "644",
"Fsort": "95",
"Ftrend": "1",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "T",
"Fother_name": "",
"Fsinger_id": "6370",
"Fsinger_mid": "000QG95i2rHlOf",
"Fsinger_name": "谭晶",
"Fsinger_tag": "",
"Fsort": "96",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "C",
"Fother_name": "Sean Chen",
"Fsinger_id": "22926",
"Fsinger_mid": "004EyqQS2hMS6V",
"Fsinger_name": "陈翔",
"Fsinger_tag": "555",
"Fsort": "97",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "1",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "L",
"Fother_name": "Andy Lau",
"Fsinger_id": "163",
"Fsinger_mid": "003aQYLo2x8izP",
"Fsinger_name": "刘德华",
"Fsinger_tag": "555",
"Fsort": "98",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "3",
"Fattribute_3": "7",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "O",
"Fother_name": "单向组合",
"Fsinger_id": "24561",
"Fsinger_mid": "001FXn5P0kkWfV",
"Fsinger_name": "One Direction (单向组合)",
"Fsinger_tag": "645",
"Fsort": "99",
"Ftrend": "0",
"Ftype": "2",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "C",
"Fother_name": "Tanya Chua",
"Fsinger_id": "112",
"Fsinger_mid": "000hNnWC3kko2c",
"Fsinger_name": "蔡健雅",
"Fsinger_tag": "541,555",
"Fsort": "100",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "F",
"Fother_name": "Christine Fan",
"Fsinger_id": "4351",
"Fsinger_mid": "003vyG9q2klWs4",
"Fsinger_name": "范玮琪",
"Fsinger_tag": "541,555,558",
"Fsort": "101",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "2",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "X",
"Fother_name": "LALA Xu",
"Fsinger_id": "16244",
"Fsinger_mid": "002LZVMH0zc8F4",
"Fsinger_name": "徐佳莹",
"Fsinger_tag": "541,555,569",
"Fsort": "102",
"Ftrend": "1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "1",
"Fgenre": "0",
"Findex": "J",
"Fother_name": "J Sound",
"Fsinger_id": "44018",
"Fsinger_mid": "001m7JoC1IVL44",
"Fsinger_name": "金南玲",
"Fsinger_tag": "",
"Fsort": "103",
"Ftrend": "-1",
"Ftype": "1",
"voc": "0"
}, {
"Farea": "0",
"Fattribute_3": "1",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "L",
"Fother_name": "Hacken Lee",
"Fsinger_id": "235",
"Fsinger_mid": "003nS2v740Lxcw",
"Fsinger_name": "李克勤",
"Fsinger_tag": "555",
"Fsort": "104",
"Ftrend": "-1",
"Ftype": "0",
"voc": "0"
}, {
"Farea": "1",
"Fattribute_3": "3",
"Fattribute_4": "0",
"Fgenre": "0",
"Findex": "Q",
"Fother_name": "",
"Fsinger_id": "40798",
"Fsinger_mid": "000H4xDG3heHtr",
"Fsinger_name": "齐晨",
"Fsinger_tag": "555",
"Fsort": "105",
"Ftrend": "1",
"Ftype": "0",
"voc": "0"
}],
"per_page": 100,
"total": 552503,
"total_page": 5526
},
"message": "succ",
"subcode": 0
},
code = data.code,
data = data.data,
list = data.list;
if (code == 0) {
that.setData({
logs: that.normalizeSinger(list)
})
that._calculateHeight();
wx.hideLoading();
}
// },
// fail: req => {
// wx.showToast({
// icon:'none',
// title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
// })
// }
// })
},
normalizeSinger(list) {
//歌手列表渲染
let map = {
hot: {
title: this.data.HOT_NAME,
items: []
}
}
list.forEach((item, index) => {
if (index < this.data.HOT_SINGER_LEN) {
map.hot.items.push({
name: item.Fsinger_name,
avatar: this.constructor(item.Fsinger_mid),
mid: item.Fsinger_mid
})
}
const key = item.Findex
if (!map[key]) {
map[key] = {
title: key,
items: []
}
}
map[key].items.push({
name: item.Fsinger_name,
avatar: this.constructor(item.Fsinger_mid),
mid: item.Fsinger_mid
})
})
// 为了得到有序列表,我们需要处理 map
let ret = []
let hot = []
for (let key in map) {
let val = map[key]
if (val.title.match(/[a-zA-Z]/)) {
ret.push(val)
} else if (val.title === this.data.HOT_NAME) {
hot.push(val)
}
}
ret.sort((a, b) => {
return a.title.charCodeAt(0) - b.title.charCodeAt(0)
})
return hot.concat(ret)
},
scroll: function(e) {
var newY = e.detail.scrollTop;
this.scrollY(newY);
},
scrollY(newY) {
const listHeight = this.data.listHeight
// 当滚动到顶部,newY>0
if (newY == 0 || newY < 0) {
this.setData({
currentIndex: 0,
fixedTitle: ''
})
return
}
// 在中间部分滚动
for (let i = 0; i < listHeight.length - 1; i++) {
let height1 = listHeight[i]
let height2 = listHeight[i + 1]
if (newY >= height1 && newY < height2) {
this.setData({
currentIndex: i,
fixedTitle: this.data.logs[i].title
})
this.fixedTt(height2 - newY);
return
}
}
// 当滚动到底部,且-newY大于最后一个元素的上限
this.setData({
currentIndex: listHeight.length - 2,
fixedTitle: this.data.logs[listHeight.length - 2].title
})
},
fixedTt(newVal) {
let fixedTop = (newVal > 0 && newVal < TITLE_HEIGHT) ? newVal - TITLE_HEIGHT : 0
if (this.data.fixedTop === fixedTop) {
return
}
this.setData({
fixedTop: fixedTop
})
},
_calculateHeight() {
var lHeight = [],
that = this;
let height = 0;
lHeight.push(height);
var query = wx.createSelectorQuery();
query.selectAll('.list-group').boundingClientRect(function(rects) {
var rect = rects,
len = rect.length;
for (let i = 0; i < len; i++) {
height += rect[i].height;
lHeight.push(height)
}
}).exec();
var calHeight = setInterval(function() {
if (lHeight != [0]) {
that.setData({
listHeight: lHeight
});
clearInterval(calHeight);
}
}, 1000)
},
constructor: function(id) {
this.id = id
this.avatar = `https://y.gtimg.cn/music/photo_new/T001R300x300M000${id}.jpg?max_age=2592000`
return this.avatar;
},
scrollToview(e) {
var id = e.target.dataset.id
if (id == '热') {
this.setData({
scrollTop: 0
})
} else {
this.setData({
toSingerNum: id
})
}
},
toSinger(e) {
var id = e.currentTarget.id;
wx.navigateTo({
url: '../singer/singer?disstid=' + id,
})
}
})
================================================
FILE: pages/logs/logs.json
================================================
{
"navigationBarTitleText": "HMusic"
}
================================================
FILE: pages/logs/logs.wxml
================================================
<!--logs.wxml-->
<view class="container log-list">
<scroll-view scroll-y style="height:100%;white-space:nowrap;" scroll-into-view="{{toSingerNum}}" enable-back-to-top bindscroll="scroll" scroll-with-animation scroll-top="{{scrollTop}}">
<view class="list-group" wx:for="{{logs}}" wx:for-item="group" wx:key="{{group}}">
<view class="title" id="{{group.title}}">{{group.title}}</view>
<block wx:for="{{group.items}}" wx:for-item="user" wx:key="{{user}}">
<view id="{{user.mid}}" class="list-group-item" bindtap='toSinger'>
<image class="icon" src="{{user.avatar}}" lazy-load="true"></image>
<text class="log-item">{{user.name}}</text>
</view>
</block>
</view>
</scroll-view>
<!-- 侧边字母导航 -->
<view class="list-shortcut">
<block wx:for="{{logs}}" wx:key="{{logs}}">
<text class="{{currentIndex===index?'current':''}}" data-id="{{item.title}}" bindtap='scrollToview'>{{item.title}}</text>
</block>
</view>
<!-- 固定在顶部的字母导航 -->
<view class="list-fixed {{fixedTitle=='' ? 'hide':''}}" style="transform:translate3d(0,{{fixedTop}}px,0);">
<view class="fixed-title">
{{fixedTitle}}
</view>
</view>
</view>
================================================
FILE: pages/logs/logs.wxss
================================================
.log-list {
display: flex;
flex-direction: column;
/* padding-bottom:60rpx; */
}
.log-item {
margin: 10rpx;
}
.title {
height: 60rpx;
line-height: 60rpx;
padding-left: 40rpx;
font-size: 24rpx;
color: rgba(255, 255, 255, 1);
background: #ccc;
margin-top:60rpx;
}
.title:first-child {
margin-top:0;
}
.list-group-item {
display: flex;
-webkit-box-align: center;
align-items: center;
padding: 40rpx 0 0 60rpx;
}
.list-group-item:last-child {
padding-bottom: 60rpx;
}
.list-group-item .icon {
width:100rpx;
height:100rpx;
border-radius: 50%;
}
::-webkit-scrollbar{
width: 0;
height: 0;
color: transparent;
}
.list-shortcut {
position: fixed;
z-index: 30;
right: 0;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
width: 20px;
padding: 20px 0;
border-radius: 10px;
text-align: center;
background: rgba(0,0,0,.3);
font-family: Helvetica;
}
.list-shortcut text {
display: block;
padding: 3px;
line-height: 1;
color: #fff;
font-size: 24rpx;
}
.current{
color: #ffcd32 !important;
}
.list-fixed {
position: absolute;
top: 0;
left: 0;
width: 100%;
}
.fixed-title {
height:60rpx;
line-height:60rpx;
padding-left:40rpx;
font-size:24rpx;
color:rgba(255, 255, 255, 1);
background:#ccc;
}
================================================
FILE: pages/playSong/playSong.js
================================================
const app = getApp();
Page({
data: {},
onLoad: function(options) {
wx.hideLoading();
wx.showShareMenu({
withShareTicket: true
});
this.setData({
isPlay: app.globalData.isPlay
})
app.globalData.backgroundAudioManager.onPlay(() => {
var that = this;
that.updateTime(that);
that.setData({
isPlay: true,
});
app.globalData.isPlay = true;
});
app.globalData.backgroundAudioManager.onError((res) => {
if (res.errCode == '10001') {
wx.showToast({
icon: 'none',
title: '由于系统错误导致歌曲播放失败',
})
} else if (res.errCode == '10002') {
wx.showToast({
icon: 'none',
title: '由于网络错误导致歌曲播放失败',
})
} else if (res.errCode == '10003') {
wx.showToast({
icon: 'none',
title: '哎呀!播放文件错误',
})
} else if (res.errCode == '10004') {
wx.showToast({
icon: 'none',
title: '哎呀!播放格式错误',
})
} else if (res.errCode == '-1') {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
});
app.globalData.backgroundAudioManager.onEnded(() => {
this.setData({
isPlay: false
});
app.globalData.isPlay = false;
var id = wx.getStorageSync('song_id'),
num = this.data.num;
num++;
var this_id = id[num];
this.setData({
num: num,
musicTime: 1,
toView: 'A0'
});
wx.setStorage({
key: 'num',
data: num,
})
wx.setStorage({
key: 'current',
data: {
musicTime: 1,
toView: 'A0'
},
})
if (num > 0 && num < 19) {
this.setData({
haveNext: true,
havePop: true
})
} else {
this.setData({
haveNext: false,
havePop: true
})
}
this.music_fcg(this_id);
});
app.globalData.backgroundAudioManager.onPause(() => {
this.setData({
isPlay: false
});
app.globalData.isPlay = false;
});
app.globalData.backgroundAudioManager.onStop(() => {
app.globalData.shouldPlay = true;
// app.globalData.unload = true;
app.globalData.startTime = 0;
wx.setStorage({
key: 'current',
data: {
toView: 'A0',
musicTime: 1
},
});
this.setData({
isPlay: false
})
app.globalData.isPlay = false;
});
app.globalData.backgroundAudioManager.onNext(() => {
this.nextAudio();
});
app.globalData.backgroundAudioManager.onPrev(() => {
this.popAudio();
});
},
onShow() {
var startTime = app.globalData.startTime;
// console.log(startTime, app.globalData.shouldPlay, this.data.time,app.globalData.unload,app.globalData.musicMsg);
if (wx.getStorageSync('song_id').length == 0) {
wx.showModal({
title: '提示',
content: '您还未选择播放的歌曲,请移步推荐页哟',
showCancel: false,
success: function(res) {
if (res.confirm) {
wx.switchTab({
url: '../index/index',
})
}
}
});
this.setData({
haveMusicStorage: false
});
} else {
var id = app.globalData.labelid,
rid = app.globalData.radioId,
radioid = wx.getStorageSync('labelid'),
shouldPlay = app.globalData.shouldPlay,
index = wx.getStorageSync('num');
if (shouldPlay) {
var song_id = wx.getStorageSync('song_id'),
this_id = song_id[index],
unload = app.globalData.unload;
wx.showLoading({
title: '加载中',
})
if (!unload) {
this.setData({
num: index,
time: 0,
toView:'A0',
musicTime:1
});
this.music_fcg(this_id);
} else {
var current = wx.getStorageSync('current'),
msg = app.globalData.musicMsg;
if (current.toView) {
this.setData({
toView: current.toView,
musicTime: current.musicTime
});
}
if (msg.audioSrc) {
this.setData({
audioSrc:msg.audioSrc
})
}
if (msg.haveCommentlist) {
this.setData({
commentlist: msg.commentlist,
haveCommentlist: true
});
} else {
this.setData({
haveCommentlist: false,
commentlist: msg.commentlist,
});
}
this.setData({
num: index,
time: startTime,
track_info: msg.track_info,
gedan: msg.gedan,
simsongs: msg.simsongs,
singer: msg.singer,
songmid: msg.songmid,
video: msg.video,
lyrics: app.globalData.lyrics,
});
app.globalData.unload = false;
this.updateTime(this);
wx.hideLoading();
}
app.globalData.labelid = radioid;
app.globalData.shouldPlay = false;
// wx.setStorage({
// key: 'share_id',
// data: [],
// });
// wx.setStorage({
// key: 'share_name',
// data: [],
// });
} else {
var share_id = wx.getStorageSync('share_id');
if (share_id.length != 0) {
var background = wx.getStorageSync('backgrond'),
current = wx.getStorageSync('current'),
index = wx.getStorageSync('num'),
song_id = wx.getStorageSync('song_id'),
msg = app.globalData.musicMsg,
this_id = song_id[index];
if (current.toView) {
this.setData({
toView: current.toView,
musicTime: current.musicTime
});
}
if (msg.audioSrc) {
this.setData({
audioSrc: msg.audioSrc
})
}
if (msg.haveCommentlist) {
this.setData({
commentlist: msg.commentlist,
haveCommentlist: true
});
} else {
this.setData({
haveCommentlist: false,
commentlist: msg.commentlist,
});
}
this.setData({
lyrics: app.globalData.lyrics,
haveMusicStorage: true,
audioSrc: background.src,
time: startTime,
num: index,
track_info: msg.track_info,
gedan: msg.gedan,
simsongs: msg.simsongs,
singer: msg.singer,
songmid: msg.songmid,
video: msg.video,
});
var that = this;
that.updateTime(that);
// that.music_fcg(this_id);
} else if (rid.indexOf(radioid) == -1) {
if (radioid != id) {
var song_id = wx.getStorageSync('song_id'),
this_id = song_id[0];
this.setData({
num: 0,
time: 0,
toView:'A0',
musicTime:1
});
wx.showLoading({
title: '加载中',
})
this.music_fcg(this_id);
app.globalData.labelid = radioid;
}
}
}
var music_name = wx.getStorageSync('music_name');
this.setData({
song_id: id,
haveMusicStorage: true,
MusicName: music_name
});
}
},
onShareAppMessage: function(options) {
var that = this,
song_id = wx.getStorageSync('song_id'),
music_name = wx.getStorageSync('music_name'),
num = wx.getStorageSync('num'),
path = '/pages/share/share?songid=' + song_id[num] + '&name=' + music_name[num];
// path = '/pages/playSong/playSong';
app.globalData.clickShare = true;
return {
title: '@我,诚意推荐《' + music_name[num] + '》这首歌',
path: path,
imageUrl: 'https://y.gtimg.cn/music/photo_new/T002R300x300M000' + that.data.track_info.album.mid + '.jpg?max_age=2592000',
}
},
onUnload() {
// wx.setStorage({
// key: 'share_id',
// data: [],
// });
// app.globalData.shareMusic = true;
app.globalData.shouldPlay = true;
app.globalData.unload = true;
// console.log('页面卸载');
},
onHide() {
// console.log('页面隐藏');
},
music_fcg: function(this_id) {
var musicu = this.data.musicu;
musicu.detail.param.song_id = this_id;
musicu.simsongs.param.songid = this_id;
musicu.gedan.param.song_id = this_id;
typeof this_id == 'string' ? musicu.video.param.songid = this_id.toString() : musicu.video.param.songid = this_id;
//歌曲相关信息
wx.request({
url: '歌曲信息API',
method: 'POST',
data: JSON.stringify(musicu),
success: res => {
var detail = res.data.detail,
gedan = res.data.gedan,
simsongs = res.data.simsongs,
songmid = detail.data.track_info.mid,
info = detail.data.info,
video = res.data.video.data.list,
vids = [],
lyric,
mediaArray = [],
haveLyric = false;
//将歌词字符串转为数组,并去掉前五组数据
for (var i = 0; i < info.length; i++) {
if (info[i].title == '歌词') {
lyric = info[i].content[0].value.split('\n').slice(5);
haveLyric = true;
}
}
for (var i = 0; i < video.length; i++) {
vids.push(video[i].vid);
}
if (vids.length > 0) {
this.getVideoSrc(vids);
}
//将时间跟歌词分开
if (haveLyric) {
for (var j = 0; j < lyric.length; j++) {
var t = lyric[j].substring(lyric[j].indexOf('[') + 1, lyric[j].indexOf(']')),
c = lyric[j].substring(lyric[j].indexOf("]") + 1, lyric[j].length);
if (c != '') {
mediaArray.push({
t: (parseInt(t.split(":")[0] * 60) + parseFloat(t.split(":")[1])).toFixed(1),
c: c,
id: 'A' + j
})
}
}
}
this.setData({
track_info: detail.data.track_info,
gedan: gedan.data.vec_gedan,
simsongs: simsongs.data.songInfoList,
singer: detail.data.track_info.singer,
songmid: songmid,
lyrics: mediaArray,
video: video
});
app.globalData.lyrics = mediaArray;
app.globalData.musicMsg = {
track_info: detail.data.track_info,
gedan: gedan.data.vec_gedan,
simsongs: simsongs.data.songInfoList,
singer: detail.data.track_info.singer,
songmid: songmid,
video: video
}
var songUrl = this.data.pUrl,
mid = songmid;
songUrl.req_0.param.songmid.splice(0, 1, mid);
//获取歌曲链接
wx.request({
url: '歌曲播放API',
method: 'post',
data: JSON.stringify(songUrl),
success: res => {
wx.hideLoading();
var pUrl = res.data.req_0.data.midurlinfo[0].purl;
if (pUrl == '') {
app.globalData.backgroundAudioManager.pause();
var that = this;
that.setData({
audioSrc: ''
});
wx.showModal({
title: '提示',
content: '很抱歉,该歌曲暂不支持播放哦,咱们听下一首歌吧',
success: function(res) {
if (res.confirm) {
that.nextAudio();
}
}
})
} else if (this.data.time == 0) {
wx.setStorage({
key: 'backgrond',
data: {
title: detail.data.track_info.name,
singer: detail.data.track_info.singer[0].name,
src: pUrl,
coverImgUrl: 'https://y.gtimg.cn/music/photo_new/T002R300x300M000' + detail.data.track_info.album.mid + '.jpg?max_age=2592000'
},
});
app.globalData.backgroundAudioManager.title = detail.data.track_info.name;
app.globalData.backgroundAudioManager.singer = detail.data.track_info.singer[0].name;
app.globalData.backgroundAudioManager.src = pUrl;
app.globalData.backgroundAudioManager.coverImgUrl = 'https://y.gtimg.cn/music/photo_new/T002R300x300M000' + detail.data.track_info.album.mid + '.jpg?max_age=2592000'
app.globalData.backgroundAudioManager.play();
this.setData({
audioSrc: pUrl,
isPlay: true
});
app.globalData.isPlay = true;
app.globalData.musicMsg.audioSrc = pUrl;
wx.setStorage({
key: 'share_id',
data: [],
});
}
},
error: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
});
},
error: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
});
//精彩评论
wx.request({
url: '评论API',
data: {},
success: res => {
var commentlist = res.data.hot_comment.commentlist,
list = [];
if (commentlist) {
if (commentlist.length > 4) {
list.push(commentlist[1]);
list.push(commentlist[2]);
list.push(commentlist[3]);
} else {
for (var i = 0; i < commentlist.length; i++) {
list.push(commentlist[i]);
}
}
for (var i = 0; i < list.length; i++) {
list[i].time = app.timestampToTime(list[i].time);
}
this.setData({
commentlist: list,
haveCommentlist: true
});
app.globalData.musicMsg.commentlist = list;
app.globalData.musicMsg.haveCommentlist = true;
} else {
this.setData({
haveCommentlist: false
});
app.globalData.musicMsg.haveCommentlist = false;
app.globalData.musicMsg.commentlist = '';
}
},
error: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
});
},
audioPlay() {
//音乐播放暂停
var isPlay = this.data.isPlay,
src = this.data.audioSrc;
if (isPlay) {
app.globalData.backgroundAudioManager.pause();
this.setData({
isPlay: false
});
app.globalData.isPlay = false;
} else if (isPlay == false && src != '') {
app.globalData.backgroundAudioManager.play();
this.setData({
isPlay: true
});
app.globalData.isPlay = true;
} else {
var that = this;
wx.showModal({
title: '提示',
content: '很抱歉,该歌曲需要vip哦,咱们听下一首歌吧',
success: function(res) {
if (res.confirm) {
that.nextAudio();
}
}
})
}
},
updateTime: function(that) {
//播放时更新时间
app.globalData.backgroundAudioManager.onTimeUpdate((res) => {
var duration = app.globalData.backgroundAudioManager.duration,
currentTime = app.globalData.backgroundAudioManager.currentTime.toFixed(1),
time = this.data.lyrics,
musicTime = this.data.musicTime;
app.globalData.startTime = app.globalData.backgroundAudioManager.currentTime;
// if (parseInt(currentTime) <= parseInt(time[0].t)) {
// this.setData({
// toView: time[0].id
// });
// // console.log(this.data.toView);
// } else {
for (var i = musicTime; i < time.length; i++) {
if (parseInt(currentTime) > parseInt(time[i].t)) {
if (this.data.toView != time[i].id) {
this.setData({
toView: time[i].id,
musicTime: musicTime + 1
});
wx.setStorage({
key: 'current',
data: {
toView: time[i].id,
musicTime: musicTime + 1
},
})
}
// console.log(currentTime, time[i].id, time[i].t,musicTime);
return;
}
}
// }
// console.log(currentTime);
})
},
nextAudio(e) {
//下一首
wx.showLoading({
title: '加载中',
});
var id = wx.getStorageSync('song_id'),
num = this.data.num,
len = id.length;
console.log(num)
if (num == len - 1) {
num = 0;
} else {
num++;
}
var this_id = id[num];
this.setData({
num: num,
musicTime: 1,
toView: 'A0',
time: 0
});
wx.setStorage({
key: 'num',
data: num,
});
// wx.setStorage({
// key: 'share_id',
// data: [],
// });
if (num < (len - 1)) {
this.setData({
haveNext: true,
havePop: true
})
} else {
this.setData({
num: -1
})
}
// this.audioPlay();
this.music_fcg(this_id);
},
popAudio(e) {
//上一首
wx.showLoading({
title: '加载中',
})
var id = wx.getStorageSync('song_id'),
num = this.data.num;
if (num == 0) {
num = id.length - 1;
} else {
num--;
}
var this_id = id[num];
this.setData({
num: num,
musicTime: 1,
toView: 'A0',
time: 0
});
wx.setStorage({
key: 'num',
data: num,
});
// wx.setStorage({
// key: 'share_id',
// data: [],
// });
if (num != 0) {
this.setData({
havePop: true,
haveNext: true
})
} else {
this.setData({
num: 0
})
}
// this.audioPlay();
this.music_fcg(this_id);
},
playVideo(e) {
//播放视频
var isPlay = this.data.isPlay,
id = e.currentTarget.id,
index = e.target.dataset.index,
video = this.data.videoisPlay;
for (var i = 0; i < video.length; i++) {
var videoContext = wx.createVideoContext('mid' + (i - 1));
videoContext.pause();
// video[i] = false;
}
video[index] = true;
this.setData({
videoisPlay: video
})
var videoContext1 = wx.createVideoContext(id);
videoContext1.play();
if (isPlay) {
app.globalData.backgroundAudioManager.pause();
this.setData({
isPlay: false
});
app.globalData.isPlay = false;
}
},
playVideo1(e) {
//点击自带的播放按钮
var isPlay = this.data.isPlay,
id = e.currentTarget.id,
index = e.target.dataset.index,
video = this.data.videoisPlay;
for (var i = 0; i < video.length; i++) {
if ('mid' + (i - 1) != id) {
var videoContext = wx.createVideoContext('mid' + (i - 1));
videoContext.pause();
}
}
video[index] = true;
this.setData({
videoisPlay: video
})
if (isPlay) {
app.globalData.backgroundAudioManager.pause();
this.setData({
isPlay: false
});
app.globalData.isPlay = false;
}
},
pauseVideo(e) {
//暂停播放视频
var isPlay = this.data.isPlay;
if (isPlay) {
app.globalData.backgroundAudioManager.pause();
this.setData({
isPlay: false
});
app.globalData.isPlay = false;
}
},
getVideoSrc(vids) {
//获取视频链接
var videoData = this.data.videoSrcData;
videoData.getMVInfo.param.vidlist = vids;
videoData.getMVUrl.param.vids = vids;
wx.request({
url: 'MVAPI',
data: {},
success: res => {
var data = res.data.getMVUrl.data,
url = [],
isPlaying = [];
for (var i = 0; i < vids.length; i++) {
var vid = vids[i];
url.push(data[vid].mp4[1].freeflow_url[0]);
isPlaying[i] = false;
}
this.setData({
videoSrc: url,
videoisPlay: isPlaying
});
},
error: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
})
},
getGd(e) {
//跳转到歌单信息页
var id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '../gedan/gedan?disstid=' + id,
})
},
goSinger(e) {
var id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '../singer/singer?disstid=' + id,
})
},
addSong(e) {
//跳到喜欢的歌曲
var id = e.currentTarget.dataset.id, //获取到点击歌曲id
name = e.currentTarget.dataset.name,
num = this.data.num,
song_id = wx.getStorageSync('song_id'),
music_name = wx.getStorageSync('music_name');
var a = song_id.indexOf(id);
if (a != -1) {
id = song_id[a];
this.setData({
num: a,
time: 0
})
wx.setStorage({
key: 'num',
data: a,
})
this.audioPlay();
this.music_fcg(id);
} else {
num++;
song_id.splice(num, 0, id);
music_name.splice(num, 0, name);
wx.setStorageSync('song_id', song_id);
wx.setStorageSync('music_name', music_name);
this.setData({
num: num,
MusicName: music_name,
time: 0
})
wx.setStorage({
key: 'num',
data: num,
})
this.audioPlay();
this.music_fcg(id);
}
// wx.setStorage({
// key: 'share_id',
// data: [],
// });
},
musicChange(e) {
var index = parseInt(e.detail.value),
song_id = wx.getStorageSync('song_id'),
this_id = song_id[index],
num = wx.getStorageSync('num');
if (num != index) {
wx.showLoading({
title: '切换歌曲中',
});
this.setData({
num: index,
time: 0,
musicTime: 1,
toView: 'A0'
});
this.music_fcg(this_id);
wx.setStorage({
key: 'num',
data: index,
});
// wx.setStorage({
// key: 'share_id',
// data: [],
// });
}
},
musicCancel(e) {
console.log(e);
},
showPlayList(){
var pix = 750 / app.globalData.system.windowWidth,
height = 758 / pix;
const animation = wx.createAnimation({
durarion: 1000,
timingFunction: 'ease-in-out',
})
this.animation = animation;
animation.translateY(-height).step();
this.setData({
animationData: animation.export(),
showList: true
});
},
close(e) {
// this.setData({
// showList:false
// })
var pix = 750 / app.globalData.system.windowWidth,
height = 758 / pix;
const animation = wx.createAnimation({
durarion: 1000,
timingFunction: 'ease-in-out',
})
this.animation = animation;
animation.translateY(height).step();
this.setData({
animationData: animation.export(),
showList: false
});
},
del(e) {
var num = e.currentTarget.dataset.num,
songid = wx.getStorageSync('song_id'),
musicName = wx.getStorageSync('music_name'),
index = wx.getStorageSync('num');
songid.splice(num,1);
musicName.splice(num,1);
wx.setStorage({
key: 'song_id',
data: songid,
});
wx.setStorage({
key: 'music_name',
data: musicName,
});
wx.showToast({
icon:'none',
title: '已删除',
})
this.setData({
MusicName:musicName
});
if (num == index) {
if (index < songid.length) {
var id = songid[index];
this.setData({
num: index,
time: 0,
musicTime: 1,
toView: 'A0'
});
this.music_fcg(id);
wx.setStorage({
key: 'num',
data: index,
});
} else {
var id = songid[0];
this.setData({
num: 0,
time: 0,
musicTime: 1,
toView: 'A0'
});
this.music_fcg(id);
wx.setStorage({
key: 'num',
data: 0,
});
}
}
},
changeMusic(e) {
var index = e.currentTarget.dataset.num,
songid = wx.getStorageSync('song_id'),
id = songid[index],
num = wx.getStorageSync('num');
if (num != index) {
wx.showLoading({
title: '切换歌曲中',
});
this.setData({
num: index,
time: 0,
musicTime: 1,
toView: 'A0'
});
this.music_fcg(id);
wx.setStorage({
key: 'num',
data: index,
});
}
}
})
================================================
FILE: pages/playSong/playSong.json
================================================
{
"navigationBarTitleText": "HMusic"
}
================================================
FILE: pages/playSong/playSong.wxml
================================================
<view wx:if="{{haveMusicStorage}}" class="playSong" style="height:{{showList ? '100vh':''}};overflow:hidden;">
<view class="main">
<view class="main_bd">
<view class="song_info">
<view class="song_info_hd">
<view class="song_name">
<view class="song_name__text">
{{track_info.title}}
</view>
<!-- <picker bindchange="musicChange" bindcancel="musicCancel" value="{{num}}" range="{{MusicName}}"> -->
<image class="icon_playlist" src="../../img/playlist.png" bindtap="showPlayList"></image>
<!-- </picker> -->
</view>
<view class="singer_name">
<block wx:for="{{singer}}" wx:key="singer">
<view class="item_name">{{index > 0 ? ' / ' : ''}}{{item.name}}</view>
</block>
</view>
</view>
<view class="song_info_bd">
<view class="album_cover">
<image wx:if="{{track_info.album.mid}}" class="album_cover__img" src="https://y.gtimg.cn/music/photo_new/T002R300x300M000{{track_info.album.mid}}.jpg?max_age=2592000"></image>
</view>
<view class="lyric">
<view class="lyric__bd">
<scroll-view scroll-y style="height:100%;white-space:nowrap;font-size:15px;" scroll-into-view="{{toView}}" scroll-with-animation>
<block wx:for="{{lyrics}}" wx:for-item="lyric" wx:key="{{lyric}}">
<view style="color:{{toView == lyric.id ? '#31c27c':''}}" class="lyric__para" data-time="{{lyric.t}}" id="{{lyric.id}}">
{{lyric.c}}
</view>
</block>
</scroll-view>
</view>
</view>
</view>
</view>
<view class="opt">
<view wx:if="{{havePop}}" class="opt__item" bindtap="popAudio">
<image class="opt__icon" src="../../img/pop.png"></image>
</view>
<view class="opt__item" bindtap="audioPlay">
<image wx:if="{{isPlay}}" class="opt__icon" src="../../img/pause.png"></image>
<image wx:else class="opt__icon" src="../../img/opt_icon.png"></image>
</view>
<view wx:if="{{haveNext}}" class="opt__item" bindtap="nextAudio">
<image class="opt__icon" src="../../img/next.png"></image>
</view>
<view class="opt__item">
<!-- <image class="opt__icon" src="../../img/share.png"></image> -->
<button open-type='share' style="border:0;" plain>
<image class="opt__icon" src="../../img/share.png"></image>
</button>
</view>
</view>
</view>
<view class="bg">
<image wx:if="{{track_info.album.mid}}" class="bg_img" src="https://y.gtimg.cn/music/photo_new/T002R300x300M000{{track_info.album.mid}}.jpg?max_age=2592000"></image>
</view>
</view>
<!-- 包含这首歌的歌单 -->
<view wx:if="{{gedan.length > 0}}" class="related_album">
<view class="mod_tit">包含这首歌的歌单</view>
<view class="qui_list" wx:for="{{gedan}}" wx:key="{{gedan}}" data-id="{{item.tid}}" bindtap='getGd'>
<view class="qui_list__item">
<view class="qui_list__media">
<image class="qui_list__img" src="{{item.imgurl}}"></image>
</view>
<view class="qui_list__bd">
<view class="qui_list__box">
<view class="qui_list__tit">
{{item.dissname}}
</view>
<view class="qui_list__desc">
{{item.creator}}
</view>
</view>
<view class="qui_list__arrow">
</view>
</view>
</view>
</view>
</view>
<!-- 喜欢这首歌的人也听 -->
<view wx:if="{{simsongs.length > 0}}" class="similar_song">
<view class="mod_tit">
喜欢这首歌的人也听
</view>
<view class="qui_list" wx:for="{{simsongs}}" wx:key="{{simsongs}}" data-name="{{item.name}}" data-id="{{item.id}}" bindtap='addSong'>
<view class="qui_list__item">
<view class="qui_list__media">
<image wx:if="{{item.album.mid}}" class="qui_list__img" src="https://y.gtimg.cn/music/photo_new/T002R150x150M000{{item.album.mid}}.jpg?max_age=2592000"></image>
</view>
<view class="qui_list__bd">
<view class="qui_list__box">
<view class="qui_list__tit">
{{item.name}}
</view>
<view class="qui_list__desc">
{{item.singer[0].name}}
</view>
</view>
<view class="qui_list__arrow">
</view>
</view>
</view>
</view>
</view>
<!-- 歌手 -->
<view wx:if="{{singer != []}}" class="similar_song">
<view class="mod_tit">
歌手
</view>
<view class="qui_list" wx:for="{{singer}}" wx:key="{{singer}}">
<view class="qui_list__item" data-id="{{item.mid}}" bindtap="goSinger">
<view class="qui_list__media">
<image wx:if="{{item.mid}}" class="qui_list__img" src="https://y.gtimg.cn/music/photo_new/T001R150x150M000{{item.mid}}.jpg?max_age=2592000"></image>
</view>
<view class="qui_list__bd">
<view class="qui_list__box">
<view class="qui_list__tit">
歌手 {{item.name}}
</view>
</view>
<view class="qui_list__arrow">
</view>
</view>
</view>
</view>
</view>
<!-- 精彩评论 -->
<view wx:if="{{haveCommentlist}}" class="comment">
<view class="mod_tit">
精彩评论
</view>
<view class="comment_box">
<view class="mod_comment">
<view class="mod_comment_list" wx:for="{{commentlist}}" wx:key="{{commentlist}}">
<view class="comment_list__item" data-commentid="{{item.uin}}">
<view class="comment_list__avatar">
<image class="comment_list__avatar_img" src="{{item.avatarurl}}"></image>
</view>
<view class="comment_list__body">
<view class="comment_list__heading">
<view class="comment_list__tit">
{{item.nick}}
</view>
<view class="comment_list__time">
{{item.time}}
</view>
</view>
<view class="comment_list__cont">
<text decode class="comment_list__para">
{{item.rootcommentcontent}}
</text>
</view>
<view class="mod_comment_opt">
<view class="mod_praise">
<view class="praise__number">
{{item.praisenum}}
</view>
<image class="praise__icon" src="../../img/zan.png"></image>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- MV播放 -->
<view wx:if="{{video.length > 0}}" class="js_video">
<view class="mod_tit">
推荐音乐视频
</view>
<block wx:for="{{video}}" wx:key="{{video}}">
<view class="mod_mv" wx:if="{{videoSrc[index]}}">
<view class="mv__media">
<view wx:if="{{videoisPlay[index] == false}}">
<image src="{{item.picurl}}" class="mv__img"></image>
<view class="mv__play" bindtap="playVideo" id="mid{{index-1}}" data-index="{{index}}">
</view>
</view>
<video wx:else id="mid{{index-1}}" class="video_player__source" data-vid="{{item.vid}}" poster="{{item.picurl}}" src="{{videoSrc[index]}}" page-gesture direction="{{direction}}" bindplay="playVideo1" bindpause="pauseVideo"></video>
</view>
<view class="mv__tit">
{{item.title}}
</view>
<view class="mv__desc">
<block wx:for="{{item.singers}}" wx:for-item="ss" wx:key="{{ss}}">
<view style="display:inline-block;">{{index > 0 ? ' / ' : ''}}{{ss.name}}</view>
</block>
</view>
</view>
</block>
</view>
<!-- 播放列表选择框 -->
<!-- <view class="playlist">
<view class="list-wrapper">
<view class="list-header">
<view class='title'>
播放列表({{MusicName.length}})
<image src='../../img/delAll.png'></image>
</view>
</view>
<scroll-view class="list-content" srcoll-y style='height:480rpx;' scroll-into-view="{{toMusicName}}" scroll-with-animation>
<block wx:for="{{MusicName}}" wx:key="{{MusicName}}">
<view class="item">
{{item}}
<image src="../../img/del.png"></image>
</view>
</block>
</scroll-view>
</view>
</view> -->
<view id="mask" wx:if="{{showList}}" catchtap="close" animation="{{animationMask}}"></view>
<view class="playlist" animation="{{animationData}}">
<view class="title">播放列表({{MusicName.length}})</view>
<scroll-view class="list" scroll-y style="height:538rpx;" scroll-into-view="S{{num}}">
<block wx:for="{{MusicName}}" wx:key="{{MusicName}}">
<view bindtap="changeMusic" data-num="{{index}}" style="color:{{index == num ? '#31c27c':''}};" id="S{{index}}">{{item}}<image catchtap="del" data-num="{{index}}" class="close" src="../../img/del.png"></image></view>
</block>
</scroll-view>
<view class="list_close" bindtap='close'>关闭</view>
</view>
</view>
================================================
FILE: pages/playSong/playSong.wxss
================================================
page {
background: #fff;
}
.main {
position: relative;
padding-bottom: 30rpx;
overflow: hidden;
}
.main_bd {
position: relative;
z-index: 4;
}
.song_name {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
margin-top: 40rpx;
font-size:18px;
font-weight: 300;
}
.song_name .song_name__text {
max-width: 222rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 18px;
font-weight: 400;
color: #000;
}
.song_name .icon_playlist {
position: relative;
display: block;
width: 36rpx;
height: 36rpx;
margin: 0 -44rpx 0 8rpx;
}
.icon_playlist::after {
content: "";
position: absolute;
top: -100%;
left: -100%;
width: 300%;
height: 300%;
}
.singer_name {
margin: 0 40rpx 30rpx;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 14px;
color:grey;
}
.singer_name .item_name {
display: inline-block;
}
.song_info_bd {
position: relative;
height: 300rpx;
}
.song_info_bd .album_cover {
position: absolute;
top: 0;
left: 50%;
z-index: 2;
width: 468rpx;
height: 468rpx;
margin-left: -234rpx;
box-shadow: 0 1rpx 4px rgba(0,0,0,.2);
display: none;
}
.album_cover__img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.lyric {
position: absolute;
top: 0;
left: 0;
z-index: 1;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
-webkit-box-align: center;
width: 100%;
height: 100%;
}
.lyric .lyric__bd {
width: 100%;
height: 300rpx;
overflow: hidden;
/* -webkit-mask: -webkit-linear-gradient(top,rgba(0,0,0,0),#fff 25%,#fff 75%,rgba(0,0,0,0)); */
}
.lyric__para {
line-height: 2;
margin: 0 40rpx;
text-align: center;
overflow: hidden;
white-space: normal;
text-overflow: ellipsis;
font-size: 15px;
/* color: #31c27c; */
}
/* .opt {
position: relative;
height:180rpx;
}
.opt__item {
position: absolute;
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
width:80rpx;
height:80rpx;
margin: 0 40rpx;
border: solid 1px rgba(0,0,0,.2);
border-radius: 100%;
top:50%;
left:45%;
transform:translate(-50%,-50%);
}
.opt__icon {
display: block;
width: 44rpx;
height: 44rpx;
fill: #000;
} */
.opt {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 180rpx;
}
.opt__item {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
width:76rpx;
height:76rpx;
margin: 0 40rpx;
/* border: solid 1px rgba(0,0,0,.2); */
border-radius: 100%;
}
.opt__icon {
display: block;
width: 64rpx;
height: 64rpx;
fill: #000;
}
.bg {
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: 100%;
height:750rpx;
}
.bg_img {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 100%;
height: 100%;
opacity: .06;
-webkit-transform: scale(1.2);
}
.mod_tit {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 110rpx;
font-size: 16px;
font-weight: 400;
color: #000;
}
.qui_list {
margin-bottom: 30rpx;
overflow: hidden;
}
.qui_list__item {
position: relative;
display: -webkit-box;
-webkit-box-align: center;
margin: 0 0 4rpx 32rpx;
}
.qui_list__media {
position: relative;
display: block;
width: 130rpx;
height: 130rpx;
margin-right: 24rpx;
overflow: hidden;
}
.qui_list__img {
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: 100%;
height: 100%;
object-fit: cover;
}
.qui_list__bd {
position: relative;
-webkit-box-flex: 1;
display: -webkit-box;
-webkit-box-align: center;
height: 130rpx;
padding-right: 32rpx;
}
.qui_list__box {
-webkit-box-flex: 1;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.qui_list__tit {
font-size: 13px;
color: #000;
}
.qui_list__desc {
font-size:12px;
color:grey;
}
.qui_list__arrow {
display: block;
width: 14rpx;
height: 14rpx;
border-style: solid;
border-width: 0 1px 1px 0;
border-color: grey;
-webkit-transform: rotate(-45deg);
}
.comment_box {
padding: 0 32rpx;
overflow: hidden;
font: 300 24rpx/1.5 sans-serif;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.mod_comment_list {
position: relative;
margin: 0;
padding: 0;
}
.comment_list__item {
position: relative;
display: -webkit-box;
margin-bottom: 16rpx;
padding-top: 4rpx;
}
.comment_list__avatar {
position: relative;
width: 70rpx;
height: 70rpx;
margin-right: 2rpx;
border-radius: 100%;
background-color: rgba(203,203,203,.2);
-webkit-user-select: none;
}
.comment_list__avatar_img {
display: block;
width: 100%;
height: 100%;
border-radius: 100%;
object-fit: cover;
pointer-events: none;
}
.comment_list__body {
position: relative;
-webkit-box-flex: 1;
padding-bottom: 2rpx;
}
.comment_list__heading {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
min-height: 70rpx;
margin: 0 18rpx 8rpx 0;
}
.comment_list__tit {
display: -webkit-box;
-webkit-box-align: center;
margin: -8rpx 0 -4rpx;
font-size: 28rpx;
font-weight: 300;
-webkit-user-select: none;
}
.comment_list__time {
color: grey;
}
.comment_list__cont {
position: relative;
font-size: 28rpx;
}
.comment_list__para {
margin: 0;
overflow: hidden;
word-wrap: break-word;
word-break: break-all;
text-align: justify;
line-height: 1.6;
color:#000;
}
.mod_comment_opt {
position: absolute;
top: 24rpx;
right: 0px;
display: -webkit-box;
-webkit-user-select: none;
}
.mod_comment_opt .mod_praise {
opacity: .6;
}
.mod_praise {
position: relative;
display: -webkit-box;
-webkit-box-pack: end;
-webkit-box-align: end;
-webkit-transform: translateZ(0);
min-width: 10rpx;
}
.praise__number {
display: block;
margin-right: 4rpx;
line-height: 1.1;
overflow: hidden;
font-size: 12px;
}
.praise__icon {
display: block;
width: 36rpx;
height: 36rpx;
stroke-width: 0;
stroke: currentColor;
fill: currentColor;
}
.mod_mv {
margin: 0 32rpx 40rpx;
}
.mv__media {
position: relative;
height: 386rpx;
}
.mv__img {
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: 100%;
height: 100%;
object-fit: cover;
}
.mv__play {
position: absolute;
top: 50%;
left: 50%;
z-index: 2;
width: 90rpx;
height: 90rpx;
margin: -44rpx 0 0 -44rpx;
background: url('https://y.gtimg.cn/mediastyle/mobile/project_v5/img/cover_play.png?max_age=2592000');
background-repeat: no-repeat;
background-size: 90rpx;
}
.mv__media::after {
content: "";
display: block;
padding-top: 56.25%;
}
.mv__tit {
margin-top: 10rpx;
font-size: 28rpx;
color: #000;
}
.mv__desc, .mv__tit {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.mv__desc{
font-size: 12px;
}
.video_player__preview, .video_player__source, .video_player_mask {
position: absolute;
display: block;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.js_playlist_box {
position: absolute;
right: 0;
bottom: 0;
left: 0;
display: -webkit-box;
-webkit-box-orient: vertical;
height: 758rpx;
background: #fff;
transform: translateY(100%);
transition: 250ms ease-in-out;
}
.js_playlist_box .actionsheet__tit {
position: relative;
display: block;
height: 110rpx;
line-height: 110rpx;
text-align: center;
font-weight: 400;
font-size: 32rpx;
color: #000;
}
.js_playlist_box .actionsheet__tit::before {
top:0;
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
height: 2rpx;
background: rgba(0,0,0,.08);
}
.js_playlist_box .actionsheet__tit::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
height: 2rpx;
background: rgba(0,0,0,.08);
}
.js_playlist_box .actionsheet__bd {
-webkit-box-flex: 1;
overflow-y: auto;
}
.js_playlist_box .play_list__item {
position: relative;
display: -webkit-box;
-webkit-box-align: center;
height: 90rpx;
margin-left: 32rpx;
font-size: 30rpx;
color: #000;
}
.js_playlist_box .play_list__item::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
height: 2rpx;
background: rgba(0,0,0,.08);
}
.js_playlist_box .play_list__song,.play_list__singer {
display: block;
max-width: 45%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.js_playlist_box .play_list_line {
display: block;
margin: 0 10rpx;
font-weight: 300;
font-size: 24rpx;
color: grey;
}
.playlist {
position:fixed;
width:100%;
height:758rpx;
background-color:#fff;
left:0;
bottom:-758rpx;
/* bottom:0; */
z-index:999999;
}
.playlist .title {
width:100%;
height:110rpx;
line-height:110rpx;
text-align: center;
font-weight: 400;
font-size:32rpx;
color:#000;
border-top: 1px solid rgba(0,0,0,.08);
border-bottom: 1px solid rgba(0,0,0,.08);
}
/* .playlist .title::before,.title::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
height: 2rpx;
background: rgba(0,0,0,.08);
} */
.playlist .list view {
position: relative;
height: 90rpx;
line-height: 90rpx;
margin-left: 32rpx;
font-size: 30rpx;
color: #000;
border-bottom: 1px solid rgba(0,0,0,.08);
}
.playlist .list .close {
position: absolute;
right:40rpx;
top:50%;
transform:translateY(-50%);
width:32rpx;
height:32rpx;
}
.playlist .list_close {
width:100%;
height:110rpx;
line-height: 110rpx;
text-align: center;
border-top:1px solid rgba(0,0,0,.08);
}
================================================
FILE: pages/rank/rank.js
================================================
//rank.js
const app = getApp()
const util = require('../../utils/util.js')
Page({
data: {
rank: []
},
onLoad: function() {
wx.showLoading({
title: '加载中',
});
wx.showShareMenu();
// wx.request({
// url: '排行榜API',
// data: {},
// success: res => {
var data = {
"code": 0,
"subcode": 0,
"message": "",
"default": 0,
"data": {
"topList": [{
"id": 4,
"listenCount": 19800000,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000002UMwvi2ArZqt.jpg",
"songList": [{
"singername": "马良",
"songname": "往后余生"
}, {
"singername": "谭维维",
"songname": "晚婚"
}, {
"singername": "韩寒",
"songname": "奉献"
}],
"topTitle": "巅峰榜·流行指数",
"type": 0
}, {
"id": 26,
"listenCount": 20000000,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000000twWI9013HkE.jpg",
"songList": [{
"singername": "张学友",
"songname": "烦恼歌"
}, {
"singername": "胡夏/郁可唯",
"songname": "知否知否"
}, {
"singername": "G.E.M. 邓紫棋",
"songname": "光年之外"
}],
"topTitle": "巅峰榜·热歌",
"type": 0
}, {
"id": 27,
"listenCount": 16000000,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000001vuHHC1KusDA.jpg",
"songList": [{
"singername": "张杰",
"songname": "时间的远方"
}, {
"singername": "杨宗纬",
"songname": "星"
}, {
"singername": "韩寒",
"songname": "奉献"
}],
"topTitle": "巅峰榜·新歌",
"type": 0
}, {
"id": 58,
"listenCount": 5639020,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000003V1F2d3cYvdN.jpg",
"songList": [{
"singername": "王嘉尔/ICE",
"songname": "Red"
}, {
"singername": "G.E.M. 邓紫棋/艾热",
"songname": "光年之外 (热爱版)"
}, {
"singername": "小青龙",
"songname": "潇洒每一天"
}],
"topTitle": "说唱榜",
"type": 0
}, {
"id": 28,
"listenCount": 16000000,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000000JQoDV2XeV9P.jpg",
"songList": [{
"singername": "曲肖冰",
"songname": "天亮以前说再见"
}, {
"singername": "花姐",
"songname": "狂浪"
}, {
"singername": "刘珂矣",
"songname": "半壶纱"
}],
"topTitle": "巅峰榜·网络歌曲",
"type": 0
}, {
"id": 5,
"listenCount": 3485480,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000001zMoTN4QBVWj.jpg",
"songList": [{
"singername": "胡夏/郁可唯",
"songname": "知否知否"
}, {
"singername": "张杰",
"songname": "时间的远方"
}, {
"singername": "郁可唯",
"songname": "知否知否 (女声版)"
}],
"topTitle": "巅峰榜·内地",
"type": 0
}, {
"id": 6,
"listenCount": 1517820,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000002UItCc37aNxu.jpg",
"songList": [{
"singername": "杨宗纬",
"songname": "星"
}, {
"singername": "阿信",
"songname": "一半人生"
}, {
"singername": "G.E.M. 邓紫棋",
"songname": "岩石里的花"
}],
"topTitle": "巅峰榜·港台",
"type": 0
}, {
"id": 3,
"listenCount": 9300000,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000000F1Kaw1UbOri.jpg",
"songList": [{
"singername": "Westlife",
"songname": "Hello My Love"
}, {
"singername": "Ariana Grande",
"songname": "7 rings (Explicit)"
}, {
"singername": "Galantis/OneRepublic",
"songname": "Bones"
}],
"topTitle": "巅峰榜·欧美",
"type": 0
}, {
"id": 16,
"listenCount": 4530780,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000001Eb9x31z2mOO.jpg",
"songList": [{
"singername": "ITZY",
"songname": "달라달라 (DALLA DALLA)"
}, {
"singername": "화사 (华莎)",
"songname": "멍청이 (TWIT)"
}, {
"singername": "로시 (Rothy)",
"songname": "레인보우 (Rainbow)"
}],
"topTitle": "巅峰榜·韩国",
"type": 0
}, {
"id": 29,
"listenCount": 1960000,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000000X0tfU105Xa3.jpg",
"songList": [{
"singername": "摩登兄弟",
"songname": "宁愿"
}, {
"singername": "韩寒",
"songname": "奉献"
}, {
"singername": "周笔畅",
"songname": "去流浪"
}],
"topTitle": "巅峰榜·影视金曲",
"type": 0
}, {
"id": 17,
"listenCount": 1495456,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000000B6izj4I0MD3.jpg",
"songList": [{
"singername": "あいみょん",
"songname": "あした世界が終わるとしても (即便明天世界终结)"
}, {
"singername": "女王蜂 (じょおうばち)",
"songname": "火炎"
}, {
"singername": "RADWIMPS (ラッドウィンプス)",
"songname": "PAPARAZZI (English Version)"
}],
"topTitle": "巅峰榜·日本",
"type": 0
}, {
"id": 201,
"listenCount": 156846,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000001BJIeN4b2v95.jpg",
"songList": [{
"singername": "蔡徐坤",
"songname": "Wait Wait Wait"
}, {
"singername": "周笔畅",
"songname": "去流浪 (《流浪地球》电影推广曲)"
}, {
"singername": "ITZY",
"songname": "달라달라 (DALLA DALLA)"
}],
"topTitle": "巅峰榜·MV",
"type": 0
}, {
"id": 52,
"listenCount": 867895,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000000KIAVP3s8Oun.jpg",
"songList": [{
"singername": "陈硕子",
"songname": "你早就该忘了她"
}, {
"singername": "一只白",
"songname": "零食、恋爱和想你"
}, {
"singername": "司徒赫伦",
"songname": "阿里"
}],
"topTitle": "巅峰榜·腾讯音乐人原创榜",
"type": 0
}, {
"id": 36,
"listenCount": 2499300,
"picUrl": "http://y.gtimg.cn/music/photo_new/T003R300x300M000004bhA5d4QVHL3.jpg",
"songList": [{
"singername": "大天使 icey",
"songname": "知否知否"
}, {
"singername": "朴爱源",
"songname": "不为谁而作的歌"
}, {
"singername": "麓七",
"songname": "光年之外"
}],
"topTitle": "巅峰榜·K歌金曲",
"type": 0
}]
}
},
code = data.code,
data = data.data,
list = data.topList;
if (code == 0) {
this.setData({
rank: list
});
wx.hideLoading();
}
// },
// fail: req => {
// wx.showToast({
// icon:'none',
// title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
// })
// }
// })
},
goTonext(e) {
var id = e.currentTarget.dataset.id;
//跳转详情榜单页面
wx.navigateTo({
url: '../top/top?disstid=' + id,
})
}
})
================================================
FILE: pages/rank/rank.json
================================================
{
"navigationBarTitleText": "HMusic"
}
================================================
FILE: pages/rank/rank.wxml
================================================
<view class="rank">
<block wx:for="{{rank}}" wx:for-item="list" wx:key="list">
<view class="list" data-id="{{list.id}}" bindtap='goTonext'>
<image class="picUrl" src="{{list.picUrl}}"></image>
<image class="radio_icon" src="../../img/music.png"></image>
<text class="listNum">{{list.listenCount/10000}}万</text>
<view class="songList">
<block wx:for="{{list.songList}}" wx:for-item="songlist" wx:key="songlist">
<view class="song">{{index+1}} {{songlist.songname}}-{{songlist.singername}}</view>
</block>
</view>
</view>
</block>
</view>
================================================
FILE: pages/rank/rank.wxss
================================================
.rank {
padding-bottom: 40rpx;
}
.list {
position: relative;
display: flex;
margin: 0 40rpx;
padding-top: 40rpx;
height: 200rpx;
}
.list image.picUrl {
-webkit-box-flex: 0;
-ms-flex: 0 0 200rpx;
flex: 0 0 w00rpx;
width: 200rpx;
height: 200rpx;
}
.list image.radio_icon {
position: absolute;
width:40rpx;
height:40rpx;
left:14rpx;
bottom:10rpx;
}
.list .listNum {
position:absolute;
left:70rpx;
bottom:10rpx;
color:#fff;
font-size:12px;
}
.list .songList {
-webkit-box-flex: 1;
-ms-flex: 1;
flex: 1;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
padding: 0 40rpx;
height: 200rpx;
overflow: hidden;
background: #fff;
color: hsla(0,0%,100%,.3);
font-size: 12px;
}
.list .songList .song {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
line-height: 52rpx;
color:#000;
}
================================================
FILE: pages/search/search.js
================================================
const app = getApp();
Page({
data: {},
onLoad: function() {
wx.hideLoading();
wx.showShareMenu();
this.getStorage();
var key = wx.getStorageSync('hotkey'),
expirationTime = wx.getStorageSync('expirationTime'), //过期时间一天
time = Date.parse(new Date());
if (!expirationTime) {
expirationTime = time;
}
if (expirationTime > time) {
this.setData({
list: key
})
} else {
wx.request({
url: '关键字API',
data: {},
success: res => {
var code = res.data.code,
data = res.data.data,
list = data.hotkey;
if (code == 0) {
var timestamp = Date.parse(new Date());
var expiration = timestamp + 86400; //过期时间一天
this.setData({
list: list
});
wx.setStorage({
key: 'hotkey',
data: list,
});
wx.setStorage({
key: 'expirationTime',
data: expiration,
})
}
},
fail: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
})
}
},
getStorage() {
var logs = wx.getStorageSync('yqq_search_history').split(','); //获取搜索记录缓存
if (logs[0] == '') {
this.setData({
keys: [],
haveKeys: false
});
} else {
this.setData({
keys: logs,
haveKeys: true
});
}
},
inputFocus(e) {
//输入框获取焦点
if (!this.data.havaResult) {
this.setData({
isHide: true,
hotHide: true,
isCancel: true,
inputShowed: true
});
this.getStorage();
}
},
clearKeys: function() {
//清空搜索记录
this.setData({
keys: [],
haveKeys: false
});
wx.setStorageSync('yqq_search_history', '');
},
cancel: function() {
//取消
this.setData({
isHide: false,
sInput: '',
isNull: true,
hotHide: false,
isCancel: false,
havaResult: false,
searchResult: [],
isLoadAll: false,
inputShowed: false
})
},
clearKey: function(e) {
//删除某一个记录
var key = e.target.dataset.key,
data = this.data.keys;
for (var i = 0; i < data.length; i++) {
if (key == data[i]) {
data.splice(i, 1);
this.setData({
keys: data
})
}
}
wx.setStorageSync('yqq_search_history', this.data.keys);
},
searchKey(e) {
//点击完成按钮时触发
var val = e.detail.value;
// console.log(val.trim().length);
if (val.trim().length == 0) {
wx.showToast({
icon: 'none',
title: '不能查询空值哦',
})
} else {
this.setData({
searchResult:[]
});
this.searchKeyword(val, 1);
}
},
searchInput(e) {
//输入的时候触发
var val = e.detail.value;
if (val.length == 0) {
this.setData({
isNull: true
})
} else {
this.setData({
isNull: false
})
}
},
clearInput() {
//清空输入框
this.setData({
sInput: '',
isNull: true,
searchResult:[]
})
},
searchThisKey(e) {
//点击热门搜索值
var key = e.target.dataset.key.replace(/\s+/g, "");
this.setData({
sInput: key,
hotHide: true,
isNull: false,
haveKeys: false,
havaResult: true,
isCancel: true,
inputShowed: true,
sInput: key,
searchResult:[]
})
this.searchKeyword(key, 1);
},
in_array(v, arr) {
var output = true;
for (var i in arr) {
if (v == arr[i]) {
output = false;
return output;
}
}
output = true;
return output;
},
searchKeyword: function(key, p) { //调用搜索查询接口
wx.showLoading({
title: '加载中',
});
var logs = this.data.keys;
var is_true = this.in_array(key, logs);
if (is_true) {
logs.push(key);
wx.setStorageSync('yqq_search_history', logs.join(','));
}
wx.request({
url: '搜索API',
dataType: 'json',
success: res => {
wx.hideLoading();
var code = res.data.code,
subcode = res.data.subcode;
if (subcode == '-10001') {
wx.showToast({
icon: 'none',
title: '哎呀,接口出错了,暂时不能搜索咯,很抱歉',
})
} else {
var song = res.data.data.song,
curpage = song.curpage,
curnum = song.curnum,
totalnum = song.totalnum,
list = this.data.searchResult,
singer = res.data.data.zhida;
var c = list.concat(song.list);
if (curpage * curnum >= totalnum) {
this.setData({
searchResult: c,
isLoadAll: true,
canGetsearch: false,
isHide: false,
havaResult: true,
singer: singer
})
} else {
this.setData({
searchResult: c,
isLoadAll: false,
canGetsearch: true,
isHide: false,
havaResult: true,
singer: singer
})
}
}
}
})
},
scroll: function(e) {
var p = this.data.p,
sInput = this.data.sInput;
if (this.data.canGetsearch) {
p = p + 1;
this.searchKeyword(sInput, p);
this.setData({
canGetsearch: false,
p: p
})
}
},
goToplay: function(e) {
//跳到播放页
var id = e.currentTarget.dataset.id,
name = e.currentTarget.dataset.name,
song_id = wx.getStorageSync('song_id');
// console.log(song_id);
if (song_id == '') {
var songid = [],
mname = [];
songid.push(id);
mname.push(name);
wx.setStorage({
key: 'song_id',
data: songid,
});
wx.setStorage({
key: 'music_name',
data: mname,
});
wx.setStorage({
key: 'num',
data: 0,
})
app.globalData.shouldPlay = true;
// app.globalData.unload = true;
} else {
if (song_id.indexOf(id) != '-1') {
var num = song_id.indexOf(id);
wx.setStorage({
key: 'num',
data: num,
});
} else {
var num = wx.getStorageSync('num'),
musicName = wx.getStorageSync('music_name');
num++;
song_id.splice(num, 0, id);
musicName.splice(num, 0, name);
wx.setStorage({
key: 'song_id',
data: song_id,
});
wx.setStorage({
key: 'music_name',
data: musicName,
});
wx.setStorage({
key: 'num',
data: num,
})
app.globalData.shouldPlay = true;
// app.globalData.unload = true;
}
}
wx.switchTab({
url: '../playSong/playSong',
})
},
goToSinger(e) {
var id = e.currentTarget.dataset.singermid;
wx.navigateTo({
url: '../singer/singer?disstid=' + id,
})
}
})
================================================
FILE: pages/search/search.json
================================================
{
"navigationBarTitleText": "HMusic"
}
================================================
FILE: pages/search/search.wxml
================================================
<view class="searchPage">
<!-- 输入框 -->
<!-- <view class="search-box-wrapper">
<view class="search-box">
<image class="icon" src="../../img/search.png"></image>
<input class="search_input" value='{{sInput}}' placeholder='搜索歌曲、歌手' placeholder-class="input-placeholder" bindfocus="inputFocus" bindconfirm="searchKey" bindinput="searchInput"></input>
<image class="cc {{isNull?'hide':''}}" src="../../img/close1.png" bindtap='clearInput'></image>
</view>
<view class="cancel {{isCancel?'':'hide'}}" bindtap='cancel'>取消</view>
</view> -->
<view class="page__bd">
<view class="weui-search-bar">
<view class="weui-search-bar__form">
<view class="weui-search-bar__box">
<icon class="weui-icon-search_in-box" type="search" size="14"></icon>
<input type="text" class="weui-search-bar__input" placeholder="搜索歌曲、歌手" value="{{sInput}}" focus="{{inputShowed}}" bindinput="searchInput" bindconfirm="searchKey"/>
<view class="weui-icon-clear {{isNull?'hide':''}}" bindtap="clearInput">
<icon type="clear" size="14"></icon>
</view>
</view>
<label class="weui-search-bar__label" hidden="{{inputShowed}}" bindtap="inputFocus">
<icon class="weui-icon-search" type="search" size="14"></icon>
<view class="weui-search-bar__text">搜索歌曲、歌手</view>
</label>
</view>
<view class="weui-search-bar__cancel-btn {{isCancel?'':'hide'}}" bindtap="cancel">取消</view>
</view>
</view>
<!-- 热门搜索 -->
<view class="hot_keys {{hotHide?'hide':''}}">
<view class="title">热门搜索</view>
<view class="res_tags">
<block wx:for="{{list}}" wx:key="{{list}}">
<view class="list" data-key="{{item.k}}" bindtap='searchThisKey'>{{item.k}}</view>
</block>
</view>
</view>
<!-- 搜索记录模块 -->
<view class="record_keys {{isHide?'':'hide'}}">
<block wx:for="{{keys}}" wx:key="{{keys}}">
<view class="key_list">
<image class="clock" src="../../img/clock.png"></image>
<view class="key_text" data-key="{{item}}" bindtap='searchThisKey'>{{item}}</view>
<image data-key="{{item}}" class="close" src='../../img/close.png' bindtap='clearKey'></image>
</view>
</block>
<view class="clear {{haveKeys?'':'hide'}}" bindtap='clearKeys'>清除搜索记录</view>
</view>
<!-- 搜索结果模块 -->
<scroll-view wx:if="{{searchResult.length != 0}}" scroll-y style="height:100vh;" bindscrolltolower="scroll" lower-threshold="50" scroll-with-animation enable-back-to-top>
<view class="search_result {{havaResult?'':'hide'}}">
<view class="search_page" wx:if="{{singer.singerid}}" data-singermid="{{singer.singermid}}" data-id="{{singer.singerid}}" bindtap='goToSinger'>
<image class="media" wx:if="{{singer.singermid}}" src="https://y.gtimg.cn/music/photo_new/T001R68x68M000{{singer.singermid}}.jpg?max_age=2592000"></image>
<view class="title">{{singer.singername}}</view>
<view class="name">单曲:{{singer.songnum}} 专辑:{{singer.albumnum}}</view>
</view>
<block wx:for="{{searchResult}}" wx:key="{{searchResult}}">
<view class="search_page" data-name="{{item.songname}}" data-id="{{item.songid}}" bindtap='goToplay'>
<image class="Micon" src="../../img/icon.png"></image>
<view class="title">{{item.songname}}</view>
<view class="name">{{item.singer[0].name}}</view>
</view>
</block>
<view class="loadAll {{isLoadAll?'':'hide'}}">已加载全部</view>
</view>
</scroll-view>
</view>
================================================
FILE: pages/search/search.wxss
================================================
page {
background-color: #fff;
}
.page__bd {
position: fixed;
top:0;
width:100%;
background: #f4f4f4;
/* padding: 20rpx; */
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-align: center;
z-index:1;
}
.weui-search-bar {
width:100%;
}
.weui-search-bar__cancel-btn {
color:#000;
font-size:24rpx;
}
.weui-search-bar__input {
color:#000;
}
/* 自己写的搜索框 */
.search-box-wrapper {
position: fixed;
top:0;
width:95%;
background: #f4f4f4;
padding: 20rpx;
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-align: center;
z-index:1;
}
.search-box {
position: relative;
border-radius: 3px;
background: #fff;
height: 40rpx;
line-height: 40rpx;
padding: 16rpx 24rpx 16rpx 70rpx;
-webkit-box-flex: 1;
}
.search-box .cc {
position: absolute;
top: 9px;
right: 12px;
width: 18px;
height: 18px;
background: #b1b1b1;
text-indent: -9999px;
border-radius: 99px;
z-index:999;
}
.icon {
position: absolute;
top: 18rpx;
left: 20rpx;
width: 36rpx;
height: 36rpx;
background-repeat: no-repeat;
background-size: cover;
/* text-indent: -999px; */
}
input {
min-height: 40rpx;
height: 40rpx;
line-height: 40rpx;
width: 100%;
color: rgba(0,0,0,.3);
border: none;
-webkit-appearance: none;
font-size: 14px;
}
.input-placeholder {
font-size:14px;
color: rgba(0,0,0,.3);
}
.cancel {
padding-right: 20rpx;
padding-left: 20rpx;
font-size: 14px;
height: 72rpx;
line-height: 72rpx;
}
.hot_keys {
background: #fff;
padding: 30rpx 30rpx 20rpx 30rpx;
margin-top:96rpx;
}
.record_keys {
margin-top:96rpx;
}
.search_result {
margin-top:96rpx;
}
.title {
color: rgba(0,0,0,.6);
margin-bottom: 16rpx;
}
.list {
display: inline-block;
padding: 10rpx 20rpx;
margin: 0 40rpx 20rpx 0;
border-radius: 12rpx;
background: rgb(146, 144, 144);
font-size: 14px;
color: #fff;
}
.key_list {
border-top: 1px solid #ededed;
padding: 0 30rpx;
position: relative;
display: block;
height: 88rpx;
line-height: 88rpx;
}
.key_list .clock {
position: absolute;
left: 60rpx;
top: 24rpx;
width: 40rpx;
height: 40rpx;
text-indent: -999px;
}
.key_list .key_text {
position: absolute;
left: 140rpx;
right: 100rpx;
display: block;
height: 88rpx;
line-height: 88rpx;
color: #000;
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.key_list .close {
position: absolute;
right: 60rpx;
top: 24rpx;
width: 40rpx;
height: 40rpx;
}
.clear {
text-align: center;
height: 88rpx;
line-height: 88rpx;
color:#47c88a;
font-size:14px;
}
.search_page {
position:relative;
height: 110rpx;
padding-left: 112rpx;
overflow: hidden;
}
.search_page::after {
content:"";
position:absolute;
height: 1px;
top:0;
left:0;
right: 0;
background:#e5e5e5;
}
.search_page .Micon {
position: absolute;
top: 36rpx;
left: 36rpx;
width: 44rpx;
height: 40rpx;
background-position: 0 0;
}
.search_page .media {
position: absolute;
top: 16rpx;
left: 16rpx;
width: 80rpx;
height: 80rpx;
border-radius: 80rpx;
}
.search_page .title {
margin: 20rpx 0 2px;
line-height: 36rpx;
font-size: 16px;
font-weight: normal;
color: #000;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.search_page .name {
color:#80808080;
font-size:14px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.search_result .loadAll {
line-height: 80rpx;
text-align: center;
color: #808080;
}
================================================
FILE: pages/share/share.js
================================================
const app = getApp();
Page({
data: {},
onLoad: function(options) {
wx.hideLoading();
app.globalData.backgroundAudioManager.onPlay(() => {
var that = this;
that.updateTime(that);
this.setData({
isPlay: true
});
app.globalData.isPlay = true;
});
app.globalData.backgroundAudioManager.onError((res) => {
if (res.errCode == '10001') {
wx.showToast({
icon: 'none',
title: '由于系统错误导致歌曲播放失败',
})
} else if (res.errCode == '10002') {
wx.showToast({
icon: 'none',
title: '由于网络错误导致歌曲播放失败',
})
} else if (res.errCode == '10003') {
wx.showToast({
icon: 'none',
title: '哎呀!播放文件错误',
})
} else if (res.errCode == '10004') {
wx.showToast({
icon: 'none',
title: '哎呀!播放格式错误',
})
} else if (res.errCode == '-1') {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
});
app.globalData.backgroundAudioManager.onEnded(() => {
// var id = wx.getStorageSync('share_id');
// var this_id = id[0];
var background = wx.getStorageSync('backgrond');
app.globalData.backgroundAudioManager.title = background.title;
app.globalData.backgroundAudioManager.singer = background.singer;
app.globalData.backgroundAudioManager.src = background.src;
app.globalData.backgroundAudioManager.coverImgUrl = background.coverImgUrl;
app.globalData.backgroundAudioManager.play();
this.setData({
musicTime: 1,
toView: 'A0',
isPlay: true
});
app.globalData.isPlay = true;
wx.setStorage({
key: 'current',
data: {
toView: 'A0',
musicTime: 1
},
});
var that = this;
that.updateTime(that);
// this.music_fcg(this_id);
});
app.globalData.backgroundAudioManager.onPause(() => {
this.setData({
isPlay: false
})
app.globalData.isPlay = false;
});
app.globalData.backgroundAudioManager.onStop(() => {
app.globalData.startTime = 0;
wx.setStorage({
key: 'current',
data: {
toView: 'A0',
musicTime: 1
},
});
this.setData({
isPlay: false
});
wx.setStorage({
key: 'share_id',
data: '[]',
});
app.globalData.isPlay = false;
});
},
onShow() {
this.setData({
isPlay: app.globalData.isPlay
})
var startTime = app.globalData.startTime;
app.globalData.shouldPlay = false;
// console.log(startTime, app.globalData.changeMusic,this.data.isPlay);
if (startTime > 0) {
var background = wx.getStorageSync('backgrond'),
// msg = wx.getStorageSync('msg'),
msg = app.globalData.musicMsg,
current = wx.getStorageSync('current'),
changeMusic = app.globalData.changeMusic;
if (changeMusic) {
var song_id = wx.getStorageSync('share_id'),
music_name = wx.getStorageSync('share_name'),
this_id = song_id[0],
sid = wx.getStorageSync('song_id'),
mName = wx.getStorageSync('music_name'),
num = wx.getStorageSync('num');
if (sid) {
var index = sid.indexOf(this_id);
if (index == -1) {
sid.splice(parseInt(num + 1), 0, this_id);
mName.splice(parseInt(num + 1), 0, music_name[0]);
wx.setStorage({
key: 'num',
data: parseInt(num + 1),
})
} else {
wx.setStorage({
key: 'num',
data: index,
})
}
wx.setStorage({
key: 'song_id',
data: sid,
});
wx.setStorage({
key: 'music_name',
data: mName,
})
} else {
wx.setStorage({
key: 'song_id',
data: song_id,
});
wx.setStorage({
key: 'music_name',
data: music_name,
});
wx.setStorage({
key: 'num',
data: 0,
})
}
this.music_fcg(this_id);
this.setData({
haveMusicStorage: true,
MusicName: music_name,
isPlay: true,
toView: 'A0',
musicTime: 1,
time: 0
});
app.globalData.isPlay = true;
wx.setStorage({
key: 'current',
data: {
toView: 'A0',
musicTime: 1
},
})
} else {
if (current.toView) {
this.setData({
toView: current.toView,
musicTime: current.musicTime
});
}
this.setData({
lyrics: app.globalData.lyrics,
haveMusicStorage: true,
audioSrc: background.src,
time: startTime,
track_info: msg.track_info,
singer: msg.singer
});
if (!this.data.isPlay) {
app.globalData.backgroundAudioManager.title = background.title;
app.globalData.backgroundAudioManager.singer = background.singer;
app.globalData.backgroundAudioManager.src = background.src;
app.globalData.backgroundAudioManager.startTime = startTime;
app.globalData.backgroundAudioManager.coverImgUrl = background.coverImgUrl;
app.globalData.backgroundAudioManager.play();
app.globalData.isPlay = true;
this.setData({
isPlay: true
})
} else {
this.updateTime(this);
}
}
} else {
if (wx.getStorageSync('share_id').length == 0) {
wx.showModal({
title: '提示',
content: '暂时无法获取分享的歌曲,请移步推荐页哟',
showCancel: false,
success: function(res) {
if (res.confirm) {
wx.switchTab({
url: '../index/index',
})
}
}
});
this.setData({
haveMusicStorage: false
});
} else {
// var id = app.globalData.labelid,
// rid = app.globalData.radioId,
// radioid = wx.getStorageSync('labelid'),
// shouldPlay = app.globalData.shouldPlay,
// index = wx.getStorageSync('num');
// if (shouldPlay) {
var music_name = wx.getStorageSync('share_name');
var song_id = wx.getStorageSync('share_id'),
this_id = song_id[0],
sid = wx.getStorageSync('song_id'),
mName = wx.getStorageSync('music_name'),
num = wx.getStorageSync('num');
if (sid) {
var index = sid.indexOf(this_id);
if (index == -1) {
sid.splice(parseInt(num + 1), 0, this_id);
mName.splice(parseInt(num + 1), 0, music_name[0]);
wx.setStorage({
key: 'num',
data: parseInt(num + 1),
})
} else {
wx.setStorage({
key: 'num',
data: index,
})
}
wx.setStorage({
key: 'song_id',
data: sid,
});
wx.setStorage({
key: 'music_name',
data: mName,
});
} else {
wx.setStorage({
key: 'song_id',
data: song_id,
});
wx.setStorage({
key: 'music_name',
data: music_name,
});
wx.setStorage({
key: 'num',
data: 0,
})
}
this.music_fcg(this_id);
// this.setData({
// num: index
// })
// app.globalData.labelid = radioid;
// app.globalData.shouldPlay = false;
// } else {
// if (rid.indexOf(radioid) == -1) {
// if (radioid != id) {
// var song_id = wx.getStorageSync('share_id'),
// this_id = song_id[0];
// this.music_fcg(this_id);
// this.setData({
// num: 0
// })
// app.globalData.labelid = radioid;
// }
// }
// }
this.setData({
haveMusicStorage: true,
MusicName: music_name
});
}
}
},
music_fcg: function(this_id) {
wx.showLoading({
title: '加载中',
})
var musicu = this.data.musicu;
musicu.detail.param.song_id = this_id;
musicu.simsongs.param.songid = this_id;
musicu.gedan.param.song_id = this_id;
typeof this_id == 'string' ? musicu.video.param.songid = this_id.toString() : musicu.video.param.songid = this_id;
//歌曲相关信息
wx.request({
url: '歌曲API',
method: 'POST',
data: JSON.stringify(musicu),
success: res => {
var detail = res.data.detail,
gedan = res.data.gedan,
simsongs = res.data.simsongs,
songmid = detail.data.track_info.mid,
info = detail.data.info,
video = res.data.video.data.list,
vids = [],
lyric,
mediaArray = [],
haveLyric = false;
//将歌词字符串转为数组,并去掉前五组数据
for (var i = 0; i < info.length; i++) {
if (info[i].title == '歌词') {
lyric = info[i].content[0].value.split('\n').slice(5);
haveLyric = true;
}
}
for (var i = 0; i < video.length; i++) {
vids.push(video[i].vid);
}
if (vids.length > 0) {
this.getVideoSrc(vids);
}
//将时间跟歌词分开
if (haveLyric) {
for (var j = 0; j < lyric.length; j++) {
var t = lyric[j].substring(lyric[j].indexOf('[') + 1, lyric[j].indexOf(']')),
c = lyric[j].substring(lyric[j].indexOf("]") + 1, lyric[j].length);
if (c != '') {
mediaArray.push({
t: (parseInt(t.split(":")[0] * 60) + parseFloat(t.split(":")[1])).toFixed(1),
c: c,
id: 'A' + j
})
}
}
}
this.setData({
track_info: detail.data.track_info,
gedan: gedan.data.vec_gedan,
simsongs: simsongs.data.songInfoList,
singer: detail.data.track_info.singer,
songmid: songmid,
lyrics: mediaArray,
video: video
});
app.globalData.musicMsg = {
track_info: detail.data.track_info,
gedan: gedan.data.vec_gedan,
simsongs: simsongs.data.songInfoList,
singer: detail.data.track_info.singer,
songmid: songmid,
video: video
}
// wx.setStorage({
// key: 'msg',
// data: {
// track_info: detail.data.track_info,
// singer: detail.data.track_info.singer
// },
// })
app.globalData.lyrics = mediaArray;
var songUrl = this.data.pUrl,
mid = songmid;
songUrl.req_0.param.songmid.splice(0, 1, mid);
//获取歌曲链接
wx.request({
url: '歌曲API',
method: 'post',
data: JSON.stringify(songUrl),
success: res => {
wx.hideLoading();
var pUrl = res.data.req_0.data.midurlinfo[0].purl;
if (pUrl == '') {
app.globalData.backgroundAudioManager.pause();
var that = this;
that.setData({
audioSrc: ''
});
wx.showModal({
title: '提示',
content: '很抱歉,该歌曲暂不支持播放哦,咱们听下一首歌吧',
success: function(res) {
if (res.confirm) {
that.nextAudio();
}
}
})
} else if (this.data.time == 0) {
wx.setStorage({
key: 'backgrond',
data: {
title: detail.data.track_info.name,
singer: detail.data.track_info.singer[0].name,
src: pUrl,
coverImgUrl: 'https://y.gtimg.cn/music/photo_new/T002R300x300M000' + detail.data.track_info.album.mid + '.jpg?max_age=2592000'
},
});
app.globalData.backgroundAudioManager.title = detail.data.track_info.name;
app.globalData.backgroundAudioManager.singer = detail.data.track_info.singer[0].name;
app.globalData.backgroundAudioManager.src = pUrl;
app.globalData.backgroundAudioManager.coverImgUrl = 'https://y.gtimg.cn/music/photo_new/T002R300x300M000' + detail.data.track_info.album.mid + '.jpg?max_age=2592000'
app.globalData.backgroundAudioManager.play();
this.setData({
audioSrc: pUrl,
isPlay: true
});
app.globalData.isPlay = true;
app.globalData.musicMsg.audioSrc = pUrl;
}
},
error: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
});
},
error: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
});
//精彩评论
wx.request({
url: '评论API',
data: {},
success: res => {
var commentlist = res.data.hot_comment.commentlist,
list = [];
if (commentlist) {
if (commentlist.length > 4) {
list.push(commentlist[1]);
list.push(commentlist[2]);
list.push(commentlist[3]);
} else {
for (var i = 0; i < commentlist.length; i++) {
list.push(commentlist[i]);
}
}
for (var i = 0; i < list.length; i++) {
list[i].time = app.timestampToTime(list[i].time);
}
this.setData({
commentlist: list,
haveCommentlist: true
});
app.globalData.musicMsg.commentlist = list;
app.globalData.musicMsg.haveCommentlist = true;
} else {
this.setData({
haveCommentlist: false
});
app.globalData.musicMsg.haveCommentlist = false;
app.globalData.musicMsg.commentlist = '';
}
},
error: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
})
}
});
},
audioPlay() {
//音乐播放暂停
var isPlay = this.data.isPlay,
src = this.data.audioSrc;
if (isPlay) {
app.globalData.backgroundAudioManager.pause();
this.setData({
isPlay: false
})
app.globalData.isPlay = false;
} else if (isPlay == false && src != '') {
app.globalData.backgroundAudioManager.play();
this.setData({
isPlay: true
});
app.globalData.isPlay = true;
} else {
var that = this;
wx.showModal({
title: '提示',
content: '很抱歉,该歌曲需要vip哦,咱们听下一首歌吧',
success: function(res) {
if (res.confirm) {
that.nextAudio();
}
}
})
}
},
updateTime: function(that) {
//播放时更新时间
app.globalData.backgroundAudioManager.onTimeUpdate((res) => {
var duration = app.globalData.backgroundAudioManager.duration,
currentTime = app.globalData.backgroundAudioManager.currentTime.toFixed(1),
time = this.data.lyrics,
musicTime = this.data.musicTime;
app.globalData.startTime = app.globalData.backgroundAudioManager.currentTime;
for (var i = musicTime; i < time.length; i++) {
if (parseInt(currentTime) > parseInt(time[i].t)) {
if (this.data.toView != time[i].id) {
this.setData({
toView: time[i].id,
musicTime: musicTime + 1
});
wx.setStorage({
key: 'current',
data: {
toView: time[i].id,
musicTime: musicTime + 1
},
})
}
return;
}
}
})
},
goIndex(){
wx.switchTab({
url: '../../pages/index/index',
})
}
})
================================================
FILE: pages/share/share.json
================================================
{
"navigationBarTitleText": "HMusic"
}
================================================
FILE: pages/share/share.wxml
================================================
<view wx:if="{{haveMusicStorage}}" class="playSong" style="height:100%;">
<view class="main" style="height:100%;">
<view class="main_bd" style="height:70%;">
<view class="song_info" style="height:70%;">
<view class="song_info_hd">
<view class="song_name">
<view class="song_name__text">
{{track_info.title}}
</view>
</view>
<view class="singer_name">
<block wx:for="{{singer}}" wx:key="singer">
<view class="item_name">{{index > 0 ? ' / ' : ''}}{{item.name}}</view>
</block>
</view>
</view>
<view class="song_info_bd">
<view class="album_cover">
<image wx:if="{{track_info.album.mid}}" class="album_cover__img" src="https://y.gtimg.cn/music/photo_new/T002R300x300M000{{track_info.album.mid}}.jpg?max_age=2592000"></image>
</view>
<view class="lyric">
<view class="lyric__bd" style="position:reative;">
<scroll-view scroll-y style="position:absolute;bottom:0;height:80%;white-space:nowrap;font-size:15px;" scroll-into-view="{{toView}}" upper-threshold="2000" scroll-with-animation scroll-top="40rpx;">
<block wx:for="{{lyrics}}" wx:for-item="lyric" wx:key="{{lyric}}">
<view style="color:{{toView == lyric.id ? '#31c27c':''}}" class="lyric__para" data-time="{{lyric.t}}" id="{{lyric.id}}">
{{lyric.c}}
</view>
</block>
</scroll-view>
</view>
</view>
</view>
</view>
<view class="opt">
<view wx:if="{{havePop}}" class="opt__item" bindtap="" style="opacity:.5;">
<image class="opt__icon" src="../../img/pop.png"></image>
</view>
<view class="opt__item" bindtap="audioPlay">
<image wx:if="{{isPlay}}" class="opt__icon" src="../../img/pause.png"></image>
<image wx:else class="opt__icon" src="../../img/opt_icon.png"></image>
</view>
<view wx:if="{{haveNext}}" class="opt__item" bindtap="" style="opacity:.5;">
<image class="opt__icon" src="../../img/next.png"></image>
</view>
<!-- <view class="opt__item"> -->
<!-- <image class="opt__icon" src="../../img/share.png"></image> -->
<!-- <button open-type='share' style="border:0;" plain><image class="opt__icon" src="../../img/share.png"></image></button> -->
<!-- </view> -->
</view>
<view class='opt'>
<button type="primary" bindtap="goIndex">回到首页</button>
</view>
</view>
<view class="bg" style="height:100%;">
<image wx:if="{{track_info.album.mid}}" class="bg_img" src="https://y.gtimg.cn/music/photo_new/T002R300x300M000{{track_info.album.mid}}.jpg?max_age=2592000"></image>
</view>
</view>
</view>
================================================
FILE: pages/share/share.wxss
================================================
page {
background: #fff;
}
.main {
position: relative;
/* padding-bottom: 30rpx; */
overflow: hidden;
}
.main_bd {
position: relative;
z-index: 4;
}
.song_name {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
margin-top: 40rpx;
font-size:18px;
font-weight: 300;
}
.song_name .song_name__text {
max-width: 222rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 18px;
font-weight: 400;
color: #000;
}
.song_name .icon_playlist {
position: relative;
display: block;
width: 36rpx;
height: 36rpx;
margin: 0 -44rpx 0 8rpx;
}
.icon_playlist::after {
content: "";
position: absolute;
top: -100%;
left: -100%;
width: 300%;
height: 300%;
}
.singer_name {
margin: 0 40rpx 30rpx;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 14px;
color:grey;
}
.singer_name .item_name {
display: inline-block;
}
.song_info_bd {
position: relative;
/* height: 300rpx; */
height:80%;
}
.song_info_bd .album_cover {
position: absolute;
top: 0;
left: 50%;
z-index: 2;
width: 468rpx;
height: 468rpx;
margin-left: -234rpx;
box-shadow: 0 1rpx 4px rgba(0,0,0,.2);
display: none;
}
.album_cover__img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.lyric {
position: absolute;
top: 0;
left: 0;
z-index: 1;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
-webkit-box-align: center;
width: 100%;
height: 100%;
}
.lyric .lyric__bd {
width: 100%;
/* height: 300rpx; */
height:100%;
overflow: hidden;
-webkit-mask: -webkit-linear-gradient(top,rgba(0,0,0,0),#fff 25%,#fff 75%,rgba(0,0,0,0));
}
.lyric__para {
line-height: 2;
margin: 0 40rpx;
text-align: center;
overflow: hidden;
white-space: normal;
text-overflow: ellipsis;
font-size: 15px;
/* color: #31c27c; */
}
/* .opt {
position: relative;
height:180rpx;
}
.opt__item {
position: absolute;
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
width:80rpx;
height:80rpx;
margin: 0 40rpx;
border: solid 1px rgba(0,0,0,.2);
border-radius: 100%;
top:50%;
left:45%;
transform:translate(-50%,-50%);
}
.opt__icon {
display: block;
width: 44rpx;
height: 44rpx;
fill: #000;
} */
.opt {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 180rpx;
}
.opt__item {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
width:76rpx;
height:76rpx;
margin: 0 40rpx;
/* border: solid 1px rgba(0,0,0,.2); */
border-radius: 100%;
}
.opt__icon {
display: block;
width: 64rpx;
height: 64rpx;
fill: #000;
}
.bg {
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: 100%;
height:750rpx;
}
.bg_img {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 100%;
height: 100%;
opacity: .06;
-webkit-transform: scale(1.2);
}
================================================
FILE: pages/singer/singer.js
================================================
const app = getApp()
Page({
data: {},
onLoad: function (option) {
wx.showLoading({
title: '加载中',
})
let disstid = option.disstid;
this.setData({
disstid: disstid
});
this.getSinger(disstid, 0);
wx.showShareMenu();
},
getSinger(dissitd, begin) {
wx.request({
url: '歌手详情API',
data: {},
success: (res) => {
var dataList = this.data.list,
data = res.data.data,
songids = this.data.songids,
songName = this.data.songName,
list = data.list;
if (parseInt(data.total - begin)< 15) {
this.setData({
havaMusic: false
})
} else {
this.setData({
havaMusic: true
})
}
if (dataList.list) {
dataList.list = dataList.list.concat(list);
} else {
dataList = data;
}
data.SingerDesc = data.SingerDesc.replace(/ /g, ' ');
data.SingerDesc = data.SingerDesc.replace(/´/g, "'");
data.SingerDesc = data.SingerDesc.replace(/<br>/g, "\n");
for (var i = 0; i < list.length; i++) {
songids.push(parseInt(list[i].musicData.songid));
songName.push(list[i].musicData.songname);
}
this.setData({
list: dataList,
songids: songids,
songName: songName,
begin: begin
});
wx.hideLoading();
},
error: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
});
}
})
},
getMoreMusic: function () {
var disstid = this.data.disstid,
begin = this.data.begin;
begin = begin + 15;
this.getSinger(disstid, begin);
},
playAll() {
var songids = this.data.songids,
songName = this.data.songName;
wx.showLoading({
title: '加载中',
})
wx.setStorage({
key: 'song_id',
data: songids
});
wx.setStorage({
key: 'music_name',
data: songName,
});
wx.setStorage({
key: 'num',
data: 0,
});
app.globalData.shouldPlay = true;
// app.globalData.unload = false;
wx.switchTab({
url: '../playSong/playSong',
})
},
musicPlay(e){
var songids = this.data.songids,
songName = this.data.songName,
num = e.currentTarget.dataset.num;
wx.showLoading({
title: '加载中',
})
wx.setStorage({
key: 'song_id',
data: songids
});
wx.setStorage({
key: 'music_name',
data: songName,
});
wx.setStorage({
key: 'num',
data: num,
});
wx.setStorage({
key: 'labelid',
data: '',
});
app.globalData.shouldPlay = true;
// app.globalData.unload = false;
wx.switchTab({
url: '../playSong/playSong',
})
}
})
================================================
FILE: pages/singer/singer.json
================================================
{
"navigationBarTitleText": "HMusic"
}
================================================
FILE: pages/singer/singer.wxml
================================================
<view class="gedan">
<view class="info_box">
<view class="info_box__bd">
<view class="album">
<view class="album__media">
<image wx:if="{{list.singer_mid}}" src="https://y.gtimg.cn/music/photo_new/T001R150x150M000{{list.singer_mid}}.jpg?max_age=2592000" class="album__cover"></image>
</view>
<view class="album__bd">
<view class="album__name">
{{list.singer_name}}
</view>
<view class="fans_number">
粉丝: {{list.fans}}人
</view>
<view class="album__desc">
{{list.SingerDesc}}
</view>
</view>
</view>
<view class="opt_box">
<view class="btn_play_all" data-id="{{disstid}}" bindtap='playAll'>
播放全部
</view>
</view>
</view>
<image wx:if="{{list.singer_mid}}" src="https://y.gtimg.cn/music/photo_new/T001R150x150M000{{list.singer_mid}}.jpg?max_age=2592000" class="info_box__bg"></image>
</view>
<view class="wrap">
<view class="main">
<view class="count_box">
<view class="count_box__desc">
歌单 <view class="count_box__number" style="display:inline-block;">共{{list.total}}首</view>
</view>
</view>
<view class="qui_list">
<block wx:for="{{list.list}}" wx:key="{{list.list}}">
<view style="opacity:{{item.musicData.alertid == 0? '0.5':'1'}};" class="qui_list__item" data-songid="{{item.musicData.songid}}" data-num="{{index}}" data-mid="{{item.musicData.songmid}}" bindtap='musicPlay'>
<view class="qui_list__bd">
<view class="qui_list__box">
<view class="qui_list__tit">
{{item.musicData.songname}}
</view>
<view class="qui_list__desc">
{{list.singer_name}}{{item.musicData.albumdesc}}
</view>
</view>
</view>
</view>
</block>
</view>
<view wx:if="{{havaMusic}}" class="check_more" bindtap='getMoreMusic'>点击加载更多歌曲</view>
<view class="qui_tit">
<view class="qui_tit__text">
歌手简介
</view>
</view>
<view class="intro">
<text decode>
{{list.SingerDesc}}
</text>
</view>
</view>
</view>
</view>
================================================
FILE: pages/singer/singer.wxss
================================================
page {
background: #fff;
color:#777;
}
.info_box {
position: absolute;
top: 0;
left: 0;
z-index: 10;
width: 100%;
height: 480rpx;
overflow: hidden;
color: #fff;
background: #fff;
}
.info_box__bd {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 4;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
background: rgba(0,0,0,.5);
}
.album {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
-webkit-box-sizing: border-box;
width: 100%;
margin-top: 34rpx;
padding: 0 32rpx;
overflow: hidden;
}
.album__media {
position: relative;
width: 250rpx;
margin-right: 20rpx;
overflow: hidden;
}
.album__cover {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 100%;
height: 100%;
object-fit: cover;
}
.album__media::after {
content: "";
display: block;
padding-top: 100%;
}
.album__bd {
position: relative;
-webkit-box-flex: 1;
}
.album__name {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
max-height: 94rpx;
line-height: 1.3;
overflow: hidden;
font-size: 18px;
font-weight: 300;
}
.fans_number {
margin-top:16rpx;
font-size:28rpx;
}
.author {
display: -webkit-box;
-webkit-box-align: center;
margin-top: 16rpx;
overflow: hidden;
}
.author__avatar {
display: block;
width: 48rpx;
height: 48rpx;
margin-right: 16rpx;
border-radius: 48rpx;
}
.author__bd {
-webkit-box-flex: 1;
}
.author__name {
display: block;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 14px;
color: #fff;
}
.album__desc {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
max-height: 72rpx;
overflow: hidden;
margin-top: 16rpx;
font-size: 12px;
}
.opt_box {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 196rpx;
padding: 0 32rpx;
-webkit-transition: 1s ease-in-out;
}
.btn_play_all {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
min-width: 260rpx;
padding: 0 40rpx;
height: 80rpx;
overflow: hidden;
text-align: center;
font-size: 16px;
color: #fff;
border-radius: 40rpx;
background: #31c27c;
}
.btn_play_all::before {
content: "";
display: block;
height: 0;
width: 0;
margin-right: -6rpx;
border-color: transparent transparent transparent #fff;
border-width: 14rpx 22rpx;
border-style: solid;
border-radius: 4rpx;
}
.info_box__bg {
position: absolute;
top: 0;
left: 0;
z-index: 3;
width: 100%;
height: 100%;
object-fit: cover;
-webkit-transform: scale(1.1) translateZ(0);
-webkit-filter: blur(36px);
}
.wrap {
/* position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 2;
padding-bottom: 0; */
overflow: hidden;
}
.main {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 100%;
padding-top: 480rpx;
padding-bottom: 100rpx;
overflow: hidden;
will-change: transform;
-webkit-transform: translateZ(0);
}
.count_box {
position: relative;
display: -webkit-box;
-webkit-box-align: center;
height: 108rpx;
margin: 0 32rpx -20rpx;
}
.count_box__desc {
font-size: 14px;
}
.count_box__number {
margin-left: 10rpx;
}
.qui_list {
overflow: hidden;
}
.qui_list__item {
position: relative;
display: -webkit-box;
}
.qui_list__bd {
position: relative;
-webkit-box-flex: 1;
display: -webkit-box;
-webkit-box-align: center;
padding: 20rpx 32rpx;
overflow: hidden;
}
.qui_list__box {
-webkit-box-flex: 1;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.qui_list__tit {
font-size: 16px;
color: #000;
display: -webkit-box;
-webkit-box-align: center;
overflow: hidden;
max-width: 100%;
white-space: nowrap;
text-overflow: ellipsis;
}
.qui_list__desc{
display: -webkit-box;
-webkit-box-align: center;
overflow: hidden;
font-size:12px;
}
.qui_list__txt {
display: block;
max-width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size:16px;
}
.check_more {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 64rpx;
margin-bottom: 30rpx;
font-size: 28rpx;
}
.qui_tit {
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 110rpx;
padding: 0 80rpx;
overflow: hidden;
text-align: center;
}
.intro {
position: relative;
margin: 0 32rpx 40rpx;
overflow: hidden;
text-align: justify;
word-wrap: break-word;
font-size: 14px;
}
================================================
FILE: pages/top/top.js
================================================
const app = getApp()
Page({
data: {},
onLoad: function (option) {
wx.showLoading({
title: '加载中',
})
let disstid = option.disstid;
this.setData({
disstid: disstid
});
this.getSinger(disstid);
wx.showShareMenu();
},
getSinger(dissitd) {
wx.request({
url: '歌单API',
data: {},
success: (res) => {
var dataList = this.data.list,
data = res.data,
songids = this.data.songids,
songName = this.data.songName,
list = data.songlist;
data.topinfo.info = data.topinfo.info.replace(/ /g, ' ');
data.topinfo.info = data.topinfo.info.replace(/´/g, "'");
data.topinfo.info = data.topinfo.info.replace(/<br>/g, "\n");
for (var i = 0; i < list.length; i++) {
songids.push(parseInt(list[i].data.songid));
songName.push(list[i].data.songname);
}
if (data.day_of_year == '') {
data.date = data.date.split('_')[1];
}
dataList = data;
this.setData({
list: dataList,
songids: songids,
songName: songName
});
// this.MusicFcg();
wx.hideLoading();
},
error: req => {
wx.showToast({
icon: 'none',
title: '哎呀!数据出错了,别急,程序猿正在加急修改中',
});
}
})
},
playAll() {
var songids = this.data.songids,
songName = this.data.songName;
wx.showLoading({
title: '加载中',
})
wx.setStorage({
key: 'song_id',
data: songids
});
wx.setStorage({
key: 'music_name',
data: songName,
});
wx.setStorage({
key: 'num',
data: 0,
});
app.globalData.shouldPlay = true;
// app.globalData.unload = true;
wx.switchTab({
url: '../playSong/playSong',
})
},
musicPlay(e) {
var songids = this.data.songids,
songName = this.data.songName,
num = e.currentTarget.dataset.num;
wx.showLoading({
title: '加载中',
})
wx.setStorage({
key: 'song_id',
data: songids
});
wx.setStorage({
key: 'music_name',
data: songName,
});
wx.setStorage({
key: 'num',
data: num,
});
wx.setStorage({
key: 'labelid',
data: '',
});
app.globalData.shouldPlay = true;
// app.globalData.unload = true;
wx.switchTab({
url: '../playSong/playSong',
})
}
})
================================================
FILE: pages/top/top.json
================================================
{
"navigationBarTitleText": "HMusic"
}
================================================
FILE: pages/top/top.wxml
================================================
<view class="gedan">
<view class="info_box">
<view class="info_box__bd">
<view class="album">
<view class="album__media">
<image wx:if="{{list.songlist[0].data.albummid}}" src="https://y.gtimg.cn/music/photo_new/T002R300x300M000{{list.songlist[0].data.albummid}}.jpg?max_age=2592000" class="album__cover"></image>
</view>
<view class="album__bd">
<view class="album__name">
{{list.topinfo.ListName}}
</view>
<view class="fans_number" wx:if="{{list.day_of_year != ''}}">
第{{list.day_of_year}}天
</view>
<view class="fans_number" wx:else>
第{{list.date}}周
</view>
<view class="album__desc">
{{list.topinfo.info}}
</view>
</view>
</view>
<view class="opt_box">
<view class="btn_play_all" data-id="{{disstid}}" bindtap='playAll'>
播放全部
</view>
</view>
</view>
<image wx:if="{{list.songlist[0].data.albummid}}" src="https://y.gtimg.cn/music/photo_new/T002R300x300M000{{list.songlist[0].data.albummid}}.jpg?max_age=2592000" class="info_box__bg"></image>
</view>
<view class="wrap">
<view class="main">
<view class="count_box">
<view class="count_box__desc">
排行榜 <view class="count_box__number" style="display:inline-block;">共{{list.cur_song_num}}首</view>
</view>
</view>
<view class="qui_list">
<block wx:for="{{list.songlist}}" wx:key="{{list.songlist}}">
<view style="opacity:{{item.data.alertid == 0? '0.5':'1'}};" class="qui_list__item" data-songid="{{item.data.songid}}" data-num="{{index}}" data-mid="{{item.data.songmid}}" bindtap='musicPlay'>
<view class="qui_list__order" style="color:{{index < 3 ? '#FF400B':''}};">{{index + 1}}</view>
<view class="qui_list__bd">
<view class="qui_list__box">
<view class="qui_list__tit">
{{item.data.songname}}
</view>
<view class="qui_list__desc">
<view style="display:inline-block;" wx:for="{{item.data.singer}}" wx:key="{{item.data.singer}}" wx:for-item="singer" wx:for-index="singerNum">
{{singerNum > 0 ? ' / ' : ''}}{{singer.name}}
</view>· {{item.data.albumdesc}}
</view>
</view>
</view>
</view>
</block>
</view>
<!-- <view wx:if="{{havaMusic}}" class="check_more" bindtap='getMoreMusic'>点击加载更多歌曲</view> -->
<view class="qui_tit">
<view class="qui_tit__text">
简介
</view>
</view>
<view class="intro">
<text decode>
{{list.topinfo.info}}
</text>
</view>
</view>
</view>
</view>
================================================
FILE: pages/top/top.wxss
================================================
page {
background: #fff;
color:#777;
}
.info_box {
position: absolute;
top: 0;
left: 0;
z-index: 10;
width: 100%;
height: 480rpx;
overflow: hidden;
color: #fff;
background: #fff;
}
.info_box__bd {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 4;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
background: rgba(0,0,0,.5);
}
.album {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
-webkit-box-sizing: border-box;
width: 100%;
margin-top: 34rpx;
padding: 0 32rpx;
overflow: hidden;
}
.album__media {
position: relative;
width: 250rpx;
margin-right: 20rpx;
overflow: hidden;
}
.album__cover {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 100%;
height: 100%;
object-fit: cover;
}
.album__media::after {
content: "";
display: block;
padding-top: 100%;
}
.album__bd {
position: relative;
-webkit-box-flex: 1;
}
.album__name {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
max-height: 94rpx;
line-height: 1.3;
overflow: hidden;
font-size: 18px;
font-weight: 300;
}
.fans_number {
margin-top:16rpx;
font-size:28rpx;
}
.author {
display: -webkit-box;
-webkit-box-align: center;
margin-top: 16rpx;
overflow: hidden;
}
.author__avatar {
display: block;
width: 48rpx;
height: 48rpx;
margin-right: 16rpx;
border-radius: 48rpx;
}
.author__bd {
-webkit-box-flex: 1;
}
.author__name {
display: block;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 14px;
color: #fff;
}
.album__desc {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
max-height: 72rpx;
overflow: hidden;
margin-top: 16rpx;
font-size: 12px;
}
.opt_box {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 196rpx;
padding: 0 32rpx;
-webkit-transition: 1s ease-in-out;
}
.btn_play_all {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
min-width: 260rpx;
padding: 0 40rpx;
height: 80rpx;
overflow: hidden;
text-align: center;
font-size: 16px;
color: #fff;
border-radius: 40rpx;
background: #31c27c;
}
.btn_play_all::before {
content: "";
display: block;
height: 0;
width: 0;
margin-right: -6rpx;
border-color: transparent transparent transparent #fff;
border-width: 14rpx 22rpx;
border-style: solid;
border-radius: 4rpx;
}
.info_box__bg {
position: absolute;
top: 0;
left: 0;
z-index: 3;
width: 100%;
height: 100%;
object-fit: cover;
-webkit-transform: scale(1.1) translateZ(0);
-webkit-filter: blur(36px);
}
.wrap {
/* position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 2;
padding-bottom: 0; */
overflow: hidden;
}
.main {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 100%;
padding-top: 480rpx;
padding-bottom: 100rpx;
overflow: hidden;
will-change: transform;
-webkit-transform: translateZ(0);
}
.count_box {
position: relative;
display: -webkit-box;
-webkit-box-align: center;
height: 108rpx;
margin: 0 32rpx -20rpx;
}
.count_box__desc {
font-size: 14px;
}
.count_box__number {
margin-left: 10rpx;
}
.qui_list {
overflow: hidden;
}
.qui_list__item {
position: relative;
display: -webkit-box;
}
.qui_list__order {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
-webkit-box-align: center;
width: 90rpx;
margin-right: -32rpx;
font-size: 32rpx;
}
.qui_list__bd {
position: relative;
-webkit-box-flex: 1;
display: -webkit-box;
-webkit-box-align: center;
padding: 20rpx 32rpx;
overflow: hidden;
}
.qui_list__box {
-webkit-box-flex: 1;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.qui_list__tit {
font-size: 16px;
color: #000;
display: -webkit-box;
-webkit-box-align: center;
overflow: hidden;
max-width: 94%;
white-space: nowrap;
text-overflow: ellipsis;
}
.qui_list__desc{
display: -webkit-box;
-webkit-box-align: center;
overflow: hidden;
font-size:12px;
}
.qui_list__txt {
display: block;
max-width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size:16px;
}
.check_more {
display: -webkit-box;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 64rpx;
margin-bottom: 30rpx;
font-size: 28rpx;
}
.qui_tit {
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-box-pack: center;
-webkit-box-align: center;
height: 110rpx;
padding: 0 80rpx;
overflow: hidden;
text-align: center;
}
.intro {
position: relative;
margin: 0 32rpx 40rpx;
overflow: hidden;
text-align: justify;
word-wrap: break-word;
font-size: 14px;
}
================================================
FILE: project.config.json
================================================
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"autoAudits": false
},
"compileType": "miniprogram",
"libVersion": "2.5.1",
"appid": "wxbc620d9c9d303f95",
"projectname": "weChatApp-HMusic",
"debugOptions": {
"hidedInDevtools": []
},
"isGameTourist": false,
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
================================================
FILE: utils/util.js
================================================
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes(
gitextract_rgoq66r_/ ├── README.md ├── app.js ├── app.json ├── app.wxss ├── component/ │ └── playMusic/ │ ├── playMusic.js │ ├── playMusic.json │ ├── playMusic.wxml │ └── playMusic.wxss ├── pages/ │ ├── gedan/ │ │ ├── gedan.js │ │ ├── gedan.json │ │ ├── gedan.wxml │ │ └── gedan.wxss │ ├── index/ │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ ├── logs/ │ │ ├── logs.js │ │ ├── logs.json │ │ ├── logs.wxml │ │ └── logs.wxss │ ├── playSong/ │ │ ├── playSong.js │ │ ├── playSong.json │ │ ├── playSong.wxml │ │ └── playSong.wxss │ ├── rank/ │ │ ├── rank.js │ │ ├── rank.json │ │ ├── rank.wxml │ │ └── rank.wxss │ ├── search/ │ │ ├── search.js │ │ ├── search.json │ │ ├── search.wxml │ │ └── search.wxss │ ├── share/ │ │ ├── share.js │ │ ├── share.json │ │ ├── share.wxml │ │ └── share.wxss │ ├── singer/ │ │ ├── singer.js │ │ ├── singer.json │ │ ├── singer.wxml │ │ └── singer.wxss │ └── top/ │ ├── top.js │ ├── top.json │ ├── top.wxml │ └── top.wxss ├── project.config.json ├── utils/ │ └── util.js └── weui.wxss
SYMBOL INDEX (53 symbols across 10 files)
FILE: app.js
method onShow (line 11) | onShow(options){
method onHide (line 38) | onHide(){
FILE: pages/gedan/gedan.js
method getGeDan (line 15) | getGeDan(disstid,begin) {
method MusicFcg (line 61) | MusicFcg(begin) {
method playAll (line 135) | playAll() {
method musicPlay (line 143) | musicPlay(e){
FILE: pages/index/index.js
method go_search (line 182) | go_search() { //跳到搜索页
method getGedan (line 187) | getGedan(e) { //跳到歌单详情页
FILE: pages/logs/logs.js
constant TITLE_HEIGHT (line 4) | const TITLE_HEIGHT = 30
constant ANCHOR_HEIGHT (line 5) | const ANCHOR_HEIGHT = 18
method normalizeSinger (line 1558) | normalizeSinger(list) {
method scrollY (line 1607) | scrollY(newY) {
method fixedTt (line 1636) | fixedTt(newVal) {
method _calculateHeight (line 1645) | _calculateHeight() {
method scrollToview (line 1674) | scrollToview(e) {
method toSinger (line 1687) | toSinger(e) {
FILE: pages/playSong/playSong.js
method onShow (line 115) | onShow() {
method onUnload (line 293) | onUnload() {
method onHide (line 303) | onHide() {
method audioPlay (line 486) | audioPlay() {
method nextAudio (line 553) | nextAudio(e) {
method popAudio (line 595) | popAudio(e) {
method playVideo (line 635) | playVideo(e) {
method playVideo1 (line 660) | playVideo1(e) {
method pauseVideo (line 684) | pauseVideo(e) {
method getVideoSrc (line 695) | getVideoSrc(vids) {
method getGd (line 725) | getGd(e) {
method goSinger (line 732) | goSinger(e) {
method addSong (line 738) | addSong(e) {
method musicChange (line 781) | musicChange(e) {
method musicCancel (line 807) | musicCancel(e) {
method showPlayList (line 810) | showPlayList(){
method close (line 824) | close(e) {
method del (line 842) | del(e) {
method changeMusic (line 895) | changeMusic(e) {
FILE: pages/rank/rank.js
method goTonext (line 269) | goTonext(e) {
FILE: pages/search/search.js
method getStorage (line 51) | getStorage() {
method inputFocus (line 65) | inputFocus(e) {
method searchKey (line 113) | searchKey(e) {
method searchInput (line 129) | searchInput(e) {
method clearInput (line 142) | clearInput() {
method searchThisKey (line 150) | searchThisKey(e) {
method in_array (line 166) | in_array(v, arr) {
method goToSinger (line 301) | goToSinger(e) {
FILE: pages/share/share.js
method onShow (line 93) | onShow() {
method audioPlay (line 479) | audioPlay() {
method goIndex (line 536) | goIndex(){
FILE: pages/singer/singer.js
method getSinger (line 15) | getSinger(dissitd, begin) {
method playAll (line 68) | playAll() {
method musicPlay (line 92) | musicPlay(e){
FILE: pages/top/top.js
method getSinger (line 15) | getSinger(dissitd) {
method playAll (line 53) | playAll() {
method musicPlay (line 77) | musicPlay(e) {
Condensed preview — 47 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (238K chars).
[
{
"path": "README.md",
"chars": 3869,
"preview": " - 歌曲来源:[QQ音乐][1]\n\n说明\n--\n\n - 目前只有体验版,如果有兴趣的同学可以私聊我,我帮您加入,名额有限。(博客标题下方有本人的qq链接)\n - 因为个人开发者无法发布在线音乐播放小程序,所以开发该小程序目的只为学习小程序"
},
{
"path": "app.js",
"chars": 2578,
"preview": "//app.js\nApp({\n onLaunch: function (options) {\n var that = this;\n wx.getSystemInfo({\n success: function(res)"
},
{
"path": "app.json",
"chars": 852,
"preview": "{\n \"pages\": [\n \"pages/index/index\",\n \"pages/logs/logs\",\n \"pages/rank/rank\",\n \"pages/search/search\",\n \"pa"
},
{
"path": "app.wxss",
"chars": 1094,
"preview": "/**app.wxss**/\n@import 'weui.wxss';\n.container {\n height: 100%;\n display: flex;\n flex-direction: column;\n align-item"
},
{
"path": "component/playMusic/playMusic.js",
"chars": 184,
"preview": "// component/playMusic/playMusic.js\nComponent({\n /**\n * 组件的属性列表\n */\n properties: {\n\n },\n\n /**\n * 组件的初始数据\n */"
},
{
"path": "component/playMusic/playMusic.json",
"chars": 48,
"preview": "{\n \"component\": true,\n \"usingComponents\": {}\n}"
},
{
"path": "component/playMusic/playMusic.wxml",
"chars": 999,
"preview": "<!--component/playMusic/playMusic.wxml-->\n<view class=\"player\">\n <view class=\"normal-player\" wx:if=\"{{fullScreen}}\">\n "
},
{
"path": "component/playMusic/playMusic.wxss",
"chars": 40,
"preview": "/* component/playMusic/playMusic.wxss */"
},
{
"path": "pages/gedan/gedan.js",
"chars": 4033,
"preview": "const app = getApp()\nPage({\n data:{},\n onLoad: function (option) {\n wx.showLoading({\n title: '加载中',\n })\n "
},
{
"path": "pages/gedan/gedan.json",
"chars": 2,
"preview": "{}"
},
{
"path": "pages/gedan/gedan.wxml",
"chars": 2253,
"preview": "<view class=\"gedan\">\n <view class=\"info_box\">\n <view class=\"info_box__bd\">\n <view class=\"album\">\n <view "
},
{
"path": "pages/gedan/gedan.wxss",
"chars": 4590,
"preview": "page {\n background: #fff;\n color:#777;\n}\n.info_box {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 10;\n width"
},
{
"path": "pages/index/index.js",
"chars": 6207,
"preview": "const app = getApp()\nPage({\n data: {\n banner: [], //轮播图\n radioList: [], //电台\n songList: [], //歌单\n loading: "
},
{
"path": "pages/index/index.json",
"chars": 6,
"preview": "{\n \n}"
},
{
"path": "pages/index/index.wxml",
"chars": 2947,
"preview": "<!--index.wxml-->\n<view class=\"container\">\n<!-- <view style=\"width:100%;height:168rpx;\">\n <official-account bindload=\"\""
},
{
"path": "pages/index/index.wxss",
"chars": 1451,
"preview": "/**index.wxss**/\npage {\n width: 100%;\n}\n.page__bd {\n width:100%;\n}\n.main {\n width:100%;\n /* margin-top:48px; */\n}\n.b"
},
{
"path": "pages/logs/logs.js",
"chars": 49661,
"preview": "//logs.js\nconst util = require('../../utils/util.js')\nconst app = getApp()\nconst TITLE_HEIGHT = 30\nconst ANCHOR_HEIGHT ="
},
{
"path": "pages/logs/logs.json",
"chars": 40,
"preview": "{\n \"navigationBarTitleText\": \"HMusic\"\n}"
},
{
"path": "pages/logs/logs.wxml",
"chars": 1180,
"preview": "<!--logs.wxml-->\n<view class=\"container log-list\">\n<scroll-view scroll-y style=\"height:100%;white-space:nowrap;\" scroll-"
},
{
"path": "pages/logs/logs.wxss",
"chars": 1303,
"preview": ".log-list {\n display: flex;\n flex-direction: column;\n /* padding-bottom:60rpx; */\n}\n.log-item {\n margin: 10rpx;\n}\n.t"
},
{
"path": "pages/playSong/playSong.js",
"chars": 24464,
"preview": "const app = getApp();\nPage({\n data: {},\n onLoad: function(options) {\n wx.hideLoading();\n wx.showShareMenu({\n "
},
{
"path": "pages/playSong/playSong.json",
"chars": 40,
"preview": "{\n \"navigationBarTitleText\": \"HMusic\"\n}"
},
{
"path": "pages/playSong/playSong.wxml",
"chars": 9283,
"preview": "<view wx:if=\"{{haveMusicStorage}}\" class=\"playSong\" style=\"height:{{showList ? '100vh':''}};overflow:hidden;\">\n <view c"
},
{
"path": "pages/playSong/playSong.wxss",
"chars": 9679,
"preview": "page {\n background: #fff;\n}\n.main {\n position: relative;\n padding-bottom: 30rpx;\n overflow: hidden;\n}\n.main_bd {\n p"
},
{
"path": "pages/rank/rank.js",
"chars": 8260,
"preview": "//rank.js\nconst app = getApp()\nconst util = require('../../utils/util.js')\n\nPage({\n data: {\n rank: []\n },\n onLoad:"
},
{
"path": "pages/rank/rank.json",
"chars": 40,
"preview": "{\n \"navigationBarTitleText\": \"HMusic\"\n}"
},
{
"path": "pages/rank/rank.wxml",
"chars": 604,
"preview": "<view class=\"rank\">\n <block wx:for=\"{{rank}}\" wx:for-item=\"list\" wx:key=\"list\">\n <view class=\"list\" data-id=\"{{list."
},
{
"path": "pages/rank/rank.wxss",
"chars": 1073,
"preview": ".rank {\n padding-bottom: 40rpx;\n}\n.list {\n position: relative;\n display: flex;\n margin: 0 40rpx;\n padding-top: 40rp"
},
{
"path": "pages/search/search.js",
"chars": 6994,
"preview": "const app = getApp();\nPage({\n data: {},\n onLoad: function() {\n wx.hideLoading();\n wx.showShareMenu();\n this.g"
},
{
"path": "pages/search/search.json",
"chars": 40,
"preview": "{\n \"navigationBarTitleText\": \"HMusic\"\n}"
},
{
"path": "pages/search/search.wxml",
"chars": 3601,
"preview": "<view class=\"searchPage\">\n <!-- 输入框 -->\n <!-- <view class=\"search-box-wrapper\">\n <view class=\"search-box\">\n <i"
},
{
"path": "pages/search/search.wxss",
"chars": 3545,
"preview": "page {\n background-color: #fff;\n}\n\n\n.page__bd {\n position: fixed;\n top:0;\n width:100%;\n background: #f4f4f4;\n /* p"
},
{
"path": "pages/share/share.js",
"chars": 16238,
"preview": "const app = getApp();\nPage({\n data: {},\n onLoad: function(options) {\n wx.hideLoading();\n app.globalData.backgrou"
},
{
"path": "pages/share/share.json",
"chars": 40,
"preview": "{\n \"navigationBarTitleText\": \"HMusic\"\n}"
},
{
"path": "pages/share/share.wxml",
"chars": 2890,
"preview": "<view wx:if=\"{{haveMusicStorage}}\" class=\"playSong\" style=\"height:100%;\">\n <view class=\"main\" style=\"height:100%;\">\n "
},
{
"path": "pages/share/share.wxss",
"chars": 3086,
"preview": "page {\n background: #fff;\n}\n.main {\n position: relative;\n /* padding-bottom: 30rpx; */\n overflow: hidden;\n}\n.main_bd"
},
{
"path": "pages/singer/singer.js",
"chars": 2840,
"preview": "const app = getApp()\nPage({\n data: {},\n onLoad: function (option) {\n wx.showLoading({\n title: '加载中',\n })\n "
},
{
"path": "pages/singer/singer.json",
"chars": 40,
"preview": "{\n \"navigationBarTitleText\": \"HMusic\"\n}"
},
{
"path": "pages/singer/singer.wxml",
"chars": 2333,
"preview": "<view class=\"gedan\">\n <view class=\"info_box\">\n <view class=\"info_box__bd\">\n <view class=\"album\">\n <view "
},
{
"path": "pages/singer/singer.wxss",
"chars": 4646,
"preview": "page {\n background: #fff;\n color:#777;\n}\n.info_box {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 10;\n width"
},
{
"path": "pages/top/top.js",
"chars": 2493,
"preview": "const app = getApp()\nPage({\n data: {},\n onLoad: function (option) {\n wx.showLoading({\n title: '加载中',\n })\n "
},
{
"path": "pages/top/top.json",
"chars": 40,
"preview": "{\n \"navigationBarTitleText\": \"HMusic\"\n}"
},
{
"path": "pages/top/top.wxml",
"chars": 2835,
"preview": "<view class=\"gedan\">\n <view class=\"info_box\">\n <view class=\"info_box__bd\">\n <view class=\"album\">\n <view "
},
{
"path": "pages/top/top.wxss",
"chars": 4839,
"preview": "page {\n background: #fff;\n color:#777;\n}\n.info_box {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 10;\n width"
},
{
"path": "project.config.json",
"chars": 629,
"preview": "{\n\t\"description\": \"项目配置文件\",\n\t\"packOptions\": {\n\t\t\"ignore\": []\n\t},\n\t\"setting\": {\n\t\t\"urlCheck\": true,\n\t\t\"es6\": true,\n\t\t\"pos"
},
{
"path": "utils/util.js",
"chars": 472,
"preview": "const formatTime = date => {\n const year = date.getFullYear()\n const month = date.getMonth() + 1\n const day = date.ge"
},
{
"path": "weui.wxss",
"chars": 18872,
"preview": "/*!\n * WeUI v1.1.1 (https://github.com/weui/weui-wxss)\n * Copyright 2017 Tencent, Inc.\n * Licensed under the MIT license"
}
]
About this extraction
This page contains the full source code of the HEternally/weChatApp-HMusic GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 47 files (208.3 KB), approximately 65.4k tokens, and a symbol index with 53 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.