瀏覽代碼

接口对接

刘洋 1 年之前
父節點
當前提交
3f18ef575e

+ 48 - 1
src/api/user.js

@@ -75,10 +75,14 @@ export function getCategoryList(data) {
 }
 
 //获取“数据分类”关联的考点列表
-export function getSiteList() {
+export function getSiteList(data) {
   return request({
     url: "/api/student/exam/site/list",
     method: "post",
+    data,
+    headers: {
+      "Content-Type": "application/x-www-form-urlencoded",
+    },
   });
 }
 
@@ -89,3 +93,46 @@ export function getDateList() {
     method: "post",
   });
 }
+
+//获取电子准考证信息
+export function getAdmissionInfo(data) {
+  return request({
+    url: "/api/student/apply/ticket",
+    method: "post",
+    data,
+    headers: {
+      "Content-Type": "application/x-www-form-urlencoded",
+    },
+  });
+}
+
+//获取考试须知
+export function getExamNotice(data) {
+  return request({
+    url: "/api/student/exam/notice",
+    method: "post",
+    data,
+    headers: {
+      "Content-Type": "application/x-www-form-urlencoded",
+    },
+  });
+}
+//获取考场引导
+export function getRoomGuide(data) {
+  return request({
+    url: "/api/student/exam/room/guide",
+    method: "post",
+    data,
+    headers: {
+      "Content-Type": "application/x-www-form-urlencoded",
+    },
+  });
+}
+
+//获取考生预约结果列表(个人中心)
+export function getMyHistory() {
+  return request({
+    url: "/api/student/apply/list",
+    method: "post",
+  });
+}

+ 42 - 0
src/pages/admissionCard.vue

@@ -0,0 +1,42 @@
+<template>
+  <div class="admission-card"></div>
+</template>
+<script name="AdmissionCard" setup>
+import { ref } from "vue";
+import { useRoute } from "vue-router";
+import { getAdmissionInfo, getExamNotice, getRoomGuide } from "@/api/user";
+const route = useRoute();
+const applyId = route.params.applyId;
+const info = ref({
+  applyId: "",
+  examRoomAddress: "",
+  examRoomCode: "",
+  gender: "",
+  identityNumber: "",
+  name: "",
+  photoPath: "",
+  seatNumber: "",
+  studentCode: "",
+  ticketNumber: "",
+  ticketTitle: "",
+  timePeriodEnd: "",
+  timePeriodStart: "",
+});
+
+function _getAdmissionInfo() {
+  getAdmissionInfo({ applyId }).then((res) => {
+    res && (info.value = res);
+  });
+}
+_getAdmissionInfo();
+
+//获取考试须知
+function _getExamNotice() {
+  getExamNotice({ applyId }).then((res) => {});
+}
+//获取考场引导
+function _getRoomGuide() {
+  getRoomGuide({ applyId }).then((res) => {});
+}
+</script>
+<style lang="less" scoped></style>

+ 3 - 3
src/pages/tab-pages/index.vue

@@ -13,12 +13,12 @@ import { getIndexList, reservationCancel } from "@/api/user";
 const userStore = useUserStore();
 userStore.requestStuInfo();
 const resultList = ref([]);
-function getList() {
+function _getIndexList() {
   getIndexList().then((res) => {
     resultList.value = res || [];
   });
 }
-getList();
+_getIndexList();
 function cancel(item) {
   showConfirmDialog({
     // title: '标题',
@@ -26,7 +26,7 @@ function cancel(item) {
   }).then(() => {
     reservationCancel({ applyId: item.applyId }).then(() => {
       showSuccessToast("取消成功");
-      getList();
+      _getIndexList();
     });
   });
 }

+ 10 - 0
src/pages/tab-pages/mine.vue

@@ -1,3 +1,13 @@
 <template>
   <div class="tab-page mine">我的</div>
 </template>
+<script name="Mine" setup>
+import { ref } from "vue";
+import { getMyHistory } from "@/api/user";
+const list = ref([]);
+function _getMyHistory() {
+  getMyHistory().then((res) => {});
+}
+_getMyHistory();
+</script>
+<style lang="less" scoped></style>

+ 6 - 6
src/pages/tab-pages/reservation.vue

@@ -174,7 +174,7 @@ const toChooseSite = () => {
   router.push({ name: "ChooseSite", params: { id: params.bbb.value } });
 };
 
-function getLocation() {
+function _getCategoryList() {
   getCategoryList().then((res) => {
     res = res || [];
     treeData.value = res;
@@ -184,9 +184,9 @@ function getLocation() {
     }));
   });
 }
-getLocation();
+getCategoryList();
 
-function getDateOptions() {
+function _getDateList() {
   getDateList().then((res) => {
     dateStates.columns = res.map((item) => ({
       value: item,
@@ -194,10 +194,10 @@ function getDateOptions() {
     }));
   });
 }
-getDateOptions();
+_getDateList();
 
 const unApplyNumber = ref("");
-function getResultList() {
+function _getReservationList() {
   getReservationList({
     examSiteId: params.examSiteId.value,
     date: params.date.value,
@@ -224,7 +224,7 @@ function reservation(item) {
 
 watch([() => params.examSiteId, () => params.date], ([examSiteId, date]) => {
   if (examSiteId.value && date.value) {
-    getResultList();
+    _getReservationList();
   } else {
     resultList.value = [];
   }

+ 9 - 0
src/router/routes.js

@@ -39,6 +39,15 @@ const routes = [
     path: "/login",
     name: "Login",
     component: () => import("@/pages/login.vue"),
+    meta: {
+      title: "登录",
+    },
+  },
+  {
+    path: "/admissionCard/:applyId",
+    name: "AdmissionCard",
+    component: () => import("@/pages/admissionCard.vue"),
+    meta: { title: "电子准考证" },
   },
   {
     path: "/404",