|
@@ -7,6 +7,7 @@ import Img04 from './image/verification-img-4.png'
|
|
|
import { ref } from 'vue'
|
|
import { ref } from 'vue'
|
|
|
//引入'vue3-puzzle-vcode'插件
|
|
//引入'vue3-puzzle-vcode'插件
|
|
|
import Vcode from './components/SliderVerification.vue'
|
|
import Vcode from './components/SliderVerification.vue'
|
|
|
|
|
+// import Vcode from 'vue3-puzzle-vcode'
|
|
|
|
|
|
|
|
const openDialog = () => {
|
|
const openDialog = () => {
|
|
|
isShow.value = true
|
|
isShow.value = true
|
|
@@ -34,7 +35,7 @@ const addTipsNode = () => {
|
|
|
const childNode = document.createElement('div')
|
|
const childNode = document.createElement('div')
|
|
|
childNode.className = 'tips'
|
|
childNode.className = 'tips'
|
|
|
childNode.innerHTML = `
|
|
childNode.innerHTML = `
|
|
|
- <div style="margin-bottom: 15px; text-align: right;">
|
|
|
|
|
|
|
+ <div style="margin-bottom: 5px; text-align: right;">
|
|
|
<span class="font_family icon-icon_reject_b close-icon" style="margin-right: -20px;">
|
|
<span class="font_family icon-icon_reject_b close-icon" style="margin-right: -20px;">
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
@@ -54,6 +55,7 @@ const addTipsNode = () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const closeDialog = () => {
|
|
const closeDialog = () => {
|
|
|
|
|
+ isShow.value = false
|
|
|
emit('close')
|
|
emit('close')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -90,7 +92,7 @@ const addSliderBtnNode = (state: string) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const isShow = ref(false)
|
|
|
|
|
|
|
+const isShow = ref(true)
|
|
|
|
|
|
|
|
// 根据不同的状态,设置已滑动区域的背景颜色
|
|
// 根据不同的状态,设置已滑动区域的背景颜色
|
|
|
const updateSliderBackground = (state: string) => {
|
|
const updateSliderBackground = (state: string) => {
|
|
@@ -131,6 +133,7 @@ const onSuccess = () => {
|
|
|
}
|
|
}
|
|
|
const close = () => {
|
|
const close = () => {
|
|
|
isShow.value = true
|
|
isShow.value = true
|
|
|
|
|
+ emit('close')
|
|
|
}
|
|
}
|
|
|
const fail = () => {
|
|
const fail = () => {
|
|
|
updateSliderBackground('error')
|
|
updateSliderBackground('error')
|
|
@@ -146,24 +149,26 @@ defineExpose({
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
|
<template>
|
|
<template>
|
|
|
- <Vcode
|
|
|
|
|
- :show="isShow"
|
|
|
|
|
- @close="close"
|
|
|
|
|
- @fail="fail"
|
|
|
|
|
- :canvasWidth="320"
|
|
|
|
|
- :canvasHeight="180"
|
|
|
|
|
- sliderText="Swipe to verify"
|
|
|
|
|
- :sliderSize="38"
|
|
|
|
|
- successText="Verification successful"
|
|
|
|
|
- failText="Verification failed"
|
|
|
|
|
- :range="5"
|
|
|
|
|
- :imgs="[Img01, Img02, Img03, Img04]"
|
|
|
|
|
- ></Vcode>
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <Vcode
|
|
|
|
|
+ :show="isShow"
|
|
|
|
|
+ @close="close"
|
|
|
|
|
+ @fail="fail"
|
|
|
|
|
+ :canvasWidth="320"
|
|
|
|
|
+ :canvasHeight="180"
|
|
|
|
|
+ sliderText="Swipe to verify"
|
|
|
|
|
+ :sliderSize="38"
|
|
|
|
|
+ successText="Verification successful"
|
|
|
|
|
+ failText="Verification failed"
|
|
|
|
|
+ :range="5"
|
|
|
|
|
+ :imgs="[Img01, Img02, Img03, Img04]"
|
|
|
|
|
+ ></Vcode>
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.slider-verification {
|
|
.slider-verification {
|
|
|
width: 400px;
|
|
width: 400px;
|
|
|
- height: 373px;
|
|
|
|
|
|
|
+ height: 365px;
|
|
|
padding: 40px;
|
|
padding: 40px;
|
|
|
.tips {
|
|
.tips {
|
|
|
text-align: center;
|
|
text-align: center;
|
|
@@ -171,88 +176,90 @@ defineExpose({
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
|
-// 整体框架
|
|
|
|
|
-.vue-auth-box_ {
|
|
|
|
|
- width: 400px;
|
|
|
|
|
- height: 373px;
|
|
|
|
|
- padding: 40px;
|
|
|
|
|
- padding-top: 20px;
|
|
|
|
|
- background-color: var(--color-slider-bg);
|
|
|
|
|
- border-radius: 16px;
|
|
|
|
|
- box-shadow: -2px 2px 12px 0 rgba(0, 0, 0, 0.5);
|
|
|
|
|
- .tips {
|
|
|
|
|
- margin-bottom: 16px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- .close-icon {
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- &:hover {
|
|
|
|
|
- color: var(--color-theme);
|
|
|
|
|
|
|
+.vue-puzzle-vcode {
|
|
|
|
|
+ // 整体框架
|
|
|
|
|
+ div.vue-auth-box_ {
|
|
|
|
|
+ width: 400px;
|
|
|
|
|
+ height: 365px;
|
|
|
|
|
+ padding: 40px;
|
|
|
|
|
+ padding-top: 16px;
|
|
|
|
|
+ background-color: var(--color-slider-bg);
|
|
|
|
|
+ border-radius: 16px;
|
|
|
|
|
+ box-shadow: -2px 2px 12px 0 rgba(0, 0, 0, 0.5);
|
|
|
|
|
+ .tips {
|
|
|
|
|
+ margin-bottom: 16px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ .close-icon {
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ &:hover {
|
|
|
|
|
+ color: var(--color-theme);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- .icon-border {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- width: 16px !important;
|
|
|
|
|
- height: 16px !important;
|
|
|
|
|
- border-radius: 50%;
|
|
|
|
|
- border: none !important;
|
|
|
|
|
- span {
|
|
|
|
|
- font-size: 14px !important;
|
|
|
|
|
|
|
+ .icon-border {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ width: 16px !important;
|
|
|
|
|
+ height: 16px !important;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ border: none !important;
|
|
|
|
|
+ span {
|
|
|
|
|
+ font-size: 14px !important;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
-div.vue-puzzle-vcode {
|
|
|
|
|
- background-color: rgba(43, 47, 54, 0.7);
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ div.vue-puzzle-vcode {
|
|
|
|
|
+ background-color: rgba(43, 47, 54, 0.7);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-.vue-auth-box_ .auth-control_ div.range-box {
|
|
|
|
|
- background-color: #87909e;
|
|
|
|
|
- box-shadow: none;
|
|
|
|
|
-}
|
|
|
|
|
-.vue-auth-box_ div.auth-body_ {
|
|
|
|
|
- border-radius: 6px;
|
|
|
|
|
-}
|
|
|
|
|
-// 已滑动区域的样式
|
|
|
|
|
-.vue-auth-box_ .auth-control_ .range-box div.range-slider {
|
|
|
|
|
- background-color: var(--color-success);
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ .vue-auth-box_ .auth-control_ div.range-box {
|
|
|
|
|
+ background-color: #87909e;
|
|
|
|
|
+ box-shadow: none;
|
|
|
|
|
+ }
|
|
|
|
|
+ .vue-auth-box_ div.auth-body_ {
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 已滑动区域的样式
|
|
|
|
|
+ .vue-auth-box_ .auth-control_ .range-box div.range-slider {
|
|
|
|
|
+ background-color: var(--color-success);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-.vue-auth-box_ .auth-body_ div.loading-box_.hide_ {
|
|
|
|
|
- display: none;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ .vue-auth-box_ .auth-body_ div.loading-box_.hide_ {
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-// 成功的提示
|
|
|
|
|
-.vue-auth-box_ .auth-body_ div.info-box_ {
|
|
|
|
|
- background: var(--color-success);
|
|
|
|
|
-}
|
|
|
|
|
-// 失败的提示
|
|
|
|
|
-.vue-auth-box_ .auth-body_ div.info-box_.fail {
|
|
|
|
|
- background: #c7353f;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ // 成功的提示
|
|
|
|
|
+ .vue-auth-box_ .auth-body_ div.info-box_ {
|
|
|
|
|
+ background: var(--color-success);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 失败的提示
|
|
|
|
|
+ .vue-auth-box_ .auth-body_ div.info-box_.fail {
|
|
|
|
|
+ background: #c7353f;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-.vue-auth-box_ .auth-control_ .range-box .range-slider {
|
|
|
|
|
- border-radius: 6px;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ .vue-auth-box_ .auth-control_ .range-box .range-slider {
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-.vue-auth-box_ .auth-control_ div.range-box {
|
|
|
|
|
- border-radius: 6px;
|
|
|
|
|
-}
|
|
|
|
|
-// 滑块
|
|
|
|
|
-.vue-auth-box_ .auth-control_ .range-box .range-slider .range-btn {
|
|
|
|
|
- border-radius: 6px;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ .vue-auth-box_ .auth-control_ div.range-box {
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 滑块
|
|
|
|
|
+ .vue-auth-box_ .auth-control_ .range-box .range-slider .range-btn {
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-.vue-auth-box_ .auth-body_ .reset_ {
|
|
|
|
|
- width: 20px;
|
|
|
|
|
- height: 20px;
|
|
|
|
|
- top: 10px;
|
|
|
|
|
- right: 10px;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ .vue-auth-box_ .auth-body_ .reset_ {
|
|
|
|
|
+ width: 20px;
|
|
|
|
|
+ height: 20px;
|
|
|
|
|
+ top: 10px;
|
|
|
|
|
+ right: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-.vue-auth-box_ .auth-control_ .range-box .range-text {
|
|
|
|
|
- color: #fff;
|
|
|
|
|
|
|
+ .vue-auth-box_ .auth-control_ .range-box .range-text {
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|