<template>
  <div>
    <el-dialog :visible.sync="joinCart" width="30%" custom-class="shop_mall">
      <div class="container">
        <div class="join_success">
          <img src="@/assets/img/shopmall/cart.png" alt>
          <h3>已成功加入购物车！</h3>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'CartDialog',
  props: {
    joinCart: {
      type: Boolean,
      default() {
        return false
      }
    }
  },
  watch: {
    joinCart(n, o) {
      if (n) {
        this.$emit('joinCartFn', false)
      }
    }
  }
}
</script>

<style scoped lang="less">
.shop_mall {
  img {
    width: 66px;
    height: 66px;
    margin-right: 10px;
  }
}
.container {
  text-align: center;
  padding-bottom: 10px;
}
.join_success {
  display: inline-block;
  text-align: center;
  padding: 15px;
  user-select: none;
  line-height: 66px;
  >h3 {
    display: inline-block;
    margin: 0;
    color: #424242;
    font-size: 24px;
    font-weight: 400;
  }
}
/deep/ .shop_mall {
  margin: 50vh auto !important;
  transform: translateY(-50%);
}
</style>
