import Card from '../../../../palette/card';

// src/pages/xml2can/xml2can.js
Page({
  imagePath: '',

  /**
   * 页面的初始数据
   */
  // data: {
  //   template: {},
  // },

  data: {
    //轮播图
    swiperCurrent: 1,
    currentTab: 0,
    navData: [{
      label: '1'
    },
      {
        label: '2'
      },
      {
        label: '3'
      },
      {
        label: '4'
      },
      {
        label: '5'
      },
      {
        label: '6'
      },
      {
        label: '7'
      },
      {
        label: '8'
      },
      {
        label: '9'
      }],
    arr: [{
      images: 'https://images.unsplash.com/photo-1551334787-21e6bd3ab135?w=640'
    },
    {
      images: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2854956166,1658664264&fm=26&gp=0.jpg'
    },
    {
      images: 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2857172539,3231616089&fm=26&gp=0.jpg'
    },
    {
      images: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=222247294,2919493301&fm=26&gp=0.jpg'
    }
    ],
    indicatorDots: false,
    autoplay: false,
    interval: 2000,
    duration: 1000,
    circular: true,
    beforeColor: "white",//指示点颜色 
    afterColor: "coral",//当前选中的指示点颜色 
    previousmargin: '142rpx',//前边距
    nextmargin: '142rpx',//后边距
  },

  //轮播图的切换事件 
  swiperChange: function (e) {
    console.log(e.detail.current);
    this.setData({
      swiperCurrent: e.detail.current  //获取当前轮播图片的下标
    })
  },
  //滑动图片切换 
  chuangEvent: function (e) {
    this.setData({
      swiperCurrent: e.currentTarget.id
    })
  },
  // onImgOK(e) {
  //   this.imagePath = e.detail.path;
  //   console.log(e);
  // },

  // saveImage() {
  //   wx.saveImageToPhotosAlbum({
  //     filePath: this.imagePath,
  //   });
  // },

  // /**
  //  * 生命周期函数--监听页面初次渲染完成
  //  */
  // onReady: function () {
  //   this.setData({
  //     template: new Card().palette(),
  //   });
  // },
});