<script>
export default {
  onLaunch: function () {
    // console.log('App Launch')
    //判断客户端类别
    if (/MicroMessenger/.test(window.navigator.userAgent)) {
      uni.setStorage({
        key: 'userAgent',
        data: 'wxAgent'
      });
      console.log('微信客户端');
    } else if (/AlipayClient/.test(window.navigator.userAgent)) {
      uni.setStorage({
        key: 'userAgent',
        data: 'aliAgent'
      });
      console.log('支付宝客户端');
    } else {
      uni.setStorage({
        key: 'userAgent',
        data: 'otherAgent'
      });
      console.log('其他浏览器');
    }
    // 获取参数免费时长
    this.$u.api
      .getParamsApi({
        key: 'park.lock.freetime'
      })
      .then((res) => {
        if (res.code === 200) {
          this.$u.vuex('free_time', res.msg);
        }
      });
  },
  onShow: function () {
    // console.log('App Show')
  },
  onHide: function () {
    // console.log('App Hide')
  }
};
</script>

<style lang="scss">
@import './static/css/iconfont.css';
@import 'uview-ui/index.scss';
/*每个页面公共css */
</style>
