//index.js
//获取应用实例
const app = getApp()

Page({
  onShow() {
    wx.setNavigationBarTitle({
      title: '预约记录'
    })
  },
  data: {
    UserInfo: app.globalData.UserInfo, // 用户信息
    List: [{
      Name: '示例姓名',
      PhoneNum: '18267901393',
      CaseName: '示例项目名称',
      AppointmentDate: '2019-02-02',
      Remark: '几点睡觉都会涉及到很多技术'
    }, {
      Name: '示例姓名',
      PhoneNum: '18267901393',
      CaseName: '示例项目名称',
      AppointmentDate: '2019-02-02',
      Remark: '几点睡觉都会涉及到很多技术'
    }, {
      Name: '示例姓名',
      PhoneNum: '18267901393',
      CaseName: '示例项目名称',
      AppointmentDate: '2019-02-02',
      Remark: '几点睡觉都会涉及到很多技术'
    }, {
      Name: '示例姓名',
      PhoneNum: '18267901393',
      CaseName: '示例项目名称',
      AppointmentDate: '2019-02-02',
      Remark: '几点睡觉都会涉及到很多技术'
    }, {
      Name: '示例姓名',
      PhoneNum: '18267901393',
      CaseName: '示例项目名称',
      AppointmentDate: '2019-02-02',
      Remark: '几点睡觉都会涉及到很多技术'
    }, {
      Name: '示例姓名',
      PhoneNum: '18267901393',
      CaseName: '示例项目名称',
      AppointmentDate: '2019-02-02',
      Remark: '几点睡觉都会涉及到很多技术'
    }, {
      Name: '示例姓名',
      PhoneNum: '18267901393',
      CaseName: '示例项目名称',
      AppointmentDate: '2019-02-02',
      Remark: '几点睡觉都会涉及到很多技术'
    }, {
      Name: '示例姓名',
      PhoneNum: '18267901393',
      CaseName: '示例项目名称',
      AppointmentDate: '2019-02-02',
      Remark: '几点睡觉都会涉及到很多技术'
    }, {
      Name: '示例姓名',
      PhoneNum: '18267901393',
      CaseName: '示例项目名称',
      AppointmentDate: '2019-02-02',
      Remark: '几点睡觉都会涉及到很多技术'
    }],
    DeleteIndex: null,
    DeleteOff: true
  },
  ShowDeleteItem(e) { // 长按显示删除
    this.setData({
      DeleteIndex: e.target.dataset.index
    })
  },
  ResetDeleteIndex() { // 重置删除状态
    this.setData({
      DeleteIndex: null
    })
  },
  DeleteItem() { // 确认删除逻辑
    if (this.data.DeleteOff) {
      this.setData({
        DeleteOff: false
      })
    }
  }
})