RetrieveSuccess.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <div class="register-success">
  3. <div class="register-success-content">
  4. <img src="/register/success.png" />
  5. <div class="register-success-title">
  6. {{ L["register"]["重置成功"] }}
  7. </div>
  8. <div class="register-success-tip">
  9. <span>{{ L["register"]["重置成功"] }}</span>
  10. <span>{{ L["register"]["s内跳转到登录页"] }}</span>
  11. <span class="register-success-tip__seconds">{{ countDownM }}</span>
  12. <span>{{ L["register"]["秒"] }}</span>
  13. </div>
  14. </div>
  15. <div class="register-success-bottom">
  16. <el-button @click="goLogin">{{ L["register"]["立即登录"] }}</el-button>
  17. </div>
  18. </div>
  19. </template>
  20. <script setup>
  21. import { getCurLanguage } from "@/composables/common.js";
  22. import { useRouter } from "vue-router";
  23. const L = getCurLanguage();
  24. const router = useRouter();
  25. const countDownM = ref(6);
  26. const timeOutId = ref(""); //定时器的返回值
  27. const goLogin = () => {
  28. router.replace({
  29. path: "/login",
  30. });
  31. };
  32. //倒计时
  33. const countDown = () => {
  34. countDownM.value--;
  35. if (countDownM.value == 0) {
  36. clearTimeout(timeOutId.value);
  37. goLogin()
  38. } else {
  39. timeOutId.value = setTimeout(countDown, 1000);
  40. }
  41. };
  42. countDown();
  43. </script>
  44. <style lang="scss" scoped>
  45. .register-success {
  46. display: flex;
  47. flex-direction: column;
  48. justify-content: center;
  49. align-items: center;
  50. height: 100%;
  51. padding: 0 20px;
  52. &-content {
  53. display: flex;
  54. flex-direction: column;
  55. justify-content: center;
  56. align-items: center;
  57. width: 431px;
  58. height: 268px;
  59. margin-bottom: 100px;
  60. }
  61. img {
  62. width: 88px;
  63. height: 88px;
  64. }
  65. &-title {
  66. font-weight: bold;
  67. font-size: 32px;
  68. color: #282e30;
  69. margin: 30px 0 20px 0;
  70. }
  71. &-tip {
  72. width: 80%;
  73. font-weight: 400;
  74. font-size: 14px;
  75. color: rgba(40, 46, 48, 0.6);
  76. text-align: center;
  77. &__seconds {
  78. color: $colorMain
  79. }
  80. }
  81. &-bottom {
  82. width: 100%;
  83. :deep(.el-button) {
  84. width: 100%;
  85. height: 46px;
  86. background-color: $colorMain;
  87. font-weight: bold;
  88. font-size: 20px;
  89. color: #ffffff;
  90. // margin-top: 100px;
  91. }
  92. }
  93. }
  94. </style>