<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
import mobile from '../static/js/isMobile'
import weChat from '../static/js/wechatDropdown'

export default {
  name: 'App',
  methods: {
    /**
     * @description:判断登陆设备是否为移动端，更改对应信息
     * @return {void}
     */
    isMobile: function () {
      var isMobile = mobile.isMobile()
      console.log('isMobile:' + isMobile)
      switch (isMobile) {
        case true:
          this.$store.commit('setMobile')
          break
        case false:
          break
      }
    },

    /**
     * @description：禁止微信内置H5的下拉事件
     */
    weChatDropdown: function () {
      weChat.fun()
      // document.body.addEventListener('touchmove', function (e) {
      //   e.preventDefault() // 阻止默认的处理方式(阻止下拉滑动的效果)
      // }, {passive: false}) // passive 参数不能省略，用来兼容ios和android
    }
  },
  created: function () {
    this.isMobile()
  },
  mounted: function () {
    this.weChatDropdown()
  }
}
</script>

<style>
#app {
  /* font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale; */
  width: 100%;
  height:100%;
}
</style>
