manager.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import HTTP from "../../../../requestFn/Api"
  2. const app = getApp();
  3. Page({
  4. data: {
  5. garden_id: null,
  6. house_id: null,
  7. manager_list: []
  8. },
  9. onLoad(options) {
  10. const {
  11. garden_id,
  12. house_id
  13. } = app.globalData;
  14. if (garden_id && house_id) {
  15. this.setData({
  16. garden_id,
  17. house_id
  18. })
  19. }
  20. this.getManager();
  21. },
  22. async getManager() {
  23. wx.showNavigationBarLoading()
  24. //loading 提示框
  25. wx.showLoading({
  26. title: 'Loading...',
  27. })
  28. const {
  29. garden_id,
  30. house_id
  31. } = this.data;
  32. const res = await HTTP.GetBuildManger({
  33. garden_id,
  34. house_id
  35. });
  36. this.setData({
  37. manager_list: res.list
  38. })
  39. setTimeout(function () {
  40. wx.hideLoading();
  41. wx.hideNavigationBarLoading();
  42. //停止下拉刷新
  43. wx.stopPullDownRefresh();
  44. }, 1000)
  45. },
  46. callphone(e) {
  47. const {
  48. phone
  49. } = e.currentTarget.dataset;
  50. wx.makePhoneCall({
  51. phoneNumber: phone,
  52. })
  53. },
  54. onPullDownRefresh: function () {
  55. this.getManager();
  56. },
  57. })