summaryList.js 2.1 KB
// pages/summaryList/summaryList.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tab_state: 0,
    popup_state: false,
    choose_state: false,
    member_list: [{
        name: '曹文杰(爸爸)',
        member_state: false,
      }, {
        name: '曹文杰(爸爸)',
        member_state: false,
      },
      {
        name: '曹文杰(爸爸)',
        member_state: false,
      }
    ]
  },
  //成员选择
  memberCharge(e) {
    var member_list = this.data.member_list
    var index=e.currentTarget.dataset.index
    member_list[index].member_state = !(member_list[index].member_state)
    this.setData({
      member_list: member_list
    })
    console.log(this.data.member_list)
  },
  // tabCharge
  tabCharge(e) {
    console.log(e)
    var index = e.currentTarget.dataset.index
    var tab_state = this.data.tab_state
    if (index == tab_state) {
      return false
    } else {
      this.setData({
        tab_state: index
      })
    }
  },
  //增加推荐方案
  recommendCaseList(e) {
    this.setData({
      popup_state: true
    })
  },
  //选择推荐方案
  popupState() {
    this.setData({
      choose_state: !(this.data.choose_state)
    })
  },
  //关闭弹窗
  cancelCase() {
    this.setData({
      popup_state: false
    })
  },

  //确认选择的推荐方案
  confirmCase() {
    this.setData({
      popup_state: false
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },

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

  },

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

  },

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

  },

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

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

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

  }
})