|
|
@ -60,14 +60,48 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
open(){ |
|
|
|
open() { |
|
|
|
this.show = true |
|
|
|
}, |
|
|
|
close(){ |
|
|
|
close() { |
|
|
|
this.show = false |
|
|
|
}, |
|
|
|
// 拨打电话 |
|
|
|
confirm() { |
|
|
|
this.show = false |
|
|
|
let phone = "13575038513"; // 需要拨打的电话号码 |
|
|
|
// console.log('拨打电话', phone) |
|
|
|
const res = uni.getSystemInfoSync(); |
|
|
|
// ios系统默认有个模态框 |
|
|
|
if (res.platform == 'ios') { |
|
|
|
uni.makePhoneCall({ |
|
|
|
phoneNumber: phone, |
|
|
|
success() { |
|
|
|
console.log('ios拨打成功'); |
|
|
|
}, |
|
|
|
fail() { |
|
|
|
console.log('ios拨打失败'); |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
//安卓手机手动设置一个showActionSheet |
|
|
|
uni.showActionSheet({ |
|
|
|
itemList: [phone, '呼叫'], |
|
|
|
success: function(res) { |
|
|
|
if (res.tapIndex == 1) { |
|
|
|
uni.makePhoneCall({ |
|
|
|
phoneNumber: phone, |
|
|
|
success() { |
|
|
|
console.log('安卓拨打成功'); |
|
|
|
}, |
|
|
|
fail() { |
|
|
|
console.log('安卓拨打失败'); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|