Quellcode durchsuchen

Merge branch 'guide' into online

liushengqiang vor 1 Jahr
Ursprung
Commit
a44a7b25da

+ 1 - 1
osmd-extended

@@ -1 +1 @@
-Subproject commit c61975028e8f71a7448a92ba440fc9297a17a2ed
+Subproject commit 0ce7bef6b932f8ab1bd8887c901994e10fcbc121

+ 22 - 0
src/page-instrument/custom-plugins/guide-page/api.ts

@@ -0,0 +1,22 @@
+import request from "../../../utils/request";
+
+
+export const setGuidance = (params: any) => {
+    return request.post('/functionGuidance/save', {
+      data: params,
+      requestType: "json",
+    });
+  };
+  
+  /**
+   * 获取引导页
+   */
+  export const getGuidance = (params: any) => {
+    return request.get('/functionGuidance/queryTagDetail', {
+      data: params,
+      params,
+  
+    });
+  };
+  
+

BIN
src/page-instrument/custom-plugins/guide-page/images/teacherTop2.png


+ 1 - 1
src/page-instrument/custom-plugins/guide-page/index.module.less

@@ -54,7 +54,7 @@
   .box {
     position: fixed;
     box-shadow: rgba(33, 33, 33, 0.8) 0px 0px 0px 5000px;
-    transition: all 0.25s;
+    // transition: all 0.25s;
     transform: scale(1.2);
     border-radius: 8px;
   }

+ 39 - 10
src/page-instrument/custom-plugins/guide-page/student-bottom.tsx

@@ -4,6 +4,7 @@ import { defineComponent, nextTick, onMounted, reactive, ref, watch } from "vue"
 import styles from "./index.module.less";
 import { getImage } from "./images";
 import { getQuery } from "/src/utils/queryString";
+import { getGuidance, setGuidance } from "./api";
 
 export default defineComponent({
 	name: "studentB-guide",
@@ -19,7 +20,7 @@ export default defineComponent({
 					img: getImage("studentB1.png"),
 					handStyle: {
 						top: "-1.39rem",
-						left: "1.4rem",
+						left: "1.7rem",
 						transform: "rotate(180deg)",
 					},
 					imgStyle: {
@@ -75,12 +76,35 @@ export default defineComponent({
 		});
 		const tipShow = ref(false);
 		const query: any = getQuery();
-		const guideInfo = localStorage.getItem("guideInfo");
-		if ((guideInfo && JSON.parse(guideInfo).studentB) || !query.showGuide) {
+		// const guideInfo = localStorage.getItem("guideInfo");
+		// if ((guideInfo && JSON.parse(guideInfo).studentB) || !query.showGuide) {
+		// 	tipShow.value = false;
+		// } else {
+		// 	tipShow.value = true;
+		// }
+		const guideInfo = ref({} as any)
+		const getAllGuidance = async()=>{
+		  try{
+		  const res = await getGuidance({guideTag:'guideInfo'})
+		  if(res.data){
+			guideInfo.value = JSON.parse(res.data?.guideValue) || null
+		  }else{
+			guideInfo.value = {}
+		  }
+	  
+	  
+		  if (guideInfo.value && guideInfo.value.studentB || !query.showGuide) {
 			tipShow.value = false;
-		} else {
+		  } else {
 			tipShow.value = true;
+		  }
+		  }catch(e){
+		  console.log(e)
+		  }
+		  // const guideInfo = localStorage.getItem('teacher-guideInfo');
+	  
 		}
+		getAllGuidance()
 		const steps = [ "modeType-0", "modeType-1", "modeType-2"];
 		const getStepELe = () => {
 			console.log(steps[data.step]);
@@ -108,14 +132,19 @@ export default defineComponent({
 			getStepELe();
 		};
 
-		const endGuide = () => {
-			let guideInfo = JSON.parse(localStorage.getItem("guideInfo") || "{}") || null;
-			if (!guideInfo) {
-				guideInfo = { studentB: true };
+		const endGuide = async() => {
+			// let guideInfo = JSON.parse(localStorage.getItem("guideInfo") || "{}") || null;
+			if (!guideInfo.value) {
+				guideInfo.value = { studentB: true };
 			} else {
-				guideInfo.studentB = true;
+				guideInfo.value.studentB = true;
 			}
-			localStorage.setItem("guideInfo", JSON.stringify(guideInfo));
+			// localStorage.setItem("guideInfo", JSON.stringify(guideInfo));
+			try{
+				const res = await setGuidance({guideTag:'guideInfo',guideValue:JSON.stringify(guideInfo.value)})
+			  }catch(e){
+				console.log(e)
+			  }
 			tipShow.value = false;
 			//  localStorage.setItem('endC')
 		};

+ 43 - 12
src/page-instrument/custom-plugins/guide-page/student-top.tsx

@@ -5,6 +5,7 @@ import styles from "./index.module.less";
 import { getImage } from "./images";
 import { useRoute } from "vue-router";
 import { getQuery } from "/src/utils/queryString";
+import { getGuidance, setGuidance } from "./api";
 
 export default defineComponent({
   name: "studnetT-guide",
@@ -169,12 +170,37 @@ export default defineComponent({
     });
     const tipShow = ref(false)
     const query: any = getQuery();
-   const guideInfo = localStorage.getItem('guideInfo')
-   if(guideInfo&&JSON.parse(guideInfo).studnetT || !query.showGuide){
-    tipShow.value =false
-   }else {
-    tipShow.value =true
-   }
+  //  const guideInfo = localStorage.getItem('guideInfo')
+  //  if(guideInfo&&JSON.parse(guideInfo).studnetT || !query.showGuide){
+  //   tipShow.value =false
+  //  }else {
+  //   tipShow.value =true
+  //  }
+
+  const guideInfo = ref({} as any)
+  const getAllGuidance = async()=>{
+    try{
+    const res = await getGuidance({guideTag:'guideInfo'})
+    if(res.data){
+      guideInfo.value = JSON.parse(res.data?.guideValue) || null
+    }else{
+      guideInfo.value = {}
+    }
+
+
+    if (guideInfo.value && guideInfo.value.studnetT || !query.showGuide) {
+      tipShow.value = false;
+    } else {
+      tipShow.value = true;
+    }
+    }catch(e){
+    console.log(e)
+    }
+    // const guideInfo = localStorage.getItem('teacher-guideInfo');
+
+  }
+  getAllGuidance()
+
     const getStepELe = () => {
       console.log(`studnetT${data.step}`)
       const ele: HTMLElement = document.getElementById(`studnetT-${data.step}`)!;
@@ -206,14 +232,19 @@ export default defineComponent({
       getStepELe();
     };
     
-    const endGuide = ()=>{
-      let guideInfo = JSON.parse(localStorage.getItem('guideInfo') || '{}') || null
-      if(!guideInfo){
-        guideInfo = {studnetT:true}
+    const endGuide = async()=>{
+      // let guideInfo = JSON.parse(localStorage.getItem('guideInfo') || '{}') || null
+      if(!guideInfo.value){
+        guideInfo.value = {studnetT:true}
       }else{
-        guideInfo.studnetT = true
+        guideInfo.value.studnetT = true
       }
-      localStorage.setItem('guideInfo',JSON.stringify(guideInfo))
+      // localStorage.setItem('guideInfo',JSON.stringify(guideInfo))
+      try{
+				const res = await setGuidance({guideTag:'guideInfo',guideValue:JSON.stringify(guideInfo.value)})
+			  }catch(e){
+				console.log(e)
+			  }
       tipShow.value = false
     //  localStorage.setItem('endC')
     }

+ 56 - 21
src/page-instrument/custom-plugins/guide-page/teacher-bootom.tsx

@@ -4,7 +4,7 @@ import { defineComponent, nextTick, onMounted, reactive, ref, watch } from "vue"
 import styles from "./index.module.less";
 import { getImage } from "./images";
 import { getQuery } from "/src/utils/queryString";
-
+import {getGuidance,setGuidance} from './api'
 export default defineComponent({
 	name: "aiTeacher-guide",
 	emits: ["close"],
@@ -15,17 +15,18 @@ export default defineComponent({
 			steps: [
 				{
 					eleRect: {
-						left: "5rem",
-						top: "-3rem",
+						left: "4.5rem",
+						top: "-3.6rem",
 					},
 					img: getImage("aiTeacher1.png"),
 					imgStyle: {
-						width: "6.48rem",
-						height: "3rem",
+						width: "7.776rem",
+						height: "3.6rem",
 					},
 					btnsStyle: {
-						bottom: ".9rem",
-						left: "1.7rem",
+						bottom: "1.3rem",
+						left: "2.1rem",
+				
 					},
 					boxStyle: {
 						borderRadius: "40px",
@@ -50,7 +51,8 @@ export default defineComponent({
 					},
 					btnsStyle: {
 						bottom: ".9rem",
-						left: "1rem",
+						left: ".9rem",
+						transform: "scale(.83)",
 					},
 					boxStyle: {
 						borderRadius: "40px",
@@ -68,7 +70,8 @@ export default defineComponent({
 					},
 					btnsStyle: {
 						bottom: ".9rem",
-						left: "1rem",
+						left: ".8rem",
+						transform: "scale(.83)",
 					},
 					boxStyle: {
 						borderRadius: "40px",
@@ -86,9 +89,10 @@ export default defineComponent({
 					},
 					btnsStyle: {
 						bottom: ".9rem",
-						left: "1.7rem",
+						left: "1.6rem",
 						"justify-content": "center",
 						padding: 0,
+						transform: "scale(.83)",
 					},
 					boxStyle: {
 						borderRadius: "40px",
@@ -99,13 +103,39 @@ export default defineComponent({
 		});
 
 		const tipShow = ref(false);
-		const guideInfo = localStorage.getItem("guideInfo");
+		// const guideInfo = localStorage.getItem("guideInfo");
 		const query: any = getQuery();
-		if ((guideInfo && JSON.parse(guideInfo).teacherBottom) || !query.showGuide) {
-			tipShow.value = false;
-		} else {
-			tipShow.value = true;
+		const guideInfo = ref({} as any)
+		const getAllGuidance = async()=>{
+		  try{
+			const res = await getGuidance({guideTag:'guideInfo'})
+			if(res.data){
+			  guideInfo.value = JSON.parse(res.data?.guideValue) || null
+			}else{
+			  guideInfo.value = {}
+			}
+	
+	
+			if (guideInfo.value && guideInfo.value.teacherBottom || !query.showGuide) {
+			  tipShow.value = false;
+			} else {
+			  tipShow.value = true;
+			}
+		  }catch(e){
+			console.log(e)
+		  }
+		  // const guideInfo = localStorage.getItem('teacher-guideInfo');
+	
 		}
+		getAllGuidance()
+
+
+
+		// if ((guideInfo && JSON.parse(guideInfo).teacherBottom) || !query.showGuide) {
+		// 	tipShow.value = false;
+		// } else {
+		// 	tipShow.value = true;
+		// }
 		const steps = ["modeType-box", "modeType-0", "modeType-1", "modeType-2"];
 		const getStepELe = () => {
 			console.log(steps[data.step]);
@@ -140,14 +170,19 @@ export default defineComponent({
 			getStepELe();
 		};
 
-		const endGuide = () => {
-			let guideInfo = JSON.parse(localStorage.getItem("guideInfo") || "{}") || null;
-			if (!guideInfo) {
-				guideInfo = { teacherBottom: true };
+		const endGuide = async() => {
+			// let guideInfo = JSON.parse(localStorage.getItem("guideInfo") || "{}") || null;
+			if (!guideInfo.value) {
+				guideInfo.value = { teacherBottom: true };
 			} else {
-				guideInfo.teacherBottom = true;
+				guideInfo.value.teacherBottom = true;
 			}
-			localStorage.setItem("guideInfo", JSON.stringify(guideInfo));
+			try{
+				const res = await setGuidance({guideTag:'guideInfo',guideValue:JSON.stringify(guideInfo.value)})
+			  }catch(e){
+				console.log(e)
+			  }
+			// localStorage.setItem("guideInfo", JSON.stringify(guideInfo));
 			tipShow.value = false;
 			//  localStorage.setItem('endC')
 		};

+ 55 - 19
src/page-instrument/custom-plugins/guide-page/teacher-top.tsx

@@ -4,7 +4,7 @@ import { defineComponent, nextTick, onMounted, reactive, ref, watch } from "vue"
 import styles from "./index.module.less";
 import { getImage } from "./images";
 import { getQuery } from "/src/utils/queryString";
-
+import {getGuidance,setGuidance} from './api'
 export default defineComponent({
   name: "teacherTop-guide",
   emits: ["close"],
@@ -28,7 +28,9 @@ export default defineComponent({
           },
           btnsStyle: {
             top: "2.8rem",
-            left:'-0.4rem'
+            left:'-0.5rem',
+            transform: "scale(.83)",
+
           },
         },
         {
@@ -47,7 +49,8 @@ export default defineComponent({
           },
           btnsStyle: {
             top: "2.8rem",
-            left:'-0.4rem'
+            left:'-0.5rem',
+            transform: "scale(.83)",
           },
         },
         {
@@ -66,7 +69,8 @@ export default defineComponent({
           },
           btnsStyle: {
             top: "2.8rem",
-            left:'-0.4rem'
+            left:'-0.5rem',
+            transform: "scale(.83)",
           },
         },
         {
@@ -85,7 +89,8 @@ export default defineComponent({
           },
           btnsStyle: {
             top: "2.8rem",
-            left:'-0.4rem'
+            left:'-0.5rem',
+            transform: "scale(.83)",
           },
         },
         {
@@ -104,7 +109,8 @@ export default defineComponent({
           },
           btnsStyle: {
             top: "2.8rem",
-            left:'-0.4rem'
+            left:'-0.5rem',
+            transform: "scale(.83)",
           },
         },
         {
@@ -123,7 +129,8 @@ export default defineComponent({
           },
           btnsStyle: {
             top: "2.8rem",
-            left:'-2rem'
+            left:'-2.1rem',
+            transform: "scale(.83)",
           },
         },
       ],
@@ -131,12 +138,36 @@ export default defineComponent({
     });
     const tipShow = ref(false)
     const query: any = getQuery();
-   const guideInfo = localStorage.getItem('guideInfo' || !query.showGuide)
-   if(guideInfo&&JSON.parse(guideInfo).teacherTop){
-    tipShow.value =false
-   }else {
-    tipShow.value =true
-   }
+  //  const guideInfo = localStorage.getItem('guideInfo' || !query.showGuide)
+  //  if(guideInfo&&JSON.parse(guideInfo).teacherTop){
+  //   tipShow.value =false
+  //  }else {
+  //   tipShow.value =true
+  //  }
+  const guideInfo = ref({} as any)
+  const getAllGuidance = async()=>{
+    try{
+    const res = await getGuidance({guideTag:'guideInfo'})
+    if(res.data){
+      guideInfo.value = JSON.parse(res.data?.guideValue) || null
+    }else{
+      guideInfo.value = {}
+    }
+
+
+    if (guideInfo.value && guideInfo.value.teacherTop || !query.showGuide) {
+      tipShow.value = false;
+    } else {
+      tipShow.value = true;
+    }
+    }catch(e){
+    console.log(e)
+    }
+    // const guideInfo = localStorage.getItem('teacher-guideInfo');
+
+  }
+  getAllGuidance()
+
     const getStepELe = () => {
       console.log(`teacherTop${data.step}`)
       const ele: HTMLElement = document.getElementById(`teacherTop-${data.step}`)!;
@@ -168,14 +199,19 @@ export default defineComponent({
       getStepELe();
     };
     
-    const endGuide = ()=>{
-      let guideInfo = JSON.parse(localStorage.getItem('guideInfo') || '{}') || null
-      if(!guideInfo){
-        guideInfo = {teacherTop:true}
+    const endGuide = async()=>{
+      // let guideInfo = JSON.parse(localStorage.getItem('guideInfo') || '{}') || null
+      if(!guideInfo.value){
+        guideInfo.value = {teacherTop:true}
       }else{
-        guideInfo.teacherTop = true
+        guideInfo.value.teacherTop = true
       }
-      localStorage.setItem('guideInfo',JSON.stringify(guideInfo))
+      try{
+				const res = await setGuidance({guideTag:'guideInfo',guideValue:JSON.stringify(guideInfo.value)})
+			  }catch(e){
+				console.log(e)
+			  }
+      // localStorage.setItem('guideInfo',JSON.stringify(guideInfo))
       tipShow.value = false
     //  localStorage.setItem('endC')
     }