|  | @@ -1,5 +1,5 @@
 | 
	
		
			
				|  |  |  import request from '@/helpers/request';
 | 
	
		
			
				|  |  | -import { state } from '@/state';
 | 
	
		
			
				|  |  | +import { setLogin, state } from '@/state';
 | 
	
		
			
				|  |  |  import {
 | 
	
		
			
				|  |  |    Button,
 | 
	
		
			
				|  |  |    Cell,
 | 
	
	
		
			
				|  | @@ -14,7 +14,8 @@ import {
 | 
	
		
			
				|  |  |    reactive,
 | 
	
		
			
				|  |  |    onUnmounted,
 | 
	
		
			
				|  |  |    TransitionGroup,
 | 
	
		
			
				|  |  | -  computed
 | 
	
		
			
				|  |  | +  computed,
 | 
	
		
			
				|  |  | +  watch
 | 
	
		
			
				|  |  |  } from 'vue';
 | 
	
		
			
				|  |  |  import styles from './index.module.less';
 | 
	
		
			
				|  |  |  import { useRoute, useRouter } from 'vue-router';
 | 
	
	
		
			
				|  | @@ -34,12 +35,13 @@ import { handleCheckVip, gotoMemberCenter, hasVip } from '../hook/useFee';
 | 
	
		
			
				|  |  |  import iconList from './image/icon-list.png';
 | 
	
		
			
				|  |  |  // import OSticky from '@/components/o-sticky';
 | 
	
		
			
				|  |  |  import OHeader from '@/components/o-header';
 | 
	
		
			
				|  |  | -import { useEventListener } from '@vant/use';
 | 
	
		
			
				|  |  | +import { useEventListener, usePageVisibility } from '@vant/use';
 | 
	
		
			
				|  |  |  import OLoading from '@/components/o-loading';
 | 
	
		
			
				|  |  |  import OSticky from '@/components/o-sticky';
 | 
	
		
			
				|  |  |  export default defineComponent({
 | 
	
		
			
				|  |  |    name: 'courseList',
 | 
	
		
			
				|  |  |    setup() {
 | 
	
		
			
				|  |  | +    const pageVisibility = usePageVisibility();
 | 
	
		
			
				|  |  |      const route = useRoute();
 | 
	
		
			
				|  |  |      const router = useRouter();
 | 
	
		
			
				|  |  |      const browserInfo = browser();
 | 
	
	
		
			
				|  | @@ -281,6 +283,30 @@ export default defineComponent({
 | 
	
		
			
				|  |  |          document.documentElement.scrollTop;
 | 
	
		
			
				|  |  |        data.titleOpacity = height > 100 ? 1 : height / 100;
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    watch(
 | 
	
		
			
				|  |  | +      () => pageVisibility.value,
 | 
	
		
			
				|  |  | +      async (val: any) => {
 | 
	
		
			
				|  |  | +        // 为了处理从没有会员,到购买会员返回时状态变化
 | 
	
		
			
				|  |  | +        if (val === 'visible') {
 | 
	
		
			
				|  |  | +          try {
 | 
	
		
			
				|  |  | +            const res = await request.get(
 | 
	
		
			
				|  |  | +              state.platformType === 'STUDENT'
 | 
	
		
			
				|  |  | +                ? state.platformApi + '/student/queryUserInfo'
 | 
	
		
			
				|  |  | +                : state.platformApi + '/teacher/queryUserInfo',
 | 
	
		
			
				|  |  | +              {
 | 
	
		
			
				|  |  | +                initRequest: true, // 初始化接口
 | 
	
		
			
				|  |  | +                requestType: 'form',
 | 
	
		
			
				|  |  | +                hideLoading: true
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +            );
 | 
	
		
			
				|  |  | +            setLogin(res.data);
 | 
	
		
			
				|  |  | +          } catch (e: any) {
 | 
	
		
			
				|  |  | +            //
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    );
 | 
	
		
			
				|  |  |      return () => (
 | 
	
		
			
				|  |  |        <div class={styles.courseList}>
 | 
	
		
			
				|  |  |          <OHeader
 |