var os = getApp().globalData.setting;
Component({
  properties: {
    object: {
      type: Object,
      value: null
    },
    qy_data:{
      type: Object,
      value: null
    },
    b_gift:{
       type: Object,
       value: null
    },
  },
  data: {
    iurl:os.imghost,
    qy_list:[]
  },
  methods: {

      //
      clike_banne: function () {
          var th = this;
          var actId = th.properties.b_gift.actId;
          var giftbagid = th.properties.b_gift.giftbagid;

          if (actId != "" && giftbagid != "") {
              getApp().goto("/packageF/pages/giftpack/birthdaygift/birthdaygift?actId=" + actId + "&gifbagid=" + giftbagid + "&orderType=" + 3);
          } else {
              getApp().showWarning("请稍后重试");
          }
      },

      //--跳转到权益页面--
      go_qy: function () {
          if (!getApp().globalData.userInfo) return false;
          var url = "/packageG/pages/user/userqy/userqy";
          getApp().goto(url);
      },
  },
  observers: {
    // 监听 num1 和 num2 数据的变化
    'qy_data': function(obj){
        console.log(1111);
        console.log(obj);
        if(obj){
            //4个4个一组
            let arr = new Array();
            let ater=this.properties.object.show_num;
            let arr_data=  this.properties.qy_data.old_qy_list
            for (let i = 0; i < arr_data.length; i += ater) {
              arr.push(arr_data.slice(i, i + ater));
            }
            this.setData({qy_list:arr})
        }
    }
  },

})