index.js 890 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //index.js
  2. //获取应用实例
  3. const app = getApp()
  4. const util = require("../../util/util.js")
  5. Page({
  6. data: {
  7. StatusBar: app.globalData.StatusBar,
  8. CustomBar: app.globalData.CustomBar,
  9. CustomRate: app.globalData.CustomRate,
  10. info:{},
  11. swiperList:[],
  12. hot_list:[],
  13. },
  14. goCamara: function (el) {
  15. wx.navigateTo({
  16. url: '../flower/identify',
  17. })
  18. },
  19. onLoad: function ( ) {
  20. app.checkLogin( ()=>{
  21. this.loadData()
  22. } )
  23. },
  24. loadData :function( cb ){
  25. let that = this
  26. util.http("/base/getActiveAd", {}, function (err, res) {
  27. if( err == 0){
  28. that.setData({ swiperList:res})
  29. }
  30. cb && cb()
  31. });
  32. },
  33. onShow: function(){
  34. this.data.info.id || this.loadData( );
  35. },
  36. gotoIdentify:()=>{
  37. wx.navigateTo({
  38. url: '/pages/tool/identify/index',
  39. })
  40. },
  41. onShareAppMessage: function () {
  42. }
  43. })