ソースを参照

添加个人数据

aaa 4 年 前
コミット
7c8a5b0fbd

+ 1 - 1
package-lock.json

@@ -4727,7 +4727,7 @@
     "doctrine": {
       "version": "1.5.0",
       "resolved": "https://registry.npm.taobao.org/doctrine/download/doctrine-1.5.0.tgz",
-      "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
+      "integrity": "sha1-N53Ocw9hZvds76JTXTHoVmwLFpvo=",
       "dev": true,
       "requires": {
         "esutils": "^2.0.2",

+ 1 - 1
src/api/modules/exam.js

@@ -1,4 +1,4 @@
-// TMC系统相关api
+// JTXT系统相关api
 export default {
   basePath: process.env.VUE_APP_JTXT_URL,
   apiList: {

+ 1 - 1
src/api/modules/learn.js

@@ -1,4 +1,4 @@
-// TMC系统相关api
+// JTXT系统相关api
 export default {
   basePath: process.env.VUE_APP_JTXT_URL,
   apiList: {

+ 10 - 0
src/api/modules/user.js

@@ -0,0 +1,10 @@
+// JTXT系统相关api
+export default {
+  basePath: process.env.VUE_APP_JTXT_URL,
+  apiList: {
+    // 查询根目录
+    JTXT_GET_USER_DAIYL_POINTS: "user/{userName}/daily-points",
+    //  查询考试历史
+    JTXT_GET_USER_EXAMS_HISTORY: "exams/history"
+  }
+};

+ 25 - 1
src/router/index.js

@@ -41,7 +41,31 @@ let routes = [
     name: "learn-content",
     props: true,
     component: () => import("@/views/home/learn/page-learn-content")
-  } // 学习内容页
+  }, // 学习内容页
+  {
+    path: "/exam-history/:userId",
+    name: "exam-history",
+    props: true,
+    component: () => import("@/views/home/person/exam-history")
+  }, // 考试历史记录
+  {
+    path: "/collection/:userId",
+    name: "collection",
+    props: true,
+    component: () => import("@/views/home/person/collection")
+  }, // 收藏
+  {
+    path: "/rank/:userId",
+    name: "rank",
+    props: true,
+    component: () => import("@/views/home/person/rank")
+  }, // 排行榜
+  {
+    path: "/user-manual/:userId",
+    name: "user-manual",
+    props: true,
+    component: () => import("@/views/home/person/user-manual")
+  } // 使用手册
 ];
 
 export default new Router({

+ 26 - 0
src/views/home/person/collection.vue

@@ -0,0 +1,26 @@
+<template>
+  <div>
+    <van-nav-bar title="收藏" left-arrow @click-left="onClickLeft" />
+  </div>
+</template>
+
+<script>
+export default {
+  name: "collection",
+  components: {},
+  data() {
+    return {};
+  },
+  mounted() {
+    console.log("--收藏--");
+  },
+  methods: {
+    onClickLeft() {
+      this.$router.back();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 69 - 0
src/views/home/person/exam-history.vue

@@ -0,0 +1,69 @@
+<template>
+  <div>
+    <van-nav-bar title="成绩" left-arrow @click-left="onClickLeft" />
+    <van-list
+      v-model="loading"
+      :finished="finished"
+      finished-text="没有更多了"
+      @load="onLoad"
+    >
+      <van-cell
+        v-for="(item, index) in examHistoryList"
+        :key="index"
+        :title="item.name"
+      >
+        <div>{{ item.time }}</div>
+      </van-cell>
+    </van-list>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "exam-history",
+  components: {},
+  data() {
+    return {
+      examHistoryList: [
+        { name: "期中考试", time: "2021-02-10", score: "98" },
+        { name: "期中考试", time: "2021-02-10", score: "98" },
+        { name: "期中考试", time: "2021-02-10", score: "98" },
+        { name: "期中考试", time: "2021-02-10", score: "98" },
+        { name: "期中考试", time: "2021-02-10", score: "98" },
+        { name: "期中考试", time: "2021-02-10", score: "98" }
+      ],
+      loading: false,
+      finished: false
+    };
+  },
+  mounted() {
+    this.getExamHistory();
+  },
+  methods: {
+    getExamHistory() {
+      let params = {
+        user: "testuser-zirKBELIlg"
+      };
+      this.$_http
+        .get(this.$_API.JTXT_GET_USER_EXAMS_HISTORY, { params })
+        .then(res => {
+          this.contentObj = res.data;
+          console.log(
+            "--user-exam-history--" + JSON.stringify(this.contentObj)
+          );
+          this.finished = true;
+        })
+        .catch(() => {
+          this.$store.commit("toggleLoading", false);
+        });
+    },
+    onClickLeft() {
+      this.$router.back();
+    },
+    onLoad() {}
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 34 - 7
src/views/home/person/page-person.vue

@@ -41,6 +41,7 @@
             :key="index"
             :icon="item.icon"
             :text="item.title"
+            @click="clickGridIcon(item)"
           />
         </van-grid>
         <div style="height: 3rem"></div>
@@ -67,16 +68,42 @@ export default {
       faceUrl: "",
       userName: "test@test.com",
       menus: [
-        { title: "考试成绩", icon: "photo-o" },
-        { title: "收藏", icon: "photo-o" },
-        { title: "排行榜", icon: "photo-o" },
-        { title: "使用手册", icon: "photo-o" },
-        { title: "积分兑换", icon: "photo-o" }
+        { title: "考试成绩", icon: "photo-o", to: "exam-history" },
+        { title: "收藏", icon: "photo-o", to: "collection" },
+        { title: "排行榜", icon: "photo-o", to: "rank" },
+        { title: "使用手册", icon: "photo-o", to: "user-manual" },
+        { title: "积分兑换", icon: "photo-o", to: "" }
       ]
     };
   },
-  computed: {},
-  methods: {}
+  mounted() {
+    this.getDailyPoints();
+  },
+  methods: {
+    //   获取今日分数
+    getDailyPoints() {
+      let path = {
+        userName: "testuser-zirKBELIlg"
+      };
+      this.$_http
+        .get(this.$pathParams(this.$_API.JTXT_GET_USER_DAIYL_POINTS, path))
+        .then(res => {
+          this.contentObj = res.data;
+          console.log("--user--" + JSON.stringify(this.contentObj));
+        })
+        .catch(() => {
+          this.$store.commit("toggleLoading", false);
+        });
+    },
+    // 点击宫格图标
+    clickGridIcon(item) {
+      console.log("---click--" + JSON.stringify(item));
+      this.$router.push({
+        name: item.to,
+        params: { userId: "testuser-zirKBELIlg" }
+      });
+    }
+  }
 };
 </script>
 

+ 26 - 0
src/views/home/person/rank.vue

@@ -0,0 +1,26 @@
+<template>
+  <div>
+    <van-nav-bar title="排行榜" left-arrow @click-left="onClickLeft" />
+  </div>
+</template>
+
+<script>
+export default {
+  name: "rank",
+  components: {},
+  data() {
+    return {};
+  },
+  mounted() {
+    console.log("--收藏--");
+  },
+  methods: {
+    onClickLeft() {
+      this.$router.back();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 26 - 0
src/views/home/person/user-manual.vue

@@ -0,0 +1,26 @@
+<template>
+  <div>
+    <van-nav-bar title="使用手册" left-arrow @click-left="onClickLeft" />
+  </div>
+</template>
+
+<script>
+export default {
+  name: "user-manual",
+  components: {},
+  data() {
+    return {};
+  },
+  mounted() {
+    console.log("--收藏--");
+  },
+  methods: {
+    onClickLeft() {
+      this.$router.back();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+</style>