detail.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. },
  37. getHouseAgent (house_id) {
  38. HouseApi.getAgentByHouseId(house_id).then(res => {
  39. if (res.data && res.data[0]) {
  40. this.setData({
  41. agent_user: res.data[0]
  42. })
  43. }
  44. })
  45. }
  46. });