detail-intro.js 642 B

12345678910111213141516171819202122232425262728293031323334
  1. import HouseApi from '../../../apis/house'
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. house_id: String
  8. },
  9. data: {
  10. intros: []
  11. },
  12. ready () {
  13. this.getHouseDetail(this.properties.house_id)
  14. },
  15. methods: {
  16. getHouseDetail(house_id){
  17. wx.showLoading({
  18. title: '加载数据中'
  19. })
  20. HouseApi.houseDetail(house_id).then(res => {
  21. let house = res.data
  22. if (house.remarks) {
  23. this.setData({
  24. intros: JSON.parse(house.remarks)
  25. })
  26. }
  27. wx.hideLoading()
  28. }).catch(err => {
  29. wx.hideLoading()
  30. })
  31. },
  32. }
  33. })