// packageE/community_solitaire/components/yz_cartList/yz_cartList.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    show: {
      value: false,
      type: Boolean,
    },
    cardata: {
      value: [],
      type: Array,
    },
  },
  options: {
    multipleSlots: true,
  },

  /**
   * 组件的初始数据
   */
  data: {},

  /**
   * 组件的方法列表
   */
  methods: {
    popupcartListbtn() {
      this.triggerEvent("popupcartListbtn", { clicktype: 0 });
    },
    reduceCartNum(evt) {
      let item = evt.currentTarget.dataset.item;
      this.triggerEvent("reduceCart", item);
    },
    addCartNum(evt) {
      let item = evt.currentTarget.dataset.item;
      this.triggerEvent("addCart", item);
    },
    updateCartNum(evt) {
      let item = evt.target.dataset.item;
      item.total = evt.detail.value;
      if (evt.detail.value == "" || evt.detail.value == 0) {
        item.total = 0;
      }
      this.triggerEvent("cartInputBlur", item);
    },
  },
});
