// components/parking-info/index.js
Component({
  properties: {
    // 可根据需要定义组件的属性
    occupyFee:{
      type: Object,
        value:{
          costCycle:0,
          maxFeeTime:0,
          costTimePeriod:'',
          freeTime:0,
          capping:0
        }
    }
  },
  lifetimes:{
    attached: function () {
      this.initData()
    }
  },
  data: {
    // 组件内部数据
  },
  methods: {
    // 组件的方法
    initData() {
      let occupyFee = this.data.occupyFee;

      // let costCycle = occupyFee.costCycle / occupyFee.costCycleFee;
      let capping = (Math.floor((occupyFee.maxFeeTime / occupyFee.costCycle)) * occupyFee.costCycleFee);

      // 更新数据
      this.setData({
          'occupyFee.capping': capping
      });
      console.log("this.occupyFee",this.data);
    }
  }
})