ソースを参照

feat: HomePage OK, CoursePage\TestPage beta, refactor: InfoCard\PortalPage

Damon 4 年 前
親
コミット
1c86de3c2e

+ 2 - 0
src/api/course.js → src/api/course/course.js

@@ -1,5 +1,6 @@
 import {axios} from "@/requests/axios.config";
 import mockAPIs from "@/api/mock";
+import courseSelectionAPIs from "@/api/course/courseSelection";
 
 const prefix = "/course";
 
@@ -53,6 +54,7 @@ const courseAPIs = {
   deleteCourse,
   updateCourse,
   getExampleCourses,
+  ...courseSelectionAPIs,
 };
 
 export default courseAPIs;

+ 0 - 0
src/api/courseSelection.js → src/api/course/courseSelection.js


+ 3 - 3
src/api/index.js

@@ -1,15 +1,15 @@
 import userAPIs from "@/api/user";
-import courseAPIs from "@/api/course";
-import courseSelectionAPIs from "@/api/courseSelection";
+import courseAPIs from "@/api/course/course";
 import evalAPIs from "@/api/eval";
 import coderAPIs from "@/api/coder";
+import superAPIs from "@/api/super";
 
 const api = {
   ...userAPIs,
   ...courseAPIs,
-  ...courseSelectionAPIs,
   ...evalAPIs,
   ...coderAPIs,
+  ...superAPIs,
 };
 
 export default api;

+ 25 - 0
src/api/super.js

@@ -0,0 +1,25 @@
+import {axios} from "@/requests/axios.config";
+
+const prefix = "/super";
+
+function superGetInfoAPI(data) {
+  return axios.get(`${prefix}/getInfo`, data);
+}
+
+function superApplyAPI(data) {
+  return axios.post(`${prefix}/apply`, data);
+}
+
+function superReapplyAPI(data) {
+  return axios.post(`${prefix}/reapply`, data);
+}
+
+
+
+const superAPIs = {
+  superGetInfoAPI,
+  superApplyAPI,
+  superReapplyAPI,
+};
+
+export default superAPIs;

+ 15 - 0
src/api/user.js

@@ -26,12 +26,27 @@ function getUserAPI(data){
   });
 }
 
+function saveNameAPI(data) {
+  return axios.post(`${prefix}/saveName`, data);
+}
+
+function saveEmailAPI(data) {
+  return axios.post(`${prefix}/saveEmail`, data);
+}
+
+function saveSignatureAPI(data) {
+  return axios.post(`${prefix}/saveSignature`, data);
+}
+
 const userAPIs = {
   loginAPI,
   registerAPI,
   sendMessageAPI,
   resetAPI,
   getUserAPI,
+  saveNameAPI,
+  saveEmailAPI,
+  saveSignatureAPI,
 };
 
 export default userAPIs;

+ 1 - 2
src/components/CoderCard.vue

@@ -38,8 +38,6 @@
 </template>
 
 <script>
-import {List} from "@element-plus/icons-vue";
-
 export default {
   name: "CoderCard",
   props: {
@@ -80,6 +78,7 @@ export default {
       const userCoderExamsId = res.data.data.res.map(exam => {
         return exam.id;
       });
+      //todo
       console.log(this.coderVO.id in userCoderExamsId);
       // window.open(this.coderURL);
     },

+ 6 - 3
src/components/GlobalHeader.vue

@@ -4,11 +4,13 @@
     <div @click="toPortal">
       <img id="global-header-logo" alt="err" src="@/assets/seec-logo-full-temp.png">
     </div>
-    <div><span style="color: #a4a4a4">[定位用空白及调试信息]</span>———当前: <span style="color: red">{{ currentPage }}</span>页</div>
+<!--    <div><span style="color: #a4a4a4">[定位用空白及调试信息]</span>———当前: <span style="color: red">{{ currentPage }}</span>页</div>-->
+<!--    <div></div>-->
     <div id="global-header-navigator">
       <div class="global-header-navigator-tab" @click="toPortal"><span class="global-header-navigator-tab-text">首页</span></div>
       <div class="global-header-navigator-tab" @click="toTask"><span class="global-header-navigator-tab-text">任务</span></div>
       <div class="global-header-navigator-tab" @click="toManage"><span class="global-header-navigator-tab-text">教师[临]</span></div>
+      <div class="global-header-navigator-tab" @click="toHome"><span class="global-header-navigator-tab-text">个人中心</span></div>
       <div class="global-header-navigator-tab" @click="testButton"><span class="global-header-navigator-tab-text">...</span></div>
     </div>
     <div id="global-header-icon">
@@ -20,7 +22,7 @@
         </svg>
       </div>
       <div class="global-header-icon-content" @click="toHome">
-        <ElDropdown hide-timeout="3000">
+        <ElDropdown :hide-timeout="3000">
           <div v-if="isLogin" id="info-circle">
             <span>{{ name.substring(0, 1) }}</span>
           </div>
@@ -115,6 +117,7 @@ export default {
   display: flex;
   justify-content: center;
   align-items: center;
+  margin-left: 10px;
 }
 
 .global-header-navigator-tab:hover {
@@ -139,7 +142,7 @@ export default {
   justify-content: center;
   align-items: center;
   border-radius: 50%;
-  background: #E6A23C;
+  background: #619dc9;
 }
 
 #info-circle span {

+ 3 - 3
src/global/register-element.js

@@ -16,7 +16,6 @@ import {
   ElDatePicker,
   ElUpload,
   ElDivider,
-  ElMessage,
   ElRadioButton,
   ElRadioGroup,
   ElPopover,
@@ -33,7 +32,7 @@ import {
   ElTag,
   ElTimeline,
   ElTimelineItem,
-  ElBacktop, ElDropdown,
+  ElBacktop, ElDropdown, ElMenu, ElMenuItem,
 } from "element-plus";
 
 // NOTE 使用到的组件列表,请确保 import 和 component 的一致性
@@ -58,7 +57,6 @@ const components = [
   ElDatePicker,
   ElUpload,
   ElDivider,
-  ElMessage,
   ElRadioButton,
   ElRadioGroup,
   ElPopover,
@@ -74,6 +72,8 @@ const components = [
   ElTimelineItem,
   ElBacktop,
   ElDropdown,
+  ElMenu,
+  ElMenuItem,
 ];
 
 export default function (app) {

+ 42 - 2
src/store/modules/user.js

@@ -79,10 +79,50 @@ const user = {
       sessionStorage.removeItem("signature");
       sessionStorage.removeItem("createdTime");
       sessionStorage.removeItem("valid");
-    }
+    },
+    update_user_name: function (state, data) {
+      state.name = data;
+    },
+    update_user_email: function (state, data) {
+      state.email = data;
+    },
+    update_user_signature: function (state, data) {
+      state.signature = data;
+    },
   },
 
-  actions: {},
+  actions: {
+    update_user_name: function ({ commit, state }, that) {
+      that.$apis.saveNameAPI({ newName: that.newName })
+        .then(res => {
+          if (res.data.code === 0) {
+            that.$message({ showClose: true, message: "修改成功", type: "success" });
+            commit("update_user_name", that.newName);
+            that.newName = "";
+          }
+        });
+    },
+    update_user_email: function ({ commit, state }, that) {
+      that.$apis.saveEmailAPI({ newEmail: that.newEmail })
+        .then(res => {
+          if (res.data.code === 0) {
+            that.$message({ showClose: true, message: "修改成功", type: "success" });
+            commit("update_user_email", that.newEmail);
+            that.newEmail = "";
+          }
+        });
+    },
+    update_user_signature: function ({ commit, state }, that) {
+      that.$apis.saveSignatureAPI({ newSignature: that.newSignature })
+        .then(res => {
+          if (res.data.code === 0) {
+            that.$message({ showClose: true, message: "修改成功", type: "success" });
+            commit("update_user_signature", that.newSignature);
+            that.newSignature = "";
+          }
+        });
+    },
+  },
 
   getters: {}
 };

+ 1 - 1
src/views/CoursePage/CoursePage.vue

@@ -79,7 +79,7 @@ export default {
 
 <style scoped>
 #course-page-body {
-  margin: 20px 180px 80px 180px;
+  margin: 40px 180px 80px 180px;
   min-height: calc(100vh - 340px);
   position: relative;
 }

+ 44 - 4
src/views/HomePage/HomePage.vue

@@ -1,17 +1,57 @@
 <template>
   <GlobalHeader/>
-  <p style="text-align: center; font-weight: bolder; font-size: xxx-large">个人中心</p>
-  <img alt="err" src="@/assets/homePage.png" style="width: 100%">
+  <el-row id="home-page-body">
+    <el-col :span="4">
+      <el-menu default-active="1" background-color="#f8f9fb" @select="handleSelect">
+        <el-menu-item index="1">
+          <el-icon>
+            <User/>
+          </el-icon>
+          <span style="padding-left: 20px">基本信息</span>
+        </el-menu-item>
+        <el-menu-item index="2">
+          <el-icon>
+            <Medal/>
+          </el-icon>
+          <span style="padding-left: 20px">身份认证</span>
+        </el-menu-item>
+      </el-menu>
+    </el-col>
+    <el-col :span="1"/>
+    <el-col :span="18">
+      <InformationCard v-if="activeIndex==='1'"/>
+      <CertificationCard v-else/>
+    </el-col>
+  </el-row>
+  <GlobalFooter/>
 </template>
 
 <script>
 import GlobalHeader from "@/components/GlobalHeader";
+import GlobalFooter from "@/components/GlobalFooter";
+import { Medal, User } from "@element-plus/icons-vue";
+import InformationCard from "@/views/HomePage/components/InformationCard";
+import CertificationCard from "@/views/HomePage/components/CertificationCard";
+
 export default {
   name: "HomePage",
-  components: { GlobalHeader },
+  components: { CertificationCard, InformationCard, Medal, User, GlobalFooter, GlobalHeader },
+  data() {
+    return {
+      activeIndex: "1",
+    };
+  },
+  methods: {
+    handleSelect(index) {
+      this.activeIndex = index;
+    },
+  }
 };
 </script>
 
 <style scoped>
-
+#home-page-body {
+  margin: 40px 180px 80px 180px;
+  min-height: calc(100vh - 160px);
+}
 </style>

+ 383 - 0
src/views/HomePage/components/CertificationCard.vue

@@ -0,0 +1,383 @@
+<template>
+  <el-card id="certification-card-body">
+    <template #header>
+      <span style="font-weight: bold; font-size: larger">
+        身份认证
+      </span>
+    </template>
+    <div>
+      <el-tabs v-model="activeTab" class="main-card__tab" type="card">
+        <el-tab-pane :disabled="role!=='STUDENT'&&role!=='TEACHER'" label="教师认证" name="TEACHER">
+          <div class="certification-card-item">
+            认证角色: 教师
+          </div>
+          <div class="certification-card-item">
+            当前状态:
+            <el-tag v-if="state === 'UNIDENTIFIED'" type="info">未认证</el-tag>
+            <el-tag v-if="state === 'REJECTED'" type="danger">未通过</el-tag>
+            <el-tag v-if="state === 'IDENTIFYING'">审核中</el-tag>
+            <el-tag v-if="state === 'IDENTIFIED'" type="success">已认证</el-tag>
+          </div>
+          <div class="certification-card-item">
+            真实姓名:
+            <el-input v-model="teacher.realName" :disabled="disabled" class="certification-card-input" compositionend="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\ ]/g,'')" maxlength="20"
+                      placeholder="请输入真实姓名"></el-input>
+          </div>
+          <div class="certification-card-item">
+            所属单位:
+            <el-input v-model="teacher.organization" :disabled="disabled" class="certification-card-input" maxlength="20" placeholder="请输入单位名称"></el-input>
+          </div>
+          <div class="certification-card-item">
+            教师工号:
+            <el-input v-model="teacher.jobNumber" :disabled="disabled" class="certification-card-input" maxlength="20" oninput="value=value.replace(/[^\d]/g,'')"
+                      placeholder="请输入教师工号"></el-input>
+          </div>
+          <div class="certification-card-item">
+            <el-button v-if="state === 'UNIDENTIFIED'" :loading="loading" class="main-card__tab__button" type="primary" @click="apply('TEACHER')">提交审核</el-button>
+            <el-button v-if="state === 'REJECTED'" :loading="loading" class="main-card__tab__button" type="primary" @click="reapply('TEACHER')">再次提交</el-button>
+          </div>
+        </el-tab-pane>
+        <el-tab-pane :disabled="role!=='STUDENT'&&role!=='ASSISTANT'" label="助教认证" name="ASSISTANT">
+          <div class="certification-card-item">
+            认证角色: 助教
+          </div>
+          <div class="certification-card-item">
+            当前状态:
+            <el-tag v-if="state === 'UNIDENTIFIED'" type="info">未认证</el-tag>
+            <el-tag v-if="state === 'REJECTED'" type="danger">未通过</el-tag>
+            <el-tag v-if="state === 'IDENTIFYING'">审核中</el-tag>
+            <el-tag v-if="state === 'IDENTIFIED'" type="success">已认证</el-tag>
+          </div>
+          <div class="certification-card-item">
+            真实姓名:
+            <el-input v-model="assistant.realName" :disabled="disabled" class="certification-card-input" compositionend="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\ ]/g,'')" maxlength="20"
+                      placeholder="请输入真实姓名"></el-input>
+          </div>
+          <div class="certification-card-item">
+            所属课程:
+            <el-input v-model="assistant.organization" :disabled="disabled" class="certification-card-input" maxlength="20" placeholder="请输入课程名称"></el-input>
+          </div>
+          <div class="certification-card-item">
+            学&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:
+            <el-input v-model="assistant.jobNumber" :disabled="disabled" class="certification-card-input" maxlength="20" oninput="value=value.replace(/[^\d]/g,'')"
+                      placeholder="请输入学号"></el-input>
+          </div>
+          <div class="certification-card-item">
+            <el-button v-if="state === 'UNIDENTIFIED'" :loading="loading" class="main-card__tab__button" type="primary" @click="apply('ASSISTANT')">提交审核</el-button>
+            <el-button v-if="state === 'REJECTED'" :loading="loading" class="main-card__tab__button" type="primary" @click="reapply('ASSISTANT')">再次提交</el-button>
+          </div>
+        </el-tab-pane>
+        <el-tab-pane :disabled="role!=='STUDENT'&&role!=='HR'" label="HR认证" name="HR">
+          <div class="certification-card-item">
+            认证角色: HR
+          </div>
+          <div class="certification-card-item">
+            当前状态:
+            <el-tag v-if="state === 'UNIDENTIFIED'" type="info">未认证</el-tag>
+            <el-tag v-if="state === 'REJECTED'" type="danger">未通过</el-tag>
+            <el-tag v-if="state === 'IDENTIFYING'">审核中</el-tag>
+            <el-tag v-if="state === 'IDENTIFIED'" type="success">已认证</el-tag>
+          </div>
+          <div class="certification-card-item">
+            真实姓名:
+            <el-input v-model="hr.realName" :disabled="disabled" class="certification-card-input" compositionend="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\ ]/g,'')" maxlength="20"
+                      placeholder="请输入真实姓名"></el-input>
+          </div>
+          <div class="certification-card-item">
+            所属单位:
+            <el-input v-model="hr.organization" :disabled="disabled" class="certification-card-input" maxlength="20" placeholder="请输入单位名称"></el-input>
+          </div>
+          <div class="certification-card-item">
+            工作证号:
+            <el-input v-model="hr.jobNumber" :disabled="disabled" class="certification-card-input" maxlength="20" oninput="value=value.replace(/[^\d]/g,'')" placeholder="请输入工作证号"></el-input>
+          </div>
+          <div class="certification-card-item">
+            <el-button v-if="state === 'UNIDENTIFIED'" :loading="loading" class="main-card__tab__button" type="primary" @click="apply('HR')">提交审核</el-button>
+            <el-button v-if="state === 'REJECTED'" :loading="loading" class="main-card__tab__button" type="primary" @click="reapply('HR')">再次提交</el-button>
+          </div>
+        </el-tab-pane>
+        <el-tab-pane :disabled="role!=='STUDENT'&&role!=='STAFF'" label="职员认证" name="STAFF">
+          <div class="certification-card-item">
+            认证角色: 职员
+          </div>
+          <div class="certification-card-item">
+            当前状态:
+            <el-tag v-if="state === 'UNIDENTIFIED'" type="info">未认证</el-tag>
+            <el-tag v-if="state === 'REJECTED'" type="danger">未通过</el-tag>
+            <el-tag v-if="state === 'IDENTIFYING'">审核中</el-tag>
+            <el-tag v-if="state === 'IDENTIFIED'" type="success">已认证</el-tag>
+          </div>
+          <div class="certification-card-item">
+            真实姓名:
+            <el-input v-model="staff.realName" :disabled="disabled" class="certification-card-input" compositionend="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\ ]/g,'')" maxlength="20"
+                      placeholder="请输入真实姓名"></el-input>
+          </div>
+          <div class="certification-card-item">
+            所属单位:
+            <el-input v-model="staff.organization" :disabled="disabled" class="certification-card-input" maxlength="20" placeholder="请输入单位名称"></el-input>
+          </div>
+          <div class="certification-card-item">
+            职员工号:
+            <el-input v-model="staff.jobNumber" :disabled="disabled" class="certification-card-input" maxlength="20" oninput="value=value.replace(/[^\d]/g,'')"
+                      placeholder="请输入职员工号"></el-input>
+          </div>
+          <div class="certification-card-item">
+            <el-button v-if="state === 'UNIDENTIFIED'" :loading="loading" class="main-card__tab__button" type="primary" @click="apply('STAFF')">提交审核</el-button>
+            <el-button v-if="state === 'REJECTED'" :loading="loading" class="main-card__tab__button" type="primary" @click="reapply('STAFF')">再次提交</el-button>
+          </div>
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+  </el-card>
+</template>
+
+<script>
+export default {
+  name: "CertificationCard",
+  data() {
+    return {
+      activeTab: "TEACHER",
+      role: "STUDENT",
+      state: "UNIDENTIFIED",
+      disabled: false,
+      teacher: {
+        realName: "",
+        organization: "",
+        jobNumber: ""
+      },
+      staff: {
+        realName: "",
+        organization: "",
+        jobNumber: ""
+      },
+      hr: {
+        realName: "",
+        organization: "",
+        jobNumber: ""
+      },
+      assistant: {
+        realName: "",
+        organization: "",
+        jobNumber: ""
+      },
+      pageLoading: true,
+      loading: false
+    };
+  },
+  mounted() {
+    this.$apis.superGetInfoAPI({
+      realName: this.realName,
+      jobNumber: this.jobNumber,
+      organization: this.organization
+    }).then((res) => {
+      if (res.data.code === 0) {
+        const data = res.data;
+        switch (data.role) {
+          case "TEACHER":
+            this.teacher.realName = data.realName;
+            this.teacher.jobNumber = data.jobNumber;
+            this.teacher.organization = data.organization;
+            break;
+          case "STAFF" :
+            this.staff.realName = data.realName;
+            this.staff.jobNumber = data.jobNumber;
+            this.staff.organization = data.organization;
+            break;
+          case "HR":
+            this.hr.realName = data.realName;
+            this.hr.jobNumber = data.jobNumber;
+            this.hr.organization = data.organization;
+            break;
+          case "ASSISTANT":
+            this.assistant.realName = data.realName;
+            this.assistant.jobNumber = data.jobNumber;
+            this.assistant.organization = data.organization;
+        }
+        this.state = data.state;
+        this.disabled = (this.state === "IDENTIFYING" || this.state === "IDENTIFIED");
+        this.activeTab = data.role;
+        this.role = data.role;
+      }
+    })
+      .catch((e) => {
+        console.error(e);
+      });
+    this.pageLoading = false;
+  },
+  methods: {
+    apply(role) {
+      let realName, organization, jobNumber;
+      this.loading = true;
+      switch (role) {
+        case "TEACHER" :
+          realName = this.teacher.realName;
+          organization = this.teacher.organization;
+          jobNumber = this.teacher.jobNumber;
+          break;
+        case "STAFF" :
+          realName = this.staff.realName;
+          organization = this.staff.organization;
+          jobNumber = this.staff.jobNumber;
+          break;
+        case "HR" :
+          realName = this.hr.realName;
+          organization = this.hr.organization;
+          jobNumber = this.hr.jobNumber;
+          break;
+        case "ASSISTANT" :
+          realName = this.assistant.realName;
+          organization = this.assistant.organization;
+          jobNumber = this.assistant.jobNumber;
+          break;
+      }
+      if (realName.length === 0) {
+        this.$message({
+          showClose: true,
+          message: "真实姓名不得为空",
+          type: "error"
+        });
+        this.loading = false;
+        return;
+      }
+      if (organization.length === 0) {
+        this.$message({
+          showClose: true,
+          message: "请选择所属单位",
+          type: "error"
+        });
+        this.loading = false;
+        return;
+      }
+      if (jobNumber.length === 0) {
+        this.$message({
+          showClose: true,
+          message: "工号不得为空",
+          type: "error"
+        });
+        this.loading = false;
+        return;
+      }
+      this.$apis.superApplyAPI({
+        realName: realName,
+        jobNumber: jobNumber,
+        organization: organization,
+        role: role
+      }).then((res) => {
+          if (res.data.code === 0) {
+            this.state = "IDENTIFYING";
+            this.disabled = true;
+            this.$message({
+              showClose: true,
+              message: "提交成功,请耐心等待审核结果",
+              type: "success"
+            });
+          } else {
+            this.$message({
+              showClose: true,
+              message: res.data.message,
+              type: "error"
+            });
+          }
+        }
+      ).catch((e) => {
+        console.error(e);
+      });
+      this.loading = false;
+    },
+    reapply(role) {
+      let realName, organization, jobNumber;
+      this.loading = true;
+      switch (role) {
+        case "TEACHER" :
+          realName = this.teacher.realName;
+          organization = this.teacher.organization;
+          jobNumber = this.teacher.jobNumber;
+          break;
+        case "STAFF" :
+          realName = this.staff.realName;
+          organization = this.staff.organization;
+          jobNumber = this.staff.jobNumber;
+          break;
+        case "HR" :
+          realName = this.hr.realName;
+          organization = this.hr.organization;
+          jobNumber = this.hr.jobNumber;
+          break;
+        case "ASSISTANT" :
+          realName = this.assistant.realName;
+          organization = this.assistant.organization;
+          jobNumber = this.assistant.jobNumber;
+          break;
+      }
+      if (realName.length === 0) {
+        this.$message({
+          showClose: true,
+          message: "真实姓名不得为空",
+          type: "error"
+        });
+        this.loading = false;
+        return;
+      }
+      if (organization.length === 0) {
+        this.$message({
+          showClose: true,
+          message: "请选择所属单位",
+          type: "error"
+        });
+        this.loading = false;
+        return;
+      }
+      if (jobNumber.length === 0) {
+        this.$message({
+          showClose: true,
+          message: "工号不得为空",
+          type: "error"
+        });
+        this.loading = false;
+        return;
+      }
+      this.$apis.superReapplyAPI({
+        realName: realName,
+        jobNumber: jobNumber,
+        organization: organization,
+        role: role
+      }).then((res) => {
+          if (res.data.code === 0) {
+            this.state = "IDENTIFYING";
+            this.$message({
+              showClose: true,
+              message: "提交成功,请耐心等待审核结果",
+              type: "success"
+            });
+          } else {
+            this.$message({
+              showClose: true,
+              message: res.data.message,
+              type: "error"
+            });
+          }
+        }
+      ).catch((e) => {
+        console.error(e);
+      });
+      this.loading = false;
+    }
+  }
+};
+</script>
+
+<style scoped>
+:deep(.el-card__body) {
+  padding: 48px;
+}
+
+.certification-card-item {
+  margin-left: 10px;
+  margin-top: 30px;
+  width: 60%;
+}
+
+.certification-card-input {
+  width: 300px;
+}
+</style>

+ 189 - 0
src/views/HomePage/components/InformationCard.vue

@@ -0,0 +1,189 @@
+<template>
+  <el-card id="information-card-body">
+    <template #header>
+      <span style="font-weight: bold; font-size: larger">
+        基本信息
+      </span>
+    </template>
+    <div>
+      <el-row class="row">
+        <el-col :span="3" class="title">
+          昵称
+        </el-col>
+        <el-col :span="6">
+          <el-input v-model="name" class="content" disabled/>
+        </el-col>
+        <el-col :span="1">
+          <el-icon :size="18" class="content-edit" @click="nameEditable = !nameEditable">
+            <Edit/>
+          </el-icon>
+        </el-col>
+      </el-row>
+    </div>
+    <el-dialog v-model="nameEditable" title="修改昵称" width="30vw" @open="newName=this.name">
+      <el-input v-model="newName" autofocus compositionend="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\ ]/g,'')" maxlength="10" placeholder="请输入昵称, 长度为1-10个字符"></el-input>
+      <template #footer>
+      <span>
+        <el-button @click="cancelName">取消</el-button>
+        <el-button type="primary" @click="saveName">确认</el-button>
+      </span>
+      </template>
+    </el-dialog>
+
+    <div>
+      <el-row class="row">
+        <el-col :span="3" class="title">
+          用户名
+        </el-col>
+        <el-col :span="6">
+          <el-input v-model="user.username" class="content" disabled/>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div>
+      <el-row class="row">
+        <el-col :span="3" class="title">
+          邮箱
+        </el-col>
+        <el-col :span="6">
+          <el-input v-model="email" class="content" disabled/>
+        </el-col>
+        <el-col :span="1">
+          <el-icon :size="18" class="content-edit" @click="emailEditable = !emailEditable">
+            <Edit/>
+          </el-icon>
+        </el-col>
+      </el-row>
+    </div>
+    <el-dialog v-model="emailEditable" title="修改邮箱" width="30vw" @open="newEmail=this.email">
+      <el-input v-model="newEmail" autofocus maxlength="255" placeholder="请输入邮箱"></el-input>
+      <template #footer>
+      <span>
+        <el-button @click="cancelEmail">取消</el-button>
+        <el-button type="primary" @click="saveEmail">确认</el-button>
+      </span>
+      </template>
+    </el-dialog>
+
+    <div>
+      <el-row class="row">
+        <el-col :span="3" class="title">
+          手机号
+        </el-col>
+        <el-col :span="6">
+          <el-input v-model="user.phone" class="content" disabled/>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div>
+      <el-row class="row">
+        <el-col :span="3" class="title">
+          个性签名
+        </el-col>
+        <el-col :span="6">
+          <el-input v-model="signature" class="content" disabled/>
+        </el-col>
+        <el-col :span="1">
+          <el-icon :size="18" class="content-edit" @click="signatureEditable = !signatureEditable">
+            <Edit/>
+          </el-icon>
+        </el-col>
+      </el-row>
+    </div>
+    <el-dialog v-model="signatureEditable" title="修改个性签名" width="30vw" @open="newSignature=this.signature">
+      <el-input v-model="newSignature" autofocus maxlength="20" placeholder="请输入个性签名,长度1-20个字符"></el-input>
+      <template #footer>
+      <span>
+        <el-button @click="cancelSignature">取消</el-button>
+        <el-button type="primary" @click="saveSignature">确认</el-button>
+      </span>
+      </template>
+    </el-dialog>
+  </el-card>
+</template>
+
+<script>
+import { Edit } from "@element-plus/icons-vue";
+
+export default {
+  name: "InformationCard",
+  components: { Edit },
+  data() {
+    return {
+      newName: "",
+      nameEditable: false,
+      newEmail: "",
+      emailEditable: false,
+      newSignature: "",
+      signatureEditable: false,
+    };
+  },
+  computed: {
+    user() {
+      return this.$store.state.user;
+    },
+    name() {
+      return this.$store.state.user.name;
+    },
+    email() {
+      return this.$store.state.user.email;
+    },
+    signature() {
+      return this.$store.state.user.signature;
+    }
+  },
+  methods: {
+    cancelName() {
+      this.newName = "";
+      this.nameEditable = false;
+    },
+    saveName() {
+      const that = this;
+      this.$store.dispatch("update_user_name", that);
+      this.nameEditable = false;
+    },
+    cancelEmail() {
+      this.newEmail = "";
+      this.emailEditable = false;
+    },
+    saveEmail() {
+      const that = this;
+      this.$store.dispatch("update_user_email", that);
+      this.emailEditable = false;
+    },
+    cancelSignature() {
+      this.newSignature = "";
+      this.signatureEditable = false;
+    },
+    saveSignature() {
+      const that = this;
+      this.$store.dispatch("update_user_signature", that);
+      this.signatureEditable = false;
+    },
+  }
+};
+</script>
+
+<style scoped>
+:deep(.el-card__body) {
+  padding: 48px;
+  display: grid;
+  grid-gap: 24px;
+}
+
+.row {
+  display: flex;
+  align-items: baseline;
+}
+
+.content-edit {
+  padding-left: 10px;
+}
+
+.content-edit:hover {
+  cursor: pointer;
+  color: #409eff;
+}
+</style>

+ 2 - 1
src/views/ManagePage/ManagePage.vue

@@ -81,7 +81,7 @@
       </div>
     </el-dialog>
   </div>
-
+  <GlobalFooter/>
 </template>
 
 <script setup>
@@ -90,6 +90,7 @@ import CourseCard from "@/components/CourseCard";
 import {reactive, ref} from "vue";
 import {getCurrentInstance} from "vue";
 import {ElMessage} from "element-plus";
+import GlobalFooter from "@/components/GlobalFooter";
 
 const _this = getCurrentInstance().appContext.config.globalProperties;
 

+ 1 - 1
src/views/PortalPage/PortalPage.css

@@ -3,7 +3,7 @@
     display: grid;
     grid-template-columns: 1fr 2.5fr;
     grid-template-rows: 210px auto auto;
-    grid-gap: 20px 20px;
+    grid-gap: 12px 12px;
     padding: 10px 180px 80px 180px;
 }
 

+ 2 - 2
src/views/PortalPage/PortalPage.vue

@@ -38,7 +38,7 @@
       <el-card id="portal-course-card-main" ref="portalCourseCardBodyMain" :style="{height: courseRowHeight + 'px'}">
         <div class="portal-card-title">
           <div class="portal-card-title-main">精选课程</div>
-          <ElButton plain type="primary" @click="toCourse">查看全部课程</ElButton>
+          <ElButton round plain type="primary" @click="toCourse">查看全部课程</ElButton>
         </div>
         <el-divider class="portal-card-divider"/>
         <el-row justify="space-around" type="flex">
@@ -81,7 +81,7 @@
       <el-card id="portal-test-card-main" ref="portalTestCardBodyMain">
         <div class="portal-card-title">
           <div class="portal-card-title-main">智能测试</div>
-          <ElButton plain type="primary" @click="toTest">查看全部测试</ElButton>
+          <ElButton plain round type="primary" @click="toTest">查看全部测试</ElButton>
         </div>
         <el-divider class="portal-card-divider"/>
         <el-tabs v-model="activeTestName" @tab-click="changeTestPane">

+ 9 - 7
src/views/PortalPage/components/InfoCard.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-card style="width: 200px">
+  <el-card>
     <div id="info-card-body">
       <div>SEECODER</div>
       <div v-if="isLogin" id="info-card-circle">
@@ -67,7 +67,7 @@ export default {
 
 <style scoped>
 #info-card-body {
-  height: 200px;
+  height: 160px;
   margin: 0 auto 0 auto;
   display: flex;
   flex-direction: column;
@@ -83,7 +83,7 @@ export default {
   justify-content: center;
   align-items: center;
   border-radius: 50%;
-  background: #E6A23C;
+  background: #619dc9;
 }
 
 #info-card-circle span {
@@ -96,13 +96,14 @@ export default {
 }
 
 #info-card-button-in {
-  width: 80%;
+  width: 120px;
   height: 30px;
   border-radius: 15px;
   display: flex;
   justify-content: center;
   align-items: center;
-  background: #FFF1DE;
+  /*background: #FFF1DE;*/
+  background: #E6F1FC;
 }
 
 #info-card-button-in:hover {
@@ -110,11 +111,12 @@ export default {
 }
 
 #info-card-button-in span {
-  color: #E6A23C;
+  /*color: #E6A23C;*/
+  color: #1989FA;
 }
 
 #info-card-button-not {
-  width: 80%;
+  width: 120px;
   height: 30px;
   border-radius: 15px;
   display: flex;

+ 5 - 1
src/views/TestPage/TestPage.vue

@@ -63,7 +63,7 @@ export default {
 
 <style scoped>
 #test-page-body {
-  margin: 20px 180px 80px 180px;
+  margin: 40px 180px 80px 180px;
   min-height: calc(100vh - 340px);
   position: relative;
 }
@@ -86,4 +86,8 @@ export default {
   grid-template-columns: 1fr 1fr 1fr 1fr;
   grid-gap: 20px 20px;
 }
+
+:deep(.el-divider) {
+  margin: 0;
+}
 </style>