<template>
	<view>
		<view class="card">
			<!-- <view class="title">加入学员群</view> -->
			<view class="card-hd">
				<u-image shape="circle" width="100rpx" height="100rpx" :src="companyInfo.com_logo" mode="widthFix"></u-image>
				<view class="info">
					<view class="title">在线客服</view>
					<view class="phone">{{companyInfo.com_service_phone}}</view>
				</view>
				<u-image @click="onCall" width="40rpx" height="40rpx" src="/static/phone.png" mode="widthFix"></u-image>
			</view>
			
			<view class="card-bd">
				<u-image width="400rpx" height="400rpx"  :src="companyInfo.com_group_qrcode" mode=""></u-image>
				<view class="tips">长按识别加入学院群</view>
			</view>
			
			<view class="card-ft">
				{{companyInfo.com_slogan}}
			</view>
		</view>
		
	</view>
</template>

<script>
	import {getCompanyInfo} from '@/api/public.js'
	export default {
		data() {
			return {
				companyInfo: {
					com_service_phone: '',
					com_group_qrcode: '',
					com_slogan: '',
					com_logo: '',
					com_work_time: '',
					com_service_qrcode: '',
				}
			};
		},
		onLoad() {
			getCompanyInfo().then(res =>{
				res.data.forEach(item => {
					console.log(item);
					this.companyInfo[item.menuName] = item.value
				})
			})
		},
		methods: {
			onCall() {
				uni.makePhoneCall({
					phoneNumber: this.companyInfo.com_service_phone
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.card {
		margin: 30rpx;
		background-color: #FFFFFF;
		border-radius: 10rpx;
		box-shadow:  0 0 4rpx 4rpx rgba(#333333, .1);
	}
	.card-hd{
		display: flex;
		align-items: center;
		padding: 30rpx;
	}
	
	.info{
		height: 80rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		flex: 1;
		padding-left: 40rpx;
	}
	.title {
		font-size: 24rpx;
		color: #6c6c6c;
	}
	.phone{
		font-size: 32rpx;
		font-weight: bold;
	}
	.card-bd{
		display: flex;
		align-items: center;
		justify-items: center;
		flex-direction: column;
	}
	.tips {
		font-size: 24rpx;
		margin-top: 40rpx;
	}
	.card-ft {
		font-size: 28rpx;
		padding: 70rpx;
	}
</style>
