// pages/emergency/resourse/index/index.js
const app = getApp();

Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    condition: '',
    canChange: false,
    freshIng: false,
    page: 1,
    pageSize: 10,
    list: [{}]
  },

  pageLifetimes: {
    show: function () {
      this.getList();
    },
  },

  /**
   * 组件的方法列表
   */
  methods: {

    /**
     * 搜索
     */
    inputSearch: function (e) {
      this.data.condition = e.detail.value;
      this.refresh();
    },

    /**
     * 切换筛选
     */
    tabSelect: function (params) {
      if (!this.data.canChange) return
      this.data.canChange = false;
      const index = Number.parseInt(params.currentTarget.dataset.index);
      this.data.curTab = index;
      this.setData(this.data)
      this.refresh()
    },

    /**
     * 刷新
     * @param {*} params 
     */
    refresh: function (params) {
      this.data.page = 1;
      // this.data.list = [];
      this.setData(this.data)
      this.getList();
    },

    /**
     * 获取列表
     */
    getList: function () {}
  }
})