home-hot-category.js 656 Bytes
Component({
  properties: {
    data: {
      type: Array,
      value: {}
    },
  },
  data: {
    itemWidth: 93,
    imageHeight: 103,
  },
  attached: function () {
      try {
        let systemInfo = tt.getSystemInfoSync();
        let windowWidth = systemInfo.windowWidth;
        let itemWidth = (windowWidth - 3)/4;
        let imageHeight = (windowWidth - 3)/4 + 10;
        this.setData({
          itemWidth,
          imageHeight,
        })

      } catch(e) {
        console.log("home-hot-category error: " + e.message)
      }
    },
  methods: {
    jumpByRule: function(event) {
      this.triggerEvent('jumpByRule', event);
    }
  }
})