123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- const app = getApp();
- var utils = require('../../../utils/utils.js')
- var resut;
- Page({
-
- data: {
- showCover:false,
- currentTab:0,
- navTitle:[
- {title:'经典必听'},
- {title:'优质专辑'},
- {title:'有声小说'},
- {title:'儿童教育'},
- {title:'人文历史'},
- {title:'最潮外语'},
- {title:'商业财经'},
- {title:'热门新闻'}
- ]
- },
-
- onLoad: function (options) {
- var that = this;
- var url = 'http://mobile.ximalaya.com/mobile/discovery/v3/recommend/hotAndGuess?code=43_310000_3100&device=android&version=5.4.45'
- utils.myRequest({
- url:url,
- methods:'GET',
- success:function(res){
- console.log(res);
- resut = res;
- that.setData({
- list: res.data.hotRecommends.list[0].list
- })
- },
- fail:function(){
- }
- })
- },
- handleClick(e) {
- let currentTab = e.currentTarget.dataset.index;
-
- this.setData({
- currentTab,
- list: resut.data.hotRecommends.list[currentTab].list
- })
- },
- pullDown:function(){
- var that = this;
- that.setData({
- showCover:true
- })
- },
- closeCover:function(){
- var that = this;
- that.setData({
- showCover:false
- })
- },
- CoverCheck:function(e){
- let currentTab = e.currentTarget.dataset.index;
-
- this.setData({
- currentTab,
- list: resut.data.hotRecommends.list[currentTab].list
- })
- this.closeCover()
- }
- })
|