// pages/ticketCenter/ticketCenter.js const app = getApp() Page({ /** * 页面的初始数据 */ data: { chooseWhich:1, dataList:[],//需要展示的数据 newData:[], pageNum:1,//页码, count:10,//每页条数 total:0,//总条数 total_page:0,//总页数 scrollHig:0, type:"", hotType:2, }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { if (app.globalData.openId){ this.getDataList(); }else{ app.globalData.openidSuccessFuc = this.getDataList; } console.log(wx.getSystemInfoSync().windowHeight) this.setData({ scrollHig: wx.getSystemInfoSync().windowHeight-44-12, }); }, getDataList:function(type,hotType){ if(type || hotType){ this.data.type = type this.data.hotType = hotType }else{ this.data.type = "" this.data.hotType = 2 } let params = { list_type:2, cur_page:this.data.pageNum, show_num:this.data.count, item_type:this.data.type, item_state:1, hot_state:this.data.hotType } app.wxRequest(app.globalData.httpUrl + 'front/sell/listing', params, e => { console.log(e) if (e.code == 200) { for(var i=0;i