Browse Source

auto commit

gcz 3 years ago
parent
commit
91d045e14a

+ 1 - 1
.env.production

@@ -2,4 +2,4 @@
 NODE_ENV = production
 
 # 生产环境
-VUE_APP_BASE_API = 'http://172.16.90.64:7200/teacher/'
+VUE_APP_BASE_API = 'http://wx.hw.hongweisoft.com/veterans/teacher'

+ 9 - 0
src/assets/scss/base.scss

@@ -135,4 +135,13 @@ body, html {
 			.btn + .btn{margin-left: 24px;}
 		}
 	}
+}
+.submit-btn{
+	height: 80px;
+	line-height: 80px;
+	background: #709078;
+	text-align: center;
+	margin: 150px 0 24px;
+	color: #fff;
+	cursor: pointer;
 }

+ 2 - 0
src/utils/request.js

@@ -23,6 +23,8 @@ export default {
     login: (params) => request.POST(baseUrl + '/auth/login', params),
     resetPwd: (params) => request.PUT(baseUrl + '/teacheruser/resetPwd', params),
     getUserInfo: (params) => request.GET(baseUrl + '/teacheruser/getInfo', params),
+    getStudentInfo: (params) => request.GET(baseUrl + '/teacheruser/getInfo', params),
     setting: (params) => request.PUT(baseUrl + '/teacher', params),//消息屏蔽设置
     updateClassStatus: (id,params) => request.PUT(baseUrl + '/learnclass/updateStatus/'+id, params),//更新班级状态
+    logout: (params) => request.DELETE(`${baseUrl}/auth/logout`, params),
 }

+ 13 - 6
src/views/Center.vue

@@ -82,13 +82,20 @@ export default {
         });
     },
     logOut() {
-      this.$store
-        .dispatch("FedLogOut")
-        .then(() => {
-          location.href = "/#/login";
+      this.$api
+        .logout()
+        .then((res) => {
+          this.$store
+            .dispatch("FedLogOut")
+            .then(() => {
+              location.href = "/#/login";
+            })
+            .catch((err) => {
+              console.log("logOut err", err);
+            });
         })
-        .catch((err) => {
-          console.log("logOut err", err);
+        .catch((error) => {
+          console.log(error);
         });
     },
   },

+ 1 - 1
src/views/ClassDetails.vue

@@ -193,7 +193,7 @@ export default {
         });
     },
     goDetails(id) {
-      this.$router.push({ path: "/StudentsDetails", query: { id: id } });
+      this.$router.push({ path: "/StudentsDetails", query: { studentId: id ,classId:this.classId} });
     },
     handleReleasingNotices() {
       this.releasingNoticesShow = true;

+ 87 - 5
src/views/StudentsDetails.vue

@@ -1,11 +1,37 @@
 <template>
   <div class="ClassDetails full-body">
-    <NavBar title="学生详情" backUrl="/ClassDetails?id=1" />
+    <NavBar title="学生详情" :backUrl="backUrl" />
     <section class="base-info">
-      <img src="http://img.momen.vip/xsfm.jpg" alt="" class="img" />
-      <div class="name">郝爱国</div>
-      <div class="course">(汽车检测与维修)</div>
+      <img :src="studentInfo.avatar || defaultAvatar" alt="" class="img" />
+      <div class="name">{{ studentInfo.nickName || studentInfo.userName }}</div>
+      <div class="course" v-if="studentInfo.schoolName">
+        ({{ studentInfo.schoolName }})
+      </div>
     </section>
+    <!-- <section class="evaluation">
+      <div class="rateTitle">我的评论</div>
+      <van-rate class="rate" v-model="rateValue" />
+      <div class="evaluat">
+        <van-tag class="evaluat-item" round size="large" type="primary"
+          >认真</van-tag
+        >
+        <van-tag class="evaluat-item" round size="large" type="primary"
+          >努力</van-tag
+        >
+        <van-tag class="evaluat-item" plain size="large" round type="primary"
+          >聪明</van-tag
+        >
+      </div>
+      <van-field
+        class="textarea"
+        v-model="evaluat"
+        type="textarea"
+        :border="true"
+        placeholder="请输入您的评价"
+      />
+      <div class="submit-btn">提交</div>
+    </section> -->
+    
   </div>
 </template>
 <script>
@@ -13,7 +39,37 @@ import NavBar from "@/components/NavBar.vue";
 export default {
   components: { NavBar },
   data() {
-    return {};
+    return {
+      defaultAvatar: require("@/static/img/default-avatar.png"),
+      backUrl: "/",
+      classId: "",
+      studentId: "",
+      studentInfo: {},
+      rateValue: 3,
+      evaluat: "",
+    };
+  },
+  created() {
+    this.classId = this.$route.query.classId;
+    this.studentId = this.$route.query.studentId;
+    this.backUrl = `/ClassDetails?id=${this.classId}`;
+    this.getStudentInfo();
+  },
+  methods: {
+    getStudentInfo() {
+      this.$api
+        .getStudentInfo({ id: this.studentId })
+        .then((res) => {
+          // 当请求成功
+          if (res.code == "200") {
+            console.log("studentInfo res", res);
+            this.studentInfo = res.data;
+          }
+        })
+        .catch((error) => {
+          console.log(error);
+        });
+    },
   },
 };
 </script>
@@ -46,4 +102,30 @@ export default {
     letter-spacing: 1px;
   }
 }
+.evaluation {
+  margin: 24px;
+  .rateTitle {
+    font-size: 32px;
+    font-weight: 400;
+    color: #000;
+    line-height: 45px;
+    letter-spacing: 1px;
+  }
+  .rate {
+    margin-bottom: 24px;
+  }
+  .evaluat {
+    margin-bottom: 24px;
+    .evaluat-item {
+      & + .evaluat-item {
+        margin-left: 10px;
+      }
+    }
+  }
+  .textarea {
+    border: 1px solid #ddd;
+    background: #f5f5f5;
+    border-radius: 10px;
+  }
+}
 </style>

+ 2 - 2
vue.config.js

@@ -23,8 +23,8 @@ module.exports = {
   devServer: {
     proxy: {
       [process.env.VUE_APP_BASE_API]: {
-        // target: `http://wx.hw.hongweisoft.com/veterans/company/`,
-        target: `http://172.16.90.110:7200/teacher`,
+        target: `http://wx.hw.hongweisoft.com/veterans/teacher`,
+        // target: `http://172.16.90.110:7200/teacher`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''