myhouse.js 695 B

123456789101112131415161718192021222324252627282930313233
  1. import HTTP from '../../../../../requestFn/Api'
  2. Page({
  3. data: {
  4. house_list: []
  5. },
  6. onShow(options) {
  7. this.getRenthouse()
  8. },
  9. async getRenthouse() {
  10. const res = await HTTP.RentHouse({
  11. is_me: true
  12. })
  13. this.setData({
  14. house_list: res.list
  15. })
  16. },
  17. addRenthouse() {
  18. wx.navigateTo({
  19. url: '../addrent/addrent',
  20. })
  21. },
  22. goDetail(e) {
  23. const {id} = e.currentTarget;
  24. const {house_list} = this.data;
  25. const [house_info] = house_list.filter(item=>item.id==id);
  26. wx.navigateTo({
  27. url: '../addrent/addrent',
  28. success: function (res) {
  29. res.eventChannel.emit('acceptDataFromOpenerPage', house_info)
  30. }
  31. })
  32. }
  33. })