houseItem.js 958 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. const util = require('../../utils/util.js');
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. data:{
  8. type:Object,
  9. value:null,
  10. observer: function(newVal, oldVal, changedPath) {
  11. var that = this;
  12. const {textTag} = newVal
  13. for(var i = 0,n = textTag.length; i < n; i ++) {
  14. var obj = textTag[i];
  15. obj.bgColor = util.colorToRgba(obj.bgColor);
  16. obj.color = util.colorToRgba(obj.color);
  17. textTag[i] = obj;
  18. }
  19. newVal.textTag = textTag;
  20. that.setData({
  21. data:newVal
  22. });
  23. }
  24. }
  25. },
  26. /**
  27. * 组件的初始数据
  28. */
  29. data: {
  30. },
  31. /**
  32. * 组件的方法列表
  33. */
  34. methods: {
  35. tapItemAction() {
  36. const id = this.properties.data.id;
  37. this.triggerEvent('action',{
  38. id:id
  39. });
  40. wx.navigateTo({
  41. url: `/pages/houseDetail/houseDetail?id=${id}`
  42. });
  43. },
  44. }
  45. })