Explorar o código

feat(workPage): 重构选择题组件UI并优化用户答案处理逻辑

- 替换选择题导航按钮为更美观的箭头图标
- 移除旧版导航按钮和题目序号显示
- 修复多选题答案处理逻辑,确保userAnswer为数组
- 添加新的导航按钮样式和交互效果
SanHQin hai 3 semanas
pai
achega
d77e20ff4a

+ 1 - 1
dist/index.html

@@ -37,7 +37,7 @@
       width: 100%;
       background: #e6eaf0;
       font-family: '黑体';
-    }</style><link href=./static/css/app.8c647f66fd2bcebede091c7cbd68fd69.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.23ea04dc469b57e2b4f8.js></script><script type=text/javascript src=./static/js/vendor.714ff2bfc93f2f096b79.js></script><script type=text/javascript src=./static/js/app.a2c4b4eb5576ce47a21d.js></script></body></html><script>function stopSafari() {
+    }</style><link href=./static/css/app.f571388dd9f63c141d2f49a3a6adf3e6.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.23ea04dc469b57e2b4f8.js></script><script type=text/javascript src=./static/js/vendor.714ff2bfc93f2f096b79.js></script><script type=text/javascript src=./static/js/app.310e5a1445a84658ff32.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/css/app.f571388dd9f63c141d2f49a3a6adf3e6.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/css/app.f571388dd9f63c141d2f49a3a6adf3e6.css.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/css/workPage.60f284965fefabfa1c5fb2a1b7469681.css.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/css/workPage.f7bae04b534943cff3effe3dc1257360.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/css/workPage.f7bae04b534943cff3effe3dc1257360.css.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/app.310e5a1445a84658ff32.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/app.310e5a1445a84658ff32.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/manifest.23ea04dc469b57e2b4f8.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/workPage-manifest.2ece51fa34be51c8610a.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/workPage.5b3c7fc43389fc32201a.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/workPage.5b3c7fc43389fc32201a.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/workPage.eb774223b670b543be20.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/workPage.eb774223b670b543be20.js.map


+ 1 - 1
dist/workPage.html

@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>工作页面 - CocoFlow</title><link rel=icon href=../static/logo.ico><link href=./static/css/workPage.60f284965fefabfa1c5fb2a1b7469681.css rel=stylesheet></head><body><noscript><strong>We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script type=text/javascript src=./static/js/workPage-manifest.2ece51fa34be51c8610a.js></script><script type=text/javascript src=./static/js/workPage-vendor.7b2c55096449c94cc8fd.js></script><script type=text/javascript src=./static/js/workPage.eb774223b670b543be20.js></script></body></html><script>function stopSafari() {
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>工作页面 - CocoFlow</title><link rel=icon href=../static/logo.ico><link href=./static/css/workPage.f7bae04b534943cff3effe3dc1257360.css rel=stylesheet></head><body><noscript><strong>We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script type=text/javascript src=./static/js/workPage-manifest.2ece51fa34be51c8610a.js></script><script type=text/javascript src=./static/js/workPage-vendor.7b2c55096449c94cc8fd.js></script><script type=text/javascript src=./static/js/workPage.5b3c7fc43389fc32201a.js></script></body></html><script>function stopSafari() {
     //阻止safari浏览器双击放大功能
     let lastTouchEnd = 0  //更新手指弹起的时间
     document.documentElement.addEventListener("touchstart", function (event) {

+ 55 - 5
src/components/pages/workPage/components/choiceQuestion.vue

@@ -3,18 +3,18 @@
     <div class="cq_title" v-if="work.testJson[showIndex]">
       <span>{{ work.testJson[showIndex].teststitle }}</span>
 
-      <div class="cq_changeBtnArea" v-if="work.testJson.length>1">
+      <!-- <div class="cq_changeBtnArea" v-if="work.testJson.length>1">
         <span :class="{cq_cba_disabled: showIndex == 0}" @click="changeQuestion('prev')">{{ lang.ssPrevQ }}</span>
         <span :class="{cq_cba_disabled: showIndex == work.testJson.length - 1}" @click="changeQuestion('next')">{{ lang.ssNextQ }}</span>
-      </div>
+      </div> -->
     </div>
 
 
-    <img class="cq_image" v-if="work.testJson[showIndex].timuList.length>0" :src="work.testJson[showIndex].timuList[0].src" @click="$hevueImgPreview(work.testJson[showIndex].timuList[0].src)">
+    <img class="cq_image" v-if="work.testJson[showIndex] && work.testJson[showIndex].timuList && work.testJson[showIndex].timuList.length>0" :src="work.testJson[showIndex].timuList[0].src" @click="$hevueImgPreview(work.testJson[showIndex].timuList[0].src)">
 
     <div class="cq_type" v-if="work.testJson[showIndex]">
-      {{ work.testJson[showIndex].type == 1 ? lang.MultipleChoice : lang.MultipleChoice }}
-      <span v-if="work.testJson.length>1">({{showIndex+1}}/{{work.testJson.length}})</span>
+      {{ work.testJson[showIndex].type == '1' ? lang.SingleChoice : lang.MultipleChoice }}
+      <!-- <span v-if="work.testJson.length>1">({{showIndex+1}}/{{work.testJson.length}})</span> -->
 
     </div>
     <div class="cq_checkListArea">
@@ -67,6 +67,18 @@
         </div>
       </div>
     </div>
+
+    <div class="cq_changeBtn" v-if="work.testJson.length>1">
+      <div :class="{cq_cb_disabled: showIndex == 0}" @click="changeQuestion('prev')">
+        <svg style="transform: rotate(-90deg);" viewBox="0 0 1024 1024" version="1.1" width="200" height="200"><path d="M512 330.666667c14.933333 0 29.866667 4.266667 40.533333 14.933333l277.33333399 234.666667c27.733333 23.466667 29.866667 64 8.53333301 89.6-23.466667 27.733333-64 29.866667-89.6 8.53333299L512 477.866667l-236.8 200.53333299c-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333299-23.466667-27.733333-19.19999999-68.266667 8.53333301-89.6l277.33333399-234.666667c10.666667-10.666667 25.6-14.933333 40.533333-14.933333z" fill=""></path></svg>
+      </div>
+      <span>{{ showIndex+1 }}/{{work.testJson.length}}</span>
+      <div :class="{cq_cb_disabled: showIndex == work.testJson.length - 1}" @click="changeQuestion('next')">
+        <svg style="transform: rotate(90deg);" viewBox="0 0 1024 1024" version="1.1" width="200" height="200"><path d="M512 330.666667c14.933333 0 29.866667 4.266667 40.533333 14.933333l277.33333399 234.666667c27.733333 23.466667 29.866667 64 8.53333301 89.6-23.466667 27.733333-64 29.866667-89.6 8.53333299L512 477.866667l-236.8 200.53333299c-27.733333 23.466667-68.266667 19.19999999-89.6-8.53333299-23.466667-27.733333-19.19999999-68.266667 8.53333301-89.6l277.33333399-234.666667c10.666667-10.666667 25.6-14.933333 40.533333-14.933333z" fill=""></path></svg>
+      </div>
+      <!-- <span :class="{cq_cba_disabled: showIndex == 0}" @click="changeQuestion('prev')">{{ lang.ssPrevQ }}</span>
+      <span :class="{cq_cba_disabled: showIndex == work.testJson.length - 1}" @click="changeQuestion('next')">{{ lang.ssNextQ }}</span> -->
+    </div>
   </div>
 </template>
 
@@ -136,6 +148,7 @@ export default {
       if (this.work.testJson[this.showIndex].type == "1") {
         this.work.testJson[this.showIndex].userAnswer = index;
       } else {
+        if(typeof this.work.testJson[this.showIndex].userAnswer !== 'object') this.work.testJson[this.showIndex].userAnswer = [];
         if (this.work.testJson[this.showIndex].userAnswer.includes(index)) {
           this.work.testJson[this.showIndex].userAnswer = this.work.testJson[
             this.showIndex
@@ -411,4 +424,41 @@ export default {
   z-index: 1; /* after在内容下方 */
   pointer-events: none;
 }
+
+.cq_changeBtn{
+  display: flex;
+  align-items: center;
+  gap: 1.5rem;
+  margin-top: 2rem;
+}
+
+.cq_changeBtn>div{
+  padding: .6rem;
+  border-radius: .5rem;
+  border: solid 2px #F6C82B;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  cursor: pointer;
+
+}
+
+.cq_changeBtn>span{
+  font-weight: 500;
+}
+
+.cq_changeBtn>div>svg{
+  fill: #F6C82D;
+  width: 1rem;
+  height: 1rem;
+}
+
+.cq_cb_disabled{
+  cursor: not-allowed !important;
+  border-color: #FEF8E9 !important;
+}
+
+.cq_cb_disabled>svg{
+  fill: #A3A3A3 !important;
+}
 </style>

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio