// component/bottom/bottom.js
const wx2my = require('../../wx2my');
const Behavior = require('../../Behavior');
var app = getApp();
const wxService = require('../../utils/wxService');
const utils = require('../../utils/util');
const utilLink = require('../../utils/currentLinkRouter')
const envInfo = require('../../config/index').envInfo;

Component({
  /**
   * 组件的属性列表
   */
  data: {
    bottom: {
      type: Object,
      value: {}
    }
  },
  didMount() {
    this.setData({
      baseImgUrl: app.globalData.imageUrl
    });
  },

  /**
   * 组件的初始数据
   */
  data: {
    startX: 0,
    startY: 0,
    isAuthorization: false,
    baseUrl: '#02bb70',
    baseImgUrl: ''
  },
  /**
    * 组件的方法列表
    */
  methods: {
    touchStart(e) {
      this.setData({
        startX: e.changedTouches[0].clientX,
        startY: e.changedTouches[0].clientY
      });
    },

    touchEnd(e) {
      let x = e.changedTouches[0].clientX;
      let y = e.changedTouches[0].clientY; // endX, endY, startX, startY

      const {
        startX,
        startY
      } = this.data;
      let isTouchLeft = utils.getTouchData(x, y, startX, startY); // 触发左划事件

      if (isTouchLeft == 'left') {
        utilLink.currentLinkRouter(e, this)
      }
    }

  }

});