From 6851680b996e64c1d66c035245b2f0f6eb3425c6 Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期六, 07 九月 2024 15:33:42 +0800
Subject: [PATCH] 1

---
 packageBookService/pages/bookServices/examination/examination.js |   44 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js
index a8121dc..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) {
@@ -820,7 +838,7 @@
       let query = {
         path: "*",
         queryType: "*",
-        storeInfo: this.data.storeInfo,
+
         productId: this.data.bookId,
         cmsPath: pathitem.productLinkPath,
         itemFields: {
@@ -840,6 +858,9 @@
           size: 999,
         },
       };
+      if (this.data.storeInfo) {
+        query.storeInfo = this.data.storeInfo
+      }
       await app.MG.store.getProductDetail(query).then((res) => {
         this.setData({
           total: res.datas.cmsDatas[0].datas.length,
@@ -856,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') {
@@ -1040,6 +1061,9 @@
             questionDataList: questionList,
             cardList: cardUpdatedList,
           });
+          console.log(
+            '棰樼洰', this.data.questionDataList
+          );
         });
       });
     }
@@ -1355,7 +1379,6 @@
     for (let qindex = 0; qindex < this.data.collectList.length; qindex++) {
       const qitem = this.data.collectList[qindex];
       let query = {
-        storeInfo: this.data.storeInfo,
         path: "*",
         cmsPath: this.data.rootCmsItemId,
         cmsType: "*",
@@ -1374,6 +1397,9 @@
           Embedded_QuestionBank_Difficulty: [],
         },
       };
+      if (this.data.storeInfo) {
+        query.storeInfo = this.data.storeInfo
+      }
       await app.MG.store.getProductDetail(query).then((res) => {
         let questionArr = [];
         res.datas.cmsDatas[0].datas.forEach((item, index) => {
@@ -1603,7 +1629,6 @@
     let multipleChoiceArr = []; // 澶氶��
     let completionArr = []; // 濉┖
     let query = {
-      storeInfo: this.data.storeInfo,
       path: "*",
       cmsPath: this.data.rootCmsItemId,
       cmsType: "*",
@@ -1622,6 +1647,9 @@
         Embedded_QuestionBank_Difficulty: [],
       },
     };
+    if (this.data.storeInfo) {
+      query.storeInfo = this.data.storeInfo
+    }
     await app.MG.store.getProductDetail(query).then((res) => {
       let questionArr = [];
       res.datas.cmsDatas[0].datas.forEach((item, index) => {
@@ -1889,7 +1917,6 @@
         itemIds.push(item.id + "");
       });
       let query = {
-        storeInfo: this.data.storeInfo,
         path: "*",
         cmsPath: this.data.rootCmsItemId,
         cmsType: "*",
@@ -1908,6 +1935,9 @@
           Embedded_QuestionBank_Difficulty: [],
         },
       };
+      if (this.data.storeInfo) {
+        query.storeInfo = this.data.storeInfo
+      }
       await app.MG.store.getProductDetail(query).then((res) => {
         res.datas.cmsDatas[0].datas.forEach((item, index) => {
           // 寰幆questionList,缁欐瘡棰樿祴鍊煎垎鏁�

--
Gitblit v1.9.1