<template>
  <div class="max-w1280">
    <div class="layer cart-order-confirm">
      <div class="order_success">
        <img src="@/assets/img/icon/success.png">
        <h3>订单支付成功</h3>
        <p class="one" style="display:block;text-align:center">我们将尽快为您发货，收货期间请保持手机畅通</p>
        <p class="success">
          订单号：<i>{{params.tradeNo}}</i><br>
          支付方式：<i>支付宝</i><br>
          支付金额：<i class="err">¥{{params.totalFee}}</i>
        </p>
        <div class="btn">
          <NuxtLink :to="{path:'/search',query:{key:'',pageNum:1,pageSize:20}}" class="submit">继续购物</NuxtLink>
          <NuxtLink to="/home/order/list" class="back">查看订单</NuxtLink>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { Search } from "@element-plus/icons-vue";
import empty from "@/assets/img/empty.svg";
import { showLoadingToast, closeToast } from "vant";
let pageTitle: any = ref("HOTKING-购物车");
useHead(() => ({
  title: pageTitle.value,
}));
import { useAll } from "~/api/pubAll/service";
const { delCartGood, updateCart } = useAll();
const route = useRoute();
let params: any = ref({
  tradeNo: "",
  totalFee: "",
});
onMounted(() => {
  params.value.tradeNo = route.query.no;
  let m: any = route.query.m;
  if (m) {
    params.value.totalFee = m?.replace("_", ".");
  }
});
</script>
<style scoped lang="scss">
.max-w1280 {
  background-color: #f7f7f7;
}
.cart-order-confirm {
  background: #fff;
  min-height: calc(100vh - 44px);
}
.order_success {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  h3 {
    font-size: 18px;
    color: #1e1f30;
    letter-spacing: 1.42px;
    padding: 25px 0 11px 0;
  }

  p {
    display: inline-block;
    font-size: 12px;
    color: #9fafbc;
    text-align: left;
    line-height: 22px;

    &.success {
      display: block;
    }

    i {
      font-size: 14px;
      color: #1e1f30;
      font-weight: bold;
      font-style: normal;

      &.err {
        color: #e0212f;
      }
    }

    a {
      font-weight: bold;
      margin: 0 5px;
    }

    .one {
      font-size: 12px;
      color: #1e1f30;
      letter-spacing: 0.95px;
      margin-bottom: 12px;
    }

    &.one {
      span {
        color: #0067ed;
        cursor: pointer;
      }
    }
  }

  .btn {
    padding-top: 20px;
    padding-bottom: 20px;

    a {
      display: inline-block;
      width: 120px;
      height: 40px;
      line-height: 40px;
      color: #0067ed;
      border: 1px solid #0067ed;
      background: #fff;
      border-radius: 4px;
      font-size: 12px;

      &.back {
        background: #0067ed;
        color: #ffffff;
        margin-left: 55px;

        &:hover {
          background: #0560d6;
        }
      }

      &.erro {
        color: #fff;
      }
    }
  }
}
</style>