<template>
	<view class="content">
		<view class="content-block" v-if="params.length > 0">
			<view class="content-item" v-for="(item, index) in params" :key="index">
				<view class="text-title nowrap">{{item.title || '-'}}</view>
				<view class="text-value">{{item.value_text || '-'}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { userInfoBank } from '@/apis/interfaces/user.js'
	export default {
		data() {
			return {
				params: []
			};
		},
		created() {
			uni.showLoading({
				title: '加载中...',
				mask : true
			})
			userInfoBank(this.$Route.query.id).then(res => {
				let { params, institution } = res;
				this.params = params;
				uni.setNavigationBarTitle({
					title: institution.title + '-机构资料'
				})
				uni.hideLoading()
			}).catch(err => {
				uni.showToast({
					title: err.message,
					icon : 'none'
				})
			})
		}
	}
</script>

<style lang="scss">
	.content{
		padding: 30rpx 0;
		box-sizing: border-box;
		.content-block{
			background: white;
			.content-item{
				display: flex;
				justify-content: space-between;
				align-items: center;
				line-height: 40rpx;
				padding: 30rpx;
				font-size: 30rpx;
				.text-title{
					width: 300rpx;
					color: gray;
				}
				.text-value{
					width: calc( 100% - 300rpx);
					text-align: right;
				}
				@extend .border-solid;
				&::after{
					left: 30rpx;
				}
				&:last-child::after{
					display: none;
				}
			}
		}
	}
</style>
