order-item.js 579 Bytes
Component({
  properties: {
    item: {
      type: Object,
      value: {},
      observer: '_itemChange'
    },
    index: {
      type: Number,
      value: 0
    },
    frame: {
      type: Boolean,
      value: false
    }
  },
  methods: {
    _itemChange(item) {
      if (item && item.real_pay_price && item.sales_price > item.real_pay_price) {
        item.mark_price = item.sales_price;
        item.sales_price = item.real_pay_price;

        this.setData({item});
      }
    },
    itemTapped() {
      this.triggerEvent('itemTapped', this.data.item);
    }
  }
});