<template>
	<view class="box">
		<u--image :showLoading="true"
			:src="init.image" showMenuByLongpress
			width="690rpx" height="600rpx"></u--image>
			
			<view class=" service flex justify-center align-items" @click="callPhone(init.mobile)">
				<image src="../../static/my/server.png" mode="" style="width: 64rpx;height: 64rpx;"></image>
				<span class="flex justify-center align-items">联系客服:{{init.mobile}}</span>
			</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				init:{}
			};
		},
		onShow() {
			this.getinit()
		},
		methods:{
			callPhone(phone) {
				uni.makePhoneCall({
					phoneNumber: phone
				})
			},
			getinit() {
				uni.$u.http.get('/api/index/init', {}).then(res => {
					if (res.code == 1) {
						this.init = res.data.customer_service
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						});
					}
				}).catch(error => {
					uni.showToast({
						title: '请求失败，请稍后再试',
						icon: 'none',
						duration: 2000
					});
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.box{
		display: flex;
		justify-content: center;
		align-items: center;
		flex-flow: column;
	}
	.service{
		margin-top: 42rpx;
		margin-bottom: 120rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 30rpx;
		color: #008CFF;
		display: flex;
		justify-content: center;
		align-items: center;
		span{
			display: flex;
			justify-content: center;
			align-items: center;
		}
	}

</style>
