BeeMakePhone.vue 597 B

12345678910111213141516171819202122232425262728293031323334
  1. <template>
  2. <view class="make-phone-container" @click="handleMackPhone">
  3. <slot></slot>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. phone: {
  10. type: [Number, String],
  11. },
  12. },
  13. methods: {
  14. handleMackPhone() {
  15. if (!this.phone) {
  16. // TODO: 使用 `tui-toast`
  17. // TODO: app 使用是否需要权限 ?
  18. uni.showToast({
  19. title: '暂无联系方式',
  20. duration: 2000,
  21. icon: 'none',
  22. })
  23. return
  24. }
  25. uni.makePhoneCall({
  26. phoneNumber: this.phone,
  27. })
  28. },
  29. },
  30. }
  31. </script>