فهرست منبع

乐理题库缓存

1
mo 2 سال پیش
والد
کامیت
b24125ff93
1فایلهای تغییر یافته به همراه24 افزوده شده و 12 حذف شده
  1. 24 12
      src/views/article-center/theory.tsx

+ 24 - 12
src/views/article-center/theory.tsx

@@ -12,6 +12,8 @@ import { defineComponent } from 'vue'
 import styles from './theory.module.less'
 import ColSearch from '@/components/col-search'
 import ColResult from '@/components/col-result'
+import { postMessage, promisefiyPostMessage } from '@/helpers/native-message'
+import { state } from '@/state'
 
 export default defineComponent({
   name: 'special',
@@ -89,22 +91,32 @@ export default defineComponent({
       this.getList()
     },
     onDetail(item: any) {
-      let scrollTop  = document.documentElement.scrollTop || document.body.scrollTop;
-      console.log(scrollTop)
-      let obj = JSON.stringify({
-        search: this.params.search,
-        activeNames: this.activeNames.join(','),
-        scrollTop:scrollTop
-      })
+      // let scrollTop  = document.documentElement.scrollTop || document.body.scrollTop;
+      // console.log(scrollTop)
+      // let obj = JSON.stringify({
+      //   search: this.params.search,
+      //   activeNames: this.activeNames.join(','),
+      //   scrollTop:scrollTop
+      // })
+
+      // sessionStorage.setItem('theoryCache', obj)
 
-      sessionStorage.setItem('theoryCache', obj)
       if (item.linkUrl) {
         window.location.href = item.linkUrl
       } else {
-        this.$router.push({
-          path: 'theoryDetail',
-          query: {
-            id: item.id
+        // this.$router.push({
+        //   path: 'theoryDetail',
+        //   query: {
+        //     id: item.id
+        //   }
+        // })
+        let client = state.platformType==='STUDENT'?'student':'teacher'
+        postMessage({
+          api: 'openWebView',
+          content: {
+            url: `${location.origin}/${client}/#/theoryDetail?id=${item.id}`,
+            orientation: 1,
+            isHideTitle: false
           }
         })
       }