<template>
	<view>
		<view>

			<view class="uni-list">
				<radio-group @change="titleChange">
					<label class="display-block border-bottom-5" v-for="(item, index) in items" :key="item.value">
						<view class="elec-card bg-white">
							<view class="elec-card-left float-left">
								<view class="elec-card-msg">黄石肯特科技发展有限公司</view>
								<view class="elec-card-msg">发票类型:公司</view>
							</view>
							<view class="elec-card-right float-right">
								<button class="mini-btn color-62c7ee" type="primary" size="mini">去使用</button>
							</view>
						</view>
						<view class="uni-list-cell uni-list-cell-pd">
							<view>
								<radio :value="item.value" :checked="index === current" />
							</view>
							<view style="flex:1;">默认抬头</view>
							<view>
								<button class="mini-btn margin-left-5" type="primary" size="mini"
									@click="detailLookBtn">查看</button>
								<button class="mini-btn margin-left-5" type="default" size="mini"
									@click="detailEditBtn">编辑</button>
								<button class="mini-btn margin-left-5" type="warn" size="mini"
									@click="detailDelBtn">删除</button>
							</view>
						</view>
					</label>
				</radio-group>
			</view>
			<view class="billing-all">
				<button type="primary" class="title-submit" @click="addInvoiceTitle">添加发票抬头</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				items: [{
						value: '1',
						checked: 'true'

					},
					{
						value: '2'

					},
					{
						value: '3'

					},
				],
				current: 0,
			};
		},
		methods: {
			titleChange: function(evt) {
				for (let i = 0; i < this.items.length; i++) {
					if (this.items[i].value === evt.detail.value) {
						this.current = i;
						break;
					}
				}
			},
			detailLookBtn() {
				uni.navigateTo({
					url: '../companyMsg/companyMsg'
				});
			},
			detailEditBtn() {
				uni.navigateTo({
					url: '../editTitle/editTitle'
				});
			},
			detailDelBtn() {

			},
			addInvoiceTitle() {
				uni.navigateTo({
					url: '../addTitle/addTitle'
				});
			},
		}
	}
</script>

<style lang="scss">
	.elec-card {
		width: 100%;
		height: 64upx;
		padding: 22upx 30upx;

		border-bottom: 1px solid #e5e5e5;
	}

	.elec-card-left {
		width: 70%;
		height: 64upx;

	}

	.elec-card-right {
		width: 30%;
		height: 64upx;
		line-height: 64upx;
	}

	.elec-card-msg {
		line-height: 32upx;
		color: rgba(0, 0, 0, .7);

	}

	.billing-all {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 46px;
		line-height: 46px;
		// font-size: 24px;

	}
</style>
