<template>
	<view class="task-tab">
		<scroll-view class="scroll-Y row" scroll-x="true">
			<view class="row-justify-sb center">
				<view class="column-c tab-item p-lr30 p-t20" v-for="(item,index) in navList" :key="index"
					@click="setType(index)">
					<image class="wh-60 r-circle" :class="index===current?'double-border':''" :src="item.icon" mode="">
					</image>
					<view class="m-t16 sys-size-24 text-center sys-weight-600"
						:class="{'default-text':index===current}">
						{{item.name}}
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				navList: [{
					name: '全部',
					icon: '/static/img/task/task-all.png'
				}, {
					name: '资产/征信',
					icon: '/static/img/task/task-repayment.png'
				}, {
					name: '跟进记录',
					icon: '/static/img/task/task-business.png'
				}, {
					name: '审核进度',
					icon: '/static/img/task/task-money.png'
				}, ]
			}
		},
		methods: {
			setType(current) {
				if (current !== this.current) {
					this.current = current
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.task-tab {
		width: calc(100% - 40rpx);
		margin: 0 20rpx;
		padding: 20rpx;
		border-radius: 30rpx;
		background: #fff;
	}

	.default-text {
		color: #10B261;
	}

	.tab-item::after {
		// content: '';
		// position: absolute;
		// width: 0;
		// height: 0;
		// border-left: 10px solid transparent;
		// border-right: 10px solid transparent;
		// border-top: 10px solid black;
	}

	.double-border {
		box-shadow: 0 0 0 6rpx #fff, 0 0 0 12rpx #10B261;
	}
</style>