|
@@ -11,7 +11,7 @@ import {
|
|
|
import styles from './index.module.less';
|
|
|
import { getImage } from './images';
|
|
|
import {px2vw} from '@/utils/index'
|
|
|
-
|
|
|
+import {getGuidance,setGuidance} from './api'
|
|
|
export default defineComponent({
|
|
|
name: 'shareResources-guide',
|
|
|
emits: ['close'],
|
|
@@ -51,7 +51,7 @@ export default defineComponent({
|
|
|
height:28
|
|
|
},
|
|
|
boxStyle:{
|
|
|
- borderRadius: '30px'
|
|
|
+ borderRadius: '30px',
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -59,13 +59,13 @@ export default defineComponent({
|
|
|
img: getImage('shareResources2.png'),
|
|
|
imgStyle: {
|
|
|
|
|
|
- left: px2vw(134),
|
|
|
- width: px2vw(515),
|
|
|
- height:px2vw(227)
|
|
|
+ left: px2vw(99),
|
|
|
+ width: px2vw(618),
|
|
|
+ height:px2vw(273)
|
|
|
},
|
|
|
btnsStyle: {
|
|
|
- bottom: px2vw(75),
|
|
|
- left: px2vw(253),
|
|
|
+ bottom: px2vw(88),
|
|
|
+ left: px2vw(240),
|
|
|
},
|
|
|
|
|
|
eleRectPadding:{
|
|
@@ -84,12 +84,29 @@ export default defineComponent({
|
|
|
step: 0
|
|
|
});
|
|
|
const tipShow = ref(false);
|
|
|
- const guideInfo = localStorage.getItem('teacher-guideInfo');
|
|
|
- if (guideInfo && JSON.parse(guideInfo).shareResourcesGuide) {
|
|
|
- tipShow.value = false;
|
|
|
- } else {
|
|
|
- tipShow.value = true;
|
|
|
+ const guideInfo = ref({} as any)
|
|
|
+ const getAllGuidance = async()=>{
|
|
|
+ try{
|
|
|
+ const res = await getGuidance({guideTag:'teacher-guideInfo'})
|
|
|
+ guideInfo.value = JSON.parse(res.data?.guideValue)
|
|
|
+ if (guideInfo.value && guideInfo.value.shareResourcesGuide) {
|
|
|
+ tipShow.value = false;
|
|
|
+ } else {
|
|
|
+ tipShow.value = true;
|
|
|
+ }
|
|
|
+ }catch(e){
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+ // const guideInfo = localStorage.getItem('teacher-guideInfo');
|
|
|
+
|
|
|
}
|
|
|
+ getAllGuidance()
|
|
|
+ // const guideInfo = localStorage.getItem('teacher-guideInfo');
|
|
|
+ // if (guideInfo && JSON.parse(guideInfo).shareResourcesGuide) {
|
|
|
+ // tipShow.value = false;
|
|
|
+ // } else {
|
|
|
+ // tipShow.value = true;
|
|
|
+ // }
|
|
|
const getStepELe = () => {
|
|
|
|
|
|
const ele: HTMLElement = document.getElementById(`shareResources-${data.step}`)!;
|
|
@@ -144,13 +161,13 @@ export default defineComponent({
|
|
|
getStepELe();
|
|
|
};
|
|
|
|
|
|
- const endGuide = () => {
|
|
|
- let guideInfo =
|
|
|
- JSON.parse(localStorage.getItem('teacher-guideInfo')||'{}') || null;
|
|
|
- if (!guideInfo) {
|
|
|
- guideInfo = { shareResourcesGuide: true };
|
|
|
+ const endGuide = async() => {
|
|
|
+ // let guideInfo =
|
|
|
+ // JSON.parse(localStorage.getItem('teacher-guideInfo')||'{}') || null;
|
|
|
+ if (!guideInfo.value) {
|
|
|
+ guideInfo.value = { shareResourcesGuide: true };
|
|
|
} else {
|
|
|
- guideInfo.shareResourcesGuide = true;
|
|
|
+ guideInfo.value.shareResourcesGuide = true;
|
|
|
}
|
|
|
localStorage.setItem('teacher-guideInfo', JSON.stringify(guideInfo));
|
|
|
tipShow.value = false;
|