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