|
@@ -11,10 +11,11 @@ import styles from './index.module.less';
|
|
|
import icon_back from '../../image/icon_back.svg';
|
|
|
import icon_play from '../../image/icon_play.svg';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
-import { postMessage } from '@/helpers/native-message';
|
|
|
+import { listenerMessage, postMessage } from '@/helpers/native-message';
|
|
|
import { showToast } from 'vant';
|
|
|
import queryString from 'query-string';
|
|
|
import CoursewareDetail from '@/custom-plugins/guide-page/courseware-detail';
|
|
|
+import { usePageVisibility } from '@vant/use';
|
|
|
export default defineComponent({
|
|
|
name: 'the-book',
|
|
|
props: {
|
|
@@ -34,13 +35,14 @@ export default defineComponent({
|
|
|
emits: ['close'],
|
|
|
setup(props, { emit }) {
|
|
|
const router = useRouter();
|
|
|
- const lastTime = localStorage.getItem('lastTime');
|
|
|
+
|
|
|
const data = reactive({
|
|
|
show: false,
|
|
|
width: 0,
|
|
|
height: 0,
|
|
|
transform: '',
|
|
|
- list: [] as any[][]
|
|
|
+ list: [] as any[][],
|
|
|
+ lastTime: localStorage.getItem('lastTime')
|
|
|
});
|
|
|
const showGuide = ref(false);
|
|
|
const handleCreate = (key: string, url: string) => {
|
|
@@ -139,7 +141,9 @@ export default defineComponent({
|
|
|
};
|
|
|
onMounted(async () => {
|
|
|
await init();
|
|
|
- // handleBook();
|
|
|
+ listenerMessage('webViewOnResume', () => {
|
|
|
+ data.lastTime = localStorage.getItem('lastTime')
|
|
|
+ })
|
|
|
});
|
|
|
const getList = () => {
|
|
|
if (!props.bookData?.lessonList) return;
|
|
@@ -239,7 +243,7 @@ export default defineComponent({
|
|
|
}}>
|
|
|
<div class={styles.name}>
|
|
|
{item.name}
|
|
|
- {lastTime === item.id && (
|
|
|
+ {data.lastTime === item.id && (
|
|
|
<span class={styles.last}>上次观看</span>
|
|
|
)}
|
|
|
</div>
|