Tang 2 年之前
父节点
当前提交
c82122c05c
共有 3 个文件被更改,包括 146 次插入11 次删除
  1. 4 3
      src/pages/course-detail/components/CourseTree.vue
  2. 6 8
      src/pages/payment/index.vue
  3. 136 0
      src/pages/payment/updateUserInfo.vue

+ 4 - 3
src/pages/course-detail/components/CourseTree.vue

@@ -595,7 +595,7 @@ export default {
             .reChapterList({
               moduleId: item.moduleId,
               gradeId: this.goodsData.gradeId,
-              courseId: this.courseDataList[0].courseId,
+              courseId: this.courseList[0].courseId,
               orderGoodsId: this.goodsData.orderGoodsId,
               rebuild: this.rebuild
             })
@@ -1119,6 +1119,7 @@ export default {
         ); //重新赋值当前节数据
         ary = this.allSectionList[index + 1];
       }
+      console.log(ary, "ary");
       if (ary) {
         if (ary.type != 3) {
           this.$confirm(
@@ -1133,7 +1134,7 @@ export default {
             .then(() => {
               this.repeatShowTips = false; //是否显示跳转提示
               this.openMenu(ary);
-              this.unfoldFunc(ary, true);
+              this.unfoldFunc(ary, true, true);
             })
             .catch(() => {});
         } else {
@@ -1144,7 +1145,7 @@ export default {
           })
             .then(() => {
               this.openMenu(ary);
-              this.unfoldFunc(ary, true);
+              this.unfoldFunc(ary, true, true);
             })
             .catch(() => {});
         }

+ 6 - 8
src/pages/payment/index.vue

@@ -83,13 +83,14 @@
         <p>客服电话:020-87085982</p>
       </div>
     </el-dialog>
-
+    <updateUserInfo ref="updateUserInfo"></updateUserInfo>
     <ToolBar></ToolBar>
     <Footer></Footer>
   </div>
 </template>
 
 <script>
+import updateUserInfo from "./updateUserInfo.vue";
 import Footer from "@/components/footer/index";
 import Header from "@/components/header/index";
 import ToolBar from "@/components/toolbar/index";
@@ -101,7 +102,8 @@ export default {
     Footer,
     Header,
     ToolBar,
-    ClassTimeTip
+    ClassTimeTip,
+    updateUserInfo
   },
   data() {
     return {
@@ -221,9 +223,7 @@ export default {
               type: "warning"
             })
               .then(() => {
-                this.$router.push({
-                  path: "/person-center/my-info"
-                });
+                this.$refs.updateUserInfo.openBox(1);
               })
               .catch(() => {});
             reject();
@@ -248,9 +248,7 @@ export default {
               }
             )
               .then(() => {
-                this.$router.push({
-                  path: "/person-center/my-info"
-                });
+                this.$refs.updateUserInfo.openBox(2);
               })
               .catch(() => {});
             reject();

+ 136 - 0
src/pages/payment/updateUserInfo.vue

@@ -0,0 +1,136 @@
+<template>
+  <div id="">
+    <el-dialog
+      title="完善信息"
+      :visible.sync="isShow"
+      width="600px"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      :show-close="false"
+    >
+      <el-form
+        :model="ruleForm"
+        :rules="rules"
+        ref="ruleForm"
+        label-width="100px"
+        class="demo-ruleForm"
+      >
+        <el-form-item label="姓名" prop="realname">
+          <el-input
+            :readonly="formData.realname ? true : false"
+            v-model.trim="ruleForm.realname"
+            placeholder="请输入姓名"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="身份证" prop="idCard">
+          <el-input
+            :readonly="formData.idCard ? true : false"
+            v-model.trim="ruleForm.idCard"
+            placeholder="请输入身份证"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="性别" prop="sex" v-if="type == 2">
+          <el-radio-group
+            v-model="ruleForm.sex"
+            :disabled="formData.sex ? true : false"
+          >
+            <el-radio :label="1">男</el-radio>
+            <el-radio :label="2">女</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="公司名称" prop="companyName" v-if="type == 2">
+          <el-input
+            :readonly="formData.companyName ? true : false"
+            v-model.trim="ruleForm.companyName"
+            placeholder="请输入公司名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="教育层次" prop="eduLevel" v-if="type == 2">
+          <el-select
+            v-model="ruleForm.eduLevel"
+            placeholder="请选择教育层次"
+            :disabled="formData.eduLevel ? true : false"
+          >
+            <el-option
+              v-for="(items, indexs) in $store.state.dictList['edu_level']"
+              :key="indexs"
+              :label="items"
+              :value="items"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="close">取 消</el-button>
+        <el-button type="primary" @click="submitForm" :loading="uploading"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      isShow: false,
+      uploading: false,
+      ruleForm: {},
+      formData: {}, //备份
+      type: null, //1-学员姓名、身份证 2-学员姓名、身份证、性别、公司名称、教育层次
+      rules: {
+        realname: [{ required: true, message: "请输入姓名", trigger: "blur" }],
+        idCard: [{ required: true, message: "请输入身份证", trigger: "blur" }],
+        companyName: [
+          { required: true, message: "请输入公司名称", trigger: "blur" }
+        ],
+        eduLevel: [
+          { required: true, message: "请选择教育层次", trigger: "change" }
+        ],
+        sex: [{ required: true, message: "请选择性别", trigger: "change" }]
+      }
+    };
+  },
+  methods: {
+    //type:1-学员姓名、身份证 2-学员姓名、身份证、性别、公司名称、教育层次
+    openBox(type) {
+      this.type = type;
+      this.isShow = true;
+      this.ruleForm = Object.assign({}, this.$store.state.userInfo);
+      this.formData = Object.assign({}, this.$store.state.userInfo);
+    },
+    close() {
+      this.isShow = false;
+      this.$refs.ruleForm.resetFields();
+    },
+    submitForm() {
+      this.$refs["ruleForm"].validate(valid => {
+        if (valid) {
+          let data = {
+            userId: this.ruleForm.userId,
+            realname: this.ruleForm.realname,
+            idCard: this.ruleForm.idCard,
+            sex: this.ruleForm.sex,
+            companyName: this.ruleForm.companyName,
+            eduLevel: this.ruleForm.eduLevel
+          };
+          this.$request.editAppUser(data).then(res => {
+            if (res.code === 200) {
+              this.$store.dispatch("getUserInfo");
+              this.$message.success("保存成功");
+              this.close();
+            }
+          });
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped></style>