|
发表于 2018-2-19 23:46:41
|
显示全部楼层
本帖最后由 lidan00 于 2018-2-19 23:48 编辑
- var tracks = [];
- var result = {
- 'embed_link': '',
- //...
- 'thumbnail': '...',
- 'tracks': tracks
- };
- function MusciJsonCallback(data) {
- var ugclist = data.data.ugclist;
- for (var i = 0; i < ugclist.length; ++i) {
- tracks.push(
- {
- 'artist': '...',
- //...
- 'audioUrl': ugclist[i].audioUrl,
- 'title': ugclist[i].title,
- //...
- }
- );
- }
- console.log(result);
- }
- MusciJsonCallback({ data: { ugclist: [{ audioUrl: 'audioUrl1', title: 'title1' }, { audioUrl: 'audioUrl2', title: 'title2' }] } })
复制代码
不知道你是不是这个意思 |
|