sell-pay-ok.vue 2.09 KB
<template>
  <LayoutApp :show-back="true" title="上架成功">
    <div class="body">
      <div class="header">
        <i class="iconfont iconOk icon-class"></i>
      </div>
      <div class="title">上架成功</div>

      <ProductInfo class="product-info" :data="product"></ProductInfo>

      <YohoButton :txt="txt" class="btn-class" @click="onClick"></YohoButton>

      <div class="info">
        <div class="item" @click="goPublish">继续发布</div>
        <div class="item" @click="goHome">随便逛逛</div>
      </div>
    </div>
  </LayoutApp>
</template>

<script>

import ProductInfo from './components/confirm/buyer-product';

import { createNamespacedHelpers } from 'vuex';

const { mapActions: mapOrderAction } = createNamespacedHelpers('order/orderConfirm');

export default {
  name: 'SellPayOk',
  props: ['orderCode'],
  data() {
    return {
      txt: '查看商品',
      product: {}
    };
  },
  components: {
    ProductInfo
  },
  mounted() {
    if (this.orderCode) {
      this.fetchOrderGoods({ orderCode: this.orderCode }).then(result => {
        this.product = result.data;
      });
    }
  },
  methods: {
    ...mapOrderAction(['fetchOrderGoods']),
    onClick() {
      this.$router.replace({
        name: 'ProductDetail',
        params: {
          productId: this.product.productId
        }
      });
    },
    goPublish() {
      this.onClick();
    },
    goHome() {
      this.$router.replace({
        name: 'ChannelPage'
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.body {
  height: 100%;
  margin: 0 32px;
  padding-bottom: 140px;
  overflow-y: auto;
}

.header {
  margin-top: 80px;
  text-align: center;
}

.icon-class {
  font-size: 120px;
}

.btn-class {
  height: 100px;
  font-size: 32px;
  line-height: 100px;
}

.title {
  font-size: 40px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 60px;
}

.product-info {
  margin-top: 140px;
  margin-bottom: 74px;
}

.info {
  font-size: 28px;
  display: flex;
  margin-top: 30px;

  .item {
    width: 50%;
    text-align: center;
  }

  .item + .item {
    border-left: 1px solid black;
  }
}

</style>