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

Page({
  data: {
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar,
    CustomRate: app.globalData.CustomRate,
    info:{},
    swiperList:[],
    hot_list:[],
  },
  goCamara: function (el) {
    wx.navigateTo({
      url: '../flower/identify',
    })
  },
  onLoad: function ( ) {
    app.checkLogin( ()=>{
      this.loadData()
    } )
  },
  loadData :function( cb ){
    let that = this
    util.http("/base/getActiveAd", {}, function (err, res) {
      if( err == 0){
        that.setData({ swiperList:res})
      }
      cb && cb()
    });
  },
  onShow: function(){
    this.data.info.id || this.loadData( );
  }
  
})
