From ba2a6cd54676f752584d547445cd0baf2d5a36c5 Mon Sep 17 00:00:00 2001
From: QYF-GitLab1 <1940665526@qq.com>
Date: 星期五, 01 八月 2025 16:03:30 +0800
Subject: [PATCH] 文本框限宽,水平居中

---
 packageBookService/pages/bookServices/examination/examination.js |   51 +++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 39 insertions(+), 12 deletions(-)

diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js
index 0c0853a..740c2c2 100644
--- a/packageBookService/pages/bookServices/examination/examination.js
+++ b/packageBookService/pages/bookServices/examination/examination.js
@@ -992,18 +992,37 @@
           }
           // 濉┖棰樻敼閫�
           if (questionObj.questionType == "completion") {
+            let c = [];
             let index = 0;
             for (let i = 0; i < questionObj.stem.length; i++) {
               const item = questionObj.stem[i];
-              if (item == "input") {
-                questionObj.stem[i] = {
-                  num: index,
-                  data: "input",
-                };
+              if (item != 'input') {
+                item.split("").map(citem => {
+                  const obj = {
+                    type: 'txt',
+                    text: citem
+                  }
+                  c.push(obj)
+                })
+              } else {
+                const obj = {
+                  type: "input",
+                  num: index
+                }
                 if (!oldObj) questionObj.userAnswer[index] = "";
                 index++;
+                c.push(obj)
               }
+              // if (item == "input") {
+              //   questionObj.stem[i] = {
+              //     num: index,
+              //     data: "input",
+              //   };
+              //   if (!oldObj) questionObj.userAnswer[index] = "";
+              //   index++;
+              // }
             }
+            questionObj.customArr = c;
           }
           // 棰樺共瀵屾枃鏈鐞�
           if (questionObj.stemStyle == "RichText") {
@@ -2330,7 +2349,7 @@
           item.topicId = data.id
         }
       })
-      console.log('鐝骇', res)
+      let isJoinClass = wx.getStorageSync('joinClass')
       if (res.datas.length) {
         this.setData({
           classList: res.datas
@@ -2363,20 +2382,28 @@
             })
           } else {
             // 鎷掔粷
+            if (!isJoinClass) {
+
+              this.setData({
+                visible: true
+              })
+            }
+
+          }
+        } else {
+          // 鏈姞鍏ョ彮绾�
+          if (!isJoinClass) {
             this.setData({
               visible: true
             })
           }
-        } else {
-          // 鏈姞鍏ョ彮绾�
+        }
+      } else {
+        if (!isJoinClass) {
           this.setData({
             visible: true
           })
         }
-      } else {
-        this.setData({
-          visible: true,
-        })
       }
 
     })

--
Gitblit v1.9.1