//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    dataList:[],//轮播
    fieryArr:[],//必点热品
  },
  //事件处理函数
  onLoad: function () {
    if (app.globalData.openId){
      this.getDataList();
      this.fieryList();
    }else{
      app.globalData.openidSuccessFuc = this.getDataList;
      app.globalData.openidSuccessFuc = this.fieryList;
    }
    
  }, 
  fieryList:function(){
    app.wxRequest(app.globalData.httpUrl + 'front/banner/listing', {list_type:1}, e => {
      console.log(e)
      if (e.code == 200) {
        this.setData({
          fieryArr:e.data
        })
      }
    }, this)
  },
  getDataList:function(){
    app.wxRequest(app.globalData.httpUrl + 'front/slider/listing', {list_type:1}, e => {
      console.log(e)
      if (e.code == 200) {
        this.setData({
          dataList:e.data
        })
      }
    }, this)
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    return {
      title: "老门框爆肚会员",
      success: res => {
        console.log(res, "转发成功")
      },
    }
  },
})
