import HTTP from "../../../../requestFn/Api"
const app = getApp();
Page({
  data: {
    navbarActiveIndex: 0,
    navbarTitle: [
      "已认证",
      "未认证",
    ],
    approveList: [],
    not_approveList: [],
  },
  onLoad() {
  },
  onShow() {
    const that = this;
    HTTP.HouseholdHouse({
      approve_status: 2
    }).then(res => {
      that.setData({
        approveList: res.
        list
      })
    })
    HTTP.HouseholdHouse({
      approve_status: 4
    }).then(res => {
      that.setData({
        not_approveList: res.
        list
      })
    })
  },
  /**
   * 点击导航栏
   */
  onNavBarTap: function (event) {
    let navbarTapIndex = event.currentTarget.dataset.navbarIndex
    this.setData({
      navbarActiveIndex: navbarTapIndex
    })
  },
  houseHoldapply() {
    wx.navigateTo({
      url: '../houseApply/index',
    })
  },
  deleteHouse(e) {
    const {
      house_id,garden_id
    } = e.currentTarget.dataset;
    wx.showModal({
      title: "提示",
      content: "是否解绑该房屋",
      success: async function (res) {
        if (res.confirm) {
          const res = await HTTP.DeleteHousehold({
            garden_id,
            house_id,
          })
          console.log(res);
        } else if (res.cancel) {
          console.log("用户点击取消")

        }
      }
    })
  }
})