<template>
	<view class="box">
		<view class="phoneIcon" @click.stop="show=true">
			<slot></slot>
		</view>
		<u-action-sheet :actions="servicePhone" :show="show" @select="callPhoneClick" :closeOnClickOverlay="true" @close="show=false" cancelText="取消"></u-action-sheet>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				servicePhone: [
					{name: '18267103167'},
					{name: '18267103168'},
				],
				show: false
			}
		},
		methods: {
			callPhoneClick(item) {
				
				let phone = item.name
				// #ifdef MP-WEIXIN
				this.$u.utils.callPhone(phone)
				// #endif
				
				// #ifdef H5
				var a = document.createElement('a')
				a.setAttribute('href', 'tel:'+ phone)
				document.body.appendChild(a)
				a.click()
				console.log(phone)
				// #endif
				
				this.show =false
			},
		}
	}
</script>

<style>
</style>