文檔:www.tjit.net
開放的接口:api88.net
個人代碼:
input2(event){ //將字符轉化為encodeURL編碼,才能進行正確請求,這是這個接口要求的
//js自帶的轉化方法
var a = encodeURI(event.detail.value); this.setData({ songurl:a}); }, submit2(){ var vm = this; wx.request({ url: 'https://api88.net/api/qqmusic/?key=523077333&id='+this.data.songurl+'&type=so&cache=0&page=1&nu=10', success(res) { console.log(res); console.log(res.data.Body); // method(res); vm.setData({songlist: res.data.Body}); } }) },