// packageH/project_verification/components/storeItem/storeItem.js
// const App = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    data: {
      type: Object,
    },
    toDetails: {
      // 跳转到详情
      type: Boolean,
      value: true,
    },
  },

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

  /**
   * 组件的方法列表
   */
  methods: {
    openMap() {
      wx.openLocation({
        latitude: parseFloat(this.data.data.store_latitude),
        longitude: parseFloat(this.data.data.store_longitude),
      });
    },
    toStoreDetails() {
      if (this.data.toDetails === false) {
        return;
      }
      if (this.data.data.store_type == 2) {
        wx.redirectTo({
          url: "/packageC/hotel/HotelHome/HotelHome?id=" + this.data.data.id,
        });
      } else {
        wx.redirectTo({
          url: "/packageC/o2o/HomeSeller/HomeSeller?store_id=" + this.data.data.id,
        });
      }
    },
  },
});
