<template>
	<view class="jiben">
		<view v-for="(sc,i) in list" :key="i" v-if="i==chongci">
			<view class="schoolicon">
				<image :src="sc.schoolImg" mode="widthFix"></image>
			</view>
			<view class="icontext">
				系统预测该校录取概率为：{{chongci}}
			</view>
			<view class="jieshao">
				<sun-tab :value.sync="index" :tabList="tabList"></sun-tab>
				<view :value.sync="index" v-if="index==0">
					<view>{{sc.schoolName}}</view>
					<view>{{sc.banxuexingzhi}}</view>
					<view>{{sc.leixing}}</view>
					<view>{{sc.lishu}}</view>
					<view>{{sc.shengshi}}</view>
					<view>{{sc.dizhi}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import sunTab from '@/components/sun-tab/sun-tab.vue';

	export default {
		// props: ['schoolInfo'],
		components: {
			sunTab
		},
		data() {
			return {
				chongci: "",
				list: getApp().globalData.schoolInfo,
				schoolImg: '',
				Name: '',
				index: 0,
				tabList: ['学院介绍', '开设专业', '录取招生'], //普通数据赋值
				tabObjectList: [ //对象数组赋值
					{
						name: '学院介绍',
						value: 1
					},
					{
						name: '开设专业',
						value: 2
					},
					{
						name: '录取招生',
						value: 3
					}
				],
			}
		},
		onLoad(event) {
			this.chongci = getApp().globalData.global_page;
			// console.log(this);
			wx.setNavigationBarTitle({
				title: this._data.list[this.chongci].schoolName
			})
		},
		methods: {
			arrayChange(e) {
				console.log('数组数据返回格式');
				console.log(e);
			},
			objectChange(e) {
				console.log('对象数据返回格式');
				console.log(e);
			}
		}
	}
</script>

<style>
	.jiben {
		padding-top: 60upx;
		width: 750upx;
		height: 1002upx;
		background: rgba(255, 255, 255, 1);
	}

	.schoolicon {
		margin: 0 auto;
		width: 180upx;
		height: 180upx;
	}

	.schoolicon image {
		display: inline;
	}

	.icontext {
		margin-top: 24upx;
		text-align: center;
		font-size: 28upx;
		font-family: PingFangSC;
		font-weight: 400;
		color: rgba(117, 119, 128, 1);
		line-height: 40upx;
		margin-bottom: 60upx;
	}
</style>
