Bottom.js 576 Bytes
// packageMine/pages/order/index/components/bottom/bottom.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    item: {
      type: Object,
      value: {},
      observer: function (v) {
        this.compute(v);
      },
    },
  },

  /**
   * 组件的方法列表
   */
  methods: {
    compute(item) {
      let { applyQty, sellQty, redeemPoints, freightAmount = 0 } = item;
      const total = sellQty || applyQty || 0;
      let sum = redeemPoints * total + +freightAmount;
      this.setData({
        sum,
        total,
      });
    },
  },
});