// pages/shop/shop.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    provinceArr: [
      ["全部", "a", "b", "c", "d"], ["1", "2", "3", "4", "5"],
    ],
    cityArr: [["1", "2", "3", "4", "5"], ["1", "2", "3", "4"], ["1", "2", "3"], ["1", "2"], ["1"]],
    index:0,
    inputVal:"",
    
    scrollHig:0,
    getDataArr:[
      {
        "bigImg": "../images/shop.png",
        "name":"北京东城区金宝店",
        "address":"北京市东城区金宝大雅宝59号（鄂尔多斯酒店对面）",
        "phone":"010-8388-6698",
      },
      {
        "bigImg": "../images/shop.png",
        "name": "北京东城区金宝店",
        "address": "北京市东城区金宝大雅宝59号（鄂尔多斯酒店对面）",
        "phone": "010-8388-6698",
      },
      {
        "bigImg": "../images/shop.png",
        "name": "北京东城区金宝店",
        "address": "北京市东城区金宝大雅宝59号（鄂尔多斯酒店对面）",
        "phone": "010-8388-6698",
      }
    ]
  },
  bindchange:function(e){
    console.log("确定")
    wx.pageScrollTo({
      scrollTop: 0,
      duration: 300
    })
  },
  bindcolumnchange: function (e) {
    console.log(e)
    var clo = e.detail.column;//指移动的哪一列
    var value = e.detail.value;//指列中的哪一个
    var activeArr = [this.data.provinceArr[0], this.data.cityArr[value]]
    if (clo==0){
      console.log(0)
      this.setData({
        provinceArr: activeArr,
        index:0,
      })
    }else{
      this.setData({
        index: value
      })
    }
    console.log(activeArr)
    console.log(clo, value)
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // var Hig = wx.getSystemInfoSync().windowHeight;
    // this.setData({
    //   scrollHig: Hig-110+40,
    // })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    console.log("到顶了")
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    console.log("到底了")
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  callPhone:function(e){//拨打电话
    var index = e.target.dataset.index;
    wx.makePhoneCall({
      phoneNumber: this.data.getDataArr[index].phone
    })
  },
  getInputVal:function(e){//获取input框中value
    console.log(e.detail.value);
    this.setData({
      inputVal:e.detail.value
    })
  },
  searchFn:function(){//点击搜索按钮

  },
})