刘洋 7 months ago
parent
commit
193217595f
4 changed files with 155 additions and 9 deletions
  1. 7 0
      src/api/user.js
  2. BIN
      src/assets/imgs/off.png
  3. 18 1
      src/pages/admissionCard.vue
  4. 130 8
      src/pages/tab-pages/mine.vue

+ 7 - 0
src/api/user.js

@@ -189,3 +189,10 @@ export function getMyHistory() {
     method: "post",
     method: "post",
   });
   });
 }
 }
+
+export function getMySubjects() {
+  return request({
+    url: "/api/student/courses",
+    method: "post",
+  });
+}

BIN
src/assets/imgs/off.png


+ 18 - 1
src/pages/admissionCard.vue

@@ -8,7 +8,10 @@
       <div class="text-center title">准考证</div>
       <div class="text-center title">准考证</div>
       <div class="media-box">
       <div class="media-box">
         <div class="img-box">
         <div class="img-box">
-          <img :src="appStore.globalConfig.fileUrlPrefix + info.photoPath" />
+          <img
+            :src="appStore.globalConfig.fileUrlPrefix + info.photoPath"
+            @click="toPreview"
+          />
         </div>
         </div>
         <div class="media-right info-rows">
         <div class="media-right info-rows">
           <div><span class="label">姓名:</span>{{ info.studentName }}</div>
           <div><span class="label">姓名:</span>{{ info.studentName }}</div>
@@ -93,6 +96,12 @@
         </van-cell>
         </van-cell>
       </van-cell-group>
       </van-cell-group>
     </div>
     </div>
+    <van-image-preview
+      :showIndex="false"
+      v-model:show="showPreview"
+      :images="images"
+    >
+    </van-image-preview>
   </div>
   </div>
 </template>
 </template>
 <script name="AdmissionCard" setup>
 <script name="AdmissionCard" setup>
@@ -102,6 +111,9 @@ import { getAdmissionInfo } from "@/api/user";
 import { useAppStore } from "@/store";
 import { useAppStore } from "@/store";
 
 
 const appStore = useAppStore();
 const appStore = useAppStore();
+const showPreview = ref(false);
+const images = ref([]);
+
 const route = useRoute();
 const route = useRoute();
 const router = useRouter();
 const router = useRouter();
 const { examSiteId, timePeriodId } = route.query;
 const { examSiteId, timePeriodId } = route.query;
@@ -128,6 +140,11 @@ const info = ref({
   timePeriodStart: "",
   timePeriodStart: "",
 });
 });
 
 
+const toPreview = () => {
+  showPreview.value = true;
+  images.value = [appStore.globalConfig.fileUrlPrefix + info.value.photoPath];
+};
+
 function _getAdmissionInfo() {
 function _getAdmissionInfo() {
   getAdmissionInfo({ examSiteId, timePeriodId }).then((res) => {
   getAdmissionInfo({ examSiteId, timePeriodId }).then((res) => {
     res && (info.value = res);
     res && (info.value = res);

+ 130 - 8
src/pages/tab-pages/mine.vue

@@ -1,13 +1,48 @@
 <template>
 <template>
   <div class="tab-page mine p-16">
   <div class="tab-page mine p-16">
-    <van-cell-group inset>
-      <van-cell title="姓名" :value="stuInfo.name" />
-      <van-cell title="证件号" :value="stuInfo.identityNumber" />
-      <van-cell title="学号" :value="stuInfo.studentCode" />
-      <van-cell title="教学点" :value="stuInfo.categoryName" />
-    </van-cell-group>
+    <div class="top-box">
+      <div class="img-box">
+        <img
+          :src="appStore.globalConfig.fileUrlPrefix + stuInfo.photoPath"
+          @click="toPreview"
+        />
+      </div>
+      <div class="top-form">
+        <!-- <van-cell-group inset>
+          <van-cell title="姓名" :value="stuInfo.name" />
+          <van-cell title="证件号" :value="stuInfo.identityNumber" />
+          <van-cell title="学号" :value="stuInfo.studentCode" />
+          <van-cell title="教学点" :value="stuInfo.categoryName" />
+        </van-cell-group> -->
+        <div class="row">
+          <div class="label">姓名:</div>
+          <div class="val">{{ stuInfo.name }}</div>
+        </div>
+        <div class="row">
+          <div class="label">证件号:</div>
+          <div class="val">{{ stuInfo.identityNumber }}</div>
+        </div>
+        <div class="row">
+          <div class="label">学号:</div>
+          <div class="val">{{ stuInfo.studentCode }}</div>
+        </div>
+        <div class="row">
+          <div class="label">教学点:</div>
+          <div class="val">{{ stuInfo.categoryName }}</div>
+        </div>
+      </div>
+    </div>
 
 
     <van-cell-group inset class="cell-group2">
     <van-cell-group inset class="cell-group2">
+      <van-cell is-link @click="showKM = true">
+        <template #title>
+          <img
+            src="../../assets/imgs/icon_apply.png"
+            style="height: 20px; margin-top: -4px; margin-right: 6px"
+          />
+          <span class="custom-title">集中考试科目</span>
+        </template>
+      </van-cell>
       <van-cell is-link @click="toHistory">
       <van-cell is-link @click="toHistory">
         <template #title>
         <template #title>
           <img
           <img
@@ -42,7 +77,7 @@
           预约说明
           预约说明
         </div>
         </div>
         <div style="margin-top: 20px; text-indent: 2em">
         <div style="margin-top: 20px; text-indent: 2em">
-          当前预约系统中,有部分点未开放考生自主预约功能,若您所在教学点未开放学生预约,请联系教学点预约考试,教学点联系方式可在“学在广开”公众号对话框输入教学点名称即可查询。
+          当前预约系统中,有部分教学点未开放考生自主预约功能,若您所在教学点未开放学生预约,请联系教学点预约考试,教学点联系方式可在“学在广开”公众号对话框输入教学点名称即可查询。
           <div style="text-align: center">
           <div style="text-align: center">
             <img
             <img
               style="margin: 10px 0; max-width: 100%; display: block"
               style="margin: 10px 0; max-width: 100%; display: block"
@@ -56,15 +91,51 @@
         </div>
         </div>
       </div>
       </div>
     </van-popup>
     </van-popup>
+    <van-popup teleport="body" v-model:show="showKM" round position="bottom">
+      <div style="padding: 20px; overflow: auto">
+        <div
+          style="
+            text-align: center;
+            font-size: 18px;
+            font-weight: bold;
+            margin-bottom: 20px;
+          "
+        >
+          集中考试科目
+        </div>
+        <div v-for="item in subjectNames" style="margin-bottom: 20px">
+          {{ item }}
+        </div>
+      </div>
+    </van-popup>
+    <van-image-preview
+      :showIndex="false"
+      v-model:show="showPreview"
+      :images="images"
+    >
+    </van-image-preview>
     <div class="hid" @click="countAdd"></div>
     <div class="hid" @click="countAdd"></div>
   </div>
   </div>
 </template>
 </template>
 <script name="Mine" setup>
 <script name="Mine" setup>
-import { computed, ref } from "vue";
+import { computed, ref, onMounted } from "vue";
 import { useUserStore } from "@/store";
 import { useUserStore } from "@/store";
 import { useRouter } from "vue-router";
 import { useRouter } from "vue-router";
 import vconsole from "vconsole";
 import vconsole from "vconsole";
+import { useAppStore } from "@/store";
+import { getMySubjects } from "@/api/user";
+
+const appStore = useAppStore();
 
 
+const showPreview = ref(false);
+const images = ref([]);
+const toPreview = () => {
+  showPreview.value = true;
+  images.value = [
+    appStore.globalConfig.fileUrlPrefix + stuInfo.value.photoPath,
+  ];
+};
+const showKM = ref(false);
 const showYYSM = ref(false);
 const showYYSM = ref(false);
 const count = ref(0);
 const count = ref(0);
 function countAdd() {
 function countAdd() {
@@ -92,10 +163,61 @@ function logout() {
     userStore.logout();
     userStore.logout();
   });
   });
 }
 }
+
+const subjectNames = ref([]);
+onMounted(() => {
+  getMySubjects().then((res) => {
+    console.log("rrr", res);
+    subjectNames.value = (
+      res || [
+        { courseCode: "1", courseName: "11111" },
+        { courseCode: "2", courseName: "22222" },
+      ]
+    ).map((item) => item.courseName);
+  });
+});
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>
 .mine {
 .mine {
   position: relative;
   position: relative;
+  .top-box {
+    &:after {
+      content: "";
+      display: block;
+      clear: both;
+    }
+    .top-form {
+      width: calc(100% - 26vw - 10px);
+      margin-left: calc(26vw + 10px);
+      background-color: #fff;
+      border-radius: 6px;
+      padding: 5px 0;
+      .row {
+        display: flex;
+        align-items: flex-start;
+        padding: 5px 10px;
+        .label {
+          width: 60px;
+          color: #8c8c8c;
+          position: relative;
+          top: -1px;
+        }
+        .val {
+          flex: 1;
+          color: #262626;
+          font-size: 12px;
+        }
+      }
+    }
+  }
+  .img-box {
+    width: 26vw;
+    float: left;
+    img {
+      max-width: 100%;
+      max-height: 150px;
+    }
+  }
   :deep(.custom-btn) {
   :deep(.custom-btn) {
     border: none;
     border: none;
     .van-button__text {
     .van-button__text {