<template>
	<view class="page">
		<view class="block">
			<view class="form-list">
				<view class="line">
					<view class="name">LOGO</view>
					<view class="val">
						<image class="avatar" :src="info.logoUrl"></image>
					</view>
				</view>
				<view class="line">
					<view class="name">幼儿园名称</view>
					<view class="val">{{ info.classificationName }}</view>
				</view>
				<view class="line">
					<view class="name">幼儿园slogan</view>
					<view class="val">{{ info.slogan }}</view>
				</view>
				<view class="line">
					<view class="name">省份</view>
					<view class="val">{{ info.province }}</view>
				</view>
				<view class="line">
					<view class="name">城市</view>
					<view class="val">{{ info.city }}</view>
				</view>
				<view class="line">
					<view class="name">地址</view>
					<view class="val">{{ info.address }}</view>
				</view>
				<view class="line">
					<view class="name">联系电话</view>
					<view class="val">{{ info.phone }}</view>
				</view>
				<view class="line no-bd">
					<view class="name">幼儿园简介</view>
					<view class="val">{{ info.briefIntroduction }}</view>
				</view>
				<view class="py">
					<image v-for="(item, i) in pictureUrl" :key="i" class="pic" :src="item"></image>
				</view>
				<view class="line">
					<view class="name">二维码描述一</view>
					<view class="val">{{ info.qrCodeOneName }}</view>
				</view>
				<view class="line">
					<view class="name">二维码一</view>
					<image v-if="info.qrCodeOneUrl" class="qrcode" :src="info.qrCodeOneUrl" mode="widthFix"></image>
				</view>
				<view class="line">
					<view class="name">二维码描述二</view>
					<view class="val">{{ info.qrCodeTwoName }}</view>
				</view>
				<view class="line">
					<view class="name">二维码二</view>
					<image v-if="info.qrCodeTwoUrl" class="qrcode" :src="info.qrCodeTwoUrl" mode="widthFix"></image>
				</view>
				<view class="line">
					<view class="name">二维码描述三</view>
					<view class="val">{{ info.qrCodeThreeName }}</view>
				</view>
				<view class="line">
					<view class="name">二维码三</view>
					<image v-if="info.qrCodeThreeUrl" class="qrcode" :src="info.qrCodeThreeUrl" mode="widthFix"></image>
				</view>
			</view>
		</view>
		
		<view v-if="isTeam" class="btn-wrap">
			<view class="btn" @click="toEdit">编辑</view>
		</view>
	</view>
</template>

<script>
	import { queryTeamInfo } from '@/apis/modules/user.js'
	import Common from '@/config/common'
	export default {
		data() {
			return {
				isTeam: uni.getStorageSync('team').isTeam == 1, // 队长
				teamId: uni.getStorageSync('teamId'),
				info: {},
				pictureUrl: []
			}
		},
		onShow() {
			this.getInfo()
		},
		methods: {
			// 获取个人信息
			getInfo() {
				queryTeamInfo({
					teamId: this.teamId
					// teamId: 281
				}).then(res => {
					const data = res.teamInfo
					if (!data.logoUrl) data.logoUrl = Common.avatar
					if (data.pictureUrl) this.pictureUrl = data.pictureUrl.split(',')
					this.info = data
				}).catch(e => {})
			},
			// 编辑
			toEdit() {
				this.$util.to('/team/infoEdit/infoEdit')
			}
		}
	}
</script>

<style scoped lang="scss">
.page {
	padding-bottom: 170rpx;
	-webkit-overflow-scrolling: touch;
}
.avatar {
	width: 80rpx;
	height: 80rpx;
	border: 0;
	border-radius: 50%;
}
.form-list {
	.pic {
		width: 200rpx;
		height: 200rpx;
		margin-right: 10rpx;
	}
	.qrcode {
		width: 300rpx;
	}
}
</style>
