最近用uniapp做微信小程序,有个通讯录功能,需要调用手机拨打电话,如下所示:
<view class="action" @click="phone(information.phone)"> <view class="text-black margin-top-sm">电话</view> </view>
phone(phone) { const res = uni.getSystemInfoSync(); //获取当前的手机机型 if (res.platform == 'ios') { uni.makePhoneCall({ phoneNumber: phone }) } else { uni.makePhoneCall({ phoneNumber: phone, }) } },