Browse Source

feat:问题记录

朱波 1 year ago
parent
commit
f645b43863

+ 8 - 8
index.html

@@ -1,17 +1,17 @@
 <!doctype html>
 <html lang="zh-cn">
 <head>
-    <meta charset="UTF-8"/>
-    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
-    <link rel="icon" href="/logo.png">
-    <title>思维芯测评报告</title>
+  <meta charset="UTF-8" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+  <link rel="icon" href="/logo.png">
+  <title>思维芯测评报告</title>
 </head>
 <body>
 <script>
-    window.getToken = (token) => {
-        sessionStorage.setItem('token', token)
-        console.log("家园共育APP 返回的 token:", token);
-    };
+  window.getToken = (token) => {
+    sessionStorage.setItem("token", token);
+    console.log("家园共育APP 返回的 token:", token);
+  };
 </script>
 
 <div id="app"></div>

+ 1 - 0
package.json

@@ -12,6 +12,7 @@
     "axios": "^1.5.0",
     "html2canvas": "^1.4.1",
     "jspdf": "^2.5.1",
+    "lottie-web": "^5.12.2",
     "pdfjs-dist": "^4.0.189",
     "pinia": "^2.1.6",
     "sass": "^1.67.0",

+ 1 - 0
src/main.ts

@@ -6,6 +6,7 @@ import App from "./App.vue";
 import router from "@/router";
 import store from "@/store";
 import "vant/lib/index.css";
+
 // import vconsole from "vconsole";
 // new vconsole();
 

+ 1 - 1
src/router/index.ts

@@ -5,7 +5,7 @@ const router = createRouter({
   routes: [
     {
       path: "/",
-      redirect: "/demo",
+      redirect: "/report",
     },
     {
       path: "/demo",

+ 27 - 3
src/styles/fonts.scss

@@ -10,15 +10,39 @@
 
 @font-face {
   font-family: "YouSheBiaoTiYuan";
-  src: url("https://app-resources-luojigou.luojigou.vip/fonts/YouSheBiaoTiYuan.otf") format("opentype");
+  src: url("@/assets/font/YouSheBiaoTiYuan/YouSheBiaoTiYuan.eot"); /* IE9 */
+  src: url("@/assets/font/YouSheBiaoTiYuan/YouSheBiaoTiYuan.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
+
+  url("@/assets/font/YouSheBiaoTiYuan/YouSheBiaoTiYuan.woff") format("woff"), /* chrome、firefox */
+  url("@/assets/font/YouSheBiaoTiYuan/YouSheBiaoTiYuan.ttf") format("truetype"), /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
+
+  url("@/assets/font/YouSheBiaoTiYuan/YouSheBiaoTiYuan.svg#YouSheBiaoTiYuan") format("svg"); /* iOS 4.1- */
+  font-style: normal;
+  font-weight: normal;
 }
 
 @font-face {
   font-family: "PingFang SC-Regular";
-  src: url("https://app-resources-luojigou.luojigou.vip/fonts/PingFang-SC-Regular.ttf") format("opentype");
+  src: url("@/assets/font/PingFang-SC-Regular/PingFang-SC-Regular.eot"); /* IE9 */
+  src: url("@/assets/font/PingFang-SC-Regular/PingFang-SC-Regular.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
+
+  url("@/assets/font/PingFang-SC-Regular/PingFang-SC-Regular.woff") format("woff"), /* chrome、firefox */
+  url("@/assets/font/PingFang-SC-Regular/PingFang-SC-Regular.ttf") format("truetype"), /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
+
+  url("@/assets/font/PingFang-SC-Regular/PingFang-SC-Regular.svg#PingFang-SC-Regular") format("svg"); /* iOS 4.1- */
+  font-style: normal;
+  font-weight: normal;
 }
 
 @font-face {
   font-family: "PingFang SC";
-  src: url("https://app-resources-luojigou.luojigou.vip/fonts/PingFang-SC-Regular.ttf") format("opentype");
+  src: url("@/assets/font/PingFang-SC-Regular/PingFang-SC-Regular.eot"); /* IE9 */
+  src: url("@/assets/font/PingFang-SC-Regular/PingFang-SC-Regular.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
+
+  url("@/assets/font/PingFang-SC-Regular/PingFang-SC-Regular.woff") format("woff"), /* chrome、firefox */
+  url("@/assets/font/PingFang-SC-Regular/PingFang-SC-Regular.ttf") format("truetype"), /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
+
+  url("@/assets/font/PingFang-SC-Regular/PingFang-SC-Regular.svg#PingFang-SC-Regular") format("svg"); /* iOS 4.1- */
+  font-style: normal;
+  font-weight: normal;
 }

+ 13 - 3
src/views/report/EvaluationReport.vue

@@ -2,12 +2,13 @@
 import { useRoute } from "vue-router";
 import { useReportStore } from "@/store";
 import { storeToRefs } from "pinia";
-import { computed, ref, watch } from "vue";
+import { computed, onMounted, ref, watch } from "vue";
 import { SwipeInstance, Swipe, SwipeItem } from "vant";
 import TurnPage from "@/views/report/components/TurnPage.vue";
 import CoverPage from "@/views/report/components/CoverPage.vue";
 import HeaderPart from "@/views/report/components/HeaderPart.vue";
 import Screenshot from "@/views/report/components/Screenshot.vue";
+// import Loading from "@/components/Loading.vue";
 
 const { babyId: _babyId, recordId: _recordId, type: _type } = useRoute().query;
 
@@ -16,6 +17,7 @@ const reportStore = useReportStore();
 const { isSingle, isTeacher, babyId, recordId, babyInfo, totalPage, pageList } = storeToRefs(reportStore);
 const { getReport } = reportStore;
 
+// const loading = ref(false);
 const showCover = ref(false);
 const currentPage = ref<number>(1);
 const swipeRef = ref<SwipeInstance | null>(null);
@@ -48,8 +50,14 @@ function init() {
   isTeacher.value = _type === "1" || _type === "3";
 }
 
-init();
-getReport();
+onMounted(async () => {
+  // loading.value = true;
+  init();
+  await getReport();
+  // setTimeout(() => {
+  // loading.value = false;
+  // }, 1000);
+});
 
 /**
  * 封面页:CoverPage
@@ -84,6 +92,8 @@ getReport();
 </script>
 
 <template>
+  <!--<Loading v-if="loading" />-->
+
   <CoverPage v-if="showCover" :info="babyInfo" @start="start" />
 
   <div class="report">

+ 12 - 2
src/views/report/components/CoverPage.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
-import { onMounted, ref } from "vue";
+import { onMounted, onUnmounted, ref } from "vue";
 
-// const emit = defineEmits(["start"]);
+const emit = defineEmits(["start"]);
 
 const moveDistance = ref<number>(0);
 
@@ -26,6 +26,10 @@ const moveDistance = ref<number>(0);
 //   }
 // }
 
+function handleClick() {
+  emit("start");
+}
+
 onMounted(() => {
   const ele = document.querySelector(".cover");
   if (ele) {
@@ -46,6 +50,12 @@ onMounted(() => {
     //   }
     // });
   }
+
+  window.addEventListener("click", handleClick);
+});
+
+onUnmounted(() => {
+  window.removeEventListener("click", handleClick);
 });
 </script>