detail.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import HouseApi from '../../apis/house'
  2. const app = getApp();
  3. const BASE = require('../../utils/basic');
  4. Page({
  5. data: {
  6. agent_user: {},
  7. house_id: ''
  8. },
  9. ShureAppointment(e){
  10. },
  11. onShareAppMessage: function (res) {
  12. var path ='/pages/detail/detail?house=' + this.data.house_id;
  13. var arr = this.data.imglist;
  14. var imageurl = arr[0];
  15. return {
  16. title: this.data.house.title,
  17. path: path,
  18. imageUrl: imageurl, // 分享的封面图
  19. success: function(res) {
  20. app.ShowModel('恭喜', '转发成功~');
  21. // 转发成功
  22. },
  23. fail: function(res) {
  24. app.ShowModel('网络错误', '转发失败~');
  25. // 转发失败
  26. }
  27. }
  28. },
  29. onShow:function(e){
  30. },
  31. onLoad: function (options) {
  32. const house_id = options.house_id
  33. this.setData({
  34. house_id
  35. })
  36. this.getHouseAgent(house_id)
  37. },
  38. getHouseAgent (house_id) {
  39. HouseApi.getAgentByHouseId(house_id).then(res => {
  40. if (res.data && res.data[0]) {
  41. this.setData({
  42. agent_user: res.data[0]
  43. })
  44. }
  45. })
  46. }
  47. });