Page({
  data: {
    type: "",
    /** 索引栏*/
    indexList: ["A", "B", "C", "D"],
    scrollTop: 0,
    /** mock客户数据*/
    customerList: [
      {
        firstLetter: "A",
        list: [
          { code: "AB01", name: "A1客户" },
          { code: "AB02", name: "A2客户" },
          { code: "AB03", name: "A3客户" },
        ],
      },
      {
        firstLetter: "B",
        list: [
          { code: "BB01", name: "B1客户" },
          { code: "BB02", name: "B2客户" },
          { code: "BB03", name: "B3客户" },
          { code: "BB04", name: "B4客户" },
        ],
      },
      {
        firstLetter: "C",
        list: [
          { code: "CB01", name: "C1客户" },
          { code: "CB02", name: "C2客户" },
          { code: "CB03", name: "C3客户" },
          { code: "CB04", name: "C4客户" },
          { code: "CB05", name: "C5客户" },
        ],
      },
      {
        firstLetter: "D",
        list: [
          { code: "DB01", name: "D1客户" },
          { code: "DB02", name: "D2客户" },
          { code: "DB03", name: "D3客户" },
          { code: "DB04", name: "D4客户" },
          { code: "DB05", name: "D5客户" },
          { code: "DB06", name: "D6客户" },
        ],
      },
    ],
  },
  
  //索引栏发生变化事件 
  onPageScroll(event) {
    this.setData({
      scrollTop: event.scrollTop,
    });
  },

  /**选择客户发生事件 */
  getCustomer: function (event) {
    console.log(event.currentTarget.dataset.id);
    console.log(event.currentTarget.dataset.name);
    const value = event.currentTarget.dataset.name
    if(value){
      wx.reLaunch({
        url: '/pages/meeting/visitorIinvitation/visitorIinvitation?name='+value,
      })
    }
  },
});