Component({
  properties: {
    member_order: {
      type: null
    },
    Order: {
      type: null
    },
    Params: {
      type: null
    }
  },
  data: {
    groups_order: {}
  }, // 私有数据，可用于模板渲染

  lifetimes: {
    // 生命周期函数，可以为函数，或一个在methods段中定义的方法名
    attached() {
      if (this.data.member_order && this.data.member_order.fight_groups_order) {
        this.data.member_order.fight_groups_order.forEach(item => {
          if (item.status == 0) {
            this.setData({
              'groups_order.waitPay': item.total
            });
          } else if (item.status == 1) {
            this.setData({
              'groups_order.waitSure': item.total
            });
          } else if (item.status == 2) {
            this.setData({
              'groups_order.waitEnter': item.total
            });
          } else if (item.status == 11) {
            this.setData({
              'groups_order.waitCheckOut': item.total
            });
          }
        });
      }
    },
    moved() {},
    detached() {},
  },

  // 生命周期函数，可以为函数，或一个在methods段中定义的方法名
  attached() {

  }, // 此处attached的声明会被lifetimes字段中的声明覆盖
  ready() {

  },

  pageLifetimes: {
    // 组件所在页面的生命周期函数
    show() {},
    hide() {},
    resize() {},
  },

  methods: {
    gohotelOrderlist(e) {
      let status = e.currentTarget.dataset.status;
      let ordertype = e.currentTarget.dataset.ordertype;
      if(status == 5){
        wx.navigateTo({
          url: '/packageD/member/myOrder/Aftersaleslist/Aftersaleslist?orderType='+ ordertype
        });
        return;
      }
      wx.navigateTo({
        url: '/packageA/member/myOrder_v2/myOrder_v2?status=' + status + '&orderType=' + ordertype
      });
    },
  }
});
