Przeglądaj źródła

修改androidbackview方法3

zhangyujun 3 lat temu
rodzic
commit
b4f2c72fbb

+ 1 - 0
src/api/types/selectTestQuestionInfo.d.ts

@@ -6,6 +6,7 @@ declare namespace selectTestQuestionInfo {
         rows:[row]
     }
     interface row {
+        answerArr?: string[];
         userAnswer: string;
         createTime: string,
         titlekeyword?: string,

+ 2 - 0
src/hooks/examTest.ts

@@ -9,6 +9,7 @@ export function useExamTest() {
         {
             createTime: '2021-11-05 10:25:51',
             id: 20,
+            answerArr:[""],
             image: null,
             imageYdt: null,
             answer: '√',
@@ -502,6 +503,7 @@ export function useExamTest() {
         Api.openApiquestionInfoSelectTestQuestionInfo(params).then((res) => {
             res.data.rows.forEach((item) => {
                 item.optsArr = item.opts.split('-');
+                item.answerArr = item.answer.split('-');
                 item.userAnswer = '';
             });
             list.value = res.data.rows;

+ 2 - 0
src/utils/phone.ts

@@ -59,6 +59,7 @@ class Phone {
             }
         } else if (this.isAndroid()) {
             try {
+                console.log('运行前')
                 window.WebViewJavascriptBridge&&window.WebViewJavascriptBridge.callHandler(
                     'backView'
                     , { 'param': '返回的方法' }
@@ -66,6 +67,7 @@ class Phone {
                             
                     }
                 );
+                console.log('运行后')
             } catch (error) {
                 console.log(error)
             }