// packageA/mycomponent/coupon_item/coupon_item.js
// var app = getApp();
Component({
  /**
	 * 组件的属性列表
	 */
  properties: {
    item: {
      type: Object,
      value: {}
    },
    bottomIndex: {
      type: Number,
      value: 0
    },
    ind: {
      type: null
    },
    inds: {
      type: null
    },
    combine:{
      type:null,
    }
  },
  /**
	 * 组件的初始数据
	 */
  data: {
    colors: ['#fbbd5c', '#ff8383', '#a291ff', '#f095ed', '#6dccf8', '#fb946c', '#cecece'],
  },
  lifetimes: {
    attached() {
      let language = wx.getStorageSync('langIndex');
      this.setData({
        'language': language.en
      });
    },
  },
  /**
	 * 组件的方法列表
	 */
  methods: {
    tapGo(e){
      // let info = JSON.stringify(e.currentTarget.dataset.info);
      let info = e.currentTarget.dataset.info;
      // let mun;
      console.log();
      if(info.num){
        console.log(info);
        wx.navigateTo({
          url: '/packageA/member/coupon_v2_detail/coupon_v2_detail?info='+JSON.stringify(info)+'&combine='+this.data.combine,
        });
      }else{
        info.num = '1';
        wx.navigateTo({
          url: '/packageA/member/coupon_v2_detail/coupon_v2_detail?info='+JSON.stringify(info)+'&combine='+this.data.combine,
        });
      }
			
    },
    setBottonIndex(e){
      let tapind = e.currentTarget.dataset.index;
      this.triggerEvent('showButton',tapind);
    },
    goBuyOnce(e){
      console.log(e);
      let info ={};
      info.item = e.currentTarget.dataset.item;
      info.ind = e.currentTarget.dataset.ind;
			
      this.triggerEvent('goBuyOnce',info);
    },
    presenterOnce(e){
      let info ={};
      info.item = e.currentTarget.dataset.item;
      info.ind = e.currentTarget.dataset.ind;
			
      this.triggerEvent('presenterOnce',info);
    },
    delteteItem(e){
      console.log(e);
      let item = e.currentTarget.dataset.item;
      let ind = e.currentTarget.dataset.ind;
      this.triggerEvent('delteteItem',{item,ind});
    }
  },
	

});