<template>
  <cr-dialog
    v-model="isDelPopup"
    confirm-button-text="删除"
    :show-cancel-button="true"
    cancel-button-text="再想想"
    confirm-button-color="#999999"
    cancel-button-color="#ec1500"
    @onCancel="close"
    @onConfirm="confirm"
  >
    <div class="content">
      确定要删除这些商品吗？
    </div>
  </cr-dialog>
</template>
<script>
import { mapActions } from '../shopCartModules';
export default {
  name: 'GoodDel',
  props: {
    show: {
      type: Boolean,
      default() {
        return false;
      }
    }
  },
  data() {
    return {
      isDelPopup: false
    };
  },
  watch: {
    show: function(val) {
      this.isDelPopup = val;
    }
  },
  methods: {
    ...mapActions({
      delCartGood: 'del_cart_good'
    }),
    close() {
      this.$emit('close');
    },
    confirm() {
      this.$emit('close');
      this.delCartGood();
    }
  }
};
</script>
<style lang="less" scoped>
::v-deep .cr-dialog__message--has-msgSlot {
  padding: 0.64rem !important;
}
</style>
