Browse Source

个人认证提交

18838166547 1 year ago
parent
commit
9679ee5e0a

+ 2 - 2
app/home/controller/BaseMember.php

@@ -217,8 +217,8 @@ 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']);
+        $url = get_member_idcard_image($memberInfo['business_licence_number_electronic']);
+        $url2 = get_member_idcard_image($memberInfo['business_author_letter']);
         $base64 = $this->getBase64($url);
         $base642 = $this->getBase64($url2);
         $res = $this->postAiOcr($base64,$base642);

+ 4 - 2
app/home/controller/Sellerjoininc2c.php

@@ -137,8 +137,10 @@ class Sellerjoininc2c 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_licence_number_electronic'] = input('post.member_idcard_image2');
+//            $param['business_author_letter'] = $this->upload_image('business_author_letter');
+            $param['business_author_letter'] = input('post.member_idcard_image3');
 
             $this->step2_save_valid($param);
 

+ 1 - 1
app/home/view/default/member/sellerjoinin/step1.html

@@ -342,7 +342,7 @@
             <span class="block">{$Think.lang.upload_information2}</span></td>
         </tr>
         <tr>
-            <th><i>*</i>{$Think.lang.business_author_letter}:</th>
+            <th><i>*</i>企业授权书照片:</th>
             <td><input name="business_author_letter" type="file" class="w200" />
                 <span class="block">{$Think.lang.upload_information2}</span></td>
         </tr>

+ 266 - 9
app/home/view/default/member/sellerjoininc2c/step1.html

@@ -250,11 +250,11 @@
             </div>
           </td>
         </tr>
-        <tr>
-          <th><i>*</i>{$Think.lang.contact_name}:</th>
-          <td><input name="contacts_name" type="text" class="w100" />
-            <span></span></td>
-        </tr>
+<!--        <tr>-->
+<!--          <th><i>*</i>{$Think.lang.contact_name}:</th>-->
+<!--          <td><input name="contacts_name" type="text" class="w100" />-->
+<!--            <span></span></td>-->
+<!--        </tr>-->
         <tr>
           <th><i>*</i>{$Think.lang.contact_number}:</th>
           <td><input name="contacts_phone" type="text" class="w100" />
@@ -279,6 +279,11 @@
         </tr>
       </thead>
       <tbody>
+      <tr>
+          <th><i>*</i>姓名:</th>
+          <td><input name="contacts_name" type="text" class="w100" />
+              <span></span></td>
+      </tr>
         <tr>
           <th><i>*</i>{$Think.lang.identification_number}:</th>
           <td><input name="business_licence_number" type="text" class="w200" />
@@ -286,14 +291,75 @@
         </tr>
         <tr>
           <th><i>*</i>{$Think.lang.identification_photo}:</th>
-          <td><input name="business_licence_number_electronic" type="file" class="w200" />
-            <span class="block"></span></td>
+            <td>
+                <div>
+                    <div class='image-wrapper'>
+                        <div class="dssc-upload-thumb">
+                            <p>
+                                <img onclick='openPhoto("img_member_idcard_image2_url")'
+                                     src="{if $member_info['member_idcard_image2']!=''}{:get_member_idcard_image($member_info['member_idcard_image2'])}{else}{$Think.BASE_SITE_ROOT}/static/home/images/member_idcard_image2.png{/if}"
+                                     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>
+                        {if !in_array($member_info.member_auth_state,array(1,3))}
+                        <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>
+                        </div>
+                        {/if}
+                    </div>
+                </div>
+                <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}" {if in_array($member_info.member_auth_state,array(1,3))}disabled="" {/if}>
+                </span>
+            </td>
         </tr>
         <tr>
             <th><i>*</i>{$Think.lang.business_author_letter}:</th>
-            <td><input name="business_author_letter" type="file" class="w200" />
-                <span class="block"></span></td>
+            <td>
+                <div>
+                    <div class='image-wrapper'>
+                        <div class="dssc-upload-thumb">
+                            <p>
+                                <img onclick='openPhoto("img_member_idcard_image3_url")'
+                                     src="{if $member_info['member_idcard_image3']!=''}{:get_member_idcard_image($member_info['member_idcard_image3'])}{else}{$Think.BASE_SITE_ROOT}/static/home/images/member_idcard_image3.png{/if}"
+                                     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}
+                        </div>
+                        {if !in_array($member_info.member_auth_state,array(1,3))}
+                        <div class="dsm-upload-btn">
+                            <a href="javascript:void(0);">
+                                <span><input type="file" hidefocus="true" size="1" class="input-file"
+                                             name="member_idcard_image3_url" id="member_idcard_image3_url"
+                                             accept="image/*"/></span>
+                                <p><i class="iconfont">&#xe733;</i>图片上传</p>
+                            </a>
+                        </div>
+                        {/if}
+                    </div>
+                </div>
+                <span class="w400">
+                    <input type="text" style="width:0;opacity: 0" name="member_idcard_image3" id="member_idcard_image3"
+                           value="{$member_info.member_idcard_image3}" {if in_array($member_info.member_auth_state,array(1,3))}disabled="" {/if}>
+                </span>
+            </td>
         </tr>
+<!--        <tr>-->
+<!--            <th><i>*</i>{$Think.lang.business_author_letter}:</th>-->
+<!--            <td><input name="business_author_letter" type="file" class="w200" />-->
+<!--                <span class="block"></span></td>-->
+<!--        </tr>-->
       </tbody>
       <tfoot>
         <tr>
@@ -425,6 +491,197 @@ $(document).ready(function(){
     });
 });
 </script>
+<style>
+    .dssc-upload-thumb{width:250px;height: 200px;}
+    .dssc-upload-thumb p{width:100%;height: 100%;display: block}
+    .image-wrapper img{width:100%;height: 100%}
+    .drop-btn{position: absolute;top:0px;right:0px;}
+    .dsm-upload-btn {
+        vertical-align: top;
+        display: inline-block;
+        *display: inline/*IE7*/;
+        margin-right: 5px;
+        width: 80px;
+        height: 30px;
+        *zoom:1;}
+
+    .dsm-upload-btn a {
+        display: block;
+        position: relative;
+        z-index: 1;
+    }
+
+    .dsm-upload-btn span {
+        width: 80px;
+        height: 30px;
+        position: absolute;
+        left: 0;
+        top: 0;
+        z-index: 2;
+        cursor: pointer;
+    }
+
+    .dsm-upload-btn .input-file {
+        width: 80px;
+        height: 30px;
+        padding: 0;
+        margin: 0;
+        border: none 0;
+        opacity: 0;
+        filter: alpha(opacity=0);
+        cursor: pointer;
+    }
+
+    .dsm-upload-btn p {
+        font-size: 12px;
+        line-height: 20px;
+        background-color: #F5F5F5;
+        color: #999;
+        text-align: center;
+        color: #666;
+        width: 78px;
+        height: 20px;
+        padding: 4px 0;
+        border: solid 1px;
+        border-color: #DCDCDC #DCDCDC #B3B3B3 #DCDCDC;
+        position: absolute;
+        left: 0;
+        top: 0;
+        z-index: 1;
+    }
+
+    .dsm-upload-btn p i {
+        vertical-align: middle;
+        margin-right: 4px;
+    }
+
+    .dsm-upload-btn a:hover p {
+        background-color: #E6E6E6;
+        color: #333;
+        border-color: #CFCFCF #CFCFCF #B3B3B3 #CFCFCF;
+    }
+
+    i[class*="iconfont"] {
+        font-size: 14px;
+        margin-right: 4px;
+    }
+
+</style>
+<script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/ajaxfileupload.js"></script>
+<script>
+    function openPhoto(id){
+        var src=$('#'+id).attr('src')
+        if(!src){
+            return
+        }
+        layer.photos({
+            photos: {
+                "title": "", //相册标题
+                "id": 1, //相册id
+                "start": 0, //初始显示的图片序号,默认0
+                "data": [   //相册包含的图片,数组格式
+                    {
+                        "pid": 1, //图片id
+                        "src": src, //原图地址
+                        "thumb": src //缩略图地址
+                    }
+                ]
+            }
+            ,anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机
+        })
+    }
+    function dropImage(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_drop')}',{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 ajaxFileUpload(url, id)
+    {
+        var index=id.substr(0,20)
+        if($('#'+index).val()){
+            layer.alert('{$Think.lang.please_drop_image}');
+            return
+        }
+        $.ajaxFileUpload({
+            url: url,
+            secureuri: false,
+            fileElementId: id,
+            dataType: 'json',
+            data: {id: id},
+            success: function (data)
+            {
+                if (data.code!=10000) {
+                    layer.alert(data.message);
+                } else {
+                    $('#'+index).val(data.result.file_name)
+                    $("#img_" + id).attr('src', data.result.file_path);
+                }
+            },
+            error: function (data, status, e)
+            {
+                console.error(data);
+            }
+        })
+    }
+    $(document).ready(function () {
+        var url = '{:url("MemberAuth/image_upload")}';
+        $('#form_company_info').find('input[type="file"]').unbind().change(function () {
+            var id = $(this).attr('id');
+            ajaxFileUpload(url, id);
+        });
+        $('#form_company_info').validate({
+            submitHandler: function (form) {
+                ds_ajaxpost('member_form','url','{:url('MemberAuth/index')}');
+            },
+            rules: {
+                member_truename: {
+                    required: true
+                },
+                member_idcard: {
+                    required: true,
+                },
+                member_idcard_image1: {
+                    required: true,
+                },
+                member_idcard_image2: {
+                    required: true,
+                },
+                member_idcard_image3: {
+                    required: true,
+                },
+            },
+            messages: {
+                member_truename: {
+                    required: '{$Think.lang.member_truename_require}'
+                },
+                member_idcard: {
+                    required: '{$Think.lang.member_idcard_require}',
+                },
+                member_idcard_image1: {
+                    required: '{$Think.lang.member_idcard_image1_require}',
+                },
+                member_idcard_image2: {
+                    required: '{$Think.lang.member_idcard_image2_require}',
+                },
+                member_idcard_image3: {
+                    required: '{$Think.lang.member_idcard_image3_require}',
+                },
+            }
+        });
+
+    });
+</script>
 
 
 {/block}