修改人机验证样式和验证成功逻辑
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
background: #F2F3F7;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: 0 0.3466666667rem;
|
||||
padding: 0.2666666667rem 0.3466666667rem;
|
||||
}
|
||||
.header .txt {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
@@ -20,27 +20,28 @@ body {
|
||||
.header .name {
|
||||
color: #FF8C03;
|
||||
font-size: 0.5333333333rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 3.2rem);
|
||||
grid-gap: 5px;
|
||||
grid-template-columns: repeat(3, 2.6666666667rem);
|
||||
grid-gap: 0.2666666667rem;
|
||||
padding: 0 0.3466666667rem;
|
||||
}
|
||||
.content .image-container {
|
||||
position: relative;
|
||||
}
|
||||
.content .image-container img {
|
||||
width: 2.2933333333rem;
|
||||
height: 2.2933333333rem;
|
||||
width: 2.8rem;
|
||||
height: 2.8rem;
|
||||
border-radius: 0.1066666667rem;
|
||||
transition: filter 0.2s ease;
|
||||
}
|
||||
.content .image-container .checkmark {
|
||||
position: absolute;
|
||||
bottom: 0.24rem;
|
||||
right: 1.0666666667rem;
|
||||
right: 0.1333333333rem;
|
||||
width: 0.4266666667rem;
|
||||
height: 0.4266666667rem;
|
||||
background-image: url("../images/yes.png");
|
||||
|
@@ -5,12 +5,12 @@
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
background: #FFFFFF;
|
||||
background: #F2F3F7;
|
||||
// padding: px2rem(26);
|
||||
}
|
||||
|
||||
.header {
|
||||
padding:0 px2rem(26);
|
||||
padding:px2rem(20) px2rem(26);
|
||||
.txt {
|
||||
font-family: PingFang SC, PingFang SC;
|
||||
font-weight: 500;
|
||||
@@ -25,21 +25,21 @@ body {
|
||||
.name {
|
||||
color: #FF8C03;
|
||||
font-size: px2rem(40);
|
||||
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, px2rem(240));
|
||||
grid-gap: 5px;
|
||||
grid-template-columns: repeat(3, px2rem(200));
|
||||
grid-gap: px2rem(20);
|
||||
padding: 0 px2rem(26);
|
||||
.image-container {
|
||||
position: relative;
|
||||
|
||||
img {
|
||||
width: px2rem(172);
|
||||
height: px2rem(172);
|
||||
width: px2rem(210);
|
||||
height: px2rem(210);
|
||||
border-radius: px2rem(8);
|
||||
transition: filter 0.2s ease; // 添加过渡效果
|
||||
}
|
||||
@@ -47,7 +47,7 @@ body {
|
||||
.checkmark {
|
||||
position: absolute;
|
||||
bottom: px2rem(18);
|
||||
right: px2rem(80);
|
||||
right: px2rem(10);
|
||||
width: px2rem(32);
|
||||
height: px2rem(32);
|
||||
background-image: url('../images/yes.png'); // 替换为你的选中标记图标路径
|
||||
|
@@ -138,7 +138,7 @@ $(document).on('click', '.content .image-container img', function () {
|
||||
|
||||
|
||||
});
|
||||
let verificationResult = false;
|
||||
// let verificationResult = false;
|
||||
// 验证逻辑
|
||||
$('.bottom .right_bottom').click(function () {
|
||||
const targetImageName =imgOption[randomImageSetIndex].name;
|
||||
@@ -153,10 +153,18 @@ $('.bottom .right_bottom').click(function () {
|
||||
|
||||
if (selectedTargetImageCount === targetImageCount && onlyTargetImagesSelected) {
|
||||
toastMsg(langReplace(localLang.demoModule.text6));
|
||||
verificationResult = true
|
||||
// verificationResult = true
|
||||
// 告知客户端
|
||||
if (browser.app) {
|
||||
if (browser.android) {
|
||||
window.androidJsObj.closeToVerify(true);
|
||||
} else if (browser.ios) {
|
||||
window.webkit.messageHandlers.closeToVerify.postMessage(true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
toastMsg(langReplace(localLang.demoModule.text5));
|
||||
verificationResult = false;
|
||||
// verificationResult = false;
|
||||
randomImages = []
|
||||
selectedImages = [];
|
||||
randomImageSetIndex = ''
|
||||
@@ -165,14 +173,7 @@ $('.bottom .right_bottom').click(function () {
|
||||
renderImgOption();
|
||||
},500)
|
||||
}
|
||||
// 告知客户端
|
||||
if (browser.app) {
|
||||
if (browser.android) {
|
||||
window.androidJsObj.closeToVerify(verificationResult);
|
||||
} else if (browser.ios) {
|
||||
window.webkit.messageHandlers.closeToVerify.postMessage(verificationResult);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
var imgOption = [
|
||||
{ img: './images/hudie.png', name: '蝴蝶' },
|
||||
|
Reference in New Issue
Block a user