<template>
  <div class="flex order-item u-m-b-14 relative">
    <div class="flex u-col-center">
      <div class="img">
        <div class="isSeatFee img u-line-1 u-flex u-col-center u-row-center">
          <span>{{ name }}</span>
        </div>
      </div>
    </div>
    <div style="width: 10px"></div>
    <div class="flex">
      <div class="order-number-box u-font-12">
        <div class="">X{{ number }}</div>
      </div>

      <div class="color-333 total-price">
        <div>￥{{ to2(price) }}</div>
      </div>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  name: {
    type: String,
    default: "",
  },
  number: {
    type: Number,
    default: 0,
  },
  price: {
    type: Number,
    default: 0,
  },
});
function to2(n) {
  return n.toFixed(2);
}
</script>
<style lang="scss" scoped>
.isSeatFee {
  background: #3f9eff;
  color: #fff;
  font-size: 12px;
}

.flex.order-item {
  padding: 4px;
  border-radius: 2px;
  display: flex;
  overflow: visible;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(0, 0, 0, 0);
  transition: all 0.3s;

  .status-box {
    width: 18px;
    position: absolute;
    top: 4px;
    right: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;

    > span {
      display: block;
      width: 18px;
      height: 18px;
      border-radius: 4px 0 4px 0;
      font-size: 12px;
      line-height: 17px;
      text-align: center;
      color: #fff;
    }
  }

  .isWaitCall {
    background: #d3adf7;
  }

  .pack {
    background: #35ac6a;
    .number {
      background: #f56c6c;
      color: #fff;
      position: absolute;
      left: -7px;
      top: -7px;
      width: 14px;
      height: 14px;
      text-align: center;
      border-radius: 50%;
    }
  }

  .da {
    background: #35ac6a;
  }

  .tui {
    background: #ac4735;
  }

  &.active {
    background-color: rgba(0, 0, 0, 0.04);
  }

  .total-price {
    width: 94px;
    font-size: 16px;
    text-align: right;
  }

  .good-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 70px;

    .specSnap {
      color: #999;
      font-size: 12px;
      margin-top: 3px;
    }

    .specSnapss {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      flex-wrap: wrap;
      color: #999;
      font-size: 12px;
      margin-top: 3px;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;

      .specSnap {
        color: #999;
        font-size: 12px;
        margin-top: 3px;
      }
    }
  }

  .name {
    font-size: 13px;
    text-align: left;
    color: #212121;
    overflow: hidden;
    line-height: 1;
  }

  .img {
    width: 59px;
    height: 59px;
    position: relative;
    margin-right: 10px;

    img {
      width: 59px;
      height: 59px;
    }
  }
}

.note {
  max-width: 70%;
  font-size: 12px;
  font-weight: 400;
  text-align: left;
  color: #999;
  margin-top: 5px;
  word-break: break-all;
}

.order-number-box {
  position: relative;

  .absolute {
    width: 60px;
    height: 40px;
    right: -38px;
    top: -14px;
    position: absolute;

    .order-input-number {
      position: absolute;
      right: -6px;
      top: 0;
      justify-content: center;
      align-items: center;
      display: none;
      background-color: #fff;
      border: 1px solid #e4e7ed;
      border-radius: 4px;
      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
      padding: 9px 6px;
      background-color: #fff;
      height: 40px;
    }

    &:hover .order-input-number {
      display: flex;
    }
  }
}

.good_info_discount {
  height: 16px;
  padding: 0 3px;
  color: #ff3f3f;
  background-color: rgba(255, 63, 63, 0.1);
  border-radius: 2px;
  margin-left: 6px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

:deep(.order-input-number .el-input__inner::-webkit-inner-spin-button) {
  -webkit-appearance: none;
  margin: 0;
}

:deep(.order-input-number .el-input__inner::-webkit-outer-spin-button) {
  -webkit-appearance: none;
  margin: 0;
}
</style>