diff --git a/WebRoot/html/ypzs/view/apply.html b/WebRoot/html/ypzs/view/apply.html
index 3b5dbc8..4628509 100644
--- a/WebRoot/html/ypzs/view/apply.html
+++ b/WebRoot/html/ypzs/view/apply.html
@@ -29,14 +29,14 @@
-
+
@@ -97,23 +97,79 @@
, layer = layui.layer;
+ var stageId = -1;
+
+
//拖拽上传
upload.render({
- elem: '#uploadImg'
- , url: 'https://httpbin.org/post' //此处用的是第三方的 http 请求演示,实际使用时改成您自己的上传接口即可。
+ elem: "#uploadImg"
+ , url: "/FengHuang/yp/uploadPic"
, done: function (res) {
console.log(res);
layer.msg('上传成功');
- layui.$('#uploadView').removeClass('layui-hide').find('img').attr('src', res.files.file);
+ layui.$('#uploadView').removeClass('layui-hide').find('img').attr('src', res.files.file);
}
});
form.on('submit(save-apply)', function (data) {
- window.location="./success.html";
+ if (stageId == -1) {
+ layer.msg("身份证输入有误,请重新输入!", {
+ icon: 2,
+ time: 2500
+ });
+ }
+ // window.location = "./success.html";
+ });
+
+ $('#idcard').blur(function () {
+ if (stageId != -1) {
+ $.ajax({
+ type: "GET",
+ dataType: "json",
+ url: "/FengHuang/yp/evalBx?sfzh=" + $('#idcard').val(),
+ success: function (res) {
+ if (res.bx_id > 0) {
+ $("#stageTag").html(res.bx_name);
+ stageId = res.bx_id;
+ }
+ else {
+ stageId = -1;
+ layer.msg(res.bx_name);
+ }
+ }
+ });
+ }
});
+
+ $('#idcard').bind('input propertychange', function () {
+ if ($(this).val().length == 18) {
+ $.ajax({
+ type: "GET",
+ dataType: "json",
+ url: "/FengHuang/yp/evalBx?sfzh=" + $(this).val(),
+ success: function (res) {
+ if (res.bx_id > 0) {
+ $("#stageTag").html(res.bx_name);
+ stageId = res.bx_id;
+ }
+ else {
+ stageId = -1;
+ layer.msg(res.bx_name);
+ }
+ }
+ });
+ }
+ if ($(this).val().length == 0) {
+ stageId = -1;
+ $("#stageTag").html("输入身份证号后自动识别");
+ }
+ });
+
+
+
});