From ef37c59e055a990ce247b265b27d3fcef430a243 Mon Sep 17 00:00:00 2001
From: 杨磊 <505174330@qq.com>
Date: 星期五, 15 八月 2025 10:19:18 +0800
Subject: [PATCH] first submit

---
 src/views/personalCenter/components/teacherRegister.vue | 1028 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 1,028 insertions(+), 0 deletions(-)

diff --git a/src/views/personalCenter/components/teacherRegister.vue b/src/views/personalCenter/components/teacherRegister.vue
new file mode 100644
index 0000000..d517278
--- /dev/null
+++ b/src/views/personalCenter/components/teacherRegister.vue
@@ -0,0 +1,1028 @@
+<template>
+  <div class="teacherRegisterPage">
+    <div class="teacherRegisterBox" v-loading="teacherRegisterLoading">
+      <div class="teacherRegisterForm">
+        <div class="zertifizierungsStatus">
+          <span> 褰撳墠鐘舵�侊細 </span>
+          <span class="status-w" v-if="statusNow == 'WaitAudit'">绛夊緟瀹℃牳</span>
+          <span class="status-s" v-if="statusNow == 'Normal'">宸茶璇�</span>
+          <span class="status-f" v-if="statusNow == 'Reject'">
+            宸查┏鍥�
+            <p class="reason">鍘熷洜锛� {{ reason ? reason : "-" }}</p>
+          </span>
+          <span class="status-b" v-if="statusNow == undefined">寰呰璇�</span>
+        </div>
+        <el-form
+          :model="teacherRegisterForm"
+          ref="form"
+          :disabled="forbidden"
+          label-position="left"
+          :rules="rules"
+          label-width="130px"
+        >
+          <el-form-item label="鍦板尯锛�" prop="region">
+            <div>
+              <el-cascader
+                size="large"
+                :options="options"
+                v-model="selectedOptions"
+                @change="handleChange"
+              >
+              </el-cascader>
+            </div>
+          </el-form-item>
+          <el-form-item label="鑱屽姟锛�" prop="post">
+            <el-select
+              style="width: 100%"
+              v-model="teacherRegisterForm.post"
+              placeholder="璇烽�夋嫨鑱屽姟"
+            >
+              <el-option
+                v-for="(item, index) in postData"
+                :key="index"
+                :label="item.name"
+                :value="item.name"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="鑱岀О锛�" prop="positionalTitle">
+            <el-select
+              style="width: 100%"
+              v-model="teacherRegisterForm.positionalTitle"
+              placeholder="璇烽�夋嫨鑱岀О"
+            >
+              <el-option
+                v-for="(item, index) in positionalTitleData"
+                :key="index"
+                :label="item.name"
+                :value="item.name"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="瀛﹀巻锛�" prop="education">
+            <el-select
+              style="width: 100%"
+              v-model="teacherRegisterForm.education"
+              placeholder="璇烽�夋嫨瀛﹀巻"
+            >
+              <el-option
+                v-for="(item, index) in educationData"
+                :key="index"
+                :label="item.name"
+                :value="item.name"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="濮撳悕锛�" prop="fullName">
+            <el-input
+              v-model="teacherRegisterForm.fullName"
+              placeholder="璇疯緭鍏ュ鍚�"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="鎵嬫満鍙凤細" prop="phone">
+            <el-input
+              v-model="teacherRegisterForm.phone"
+              placeholder="璇疯緭鍏ユ墜鏈哄彿"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="閭锛�" prop="email">
+            <el-input
+              v-model="teacherRegisterForm.email"
+              placeholder="璇疯緭鍏ヤ綘鐨勯偖绠�"
+            ></el-input>
+          </el-form-item>
+          <el-form-item v-if="SMSState" label="鍥惧舰楠岃瘉鐮侊細" prop="imgCode">
+            <div class="flex">
+              <el-input
+                v-model="teacherRegisterForm.imgCode"
+                placeholder="璇疯緭鍏ュ浘褰㈤獙璇佺爜"
+              ></el-input>
+              <div class="imgCodeBox">
+                <img :src="imgCode" alt="" @click="getImgCapcha" />
+              </div>
+            </div>
+          </el-form-item>
+          <el-form-item
+            v-if="SMSState"
+            label="鐭俊楠岃瘉鐮侊細"
+            prop="verificationCode"
+          >
+            <div class="flex">
+              <el-input
+                v-model="teacherRegisterForm.verificationCode"
+                placeholder="璇疯緭鍏ョ煭淇¢獙璇佺爜"
+              ></el-input>
+              <div class="imgCodeBox">
+                <el-button
+                  style="width: 100%"
+                  @click="getVerifyCode"
+                  :disabled="countDown != 0"
+                  >{{
+                    countDown == 0
+                      ? "鑾峰彇鐭俊楠岃瘉鐮�"
+                      : "楠岃瘉鐮�(" + countDown + "s)"
+                  }}</el-button
+                >
+              </div>
+            </div>
+          </el-form-item>
+          <el-form-item label="鎵�鍦ㄥ鏍″悕绉帮細" prop="schoolName">
+            <el-input
+              v-model="teacherRegisterForm.schoolName"
+              placeholder="璇疯緭鍏ユ墍鍦ㄥ鏍″悕绉�"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="璇︾粏鍦板潃锛�" prop="detailedAddress">
+            <el-input
+              v-model="teacherRegisterForm.detailedAddress"
+              placeholder="璇疯緭鍏ヨ缁嗗湴鍧�"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="鎺堣涓撲笟锛�" prop="lecturingSpecialty">
+            <el-input
+              v-model="teacherRegisterForm.lecturingSpecialty"
+              placeholder="璇疯緭鍏ユ巿璇句笓涓�"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="鐩稿叧璇佷欢锛�" prop="relevantCertificates">
+            <div class="lecturingSpecixalty">
+              <el-upload
+                :file-list="teacherRegisterForm.relevantCertificates"
+                action=""
+                :limit="5"
+                :on-exceed="
+                  () => {
+                    this.$message({
+                      message: '鏈�澶氫笂浼�5涓枃浠讹紝璇风Щ闄ゅ叾浠栨枃浠跺悗鍐嶄笂浼犮��',
+                      type: 'warning',
+                    });
+                  }
+                "
+                :http-request="beforeRead"
+                :multiple="false"
+                list-type="picture-card"
+                :before-remove="beforeDelimg"
+                :on-preview="handlePictureCardPreview"
+                :on-success="uploadSucceeded"
+                :on-error="uploadFailed"
+                :on-remove="handleRemove"
+              >
+                <i class="el-icon-plus"></i>
+              </el-upload>
+            </div>
+          </el-form-item>
+          <div class="notice">
+            娉細鎺ㄨ崘浼樺厛涓婁紶鎮ㄧ殑鏁欏笀璇佺數瀛愮増鎴栨牎鍥崱鎴栧伐浣滆瘉鎴栬韩浠借瘉
+            鏀寔涓婁紶jpg銆乸ng鏂囦欢
+          </div>
+          <div class="agreementState">
+            <span
+              class="choose"
+              @click="
+                () => {
+                  if (!this.forbidden) {
+                    this.agreementState = !this.agreementState;
+                  }
+                }
+              "
+            >
+              <img
+                v-show="agreementState"
+                src="@/assets/images/personalCenter/choose.png"
+                alt=""
+              />
+            </span>
+            <span
+              class="infoTxt"
+              @click="
+                () => {
+                  dialogVisible = true;
+                }
+              "
+            >
+              鍚屾剰
+              <span class="agreementBox">銆婃暀甯堜細鍛樺崗璁��</span>
+            </span>
+          </div>
+          <el-form-item>
+            <template v-if="forbidden">
+              <div
+                @click="
+                  () => {
+                    this.forbidden = false;
+                  }
+                "
+                class="addAddressButton"
+              >
+                淇敼
+              </div>
+            </template>
+            <template v-else>
+              <div
+                class="addAddressButton greenButton aaa"
+                type="primary"
+                @click="teacherCertification()"
+                v-if="!topicId"
+                v-loading="subLoading"
+              >
+                鎻愪氦
+              </div>
+              <div v-else>
+                <div
+                  class="addAddressButton greenButton"
+                  type="primary"
+                  @click="updateSubmit()"
+                  v-loading="subLoading"
+                >
+                  鎻愪氦
+                </div>
+                <div class="addAddressButton" @click="cancelEditor()">鍙栨秷</div>
+              </div>
+            </template>
+          </el-form-item>
+        </el-form>
+        <div class="express">
+          <p class="title">璁よ瘉璇存槑</p>
+          <p>
+            鏈ā鍧楀彧瀵规暀甯堝紑鏀俱�傝璇佷俊鎭彁浜ゅ悗锛岀綉绔欑鐞嗕汉鍛樺皢鍦ㄤ笁涓伐浣滄棩涔嬪唴瀵规偍鐨勮璇佷俊鎭繘琛屽鏍革紝瀹℃牳閫氳繃鍚庯紝鍚勪綅鑰佸笀鍙互鍦ㄦ湰缃戠珯杩涜璇句欢涓嬭浇銆佹牱涔︾敵璇风瓑鎿嶄綔銆傛偍鐨勫鏍歌繘搴﹀彲鍦ㄤ釜浜轰俊鎭腑鏌ョ湅銆�
+          </p>
+        </div>
+      </div>
+      <el-dialog :visible.sync="dialogImageState">
+        <img width="100%" :src="dialogImageUrl" alt="" />
+      </el-dialog>
+      <el-dialog :visible.sync="dialogVisible">
+        <div class="agreementName">{{ agreement.name }}</div>
+        <div class="protocolBox" v-html="agreement.protocolTxt"></div>
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+import { regionData, CodeToText, TextToCode } from "element-china-area-data";
+import { getPublicImage } from "@/assets/js/middleGround/tool";
+import { mapState } from "vuex";
+
+export default {
+  name: "teacherRegister",
+  data() {
+    return {
+      teacherRegisterLoading: true,
+      subLoading: false,
+      teacherRegisterForm: {
+        region: "",
+        post: "",
+        positionalTitle: "",
+        education: "",
+        fullName: "",
+        phone: "",
+        email: "",
+        schoolName: "",
+        detailedAddress: "",
+        lecturingSpecialty: "",
+        imgCode: "",
+        verificationCode: "",
+        relevantCertificates: [],
+      },
+      rules: {
+        region: [{ required: true, message: "璇烽�夋嫨鍦板尯", trigger: "change" }],
+        post: [{ required: true, message: "璇烽�夋嫨鑱屽姟", trigger: "change" }],
+        positionalTitle: [
+          { required: true, message: "璇烽�夋嫨鑱岀О", trigger: "change" },
+        ],
+        education: [
+          { required: true, message: "璇烽�夋嫨瀛﹀巻", trigger: "change" },
+        ],
+        fullName: [{ required: true, message: "璇疯緭鍏ュ鍚�", trigger: "blur" }],
+        phone: [
+          { required: true, message: "璇疯緭鍏ユ墜鏈哄彿", trigger: "blur" },
+          {
+            pattern:
+              /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
+            message: "璇疯緭鍏ユ纭墜鏈哄彿",
+            trigger: "blur",
+          },
+        ],
+        email: [
+          { required: true, message: "璇峰~鍐欓偖绠�", trigger: "blur" },
+          {
+            pattern: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
+            message: "閭鏍煎紡鏍¢獙澶辫触锛岃杈撳叆閭",
+            trigger: "blur",
+          },
+        ],
+        schoolName: [
+          { required: true, message: "璇疯緭鍏ユ墍鍦ㄥ鏍″悕绉�", trigger: "blur" },
+        ],
+        detailedAddress: [
+          { required: true, message: "璇疯緭鍏ヨ缁嗗湴鍧�", trigger: "blur" },
+        ],
+        lecturingSpecialty: [
+          { required: true, message: "璇疯緭鍏ユ巿璇句笓涓�", trigger: "blur" },
+        ],
+        relevantCertificates: [
+          { required: true, message: "璇蜂笂浼犵浉鍏宠瘉浠�", trigger: "blur" },
+        ],
+        imgCode: [
+          { required: true, message: "璇疯緭鍏ュ浘褰㈤獙璇佺爜", trigger: "blur" },
+          { min: 4, max: 4, message: "璇疯緭鍏� 4 浣嶉獙璇佺爜", trigger: "blur" },
+        ],
+        verificationCode: [
+          { required: true, message: "璇疯緭鍏ョ煭淇¢獙璇佺爜", trigger: "blur" },
+        ],
+      },
+      // 鍗忚鍕鹃�夌姸鎬�
+      agreementState: false,
+      // 鍗忚鏂囨湰
+      agreement: {
+        name: "",
+        protocolTxt: "",
+      },
+      postData: [],
+      positionalTitleData: [],
+      educationData: [],
+      countDown: 0,
+      options: regionData,
+      selectedOptions: "",
+      imgCode: "",
+      worksInfo: [],
+      topicId: null,
+      topicMessageList: [],
+      statusNow: undefined,
+      // 琛ㄥ崟缂栬緫鐘舵��
+      forbidden: false,
+      // 鏌ョ湅宸查�変腑鐨勫浘鐗�
+      dialogImageUrl: "",
+      // 鏌ョ湅宸查�変腑鐨勫浘鐗� 鏄剧ず鐘舵��
+      dialogImageState: false,
+      dialogVisible: false,
+      // 鎺у埗 鑾峰彇鎵嬫満楠岃瘉鐮� 鏄惁灞曠ず
+      SMSState: true,
+      // 鎵嬫満鍙峰壇鏈紝鐢ㄤ簬鍒ゆ柇鎵嬫満鍙锋槸鍚︽洿鏀�
+      phoneCopy: "",
+    };
+  },
+  watch: {
+    "teacherRegisterForm.phone": {
+      deep: true,
+      handler: function (newV, oldV) {
+        if (oldV != "") {
+          if (newV != this.phoneCopy) {
+            // this.teacherRegisterForm.verificationCode = "";
+            this.SMSState = true;
+          } else {
+            this.SMSState = false;
+          }
+        }
+      },
+    },
+  },
+  mounted() {
+    this.getImgCapcha();
+    this.getFieldData();
+    this.getTypeItem();
+    this.getTeacherAgreement();
+    this.role = this.$store.role;
+  },
+  computed: {
+    ...mapState(["userInfo"]),
+  },
+  methods: {
+    // 鑾峰彇鏁欏笀鍗忚
+    getTeacherAgreement() {
+      this.MG.resource
+        .getItem({
+          path: "caupress_protocol",
+          fields: {
+            caupress_content: [],
+          },
+        })
+        .then((res) => {
+          try {
+            this.agreement.name = "鏁欏笀浼氬憳鍗忚";
+            const data = res.datas.find(
+              (e) => e.refCode == "caupress_teacherCertificationAgreement"
+            );
+            this.agreement.protocolTxt = data
+              ? data.caupress_content
+              : "鏆傛棤鍗忚";
+          } catch (error) {
+            this.agreement.name = "鏁欏笀浼氬憳鍗忚";
+            this.agreement.protocolTxt = "鏆傛棤鍗忚";
+          }
+        });
+    },
+    // 灏嗗競杈栧尯 杞崲涓� 鐩磋緰甯傚悕绉帮紝涓轰簡閫傚簲 element-china-area-data
+    handleChange(city) {
+      let cityStr =
+        CodeToText[city[0]] +
+        "/" +
+        CodeToText[city[1]] +
+        "/" +
+        CodeToText[city[2]];
+      let cityArr = cityStr.split("/");
+      if (cityArr[1] == "甯傝緰鍖�") {
+        cityArr[1] = cityArr[0];
+      }
+      this.teacherRegisterForm.region = cityArr.join("/");
+    },
+    // 鑾峰彇鍥惧舰楠岃瘉鐮�
+    getImgCapcha() {
+      this.MG.identity.getImgCode().then((res) => {
+        this.imgCode = "data:image/png;base64," + res;
+      });
+    },
+    // 鑾峰彇楠岃瘉鐮�
+    getVerifyCode() {
+      let validateFieldList = [];
+      this.$refs.form.validateField(["phone", "imgCode"], (val) => {
+        // 鐢变簬 validateField 楠岃瘉浼氳Е鍙戝娆★紝褰撴瘡娆¢獙璇侀�氳繃鍚庨兘寰�鏁扮粍閲屾坊鍔犱竴鏉℃暟鎹��
+        if (!val) {
+          validateFieldList.push("閫氳繃");
+        }
+        // 姝ゅ 2 涓洪獙璇佸瓧娈电殑鏁伴噺
+        if (validateFieldList.length == 2) {
+          this.MG.identity
+            .getPhoneCode({
+              phoneNumber: this.teacherRegisterForm.phone,
+              imageCaptcha: this.teacherRegisterForm.imgCode,
+              appRefCode: this.config.appRefCode,
+            })
+            .then((res) => {
+              if (
+                res == "楠岃瘉鐮佸彂閫佹垚鍔�" ||
+                res == "楠岃瘉鐮佸彂閫侀绻佽绋嶅悗鍐嶈瘯"
+              ) {
+                this.$message({
+                  message: res,
+                  type: "success",
+                });
+                // 寮�鍚煭淇¢獙璇佸�掕鏃�
+                this.getSecond(90);
+              } else {
+                this.$message({
+                  message: res,
+                  type: "error",
+                });
+                this.getImgCapcha();
+              }
+            });
+        }
+      });
+    },
+    // 楠岃瘉鐮佸�掕鏃�
+    getSecond(time) {
+      if (!this.timer) {
+        this.countDown = time;
+        this.timer = setInterval(() => {
+          this.countDown--;
+          if (this.countDown == 0) {
+            clearInterval(this.timer);
+            this.timer = null;
+          }
+        }, 1000);
+      }
+    },
+    // 鍙栨秷缂栬緫
+    cancelEditor() {
+      this.$confirm("鏄惁鍙栨秷缂栬緫锛�")
+        .then((_) => {
+          this.forbidden = true;
+          // 閲嶆柊鑾峰彇鏁欏笀璁よ瘉淇℃伅
+          this.$refs["form"].clearValidate();
+          this.getApplyTopicData();
+        })
+        .catch((_) => {});
+    },
+    // 鑾峰彇涓嬫媺妗嗗瓧娈垫暟鎹�
+    getFieldData() {
+      const data = {
+        refCodes: ["post", "positionalTitle", "education"],
+      };
+      this.MG.store.getProductTypeField(data).then((res) => {
+        let post = res.find((item) => item.refCode == "post");
+        let positionalTitle = res.find(
+          (item) => item.refCode == "positionalTitle"
+        );
+        let education = res.find((item) => item.refCode == "education");
+        try {
+          this.postData = JSON.parse(post.config).option;
+        } catch (error) {
+          this.postData = [];
+        }
+        try {
+          this.positionalTitleData = JSON.parse(positionalTitle.config).option;
+        } catch (error) {
+          this.positionalTitleData = [];
+        }
+        try {
+          this.educationData = JSON.parse(education.config).option;
+        } catch (error) {
+          this.educationData = [];
+        }
+      });
+    },
+    // 棣栨鎻愪氦
+    teacherCertification() {
+      if (this.subLoading) return;
+
+      this.subLoading = true;
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          // 鍒ゆ柇鏄惁鍚屾剰浜嗗崗璁�
+          if (this.agreementState) {
+            // 楠岃瘉鐭俊楠岃瘉鐮�
+            if (this.teacherRegisterForm.verificationCode) {
+              let query = {
+                phoneNumber: this.teacherRegisterForm.phone,
+                smsCaptcha: this.teacherRegisterForm.verificationCode,
+              };
+              this.MG.identity.verificationPhoneCode(query).then((res) => {
+                if (res) {
+                  this.$message({
+                    message: "鎵嬫満鍙烽獙璇侀�氳繃",
+                    type: "success",
+                  });
+
+                  this.teacherRegisterLoading = true;
+                  // 绉婚櫎 涓嶇浉鍏冲睘鎬�
+                  delete this.teacherRegisterForm.verificationCode;
+                  this.teacherRegisterForm.relevantCertificates.map((item) => {
+                    delete item.status;
+                    delete item.uid;
+                    delete item.url;
+                    delete item.percentage;
+                    delete item.raw;
+                    delete item.response;
+                    delete item.size;
+                  });
+                  const data = {
+                    topicIdOrRefCode: "teacherRoleApproval",
+                    name: this.teacherRegisterForm.fullName,
+                    content: "",
+                    state: "WaitAudit",
+                    type: "teacherRegister",
+                    cmsTypeRefCode: this.config.refCodes.teacherCertification,
+                    newDataListRequest: this.tool.worksDataBytool(
+                      this.worksInfo,
+                      this.teacherRegisterForm,
+                      this.teacherRegisterForm.relevantCertificates
+                    ),
+                  };
+                  let basicInfo = this.teacherRegisterForm;
+                  const userInfo = {
+                    requests: [
+                      {
+                        data: JSON.stringify(basicInfo),
+                        name: "鏁欏笀璁よ瘉",
+                        type: "teacherInfo",
+                      },
+                    ],
+                  };
+                  this.MG.identity.setAppUserInfo(userInfo).then((res) => {
+                    if (res) {
+                      this.MG.ugc.newTopicMessage(data).then((res) => {
+                        if (res !== false) {
+                          this.teacherRegisterLoading = false;
+                          this.$message({
+                            message: "鏁欏笀璁よ瘉宸叉彁浜ゅ鏍�",
+                            type: "success",
+                          });
+                          // 鑾峰彇topic鎻愪氦鐨勪俊鎭紝鐢ㄤ簬鍥炴樉鏁版嵁
+                          this.subLoading = false;
+                          this.getApplyTopicData();
+                        } else {
+                          this.$message.error("淇℃伅鎻愪氦澶辫触锛岃绋嶅悗閲嶈瘯");
+                        }
+                      });
+                    }
+                  });
+                } else {
+                  return this.$message({
+                    message: "鎵嬫満鍙烽獙璇佸け璐ワ紝璇峰~鍐欐纭殑鐭俊楠岃瘉鐮�",
+                    type: "error",
+                  });
+                }
+              });
+            }
+          } else {
+            this.$message({
+              message: "璇峰嬀閫夛紝鍚屾剰鏁欏笀浼氬憳鍗忚",
+              type: "warning",
+            });
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    // 淇敼鍚庢彁浜�
+    updateSubmit() {
+      if (this.subLoading) return;
+      this.subLoading = true;
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          // 鍒ゆ柇鏄惁鍚屾剰浜嗗崗璁�
+          if (this.agreementState) {
+            // 楠岃瘉鐭俊楠岃瘉鐮�
+            if (this.SMSState) {
+              this.teacherRegisterLoading = true;
+              let query = {
+                phoneNumber: this.teacherRegisterForm.phone,
+                smsCaptcha: this.teacherRegisterForm.verificationCode,
+              };
+              this.MG.identity
+                .verificationPhoneCode(query)
+                .then((res) => {
+                  return new Promise((resolve, reject) => {
+                    this.subLoading = false;
+                    if (res) {
+                      this.$message({
+                        message: "鎵嬫満鍙烽獙璇侀�氳繃",
+                        type: "success",
+                      });
+                      resolve();
+                    } else {
+                      this.teacherRegisterLoading = false;
+                      this.$message({
+                        message: "鎵嬫満鍙烽獙璇佸け璐ワ紝璇峰~鍐欐纭殑鐭俊楠岃瘉鐮�",
+                        type: "error",
+                      });
+                      // 閲嶇疆鍥惧舰楠岃瘉鐮� 鍜� 鐭俊楠岃瘉鐮�
+                      this.getImgCapcha();
+                      this.teacherRegisterForm.imgCode = "";
+                      this.teacherRegisterForm.verificationCode = "";
+                      reject();
+                    }
+                  });
+                })
+                .then((res) => {
+                  this.submitTeacherCertification();
+                });
+            } else {
+              this.submitTeacherCertification();
+            }
+          }
+        }
+      });
+    },
+    // 鏇存柊鐢ㄦ埛淇℃伅
+    submitTeacherCertification() {
+      this.teacherRegisterForm.relevantCertificates.map((item) => {
+        delete item.status;
+        delete item.uid;
+        delete item.url;
+        delete item.percentage;
+        delete item.raw;
+        delete item.response;
+        delete item.size;
+      });
+      const data = {
+        description: "",
+        icon: "",
+        id: this.topicId,
+        topicIdOrRefCode: "teacherRoleApproval",
+        name: this.teacherRegisterForm.fullName,
+        content: "",
+        type: "teacherRegister",
+        state: "WaitAudit",
+        newDataRequests: [],
+        updateDataRequests: this.tool.UpdateworksDataBytool(
+          this.worksInfo,
+          this.topicMessageList,
+          this.teacherRegisterForm,
+          this.teacherRegisterForm.relevantCertificates
+        ),
+        delDataRequest: {
+          ids: [],
+        },
+      };
+      let basicInfo = this.teacherRegisterForm;
+      const userInfo = {
+        requests: [
+          {
+            data: JSON.stringify(basicInfo),
+            name: "鏁欏笀璁よ瘉",
+            type: "teacherInfo",
+          },
+        ],
+      };
+      this.MG.identity.setAppUserInfo(userInfo).then((res) => {
+        if (res) {
+          this.MG.ugc.updateTopicMessage(data).then((res) => {
+            this.subLoading = false;
+            if (res !== false) {
+              this.teacherRegisterLoading = false;
+              this.getApplyTopicData();
+            }
+          });
+        }
+      });
+    },
+    // 涓婁紶鍥剧墖
+    beforeRead(file) {
+      this.isLoding = true;
+      return new Promise((resolve, reject) => {
+        const FileName = file.file.name.split(".")[0];
+        const Extension = file.file.name.split(".")[1];
+        const FileType = file.file.type;
+        if (FileType != "image/jpeg" && FileType != "image/png") {
+          this.$message({
+            message: "鏂囦欢鏍煎紡涓嶅厑璁革紝鍙厑璁镐笂浼犲浘鐗囨牸寮�",
+            type: "error",
+          });
+          return reject();
+        }
+        let size = 1024;
+        this.tool
+          .getFileMd5(file.file, size * 1024)
+          .then((e) => {
+            this.isLoding = false;
+            const imgData = new FormData();
+            this.fileMd5 = e;
+            imgData.append("Md5", e);
+            imgData.append("FileName", FileName);
+            imgData.append("Extension", Extension);
+            imgData.append("FileType", FileType);
+            imgData.append("MetaData", null);
+            imgData.append("file", file.file);
+            this.MG.file.upload(imgData).then((res) => {
+              if (res == "鏂囦欢涓婁紶鎴愬姛") {
+                this.$message({
+                  message: "鍥剧墖涓婁紶鎴愬姛",
+                  type: "success",
+                });
+                resolve(e);
+              } else {
+                reject();
+              }
+            });
+          })
+          .catch((e) => {
+            this.isLoding = false;
+            console.error(e);
+            reject();
+          });
+      });
+    },
+    // 涓婁紶鍥剧墖鎴愬姛鍚庣殑澶勭悊
+    uploadSucceeded(res, file, filelist) {
+      filelist[filelist.length - 1].md5 = res;
+      this.teacherRegisterForm.relevantCertificates = filelist;
+      this.$refs["form"].validate(() => {});
+    },
+    // 鍒犻櫎鏂囦欢涔嬪墠鐨勯挬瀛�
+    beforeDelimg() {
+      return this.$confirm(`纭畾绉婚櫎璇佷欢鐓у悧锛焋);
+    },
+    // 绉婚櫎鍥剧墖
+    handleRemove(file, filelist) {
+      this.teacherRegisterForm.relevantCertificates = filelist;
+    },
+    // 灞曠ず璇佷欢鐓�
+    handlePictureCardPreview(file) {
+      this.dialogImageState = true;
+      this.dialogImageUrl = file.url;
+    },
+    uploadFailed() {
+      this.$message.error("鏂囦欢涓婁紶澶辫触锛岃绋嶅悗閲嶈瘯");
+    },
+    // 鑾峰彇FormTypeItem
+    getTypeItem() {
+      const data = {
+        refCodes: [this.config.refCodes.teacherCertification],
+      };
+      this.MG.resource.getCmsTypeByRefCode(data).then((res) => {
+        this.worksInfo = res[0].cmsTypeLinks[0].children;
+        this.getApplyTopicData();
+      });
+    },
+    // 鑾峰彇鏁欏笀璁よ瘉淇℃伅
+    getApplyTopicData() {
+      this.teacherRegisterLoading = true;
+      const data = {
+        start: 0,
+        size: 1,
+        topicIdOrRefCode: "teacherRoleApproval",
+        appRefCode: this.config.appRefCode,
+        sort: {
+          type: "Desc",
+          field: "CreateDate",
+        },
+      };
+      this.MG.ugc.getTopicMessageList(data).then((res) => {
+        this.teacherRegisterLoading = false;
+        console.log(res, "teacherRoleApproval");
+        // res.datas 涓� 绌烘暟缁�
+        if (res.datas.length != 0) {
+          try {
+            this.topicId = res.datas[0].id;
+            this.topicMessageList = res.datas[0].cmsItemDataList;
+            this.statusNow = res.datas[0].state
+              ? res.datas[0].state
+              : undefined;
+            if (
+              res.datas.length > 0 &&
+              res.datas[0].cmsItemDataList.length > 0
+            ) {
+              this.teacherRegisterForm = this.tool.resultsBytool(
+                this.worksInfo,
+                res.datas[0].cmsItemDataList
+              );
+
+              this.phoneCopy = this.teacherRegisterForm.phone;
+
+              // 璁剧疆鍦板尯
+              let cityArr = this.teacherRegisterForm.region.split("/");
+              if (cityArr[1] == cityArr[0]) {
+                cityArr[1] = "甯傝緰鍖�";
+              }
+              this.selectedOptions =
+                TextToCode[cityArr[0]][cityArr[1]][cityArr[2]].code;
+
+              // 涓嶅睍绀虹煭淇¢獙璇佺爜
+              this.SMSState = false;
+
+              // 灏嗚〃鍗曠姸鎬佺疆涓轰笉鍙紪杈�
+              this.forbidden = true;
+              this.agreementState = true;
+
+              // 璁剧疆鍥剧墖锛岃嚦鏈湴鍥剧墖, uid 鏄负浜嗛�傞厤 element-upload 缁勪欢鐨�(缁勪欢鐨勫睍绀哄拰鍒犻櫎闇�瑕�)銆�
+              this.teacherRegisterForm.relevantCertificates =
+                this.teacherRegisterForm.relevantCertificates.map((item) => {
+                  item.uid = this.tool.uuid();
+                  item.url = getPublicImage(item.md5);
+                  return item;
+                });
+            }
+            // if (this.userInfo.role == "Student" || "") this.status = "";
+            if (this.statusNow == "Reject") {
+              this.reason = JSON.parse(res.datas[0].feedBack).reason;
+            }
+
+            this.teacherRegisterLoading = false;
+          } catch {
+            this.teacherRegisterLoading = false;
+            this.$message.error("鑾峰彇鏁欏笀璁よ瘉淇℃伅澶辫触,璇风◢鍚庨噸璇�");
+          }
+        }
+      });
+    },
+  },
+};
+</script>
+<style lang="less" scoped>
+@import "@/assets/css/theme.less";
+
+.protocolBox {
+  text-align: left;
+  line-height: 23px;
+  z-index: 1;
+  height: 500px;
+  overflow-y: auto;
+  margin-top: -20px;
+  box-sizing: border-box;
+  padding: 10px;
+}
+.agreementBox {
+  color: #00873c;
+}
+.teacherRegisterPage {
+  width: 100%;
+  background: #fff;
+  padding: 32px 40px;
+  box-sizing: border-box;
+  .teacherRegisterBox {
+    .teacherRegisterForm {
+      .zertifizierungsStatus {
+        font-size: 14px;
+        color: #606266;
+        line-height: 40px;
+        margin-bottom: 22px;
+        .reason {
+          font-size: 14px;
+          color: #b3b3b3;
+          margin-left: 134px;
+        }
+        & > :first-child {
+          display: inline-block;
+          width: 130px;
+        }
+        & > :last-child {
+          font-size: 16px;
+        }
+        .status-b {
+          color: #d18252;
+        }
+        .status-f {
+          color: #e50021;
+        }
+        .status-s {
+          color: #00873c;
+        }
+        .status-w {
+          color: #d18252;
+        }
+      }
+      &:deep(.el-input) {
+        width: 603px;
+      }
+      .lecturingSpecixalty {
+        display: flex;
+        border: 1px solid #dcdfe6;
+        border-radius: 4px;
+        padding: 20px;
+        .certificates {
+          display: inline-block;
+          width: 150px;
+          height: 150px;
+          position: relative;
+          border: 1px solid #e4e4e4;
+          background-color: #fdfdfd;
+          margin-right: 40px;
+          .closeButton {
+            position: absolute;
+            right: -11px;
+            top: -11px;
+            color: #e50021;
+            font-size: 20px;
+            background-color: #fff;
+          }
+        }
+      }
+      .notice {
+        font-size: 14px;
+        color: #b3b3b3;
+        margin-left: 140px;
+      }
+      .agreementState {
+        display: flex;
+        padding: 40px 0;
+        height: 20px;
+        align-items: center;
+        .choose {
+          display: inline-block;
+          border: 1px solid #e2e2e2;
+          width: 13px;
+          height: 13px;
+          margin-right: 10px;
+          cursor: pointer;
+          img {
+            margin-left: 2px;
+            margin-bottom: 2px;
+          }
+        }
+        .infoTxt {
+          cursor: pointer;
+        }
+      }
+      .addAddressButton {
+        width: 120px;
+        height: 38px;
+        border-radius: 4px;
+        font-size: 16px;
+        text-align: center;
+        line-height: 40px;
+        float: right;
+        border: 1px solid #00873c;
+        color: #00873c;
+        margin-right: 20px;
+        margin-bottom: 40px;
+        cursor: pointer;
+      }
+      .greenButton {
+        color: #fff;
+        background: linear-gradient(0deg, #00873c 0%, #00aa4c 100%);
+      }
+      .express {
+        font-size: 14px;
+        color: #666666;
+        line-height: 24px;
+        padding: 20px;
+        background: #f2f7f4;
+        .title {
+          line-height: 26px;
+          font-weight: 700;
+        }
+      }
+      .imgCodeBox {
+        margin-left: 20px;
+        height: 40px;
+        width: 140px;
+        cursor: pointer;
+        img {
+          width: 140px;
+          height: 100%;
+        }
+      }
+    }
+    .agreementName {
+      text-align: center;
+      font-size: 24px;
+      font-weight: 700;
+      margin-bottom: 20px;
+    }
+  }
+}
+</style>

--
Gitblit v1.9.1