<template>
	<view :style="contentStyle[0]">
		<view class="d-flex a-center">
			<u-image width="41rpx" height="40rpx" :fade="false" :src="contentStyle[2]"></u-image>
			<view class="word-color u-margin-left-10">{{ contentStyle[1] }}</view>
		</view>
		<view class="word-color u-margin-top-4">{{ tabData.num }}</view>
	</view>
</template>

<script>
	export default {
		props: {
			// 传递数据
			tabData: {
				type: Object,
				default: () => {
					return {}
				}
			},
			// 当前索引值
			itemIndex: {
				type: Number,
				defalut: 0
			}
		},
		computed: {
			contentStyle() {
				let info = []
				if (parseInt(this.tabData.status) === 1) {
					info.push(...[{'padding': '17rpx 8rpx 8rpx 8rpx'},'所有项目'])
					if (this.itemIndex + 1 === parseInt(this.tabData.status)) {
						info.push('../../static/images/project_other.png')
						return info
					}
					info.push('../../static/images/project.png')
					return info
				} else if (parseInt(this.tabData.status) === 2){ 
					info.push(...[{'padding': '13rpx 21rpx 8rpx 21rpx'},'已完成'])
					if (this.itemIndex + 1 === parseInt(this.tabData.status)) {
						info.push('../../static/images/finish_other.png')
						return info
					}
					info.push('../../static/images/finish.png')
					return info
				} else if (parseInt(this.tabData.status) === 3) {
					info.push(...[{'padding': '13rpx 21rpx 8rpx 21rpx'},'进行中'])
					if (this.itemIndex + 1 === parseInt(this.tabData.status)) {
						info.push('../../static/images/ongoing_other.png')
						return info
					}
					info.push('../../static/images/ongoing.png')
					return info
				} else {
					info.push(...[{'padding': '13rpx 21rpx 8rpx 21rpx'},'未完成'])
					if (this.itemIndex + 1 === parseInt(this.tabData.status)) {
						info.push('../../static/images/end_other.png')
						return info
					}
					info.push('../../static/images/end.png')
					return info
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.word-color {
		font-size: 25rpx;
		font-family: SimSun;
		font-weight: 400;
		color: #FFFFFF;
	}
</style>
