123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- const app = getApp();
- var resut;
- Page({
-
- data: {
- currentTab:0,
- navTitle:[
- {title:'经典必听'},
- {title:'优质专辑'},
- {title:'有声小说'},
- {title:'儿童教育'},
- {title:'人文历史'},
- {title:'最潮外语'},
- {title:'商业财经'},
- {title:'热门新闻'}
- ]
- },
-
- onLoad: function (options) {
- var that = this;
- wx.request({
- url: 'http://mobile.ximalaya.com/mobile/discovery/v3/recommend/hotAndGuess?code=43_310000_3100&device=android&version=5.4.45',
-
- header: {'content-type':'application/json'},
- method: 'GET',
- dataType: 'json',
- responseType: 'text',
- success: (res)=>{
- resut = res;
- console.log(res);
- that.setData({
- list: res.data.hotRecommends.list[0].list
- })
- },
- fail: ()=>{},
- complete: ()=>{}
- });
- },
- handleClick(e) {
- let currentTab = e.currentTarget.dataset.index;
-
- this.setData({
- currentTab,
- list: resut.data.hotRecommends.list[currentTab].list
- })
- },
- pullDown:function(){
-
- }
- })
|