index.js 837 Bytes

Page({


  data: {
    showBackBtn:false
  },


  onRoute(options) {
    const index = options.index || 0
    let title = 'wxchat_qf_title'
    let list = []
    switch (Number(index)) {
      case 1:
        title = 'wxchat_pyq_title'
        list = ['wxchat_pyq_0','wxchat_pyq_1','wxchat_pyq_2']
        break;
        case 2:
          title = 'wxchat_hy_title'
          list = ['wxchat_hy_0','wxchat_hy_1','wxchat_hy_2']
          break;
      default:
        title = 'wxchat_qf_title'
        list = ['wxchat_qf_0','wxchat_qf_1','wxchat_qf_2','wxchat_qf_3','wxchat_qf_4']
        break;
    }
    this.setData({
      title,
      list
    },()=>{
      setTimeout(() => {
        this.setData({
          showBackBtn:true
        })
      }, 1500);
    })
  },
  toBack(){
    wx.navigateBack({
      delta: 1
    });
  },

 
})