index.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // nova-tourism/components/shop-detail/index.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. shop: {
  8. type: Object,
  9. value: {}
  10. },
  11. activeColor: {
  12. type: String,
  13. value: ''
  14. }
  15. },
  16. /**
  17. * 组件的初始数据
  18. */
  19. data: {
  20. },
  21. /**
  22. * 组件的方法列表
  23. */
  24. methods: {
  25. callPhone() {
  26. wx.makePhoneCall({
  27. phoneNumber: '13026223750'
  28. })
  29. },
  30. callMap() {
  31. let that = this;
  32. const latitude = that.data.shop.location.latitude
  33. const longitude = that.data.shop.location.longitude
  34. wx.openLocation({
  35. latitude,
  36. longitude,
  37. scale: 18
  38. })
  39. },
  40. toWebView(e) {
  41. console.log(e)
  42. let path = e.currentTarget.dataset.path
  43. if (!path) {
  44. wx.showToast({
  45. title: 'VR素材收集中',
  46. duration: 1500,
  47. icon: "none",
  48. })
  49. return
  50. }
  51. wx.navigateTo({
  52. url: '/common-page/pages/web-view/index?path=' + path,
  53. })
  54. },
  55. }
  56. })