文档:www.tjit.net
开放的接口:api88.net
个人代码:
input2(event){ //将字符转化为encodeURL编码,才能进行正确请求,这是这个接口要求的 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}); } }) },