博主信息
博文 4
粉丝 0
评论 1
访问量 6406
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
仿QQ音乐的微信小程序
董辉哦呵呵
原创
1870人浏览过
  • //获取推荐频道数据
    function getRecommend(callback) {
    wx.request({
    url: 'https://c.y.qq.com/musichall/fcgi-bin/fcg_yqqhomepagerecommend.fcg',
    data: {
    g_tk: 5381,
    uin: 0,
    format: 'json',
    inCharset: 'utf-8',
    outCharset: 'utf-8',
    notice: 0,
    platform: 'h5',
    needNewCode: 1,
    _: Date.now()
    },
    method: 'GET',
    header: { 'content-Type': 'application/json' },
    success: function (res) {
    if (res.statusCode == 200) {
    callback(res.data);
    }
    }
    })
    }
    
    //获取热门搜索
    function getHotSearch(callback) {
    wx.request({
    url: 'https://c.y.qq.com/splcloud/fcgi-bin/gethotkey.fcg',
    data: {
    g_tk: 5381,
    uin: 0,
    format: 'json',
    inCharset: 'utf-8',
    outCharset: 'utf-8',
    notice: 0,
    platform: 'h5',
    needNewCode: 1,
    _: Date.now()
    },
    method: 'GET',
    header: { 'content-Type': 'application/json' },
    success: function (res) {
    if (res.statusCode == 200) {
    let data = res.data;
    data.data.hotkey = data.data.hotkey.slice(0, 8)
    callback(data);
    }
    }
    })
    }
    
    //获取搜索结果
    function getSearchMusic(keyword, page, callback) {
    wx.request({
    url: 'https://c.y.qq.com/soso/fcgi-bin/search_for_qq_cp',
    data: {
    g_tk: 5381,
    uin: 0,
    format: 'json',
    inCharset: 'utf-8',
    outCharset: 'utf-8',
    notice: 0,
    platform: 'h5',
    needNewCode: 1,
    w: keyword,
    zhidaqu: 1,
    catZhida: 1,
    t: 0,
    flag: 1,
    ie: 'utf-8',
    sem: 1,
    aggr: 0,
    perpage: 20,
    n: 20,
    p: page,
    remoteplace: 'txt.mqq.all',
    _: Date.now()
    },
    method: 'GET',
    header: { 'content-Type': 'application/json' },
    success: function (res) {
    if (res.statusCode == 200) {
    callback(res.data);
    }
    }
    })
    }
    
    /*
    ** 排行榜相关api
    */
    
    //获取排行榜频道数据
    function getToplist(callback) {
    wx.request({
    url: 'https://c.y.qq.com/v8/fcg-bin/fcg_myqq_toplist.fcg',
    data: {
    format: 'json',
    g_tk: 5381,
    uin: 0,
    inCharset: 'utf-8',
    outCharset: 'utf-8',
    notice: 0,
    platform: 'h5',
    needNewCode: 1,
    _: Date.now()
    },
    method: 'GET',
    header: { 'content-Type': 'application/json' },
    success: function (res) {
    if (res.statusCode == 200) {
    let data = res.data;
    let toplist = data.data.topList;
    for (let i = 0; i < toplist.length; i++) {
    toplist[i].listenCount = formatWan(toplist[i].listenCount);
    }
    callback(data);
    }
    }
    })
    }
    
    //获取排行榜详细信息
    function getToplistInfo(id, callback) {
    wx.request({
    url: 'https://c.y.qq.com/v8/fcg-bin/fcg_v8_toplist_cp.fcg',
    data: {
    g_tk: 5381,
    uin: 0,
    format: 'json',
    inCharset: 'utf-8',
    outCharset: 'utf-8',
    notice: 0,
    platform: 'h5',
    needNewCode: 1,
    tpl: 3,
    page: 'detail',
    type: 'top',
    topid: id,
    _: Date.now()
    },
    method: 'GET',
    header: { 'Content-Type': 'application/json' },
    success: function (res) {
    if (res.statusCode == 200) {
    callback(res.data);
    }
    }
    })
    }
  • QQ图片20180206115938.png

  • QQ图片20180206115944.png

  • QQ图片20180206115951.png

本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
2条评论
婥大爺* 2020-12-23 15:33:23
楼主还有源码嘛?1832727142@qq.com
2楼
Emma 2018-02-06 12:41:02
有需要源码的可以email我,我会发源码到你们的邮箱。 18838020329@163.com
1楼
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学