goPage.js 887 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. export default {
  2. data(){
  3. return{
  4. inputStyle:'color:#CAD0D7;font-weight:400;font-size:28rpx',
  5. }
  6. },
  7. methods: {
  8. callPhone(mobile) {
  9. if (!mobile) return
  10. uni.makePhoneCall({
  11. phoneNumber: mobile
  12. })
  13. },
  14. // 复制
  15. copy(no) {
  16. if (!no) return
  17. uni.setClipboardData({
  18. data: no,
  19. success: res => {
  20. uni.showToast({
  21. title: '复制成功',
  22. icon: 'none',
  23. duration: 2000
  24. });
  25. }
  26. });
  27. },
  28. goPage(url, type) {
  29. if (type === 'none') {
  30. return
  31. }
  32. if (type === 'switchTab') {
  33. uni.switchTab({
  34. url: url
  35. })
  36. } else if (type === 'redirectTo') {
  37. uni.redirectTo({
  38. url: url
  39. })
  40. } else if (type === 'reLaunch') {
  41. uni.reLaunch({
  42. url: url
  43. })
  44. } else {
  45. if (type === false) {
  46. this.$u.toast('暂无权限')
  47. return
  48. }
  49. uni.navigateTo({
  50. url: url
  51. })
  52. }
  53. }
  54. }
  55. }