Browse Source

web问卷修复了序号不正确的问题(由于数据类型变成了字符串引起的),加上了滚动条

zhudengkai 5 years ago
parent
commit
01093f83e2
3 changed files with 9 additions and 3 deletions
  1. BIN
      src/assets/logo-vue.png
  2. BIN
      src/assets/logo.png
  3. 9 3
      src/components/WebQn.vue

BIN
src/assets/logo-vue.png


BIN
src/assets/logo.png


+ 9 - 3
src/components/WebQn.vue

@@ -23,7 +23,7 @@
             <!-- 题目问题 -->
             <div style="margin:20px 0 40px 0">
                 <!-- <Progress :value="questionHEAD" :maxValue="questionaire.questions.length" /> -->
-
+                <mt-progress :value="percent" :bar-height="5" style="margin-top: -30px;"></mt-progress>
                 <div>
                     <span class="h3">{{questionHEAD + 1}}、</span>
                     <span class="h3" style="margin-left: 5;">[</span>
@@ -184,6 +184,11 @@
             currentQuestion() {
                 return this.questionaire.questions[this.questionHEAD];
             },
+            percent(){
+                let perc = (this.questionHEAD + 1) / this.questionaire.questions.length * 100;
+                console.log('percent', perc)
+                return perc;
+            },
             questionType() {
                 let type = this.currentQuestion.type;
                 if (type == 1) {
@@ -444,7 +449,7 @@
                         questionId: questionId,
                         answer: selectionIds.join(',')
                     };
-                    debugger;
+
                     if (this.currentQuestion.maxOptions == 1 && this.answerNote[selectionIds[0]]) {
                         this.answers[questionId].answerNote = this.answerNote[selectionIds[0]]
                     } else if (this.currentQuestion.maxOptions > 1) {
@@ -488,7 +493,8 @@
                         return;
                     } else if (hopToQuestionId > 0) {
                         // 跳转到某道题
-                        for (let i in this.questionaire.questions) {
+                        // for (let i in this.questionaire.questions) {
+                        for (let i = 0; i < this.questionaire.questions.length; i++) {
                             if (this.questionaire.questions[i].id == hopToQuestionId) {
                                 this.questionHEAD = i;
                                 this.onQuestionLoaded();