<template>
	<view class="box">
		<view class="cardbox">
			<!-- 			<view class="card">
				<view class="icon-active">
					<u-icon name="checkbox-mark" color="#fff" size="28"></u-icon>
				</view>
				<view class="content">
					<view class="title">
						发票抬头：贵州某某科技有限公司
					</view>
					<text class="">
						发票抬头：公司
					</text>
				</view>
				<view class="edit">
					<image :src="`${$imgUrl}applyCard/edit.png`" mode=""></image>
					<view>
						编辑
					</view>
				</view>
			</view> -->

			<view class="card" v-for="(item,i) in list" :key="i">
				<view class="icon-active" v-if="i==value" @click="choose(i,item)">
					<u-icon name="checkbox-mark" color="#fff" size="28"></u-icon>
				</view>
				<view class="icon-no-active" v-else @click="choose(i,item)">
				</view>
				<view class="content">
					<view class="title">
						发票抬头：{{item.name}}
					</view>
					<text class="">
						发票抬头：{{item.type}}
					</text>
				</view>
				<view class="edit" @click="toEdit(item.type)">
					<image :src="`${$imgUrl}applyCard/edit.png`" mode=""></image>
					<view>
						编辑
					</view>
				</view>
			</view>
		</view>
		<button class="submit">添加抬头信息</button>
		<button class="submit2">确定</button>
	</view>

</template>

<script setup lang="ts">
	import {
		ref,
		reactive
	} from "vue";
	import {
		msg,
		navTo
	} from '@/utils/utils';
	const list = reactive([{
			name: '贵州某某科技有限公司',
			type: '公司'
		},
		{
			name: '贵州某某科技有限公司2',
			type: '个人'
		}
	])

	const value = ref('')



	const choose = (i, item) => {
		value.value = i
		console.log(item);
	}
	const toEdit = (type) => {
		if (type == '公司') {
			navTo('/invoice/invoiceApply/edit-invoice-header-company')
		} else {
			navTo('/invoice/invoiceApply/edit-invoice-header-individual')
		}
	}
</script>


<style>
	page {
		width: 100%;
		height: 100%;
	}
</style>

<style lang="scss" scoped>
	.box {
		width: 100%;
		height: 100%;
		background-color: #EEF7F7;
		border-top: 1rpx solid #DFDFDF;
		padding: 30rpx 30rpx;

		.cardbox {
			.card {
				height: 141rpx;
				background: #FFFFFF;
				box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
				border-radius: 20rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 30rpx;
				margin-bottom: 30rpx;

				.content {
					.title {
						font-size: 30rpx;
						font-family: Noto Sans S Chinese;
						font-weight: 400;
						color: #333333;
						margin-bottom: 15rpx;
					}

					text {
						font-size: 26rpx;
						font-family: Noto Sans S Chinese;
						font-weight: 400;
						color: #666666;
					}
				}

				.icon-active {
					width: 43rpx;
					height: 43rpx;
					background: #00B38B;
					border-radius: 50%;
					display: flex;
					justify-content: center;
					align-items: center;
				}

				.icon-no-active {
					width: 44rpx;
					height: 44rpx;
					background: #FFFFFF;
					border: 1px solid #00B38B;
					border-radius: 50%;
				}

				.edit {
					display: flex;
					justify-content: center;
					align-items: center;
					flex-direction: column;


					image {
						width: 40rpx;
						height: 40rpx;
					}

					view {
						font-size: 26rpx;
						font-family: Noto Sans S Chinese;
						font-weight: 400;
						color: #999999;
					}
				}
			}
		}

		.submit {
			width: 670rpx;
			height: 80rpx;
			background: linear-gradient(-90deg, #43A1E0 0%, #13E7C1 100%);
			border-radius: 40rpx;
			font-size: 32rpx;
			font-family: Noto Sans S Chinese;
			font-weight: 400;
			color: #FFFFFF;
			line-height: 80rpx;
			margin-top: 575rpx;
			margin-bottom: 30rpx;
		}

		.submit2 {
		    width: 673rpx;
		    height: 80rpx;
		    background: #FFFFFF;
		    border: 3rpx solid #DCDCDC;
		    border-radius: 40rpx;
		    font-size: 32rpx;
		    font-family: Noto Sans S Chinese;
		    font-weight: 400;
		    color: #666666;
		    line-height: 80rpx;
		}
	}
</style>
