success.vue 2.82 KB
<!--
 * @Date: 2022-06-29 18:18:02
 * @LastEditors: hookehuyr hookehuyr@gmail.com
 * @LastEditTime: 2024-08-02 18:44:30
 * @FilePath: /temple_material_request/src/views/success.vue
 * @Description: 文件描述
-->
<template>
  <div class="success-page">
    <div class="text-wrapper">
      <van-image
        width="15rem"
        height="10rem"
        style="vertical-align: bottom"
        :src="icon_success"
      />
      <div style="font-size: 1.5rem; color: #A67939; margin-top: 2rem;">物资申领成功</div>
    </div>
    <div style="border: 1px dashed #A67939;"></div>
    <div style="padding: 3rem 4rem;">
      <van-button plain block :color="styleColor.baseColor" style="margin-bottom: 1.5rem;" @click="goTo('activity')">回到活动主页</van-button>
      <van-button plain block :color="styleColor.baseColor" @click="goTo('home')">返回首页</van-button>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import { styleColor } from "@/constant.js";
import icon_success from "@images/que-sucess@2x.png";

import {
  Cookies,
  $,
  _,
  axios,
  storeToRefs,
  mainStore,
  Toast,
  useTitle,
} from "@/utils/generatePackage.js";
//import { } from '@/utils/generateModules.js'
//import { } from '@/utils/generateIcons.js'
//import { } from '@/composables'
const $route = useRoute();
const $router = useRouter();
useTitle($route.meta.title);

const activity_id = $route.query.activity_id ? $route.query.activity_id : '';
const form_id = $route.query.form_id ? $route.query.form_id : '';
const client_id = $route.query.client_id ? $route.query.client_id : '';

const styleObj = {
  background: styleColor.baseColor,
  border: styleColor.baseColor,
  color: "#FFFFFF",
};

onMounted(() => {
  $('body').css('backgroundColor', 'white');
});

const handle = () => {
  $router.go(-1);
};

const goTo = (type) => {
  if (type === 'home') { // 返回首页
    location.href = `../../../?p=volunteer_home&t=volunteer&c=${client_id}`;
  } else { // 返回活动主页
    location.href = `../?p=activity&form_id=${form_id}&i=${activity_id}`;
  }
}
</script>

<style lang="less" scoped>
.success-page {
  .text-wrapper {
    padding-top: 2rem;
    padding-bottom: 2rem;
    text-align: center;
    .name {
      font-size: 1.25rem;
      margin: 0.5rem;
      font-weight: bold;
    }
    .text {
      font-size: 1.05rem;
      margin: 0.5rem;
      font-weight: bold;
    }
  }
  .rich-text {
    padding: 1rem 2rem;
    white-space: pre-wrap;
    :deep(img) {
      width: 100%;
    }
  }
  .button-plain {
    width: auto;
    height: auto;
    text-align: center;
    padding: 0.6rem;
    margin: 0.5rem;
    font-size: 1rem;
    // background: @base-font-color;
    border-radius: 24px;
    // border: 1px solid @base-color;
    // color: @base-color;
    font-weight: bold;
  }
}
</style>