//index.js
//获取应用实例
const app = getApp()
Page({
  data: {
    // img: '',
    id: ''
  },
  onLoad: function (options) {
    console.log(options)
    this.setData({
      id: options.scene
    })
    this.getTouxiang()
  },
  onShow() {
    this.getTouxiang()
    
  },
  
  //个人中心
  // getMy() {
  //   let token = wx.getStorageSync('token')
  //   if (token == '') {
  //     wx.navigateTo({
  //       url: "/pages/logs/logs",
  //     })
  //   } else {
  //     wx.navigateTo({
  //       url: '/pages/my/my'
  //     })
  //   }

  // },
  //购买页面
  getGoum() {
    let token = wx.getStorageSync('token')
    if (token == '') {
      wx.navigateTo({
        url: "/pages/logs/logs",
      })
    }else{
      wx.navigateTo({
        url: '/pages/buyshangpin/buyshangpin',
      })
    }
   

  },
  //常见问题
  getChangj() {
    wx.navigateTo({
      url: '/pages/problem/problem'
    })
  },
  //使用说明
  getShiy() {
    wx.navigateTo({
      url: '/pages/legend/legend'
    })
  },
  // 分销绑定接口
  getTouxiang() {
    let t = this;
    let u = "index2/fenBang"
    let p = {
      id: t.data.id
    }
    app.post(u, p).then(r => {
      console.log(r)
      if(r.code==1){
        console.log('成功')
      }else{
        console.log('失败')
      }

    })
  },

})