From c6c73b7d709322052b9cd6777b3d6657e0d43d30 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期六, 07 九月 2024 14:37:32 +0800
Subject: [PATCH] bug

---
 packageBookService/pages/bookServices/examination/examination.js |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js
index 7e2f406..2c9ab29 100644
--- a/packageBookService/pages/bookServices/examination/examination.js
+++ b/packageBookService/pages/bookServices/examination/examination.js
@@ -1,6 +1,9 @@
 import {
   getPublicImage
 } from "../../../../assets/js/middleGround/tool";
+import {
+  loginInfo
+} from '../../../../assets/js/login';
 const app = getApp();
 Page({
   /**
@@ -15,6 +18,7 @@
     isCountdownRunning: true, // 鏄惁鍊掕鏃�
     countdownTime: 0, // 鍊掕鏃舵椂闂�
     storeInfo: '',
+    jslx: '',
     bookId: "",
     productLinkPath: "",
     rootCmsItemId: "",
@@ -70,6 +74,7 @@
       idPathList: options.idPathList ? JSON.parse(options.idPathList) : [],
       answerType: options.answerType,
       storeInfo: options.storeInfo,
+      jslx: options.jslx,
     });
     wx.setNavigationBarTitle({
       title: options.answerTitle,
@@ -80,7 +85,21 @@
         mockid: options.mockid,
       });
     }
-    this.init();
+
+    const token = wx.getStorageSync(app.config.tokenKey)
+
+    if (!token) {
+      loginInfo(app, (data) => {
+        if (data) {
+          this.init();
+        } else {
+          this.init();
+        }
+      })
+    } else {
+      this.init()
+    }
+
   },
 
   /**
@@ -464,7 +483,6 @@
     const inputData = e.detail.value.detail.value;
     const id = e.detail.value.currentTarget.dataset.id;
     const index = Number(e.detail.value.currentTarget.dataset.index);
-    console.log(index);
     const questionList = this.data.questionDataList;
     questionList.forEach((item) => {
       if (item.id == id) {
@@ -859,7 +877,7 @@
           });
         }
         res.datas.cmsDatas[0].datas.forEach((item, index) => {
-          if (this.data.storeInfo) {
+          if (this.data.storeInfo || this.data.jslx) {
             if (item.Embedded_QuestionBank_QuestionType == 'singleChoice') {
               pathitem.name = "鍗曢�夐"
             } else if (item.Embedded_QuestionBank_QuestionType == 'shortAnswer') {

--
Gitblit v1.9.1