123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <template>
- <div class="verify-content">
- <slide-verify
- ref="block"
- v-bind="props.slideVerifyOptions"
- :slider-text="sliderText"
- @again="onAgain"
- @success="onSuccess"
- @fail="onFail"
- ></slide-verify>
- <div class="verify-content-action">
- <span class="verify-content-action__refresh" @click="refresh">
- <img src="/register/refresh.png" />
- <span>{{ L["humanMachineVerify"]["刷新"] }}</span>
- </span>
- </div>
- </div>
- </template>
- <script lang="ts" setup>
- import { ref, computed } from "vue";
- import SlideVerify from "vue3-slide-verify";
- import type { SlideVerifyInstance } from "vue3-slide-verify";
- import { getCurLanguage } from "@/composables/common.js";
- import "vue3-slide-verify/dist/style.css";
- const props = defineProps({
- slideVerifyOptions: {
- type: Object,
- default: () => {},
- },
- });
- const emits = defineEmits(["onSuccess", "onFail"]);
- const block = ref<SlideVerifyInstance>();
- const L = getCurLanguage();
- const sliderText = computed(
- () => L["humanMachineVerify"]["拖动滑块来填充拼图"]
- );
- const onSuccess = () => {
- emits("onSuccess");
- };
- const refresh = () => {
- block.value?.refresh();
- };
- const onFail = () => {
- emits("onFail");
- };
- const onAgain = () => {
- // 刷新
- block.value?.refresh();
- };
- </script>
- <style lang="scss" scoped>
- .verify-content {
- position: relative;
- height: 100%;
- :deep(.slide-verify) {
- canvas {
- border-radius: 20px;
- }
- .slide-verify-slider {
- border-radius: 25px;
- height: 50px;
- line-height: 50px;
- box-sizing: content-box;
- }
- .slide-verify-slider-mask {
- width: 50px;
- height: 50px;
- border-radius: 25px;
- background-color: $colorMain;
- border-color: transparent;
- }
- .slide-verify-slider-mask-item {
- width: 50px;
- height: 50px;
- border-radius: 100%;
- &:hover {
- background: #fff;
- .iconfont {
- color: #303030;
- }
- }
- }
- .slide-verify-slider-text {
- color: #666;
- }
- .container-success {
- .slide-verify-slider-mask-item {
- background-color: $colorMain !important;
- .iconfont {
- color: #fff;
- }
- }
- }
- }
- &-action {
- height: 30px;
- margin-top: 20px;
- &__refresh {
- display: flex;
- // justify-content: center;
- align-items: center;
- cursor: pointer;
- img {
- width: 20px;
- margin-right: 5px;
- }
- span {
- font-weight: bold;
- }
- }
- }
- }
- </style>
|