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

Page({
  data: {
    imgUrls: ['http://winesbook.cn/static/images_mini/aicon_94x.png',
      'http://winesbook.cn/static/images_mini/aicon_95x.png',
      'http://winesbook.cn/static/images_mini/aicon_96x.png',
      'http://winesbook.cn/static/images_mini/aicon_98x.png',
       '/img/begin.png',
    ],
    indicatorDots: false,
    autoplay: false,
    interval: 2000,
    duration: 1000,
    currentSwiper: 0,
  },
  //事件处理函数
  bindViewTap: function() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad: function () {
    
  },
  start(e) {
    let that = this;
    console.log(e)
    wx.login({
      success: (res) => {


        console.log(res)
        // let url = '/api/wxapp/public/login';
        // let params = {

        //   openid: that.data.openid,
        //   session_key: that.data.session_key,
        //   encrypted_data: e.detail.encryptedData,
        //   iv: e.detail.iv

        // }
        // app.post(url, params).then((res) => {
        //   console.log(res)
        //   wx.setStorageSync('token', res.token)
        //   that.islahei()





        // }).catch((errMsg) => {

        // })

      }
    });
  },
  swiperChange: function (e) {
    this.setData({
      currentSwiper: e.detail.current
    })
  },
 
})