/* eslint-disable arrow-parens */
import { queryForRefundDetail } from './service';
Component({
  props: {
    componentData: {}
  },
  data: {
    loadMore: false,
    list: [],
    orderId: '',
    refundId: '',
    detailData: null
  },

  async didMount() {
    const {
      refundId = ''
    } = this.$page.data.query;

    try {
      const res = await queryForRefundDetail({
        id: refundId
      }); // 退款订单详情

      const list = res.goods;
      this.setData({
        refundId,
        list: [...list],
        detailData: res
      });
    } catch (error) {
      my.showToast({
        type: 'fail',
        content: '查询退款失败'
      });
    }
  },

  didUpdate() {},

  methods: {
    loadMoreItem() {
      this.setData({
        loadMore: true
      });
    }

  }
});