<template>
	<view class="content">
		<view class="lf-row-between item">
			<view class="lf-color-gray">在线客服</view>
			<button class="btn" open-type="contact">在线联系</button>
		</view>
		
		<view class="lf-row-between item">
			<view class="lf-color-gray">服务时间</view>
			<view>{{ info.service_period }}</view>
		</view>
		<view class="lf-row-between item" @click="makePhoneCall">
			<view class="lf-color-gray">客服电话</view>
			<view>{{ info.phone }}</view>
		</view>
		<view class="lf-row-between item">
			<view class="lf-color-gray">联系地址</view>
			<view>{{ info.address }}</view>
		</view>
		<view class="lf-row-between item">
			<view class="lf-color-gray">客服微信</view>
			<view>
				<text>{{ info.wechat }}</text>
				<text class="lf-m-l-20 lf-color-primary" @click="copy">复制</text>
			</view>
		</view>
		
		<view class="lf-row-between item">
			<view class="lf-color-gray">当前版本</view>
			<view>{{ version }}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				version: '',
				info: {}
			}
		},
		onLoad(){
			this.version = this.API.VERSION;
			this.getInfo();
		},
		methods: {
			// 获取信息
			getInfo(){
				this.$http(this.API.API_CONTACT).then(res => {
					this.info = res.data;
				})
			},
			// 拨打电话
			makePhoneCall(){
				uni.makePhoneCall({
					phoneNumber: this.info.phone
				})
			},
			// 复制
			copy(){
				uni.setClipboardData({
					data: this.info.wechat
				})
			}
		}
	}
</script>

<style lang="scss" scoped="scoped">
	.content{
		width: 750rpx;
		height: auto;
		padding: 0 32rpx;
		box-sizing: border-box;
		.item{
			width: 100%;
			height: 104rpx;
			border-bottom: 1rpx solid #EEEEEE;
			.btn{
				margin: 0;
				width: 176rpx;
				height: 60rpx;
				background: #FE9903;
				border-radius: 30rpx;
				color: #FFFFFF;
				font-size: 28rpx;
				line-height: 60rpx;
			}
		}
	}
</style>
