<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>
聯(lián)系商家
</view>
/**
* @description 商家聯(lián)系方式
* @param {Number} phone
*/
handlePhone(phone) {
const res = uni.getSystemInfoSync();
// ios系統(tǒng)默認(rèn)有個模態(tài)框
if (res.platform == 'ios') {
uni.makePhoneCall({
phoneNumber: phone,
success() {
console.log('撥打成功了');
},
fail() {
console.log('撥打失敗了');
}
});
} else {
//安卓手機手動設(shè)置一個showActionSheet
uni.showActionSheet({
itemList: [phone, '呼叫'],
success: res => {
console.log(res);
if (res.tapIndex == 1) {
uni.makePhoneCall({
phoneNumber: phone
});
}
}
});
}
},