// component/tabSort/tabSort.js
var app = getApp()
const wxService = require('../../utils/wxService')
const utils = require('../../utils/util')
const envInfo = require('../../config/index').envInfo
var order = ['red', 'yellow', 'blue', 'green', 'red']

Component({
	/**
	 * 组件的属性列表
	 */
	properties: {

	},
	attached() {

	},
	/**
	 * 组件的初始数据
	 */
	data: {
		currentTab: 0,
		navData: [{
			label: '分类1'
		},
		{
			label: '分类2'
		},
		{
			label: '分类3'
		},
		{
			label: '分类4'
		},
		{
			label: '分类5'
		},
		{
			label: '分类6'
		},
		{
			label: '分类7'
		},
		{
			label: '分类8'
		},
		{
			label: '分类9'
		}
]
	},
	/**
	 * 组件的方法列表
	 */
	methods: {
		// 设置tab active
		switchNav(event) {
			const ev = event.currentTarget.dataset;
			let cur = ev.current
			if (this.data.currentTab == cur) {
				return false
			} else {
				this.setData({
					currentTab: cur,
				})
			}
		},
		switchTab(event) {
			var cur = event.detail.current
			this.setData({
				currentTab: cur			
			})
		}
	}
})
