weapps-plugin-jingtong-verify 1.4.3 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.js +40 -26
- package/weapps-plugin-jingtong-verify/pages/face-verify/face-verify.wxml +1 -0
- package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.js +35 -26
- package/weapps-plugin-jingtong-verify/pages/passport-verify/passport-verify.wxml +1 -0
package/README.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# SDK #
|
|
2
|
-
1.4.
|
|
2
|
+
1.4.5
|
package/package.json
CHANGED
|
@@ -434,6 +434,11 @@ Page({
|
|
|
434
434
|
console.log('存在可回填的temp数据', formDataTemp[cid_type])
|
|
435
435
|
let formData = Object.assign(formDataOld, formDataTemp[cid_type])
|
|
436
436
|
Nation = formData.nation
|
|
437
|
+
// 国外护照,回填名字
|
|
438
|
+
if (cid_type === '700') {
|
|
439
|
+
formData.sur_name_en = formData.sur_name
|
|
440
|
+
formData.first_name_en = formData.first_name
|
|
441
|
+
}
|
|
437
442
|
this.setData({
|
|
438
443
|
formData
|
|
439
444
|
})
|
|
@@ -640,7 +645,9 @@ Page({
|
|
|
640
645
|
nation,
|
|
641
646
|
nation_name,
|
|
642
647
|
sur_name,
|
|
648
|
+
sur_name_en: sur_name,
|
|
643
649
|
first_name,
|
|
650
|
+
first_name_en: first_name,
|
|
644
651
|
sex: sex ? sex : '',
|
|
645
652
|
birthday,
|
|
646
653
|
cid_expire_date,
|
|
@@ -683,39 +690,46 @@ Page({
|
|
|
683
690
|
})
|
|
684
691
|
},
|
|
685
692
|
|
|
693
|
+
// 显示自定义校验错误提示
|
|
694
|
+
showCuntomErrTip(msg) {
|
|
695
|
+
this.setData({
|
|
696
|
+
showCustomTips: true,
|
|
697
|
+
customTipsMsg: msg
|
|
698
|
+
}, () => {
|
|
699
|
+
// 3秒后关闭
|
|
700
|
+
setTimeout(() => {
|
|
701
|
+
this.setData({
|
|
702
|
+
showCustomTips: false,
|
|
703
|
+
customTipsMsg: ''
|
|
704
|
+
});
|
|
705
|
+
}, 3500);
|
|
706
|
+
})
|
|
707
|
+
},
|
|
708
|
+
|
|
686
709
|
async handleFormSubmit(e) {
|
|
687
|
-
// 自定义校验结果
|
|
688
710
|
const formValid = e.detail.validStatus
|
|
689
|
-
|
|
711
|
+
const customValid = this.data.language !== 'en' ? { valid: true, msg: '' } : this.validateFullname()
|
|
690
712
|
if (!formValid || !customValid.valid) {
|
|
691
|
-
// 如果自定义校验字段没问题,则跳过
|
|
692
|
-
if (customValid.valid) {
|
|
693
|
-
return
|
|
694
|
-
}
|
|
695
713
|
// 自定义校验字段有问题,获取表单错误列表
|
|
696
714
|
const formErrList = e.detail.value
|
|
697
|
-
//
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
} else {
|
|
702
|
-
showCustomTips = true
|
|
715
|
+
// 如果表单校验有问题,自定义校验没问题,则显示表单校验错误提示
|
|
716
|
+
if (!formValid && customValid.valid) {
|
|
717
|
+
this.showCuntomErrTip(formErrList[0].message)
|
|
718
|
+
return
|
|
703
719
|
}
|
|
704
|
-
//
|
|
705
|
-
if (
|
|
706
|
-
this.
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
});
|
|
716
|
-
}, 3500);
|
|
717
|
-
})
|
|
720
|
+
// 如果表单校验没有问题,自定义校验有问题,则显示自定义校验错误提示
|
|
721
|
+
if (formValid && !customValid.valid) {
|
|
722
|
+
this.showCuntomErrTip(customValid.msg)
|
|
723
|
+
return
|
|
724
|
+
}
|
|
725
|
+
// 如果两者都有问题,则判断显示谁
|
|
726
|
+
let lastMsg = ''
|
|
727
|
+
if (formErrList.some(i => ["id_card_number", "nation"].includes(i.name))) {
|
|
728
|
+
lastMsg = formErrList[0].message
|
|
729
|
+
} else {
|
|
730
|
+
lastMsg = customValid.msg
|
|
718
731
|
}
|
|
732
|
+
this.showCuntomErrTip(lastMsg)
|
|
719
733
|
return
|
|
720
734
|
}
|
|
721
735
|
wx.showLoading({
|
|
@@ -413,37 +413,46 @@ Page({
|
|
|
413
413
|
})
|
|
414
414
|
},
|
|
415
415
|
|
|
416
|
+
// 显示自定义校验错误提示
|
|
417
|
+
showCuntomErrTip(msg) {
|
|
418
|
+
this.setData({
|
|
419
|
+
showCustomTips: true,
|
|
420
|
+
customTipsMsg: msg
|
|
421
|
+
}, () => {
|
|
422
|
+
// 3秒后关闭
|
|
423
|
+
setTimeout(() => {
|
|
424
|
+
this.setData({
|
|
425
|
+
showCustomTips: false,
|
|
426
|
+
customTipsMsg: ''
|
|
427
|
+
});
|
|
428
|
+
}, 3500);
|
|
429
|
+
})
|
|
430
|
+
},
|
|
431
|
+
|
|
416
432
|
async handleFormSubmit(e) {
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
if (vid1.valid) {
|
|
421
|
-
return
|
|
422
|
-
}
|
|
433
|
+
const formValid = e.detail.validStatus
|
|
434
|
+
const customValid = this.validateFullname()
|
|
435
|
+
if (!e.detail.validStatus || !customValid.valid) {
|
|
423
436
|
// 自定义校验字段有问题,获取表单错误列表
|
|
424
437
|
const formErrList = e.detail.value
|
|
425
|
-
//
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
} else {
|
|
430
|
-
showCustomTips = true
|
|
438
|
+
// 如果表单校验有问题,自定义校验没问题,则显示表单校验错误提示
|
|
439
|
+
if (!formValid && customValid.valid) {
|
|
440
|
+
this.showCuntomErrTip(formErrList[0].message)
|
|
441
|
+
return
|
|
431
442
|
}
|
|
432
|
-
//
|
|
433
|
-
if (
|
|
434
|
-
this.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
});
|
|
444
|
-
}, 3500);
|
|
445
|
-
})
|
|
443
|
+
// 如果表单校验没有问题,自定义校验有问题,则显示自定义校验错误提示
|
|
444
|
+
if (formValid && !customValid.valid) {
|
|
445
|
+
this.showCuntomErrTip(customValid.msg)
|
|
446
|
+
return
|
|
447
|
+
}
|
|
448
|
+
// 如果两者都有问题,则判断显示谁
|
|
449
|
+
let lastMsg = ''
|
|
450
|
+
if (formErrList.some(i => ["id_card_number", "nation"].includes(i.name))) {
|
|
451
|
+
lastMsg = formErrList[0].message
|
|
452
|
+
} else {
|
|
453
|
+
lastMsg = customValid.msg
|
|
446
454
|
}
|
|
455
|
+
this.showCuntomErrTip(lastMsg)
|
|
447
456
|
return
|
|
448
457
|
}
|
|
449
458
|
this.setData({
|