const navigationBarHeight = (getApp().statusBarHeight + 50) + 'px'
const util = require("../../utils/util.js");
const Http = require("../../utils/HttpBasics");
const config = require("../../config/config");
const imgurl = require("../../utils/imgurl");
Page({
  data: {
    navigationBarHeight,
    list:[],
    teljpgUrl: imgurl.teljpg.url,
  },
  gotoDetail(e) {
    tt.navigateTo({
      url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}`
    })
  },
  phone: function (e) {
    let that = this;
    tt.makePhoneCall({
      phoneNumber: e.target.dataset.merchantlinkphone
    });
  },
  goCertification(e){
    tt.navigateTo({
      url: `/pages/shopCertification/shopCertification?id=${e.currentTarget.dataset.id}`
    })
  },
  goMap(e){

    let {latitude,longitude} = e.currentTarget.dataset.item
    console.log(latitude,longitude);
    tt.openLocation({
      latitude:Number(latitude),
      longitude:Number(longitude),
      scale: 18,
      success() {
        console.log("打开地图成功");
      },
      fail(err) {
        console.log("打开地图失败:", err.errMsg);
      },
    });

  },
  onLoad: function (options) {
    
    this.setData({
      list:JSON.parse(options.list)
    })
    console.log(this.data.list);
  },
  onReady(e) {

  },
})