Blogger Information
Blog 4
fans 0
comment 1
visits 5063
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
仿QQ音乐的微信小程序
董辉哦呵呵
Original
1631 people have browsed it
  • //获取推荐频道数据
    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

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
2 comments
婥大爺* 2020-12-23 15:33:23
楼主还有源码嘛?1832727142@qq.com
2 floor
Emma 2018-02-06 12:41:02
有需要源码的可以email我,我会发源码到你们的邮箱。 18838020329@163.com
1 floor
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!