1
jhzh
2024-08-12 f1dc8f5a7f3a661ce19513a9ad47fe18e3e883ff
src/views/my/components/identityAuthenty.vue
@@ -47,7 +47,7 @@
        <div class="image_upload">
          <!-- 正面 -->
          <div class="text-center">
            <el-upload class="avatar-uploader" :action="`${nowUrl}/api/api/uploadFile`"
            <el-upload class="avatar-uploader" :action="`${nowUrl}/wap/public/uploadimg!execute.action`"
              accept=".jpg,.jpeg,.png,.gif.JPG,.JPEG,.PNG,.GIF" :show-file-list="false"
              :on-success="handelDoucumentsFront" :on-error="onErrorUpload" :before-upload="beforeAvatarUpload"
              :disabled="identifyStatus == 1">
@@ -59,7 +59,7 @@
            <p>{{ $t("message.user.zhengjianzhengmian") }}</p>
          </div>
          <div class="text-center" style="margin: 0 10px">
            <el-upload class="avatar-uploader" :action="`${nowUrl}/api/api/uploadFile`"
            <el-upload class="avatar-uploader" :action="`${nowUrl}/wap/public/uploadimg!execute.action`"
              accept=".jpg,.jpeg,.png,.gif.JPG,.JPEG,.PNG,.GIF" :show-file-list="false" :on-success="handelDoucumentsBack"
              :on-error="onErrorUpload" :before-upload="beforeAvatarUpload" :disabled="identifyStatus == 1">
              <!-- v-if="idBackImg || identifyStatus == 2 || identifyStatus == 3" -->
@@ -70,20 +70,20 @@
            </el-upload>
            <p>{{ $t("message.user.zhengjianfanmian") }}</p>
          </div>
          <div class="text-center">
            <el-upload class="avatar-uploader" :action="`${nowUrl}/api/api/uploadFile`"
          <!-- <div class="text-center">
            <el-upload class="avatar-uploader" :action="`${nowUrl}/wap/public/uploadimg!execute.action`"
              accept=".jpg,.jpeg,.png,.gif.JPG,.JPEG,.PNG,.GIF" :show-file-list="false" :on-success="holdIdCardSuccess"
              :on-error="onErrorUpload" :before-upload="beforeAvatarUpload" :disabled="identifyStatus == 1">
              :on-error="onErrorUpload" :before-upload="beforeAvatarUpload" :disabled="identifyStatus == 1"> -->
              <!-- v-if="
                  handheldPhoto || identifyStatus == 2 || identifyStatus == 3
                " -->
              <img v-if="threeImg" :src="threeImg" class="avatar" />
              <!-- <img v-if="threeImg" :src="threeImg" class="avatar" />
              <el-icon v-else class="avatar-uploader-icon">
                <Plus />
              </el-icon>
            </el-upload>
            <p>{{ $t("message.user.shouchizhengjianzhao") }}</p>
          </div>
          </div> -->
        </div>
        <!-- 操作按钮 -->
        <div class="bind_btn">
@@ -176,7 +176,7 @@
  },
  mounted() {
    //获取域名
    this.nowUrl = "https://enjdhdg.site";
    this.nowUrl = "https://https://uni.eypmj.com";
    //调用身份认证信息方法
    this.spToken = localStorage.getItem("spToken");
    if (this.spToken) {
@@ -206,21 +206,27 @@
    },
    //上传正面
    handelDoucumentsFront(res, file) {
      const { path, httpUrl } = res.data;
      this.oneImg = httpUrl;
      this.idFrontImg = path;
      // const { path, httpUrl } = res.data;
      // this.oneImg = httpUrl;
      const data = res.data;
      this.oneImg = `${this.nowUrl}/wap/public/showimg!showImg.action?imagePath=${data}`;
      this.idFrontImg = data;
    },
    //上传背面
    handelDoucumentsBack(res, file) {
      const { path, httpUrl } = res.data;
      this.twoImg = httpUrl;
      this.idBackImg = path;
      // const { path, httpUrl } = res.data;
      // this.twoImg = httpUrl;
      const data = res.data;
      this.twoImg = `${this.nowUrl}/wap/public/showimg!showImg.action?imagePath=${data}`;
      this.idBackImg = data;
    },
    //手持身份证
    holdIdCardSuccess(res, file) {
      const { path, httpUrl } = res.data;
      this.threeImg = httpUrl;
      this.handheldPhoto = path;
      // const { path, httpUrl } = res.data;
      // this.threeImg = httpUrl;
      const data = res.data;
      this.threeImg = `${this.nowUrl}/wap/public/showimg!showImg.action?imagePath=${data}`;
      this.handheldPhoto = data;
    },
    onErrorUpload() {
      ElMessage.warning(this.$t("message.user.shangchuan3"));
@@ -265,18 +271,18 @@
        return;
      }
      if (!this.oneImg || !this.twoImg || !this.threeImg) {
      if (!this.oneImg || !this.twoImg) {
        ElMessage.warning(this.$t("message.user.shangchuan6"));
        return;
      }
      Axios.apply({
        nationality: this.nationality,
        idNumber: this.idNumber,
        idName: "id/passpost",
        idnumber: this.idNumber,
        idname: "id/passpost",
        name: this.name,
        idFrontImg: this.idFrontImg,
        idBackImg: this.idBackImg,
        handheldPhoto: this.handheldPhoto,
        idimg_1: this.idFrontImg,
        idimg_2: this.idBackImg,
        // idimg_3: this.handheldPhoto,
      }).then((res) => {
        if (res.code == "0") {
          // 出来一个弹窗,显示已经提交成功
@@ -308,7 +314,8 @@
.image_upload {
  display: flex;
  justify-content: space-between;
  /* justify-content: space-between; */
  justify-content: flex-start;
}
.avatar-uploader .el-upload:hover {