// nova-tourism/components/shop-detail/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    shop: {
      type: Object,
      value: {}
    },
    activeColor: {
      type: String,
      value: ''
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    callPhone() {
      wx.makePhoneCall({
        phoneNumber: '13026223750'
      })
    },
    callMap() {
      let that = this;
      const latitude = that.data.shop.location.latitude
      const longitude = that.data.shop.location.longitude
      wx.openLocation({
        latitude,
        longitude,
        scale: 18
      })
    },
    toWebView(e) {
      console.log(e)
      let path = e.currentTarget.dataset.path
      if (!path) {
        wx.showToast({
          title: 'VR素材收集中',
          duration: 1500,
          icon: "none",
        })
        return
      }
      wx.navigateTo({
        url: '/common-page/pages/web-view/index?path=' + path,

      })
    },
  }
})
