<view @tap.stop="handlePhone(item.storeTel)" class="t-r colorxl">
<view class="img" style="width: 28rpx;height: 28rpx;margin-right: 4rpx;">
<image style="width:100%;height: 100%;" src="../static/t-hone-tel.png" mode="aspectFill"></image>
</view>
联系商家
</view>
/**
* @description 商家联系方式
* @param {Number} phone
*/
handlePhone(phone) {
const res = uni.getSystemInfoSync();
// ios系统默认有个模态框
if (res.platform == 'ios') {
uni.makePhoneCall({
phoneNumber: phone,
success() {
console.log('拨打成功了');
},
fail() {
console.log('拨打失败了');
}
});
} else {
//安卓手机手动设置一个showActionSheet
uni.showActionSheet({
itemList: [phone, '呼叫'],
success: res => {
console.log(res);
if (res.tapIndex == 1) {
uni.makePhoneCall({
phoneNumber: phone
});
}
}
});
}
},