<template>
	<view class="column" style="height: 100%;position: relative;">
		<enterpriseimgs v-if="actindex==0"></enterpriseimgs>
		<newuser v-else></newuser>
		<view class="tabbar align-center">
			<view v-for="(item, index) in tabbarList" :key="index" @click="switchTabs(item)" class="tablist">
				<view class="column align-center justify-center" >
					<image :src="actindex==index?item.selectedIconPath:item.iconPath" class="w48 h48"></image>
					<text class="fs24 base-textcol" :class="actindex==index?'actcolor':'morecolor'">{{item.Text}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import{getenterprise} from '@/api/courseManage.js'
	import enterpriseimgs from '@/components/enterpriseimg.vue'
	import newuser from '@/components/newuser.vue'
	export default {
		components: {
			enterpriseimgs,
			newuser
		},
		data() {
			return {
				statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
				enterpriseimg:'',
				actindex:0,
				tabbarList : [{
						iconPath: '/static/manageTabIcon/training.png',
						selectedIconPath: '/static/manageTabIcon/training_on.png',
						Text: '企业理念',
						val:0
					},
					{
						iconPath:  '/static/manageTabIcon/manage.png',
						selectedIconPath:  '/static/manageTabIcon/manage_on.png',
						Text: '我的',
						val:1
					},
				]
			}
		},
		//发送给朋友
		onShareAppMessage(res) {
			return {
				title: this.$store.state.logoname,
				path: '/pages/enterprise/enterprise',
				imageUrl: this.$store.state.imgpath+'/app/image/logo.png' //分享图标，路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
			}
			
		},
		//分享到朋友圈
		onShareTimeline(res) {
			return {
				title: this.$store.state.logoname,
				imageUrl: this.$store.state.imgpath+'/app/image/logo.png' //分享图标，路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
			}
			
		},
		methods: {
			switchTabs(item) {
				this.actindex=item.val
				console.log(item)
			},
		}
	}
</script>

<style lang="scss" scoped>
.top-content {
	width: 100%;
	z-index: 10;
	position: fixed;
	top: 0;
	left: 0;
	background-color: #FFFFFF;
	.top-title {
		height: 88rpx;
		line-height: 88rpx;
		font-size: 42rpx;
		font-family: Source Han Sans CN;
		font-weight: bold;
		color: #222222;
		padding-left: 41rpx;
		background-color: #FFFFFF;
	}
}
.tabbar {
		display: flex;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		background-color: #fff;
		z-index: 1000;
		height: 120rpx;
		padding-bottom: 20rpx;
	}

	.tablist {
		width: 50%;
	}
	.morecolor{
		color: #626468;
	}
	.actcolor {
		color: #1773ff;
	}
</style>
