// pages/index/sw/index.js
const imgurl = require("../../utils/imgurl");
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    list: {
      value: [],
      type: Array
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    swiperCurrent: 0,
    bannerUrl: imgurl.banner.url
  },

  /**
   * 组件的方法列表
   */
  ready() {},
  methods: {
    swiperChange: function(e) {
      this.setData({
        swiperCurrent: e.detail.current
      });
    },
    gotobannerdetail: function(e) {
      console.log(e)
      if(e.currentTarget.dataset.data.type==2){
        wx.navigateTo({
          url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}`
        });
      }else{
        wx.navigateTo({
          url: `/pages/bannerdetail/index?id=${e.currentTarget.dataset.id}`
        });
      }
    }
  }
});
