order.vue 1.37 KB
<template>
  <div class="orders">
    <div
      v-for="(value, key) in getOrderNums"
      :key="key"
      @click="goPage(value.page)"
      class="order-cell"
    >
      <p class="order-num">{{ value.num }}</p>
      <p class="order-text">{{ value.name }}</p>
    </div>
  </div>
</template>

<script>
import { createNamespacedHelpers } from "vuex";
import { ownType } from "constants/order-constants";

const { mapGetters, mapActions } = createNamespacedHelpers("home/mine");

export default {
  name: "order",
  props: {},
  data() {
    return {};
  },
  computed: {
    ...mapGetters(["getOrderNums"])
  },
  mounted() {},
  methods: {
    goPage({ name, status }) {
      this.$router.push({
        name,
        params: {
          owner: ownType.SELL,
          status,
          isRefetch: true
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.orders {
  display: flex;
  height: 100px;
  justify-content: space-between;
}

.order-cell {
  flex: 1;
  justify-content: center;
  align-items: center;

  &:not(:last-child) {
    position: relative;

    &:after {
      content: "";
      position: absolute;
      width: 1px;
      height: 40px;
      top: 20px;
      right: 0;
      background: #e0e0e0;
    }
  }
}

.order-num {
  font-size: 32px;
  text-align: center;
  @include num;
}

.order-text {
  font-size: 24;
  color: #444;
  text-align: center;
}
</style>