<template>
	<!-- 客服热线 -->
	<view class="">

		<!-- <view class="round text-center">
			<button class="cu-btn round bg-main-oil" open-type='contact'>
				<text class="cuIcon-servicefill padding-right-xs"></text>
				联系在线客服</button>
		</view> -->
		<view class="round text-center">
			<!-- <button class="cu-btn oil-main-btn-color" open-type="contact" @contact="onContact"> -->
				<!-- <text class="text-grey text-sm">打开会话</text> -->
			<!-- </button> -->
			<view class="cu-btn round bg-main-oil" @click="callHotline">
				<text class="cuIcon-servicefill padding-right-xs"></text>
				 联系客服 
			</view> 
		</view>
		<view class="color-999 text-center padding" @tap="callHotline">
			全国统一客服/投诉热线：
			<text class="text-red">
				4008-56-5355
			</text>
		</view>
		<view class="text-center color-999" >
			<checkbox @tap="onChange" class='round red chagesize' :class="checked?'checked':''" :checked="checked?true:false"
			 value="C"></checkbox> 我已阅读并同意
			<text @tap="toAgree('xoilCloudUserAgree')" class="oil-main-color">《用户协议》</text>和<text @tap="toAgree('xoilCloudPrivacyAgreement')" class="oil-main-color">《隐私政策》</text>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			checked:{
				type:Boolean,
				default:false
			}
		},
		data() {
			return {
				// key: value
			}
		},
		methods: {
			callHotline() {
				uni.makePhoneCall({
					phoneNumber: '4008-56-5355'
				})
			},
			toAgree(link) {
				uni.navigateTo({
					url: `/pages/Auth/agreeMent/agreeMent?link=${link}`
				})
			},
			onChange() {
				let checked = !this.checked
				this.$emit('onCheck', checked)
			}
		},
	}
</script>

<style>
	.chagesize {
		transform: scale(0.6, 0.6);
	}
</style>
