You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<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>
|