// component/bottomTabs/bottomTabs.js
var app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo

Component({
	/**
	 * 组件的属性列表
	 */
	properties: {
	
  },
  attached () {
	
	},
	ready() {
		this.setData({
			currentRoute: `/${utils.getCurrentPageUrl()}`
		})
	},
	observers: {
    currentRoute(nRoute, oRoute) {
			console.log('nRoute, oRoute', nRoute, oRoute)
      const {currentRoute} = this.data
      if(nRoute != oRoute){
        
      }
    }
  },
	/**
	 * 组件的初始数据
	 */
	data: {
		currentRoute: '',
		tabs: [
      {
        active: '/assets/imgs/heart-primary.png',
        inactive: '/assets/imgs/heart-default.png',
        route: '/pages/userCenter/userCenter'
      },
      {
        active: '/assets/imgs/heart-primary.png',
        inactive: '/assets/imgs/heart-default.png',
        route: '/pages/category/category'
      },
      {
        active: '/assets/imgs/heart-primary.png',
        inactive: '/assets/imgs/heart-default.png',
        route: '/pages/my/my'
      },
      {
        active: '/assets/imgs/heart-primary.png',
        inactive: '/assets/imgs/heart-default.png',
        route: '/pages/productDetail/productDetail'
      },
      {
        active: '/assets/imgs/heart-primary.png',
        inactive: '/assets/imgs/heart-default.png',
        route: '/pages/refund/refund'
      }
    ],
    type: 1
	},
	/**
	 * 组件的方法列表
	 */
	methods: {
    handelToPage(e){
      const {route} =  e.currentTarget.dataset
      wxService.router(route)
    }
  }
})
