make-phone-call.js 562 B

123456789101112131415161718192021222324252627282930313233
  1. Page({
  2. onShareAppMessage() {
  3. return {
  4. title: '打电话',
  5. path: 'page/API/pages/make-phone-call/make-phone-call'
  6. }
  7. },
  8. data: {
  9. disabled: true
  10. },
  11. bindInput(e) {
  12. this.inputValue = e.detail.value
  13. if (this.inputValue.length > 0) {
  14. this.setData({
  15. disabled: false
  16. })
  17. } else {
  18. this.setData({
  19. disabled: true
  20. })
  21. }
  22. },
  23. makePhoneCall() {
  24. wx.makePhoneCall({
  25. phoneNumber: this.inputValue,
  26. success() {
  27. console.log('成功拨打电话')
  28. }
  29. })
  30. }
  31. })