Bladeren bron

认证调整

18838166547 1 jaar geleden
bovenliggende
commit
4a59e1bb07

+ 12 - 8
app/api/controller/MobileMember.php

@@ -2,9 +2,8 @@
 
 namespace app\api\controller;
 
-/**
- 
- * 
+use Exception;/**
+ *
  
  * 
  * ----------------------------------------------------------------------------
@@ -81,11 +80,16 @@ class MobileMember extends MobileHome
 
     public function getIdCardInfo2($memberInfo)
     {
-        $url = get_store_joinin_imageurl($memberInfo['business_licence_number_electronic']);
-        $url2 = get_store_joinin_imageurl($memberInfo['business_author_letter']);
-        $base64 = $this->getBase64($url);
-        $base642 = $this->getBase64($url2);
-        $res = $this->postAiOcr($base64,$base642);
+        try {
+            $url     = get_store_joinin_imageurl($memberInfo['business_licence_number_electronic']);
+            $url2    = get_store_joinin_imageurl($memberInfo['business_author_letter']);
+            $base64  = $this->getBase64($url);
+            $base642 = $this->getBase64($url2);
+        } catch (Exception $e) {
+            ds_json_encode(10001,'图片获取失败,请重新上传或联系管理员');
+        }
+        $res     = $this->postAiOcr($base64, $base642);
+
 
         return $res;
     }

+ 19 - 2
app/api/controller/Sellerjoinin.php

@@ -149,11 +149,28 @@ class Sellerjoinin extends MobileMember
                 ds_json_encode(10001,'请上企业授权书照片');
             }
             $res = $this->getCompanyInfo($param['business_licence_number_electronic']);
+//            if ($res['code'] == 200) {
+//                $info = $res['data'];
+//                if ($param['company_name'] != $info['company'] || $param['business_licence_number'] !== $info['reg_num']) {
+//                    ds_json_encode(10001,'您提交的企业信息或营业执照照片未通过校验,请仔细核对后提交');
+//                }
+//            } else {
+//                ds_json_encode(10001,$res['msg']);
+//            }
             if ($res['code'] == 200) {
                 $info = $res['data'];
-                if ($param['company_name'] != $info['company'] || $param['business_licence_number'] !== $info['reg_num']) {
-                    ds_json_encode(10001,'您提交的企业信息或营业执照照片未通过校验,请仔细核对后提交');
+                $info['capital'] = cn2num($info['capital'])/10000;
+                if ($info['capital'] != $param['company_registered_capital']) {
+                    ds_json_encode(10001,'填写注册资金与营业执照不匹配,请仔细核对后提交');
                 }
+                if ($info['company'] != $param['company_name']) {
+                    ds_json_encode(10001,'填写营业执照号与营业执照不匹配,请仔细核对后提交');
+                }
+                if ($info['reg_num'] != $param['business_licence_number']) {
+                    ds_json_encode(10001,'填写企业名称与营业执照不匹配,请仔细核对后提交');
+                }
+
+                ds_json_encode(10001,'您提交的企业信息或营业执照照片未通过校验,请仔细核对后提交');
             } else {
                 ds_json_encode(10001,$res['msg']);
             }

+ 43 - 0
app/common.php

@@ -21,6 +21,49 @@ function ds_validate($name)
     return new $class_name;
 }
 
+ function cn2num($string)
+{
+    if(is_numeric($string)){
+        return $string;
+    }
+    // '仟' => '千','佰' => '百','拾' => '十',
+    $string = str_replace('仟', '千', $string);
+    $string = str_replace('佰', '百', $string);
+    $string = str_replace('拾', '十', $string);
+    $num = 0;
+    $wan = explode('万', $string);
+    if (count($wan) > 1) {
+        $num += cn2num($wan[0]) * 10000;
+        $string = $wan[1];
+    }
+    $qian = explode('千', $string);
+    if (count($qian) > 1) {
+        $num += cn2num($qian[0]) * 1000;
+        $string = $qian[1];
+    }
+    $bai = explode('百', $string);
+    if (count($bai) > 1) {
+        $num += cn2num($bai[0]) * 100;
+        $string = $bai[1];
+    }
+    $shi = explode('十', $string);
+    if (count($shi) > 1) {
+        $num += cn2num($shi[0] ? $shi[0] : '一') * 10;
+        $string = $shi[1] ? $shi[1] : '零';
+    }
+    $ling = explode('零', $string);
+    if (count($ling) > 1) {
+        $string = $ling[1];
+    }
+    $d = array(
+        '一' => '1','二' => '2','三' => '3','四' => '4','五' => '5','六' => '6','七' => '7','八' => '8','九' => '9',
+        '壹' => '1','贰' => '2','叁' => '3','肆' => '4','伍' => '5','陆' => '6','柒' => '7','捌' => '8','玖' => '9',
+        '零' => 0, '0' => 0, 'O' => 0, 'o' => 0,
+        '两' => 2
+    );
+    return $num + @$d[$string];
+}
+
 function model($name, $layer = 'model')
 {
     $name = preg_replace_callback('/([-_]+([a-z]{1}))/i', function ($matches) {

+ 11 - 4
app/home/controller/BaseMember.php

@@ -6,6 +6,7 @@
 
 namespace app\home\controller;
 
+use Exception;
 use think\facade\View;
 use think\facade\Lang;
 
@@ -217,10 +218,16 @@ class BaseMember extends BaseHome
 
     public function getIdCardInfo2($memberInfo)
     {
-        $url = get_store_joinin_imageurl($memberInfo['business_licence_number_electronic']);
-        $url2 = get_store_joinin_imageurl($memberInfo['business_author_letter']);
-        $base64 = $this->getBase64($url);
-        $base642 = $this->getBase64($url2);
+        try {
+            $url = get_store_joinin_imageurl($memberInfo['business_licence_number_electronic']);
+            $url2 = get_store_joinin_imageurl($memberInfo['business_author_letter']);
+            $base64 = $this->getBase64($url);
+            $base642 = $this->getBase64($url2);
+        }
+        catch(Exception $e) {
+            $this->error('图片获取失败,请重新上传或联系管理员');
+        }
+
         $res = $this->postAiOcr($base64,$base642);
 
         return $res;

+ 5 - 0
app/home/controller/MemberAuth.php

@@ -217,6 +217,11 @@ class MemberAuth extends BaseMember
         );
     }
 
+    public function image_drop3()
+    {
+        ds_json_encode(10000);
+    }
+
     /**
      * 用户中心右边,小导航
      *

+ 20 - 6
app/home/controller/Sellerjoinin.php

@@ -142,8 +142,8 @@ class Sellerjoinin extends BaseMember
             $param['business_licence_start'] = input('post.business_licence_start');
             $param['business_licence_end'] = input('post.business_licence_end');
             $param['business_sphere'] = input('post.business_sphere');
-            $param['business_licence_number_electronic'] = $this->upload_image('business_licence_number_electronic');
-            $param['business_author_letter'] = $this->upload_image('business_author_letter');
+            $param['business_licence_number_electronic'] = $this->upload_image('business_licence_number_electronic','营业执照电子版');
+            $param['business_author_letter'] = $this->upload_image('business_author_letter','企业授权书');
 
 
             $this->step2_save_valid($param);
@@ -151,9 +151,18 @@ class Sellerjoinin extends BaseMember
             $res = $this->getCompanyInfo($param['business_licence_number_electronic']);
             if ($res['code'] == 200) {
                 $info = $res['data'];
-                if ($param['company_name'] != $info['company'] || $param['business_licence_number'] !== $info['reg_num']) {
-                    $this->error('您提交的企业信息或营业执照照片未通过校验,请仔细核对后提交');
+                $info['capital'] = cn2num($info['capital'])/10000;
+                if ($info['capital'] != $param['company_registered_capital']) {
+                    $this->error('填写注册资金与营业执照不匹配,请仔细核对后提交');
                 }
+                if ($info['company'] != $param['company_name']) {
+                    $this->error('填写营业执照号与营业执照不匹配,请仔细核对后提交');
+                }
+                if ($info['reg_num'] != $param['business_licence_number']) {
+                    $this->error('填写企业名称与营业执照不匹配,请仔细核对后提交');
+                }
+
+                $this->error('您提交的企业信息或营业执照照片未通过校验,请仔细核对后提交');
             } else {
                 $this->error($res['msg']);
             }
@@ -173,6 +182,7 @@ class Sellerjoinin extends BaseMember
         exit;
     }
 
+
     private function step2_save_valid($param)
     {
         $sellerjoinin_validate = ds_validate('sellerjoinin');
@@ -383,7 +393,7 @@ class Sellerjoinin extends BaseMember
         exit;
     }
 
-    private function upload_image($file)
+    private function upload_image($file,$name = '')
     {
         //上传文件保存路径
         $pic_name = '';
@@ -395,7 +405,11 @@ class Sellerjoinin extends BaseMember
             if ($res['code']) {
                 $pic_name = $res['data']['file_name'];
             } else {
-                $this->error($res['msg']);
+                if (!empty($name)) {
+                    $this->error($name.":".$res['msg']);
+                } else {
+                    $this->error($res['msg']);
+                }
             }
         }
         return $pic_name;

+ 99 - 27
app/home/view/default/member/sellerjoininc2c/step1.html

@@ -213,7 +213,7 @@
         <div class="joinin-concrete">
 <!-- 公司信息 -->
 
-<div id="apply_company_info" class="apply-company-info">
+<div id="apply_company_info" class="apply-company-info  dsm-default-form member_auth">
   <div class="alert">
     <h4>{$Think.lang.matters_needing_attention}:</h4>
     {$Think.lang.upload_information1}</div>
@@ -292,37 +292,41 @@
         <tr>
           <th><i>*</i>{$Think.lang.identification_photo}:</th>
             <td>
-                <div>
-                    <div class='image-wrapper'>
-                        <div class="dssc-upload-thumb">
-                            <p>
-                                <img onclick='openPhoto("img_member_idcard_image2_url")'
-                                     src="{$Think.BASE_SITE_ROOT}/static/home/images/member_idcard_image2.png"
-                                     id="img_member_idcard_image2_url"/>
-                            </p>
-<!--                            {if !in_array($member_info.member_auth_state,array(1,3))}<a-->
-<!--                                href="javascript:dropImage('member_idcard_image2')"-->
-<!--                                class="drop-btn iconfont">&#xe6e6;</a>{/if}-->
-                        </div>
-                        <div class="dsm-upload-btn">
-                            <a href="javascript:void(0);">
+                <dl>
+                    <dd>
+                        <div>
+                            <div class='image-wrapper'>
+                                <div class="dssc-upload-thumb">
+                                    <p>
+                                        <img onclick='openPhoto("img_member_idcard_image2_url")'
+                                             src="{$Think.BASE_SITE_ROOT}/static/home/images/member_idcard_image2.png"
+                                             id="img_member_idcard_image2_url"/>
+                                    </p>
+                                    <a href="javascript:dropImage3('member_idcard_image2')" class="drop-btn iconfont">&#xe6e6;</a>
+                                </div>
+                                <div class="dsm-upload-btn">
+                                    <a href="javascript:void(0);">
                                 <span><input type="file" hidefocus="true" size="1" class="input-file"
                                              name="member_idcard_image2_url" id="member_idcard_image2_url"
                                              accept="image/*"/></span>
-                                <p><i class="iconfont">&#xe733;</i>图片上传</p>
-                            </a>
+                                        <p><i class="iconfont">&#xe733;</i>图片上传</p>
+                                    </a>
+                                </div>
+                            </div>
                         </div>
-                    </div>
-                </div>
-                <span class="w400">
+                        <span class="w400">
                     <input type="text" style="width:0;opacity: 0" name="member_idcard_image2" id="member_idcard_image2"
-                           value="{$member_info.member_idcard_image2}"}>
-                </span>
+                           value="{$member_info.member_idcard_image2}" }>
+                       </span>
+                    </dd>
+                </dl>
             </td>
         </tr>
         <tr>
             <th><i>*</i>{$Think.lang.business_author_letter}:</th>
             <td>
+                <dl>
+                    <dd>
                 <div>
                     <div class='image-wrapper'>
                         <div class="dssc-upload-thumb">
@@ -331,9 +335,9 @@
                                      src="{$Think.BASE_SITE_ROOT}/static/home/images/member_idcard_image3.png"
                                      id="img_member_idcard_image3_url"/>
                             </p>
-<!--                            {if !in_array($member_info.member_auth_state,array(1,3))}<a-->
-<!--                                href="javascript:dropImage('member_idcard_image3')"-->
-<!--                                class="drop-btn iconfont">&#xe6e6;</a>{/if}-->
+                            <a
+                                href="javascript:dropImage('member_idcard_image3')"
+                                class="drop-btn iconfont">&#xe6e6;</a>
                         </div>
 
                         <div class="dsm-upload-btn">
@@ -354,6 +358,8 @@
                     <input type="text" style="width:0;opacity: 0" name="member_idcard_image3" id="member_idcard_image3"
                            value="{$member_info.member_idcard_image3}">
                 </span>
+                    </dd>
+                </dl>
             </td>
         </tr>
 <!--        <tr>-->
@@ -477,7 +483,7 @@ $(document).ready(function(){
                 email: '{$Think.lang.fill_correct_email_address}'
             },
             business_licence_number: {
-                required: '{$Think.lang.enter_business_license_number}',
+                required: '请输入身份证号码',
                 maxlength: jQuery.validator.format("{$Think.lang.most_words}")
             },
             business_licence_address: {
@@ -502,9 +508,58 @@ $(document).ready(function(){
 });
 </script>
 <style>
+
+    /*.dsm-default-form dl {*/
+    /*    font-size: 0;*/
+    /*    *word-spacing: -1px;*/
+    /*    line-height: 20px;*/
+    /*    clear: both;*/
+    /*    padding: 0;*/
+    /*    margin: 0;*/
+    /*    border-bottom: dotted 1px #E6E6E6;*/
+    /*    overflow: hidden;*/
+    /*}*/
+    /*.dsm-default-form tr td, .dsm-default-form tr td {*/
+    /*    font-size: 13px;*/
+    /*    line-height: 40px;*/
+    /*    vertical-align: top;*/
+    /*    letter-spacing: normal;*/
+    /*    word-spacing: normal;*/
+    /*    text-align: right;*/
+    /*    display: inline-block;*/
+    /*    width: 14%;*/
+    /*    padding: 10px 1% 10px 0;*/
+    /*    margin: 0;*/
+    /*    *display: inline;*/
+    /*    *zoom: 1;*/
+    /*}*/
+    /*.dsm-default-form tr td {*/
+    /*    text-align: left;*/
+    /*    width: 85%;*/
+    /*    padding: 10px 0 10px 0;*/
+    /*}*/
+    /*}*/
+    /*.dsm-default-form .dssc-upload-thumb a {*/
+    /*    font: 10px/14px Tahoma;*/
+    /*    background-color: #FFF;*/
+    /*    text-align: center;*/
+    /*    vertical-align: middle;*/
+    /*    display: none;*/
+    /*    width: 14px;*/
+    /*    height: 14px;*/
+    /*    border: 1px solid;*/
+    /*    border-radius: 8px 8px 8px 8px;*/
+    /*    position: absolute;*/
+    /*    z-index: 2;*/
+    /*    top: -8px;*/
+    /*    right: -8px;*/
+    /*}*/
+    /*a {*/
+    /*    color: #0279B9;*/
+    /*}*/
     .dssc-upload-thumb{width:250px;height: 200px;}
     .dssc-upload-thumb p{width:100%;height: 100%;display: block}
-    .image-wrapper img{width:100%;height: 100%}
+    .image-wrapper img{width:250px;height: 200px;}
     .drop-btn{position: absolute;top:0px;right:0px;}
     .dsm-upload-btn {
         vertical-align: top;
@@ -578,7 +633,24 @@ $(document).ready(function(){
 
 </style>
 <script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/ajaxfileupload.js"></script>
+<link href="/static/home/css/member.css" rel="stylesheet" type="text/css">
 <script>
+    function dropImage3(id){
+        var index=layer.confirm("{$Think.lang.ds_ensure_del}", {
+            btn: ['{$Think.lang.ds_ok}', '{$Think.lang.ds_cancel}'],
+            title: false,
+        }, function () {
+            layer.close(index)
+            $.getJSON('{:url('MemberAuth/image_drop3')}',{file_name:id},function(res){
+                if(res.code!=10000){
+                    layer.alert(res.message);
+                }else{
+                    $('#'+id).val('')
+                    $('#img_'+id+'_url').attr('src',"{$Think.BASE_SITE_ROOT}/static/home/images/"+id+".png")
+                }
+            })
+        })
+    }
     function openPhoto(id){
         var src=$('#'+id).attr('src')
         if(!src){