|
@@ -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')
|
|
|
};
|