<template>
	<view class="container avstarBack">
		<uni-navbar title="企业信息"></uni-navbar>
		<view class="box commonMt relative">
			<view class="absolute">
				<view class="choose-line-bottom commonBj commonMb">
					<view class="state-icon">
						<view class="flexAlignCenter">
							<view class="greenCircle">
							</view>
							<text class="itemText">企业名称:</text>
						</view>
						<view class="flexAlignCenter">
							<text class="infoText">{{form.companyName}}</text>
						</view>
					</view>
					<view class="state-icon">
						<view class="flexAlignCenter">
							<view class="greenCircle">
							</view>
							<text class="itemText">企业简称:</text>
						</view>
						<view class="flexAlignCenter">
							<text class="infoText">{{form.companyAbbreviation}}</text>
						</view>
					</view>
					<view class="state-icon">
						<view class="flexAlignCenter">
							<view class="greenCircle">
							</view>
							<text class="itemText">信用代码:</text>
						</view>
						<view class="flexAlignCenter">
							<text class="infoText">{{form.companyCode}}</text>
						</view>
					</view>
					<view class="state-icon">
						<view class="flexAlignCenter">
							<view class="greenCircle">
							</view>
							<text class="itemText">企业法人:</text>
						</view>
						<view class="flexAlignCenter">
							<text class="infoText">{{form.legalPerson}}</text>
						</view>
					</view>
					<view class="state-icon">
						<view class="flexAlignCenter">
							<view class="greenCircle">
							</view>
							<text class="itemText">联系电话:</text>
						</view>
						<view class="flexAlignCenter">
							<text class="infoText">{{form.phoneNumber}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getCompanyDetail
	} from "@/api/company/company.js"
	export default {
		data() {
			return {
				form: {
					companyName: null,
					companyAbbreviation: null,
					companyCode: null,
					legalPerson: null,
					phoneNumber: null
				},
				// 企业id
				id: null
			}
		},
		methods: {
			async companyDetail(id) {
				const res = await getCompanyDetail(id)
				console.log('详情', res);
				this.form = res.data
			}
		},
		onLoad(option) {
			this.companyDetail(option.id)
		}
	}
</script>

<style scoped lang="scss">
	.avstarBack {
		background-image: url(@/static/images/editInfo/editInfo.png);
	}

	.relative {
		position: relative;
	}

	.absolute {
		position: absolute;
		bottom: 46rpx;
		width: 100%;
	}

	.choose-line-bottom {
		overflow: hidden;
		padding: 41rpx 54rpx;
		box-sizing: border-box;

	}

	.mt33 {
		margin-top: 33rpx;
	}

	.state-icon {
		display: flex;
		margin: 84rpx 0;
	}

	.state-icon:nth-child(1) {
		margin: 52rpx 0 40rpx;
	}

	.state-icon:nth-last-child(1) {
		margin: 84rpx 0 52rpx;
	}
</style>
