소스 검색

上传信息调整

18838166547 1 년 전
부모
커밋
c8a5fddf20
2개의 변경된 파일31개의 추가작업 그리고 7개의 파일을 삭제
  1. 24 0
      app/home/controller/MemberAuth.php
  2. 7 7
      app/home/view/default/member/sellerjoininc2c/step1.html

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

@@ -103,6 +103,30 @@ class MemberAuth extends BaseMember
         }
         ds_json_encode(10001, lang('param_error'));
     }
+
+    public function image_upload2()
+    {
+        $file_name = input('param.id');
+        if (!empty($_FILES[$file_name]['name'])) {
+
+            $res = ds_upload_pic(ATTACH_IDCARD_IMAGE, $file_name);
+            if (!$res['code']) {
+                ds_json_encode(10001, $res['msg']);
+            }
+            if (!in_array(substr($file_name, 0, 20), array('member_idcard_image1', 'member_idcard_image2', 'member_idcard_image3'))) {
+                ds_json_encode(10001, lang('param_error'));
+            }
+            $member_array = array();
+            $member_array[substr($file_name, 0, 20)] = $res['data']['file_name'];
+            $member_model = model('member');
+//            if (!$member_model->editMember(array(array('member_id', '=', $this->member_info['member_id']), array('member_auth_state', 'in', array(0, 2))), $member_array, $this->member_info['member_id'])) {
+//                ds_json_encode(10001, lang('ds_common_save_fail'));
+//            }
+            ds_json_encode(10000, '', array('file_name' => $res['data']['file_name'], 'file_path' => get_member_idcard_image($res['data']['file_name'])));
+        }
+        ds_json_encode(10001, lang('param_error'));
+    }
+
     public function image_drop()
     {
         $file_name = input('param.file_name');

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

@@ -297,7 +297,7 @@
                         <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}"
+                                     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
@@ -330,7 +330,7 @@
                         <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}"
+                                     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
@@ -609,10 +609,10 @@ $(document).ready(function(){
     function ajaxFileUpload(url, id)
     {
         var index=id.substr(0,20)
-        if($('#'+index).val()){
-            layer.alert('{$Think.lang.please_drop_image}');
-            return
-        }
+        // if($('#'+index).val()){
+        //     layer.alert('{$Think.lang.please_drop_image}');
+        //     return
+        // }
         $.ajaxFileUpload({
             url: url,
             secureuri: false,
@@ -635,7 +635,7 @@ $(document).ready(function(){
         })
     }
     $(document).ready(function () {
-        var url = '{:url("MemberAuth/image_upload")}';
+        var url = '{:url("MemberAuth/image_upload2")}';
         $('#form_company_info').find('input[type="file"]').unbind().change(function () {
             var id = $(this).attr('id');
             ajaxFileUpload(url, id);