Baozhangchao 3 年之前
父節點
當前提交
801d4d0d80

+ 13
- 5
src/components/Question/TextAreas.vue 查看文件

@@ -1,8 +1,6 @@
1 1
 <template>
2
-  <div>
3
-    <textarea>
4
-      asdsadas
5
-    </textarea>
2
+  <div @click="$emit('clicks')">
3
+    <textarea></textarea>
6 4
   </div>
7 5
 </template>
8 6
 
@@ -10,5 +8,15 @@
10 8
 export default {}
11 9
 </script>
12 10
 
13
-<style>
11
+<style lang="less" scoped>
12
+div {
13
+  width: 93%;
14
+  > textarea {
15
+    width: 100%;
16
+    height: 20vh;
17
+    border: 1px solid rgb(192, 191, 191);
18
+    padding: 5px 8px;
19
+    font-size: 14px;
20
+  }
21
+}
14 22
 </style>

+ 0
- 2
src/components/Question/Title.vue 查看文件

@@ -29,8 +29,6 @@ export default {
29 29
           return '单选'
30 30
         case 'checkBox':
31 31
           return '多选'
32
-        case 'switch':
33
-          return '判断'
34 32
         case 'textarea':
35 33
           return '简答题'
36 34
         default:

+ 22
- 7
src/components/Question/index.vue 查看文件

@@ -3,10 +3,11 @@
3 3
     <q-title v-bind="qTitleContent"></q-title>
4 4
     <div style="margin-top:3em;">
5 5
       <div class="scroll">
6
-        <div v-for="answer in question.answerList" :key="answer.answerId">
7
-          <TextAreas v-if="answer.questionType=='textarea'" />
6
+        <div v-if="types=='textarea'">
7
+          <textarea @input="handleTextArea"></textarea>
8
+        </div>
9
+        <div v-else v-for="answer in question.answerList" :key="answer.answerId">
8 10
           <answer
9
-            v-else
10 11
             :active="values.includes(answer.optCode)"
11 12
             :option="answer.optCode"
12 13
             :label="answer.content"
@@ -23,8 +24,8 @@ export default {
23 24
   name: 'Question',
24 25
   components: {
25 26
     Answer: () => import('./Answer.vue'),
26
-    QTitle: () => import('./Title.vue'),
27
-    TextAreas: () => import('./TextAreas.vue')
27
+    QTitle: () => import('./Title.vue')
28
+    // TextAreas: () => import('./TextAreas.vue')
28 29
   },
29 30
   props: {
30 31
     value: {
@@ -54,7 +55,7 @@ export default {
54 55
   computed: {
55 56
     qTitleContent() {
56 57
       return {
57
-        serialNo: this.question.sortNo + 1,
58
+        serialNo: this.question.sortNo,
58 59
         title: this.question.content,
59 60
         qType: this.question.questionType
60 61
       }
@@ -67,12 +68,16 @@ export default {
67 68
   },
68 69
 
69 70
   methods: {
71
+    handleTextArea(e) {
72
+      // console.log(e.target.value)
73
+      this.handleAnswer(e.target.value)
74
+    },
70 75
     handleAnswer(opt) {
71 76
       console.log('🚀 ~ file: index.vue ~ line 68 ~ handleAnswer ~ opt', opt)
72 77
       const isChecked = this.values.includes(opt)
73 78
 
74 79
       // 如果是多选
75
-      if (this.question.optType === 'checkBox') {
80
+      if (this.question.questionType === 'checkBox') {
76 81
         if (isChecked) {
77 82
           this.$emit(
78 83
             'input',
@@ -106,6 +111,16 @@ export default {
106 111
     width: 100%;
107 112
     height: 46vh;
108 113
     overflow: auto;
114
+    div {
115
+      width: 93%;
116
+      > textarea {
117
+        width: 100%;
118
+        height: 20vh;
119
+        border: 1px solid rgb(192, 191, 191);
120
+        padding: 5px 8px;
121
+        font-size: 14px;
122
+      }
123
+    }
109 124
   }
110 125
 }
111 126
 </style>

+ 1
- 1
src/components/QuestionnHome.vue 查看文件

@@ -44,7 +44,7 @@ export default {
44 44
   width: 100vw;
45 45
   height: 100vh;
46 46
   z-index: 5000;
47
-  background-color: aquamarine;
47
+  background-color: #fff;
48 48
   display: flex;
49 49
   position: absolute;
50 50
   flex-direction: column;

+ 9
- 5
src/components/Questionnaire.vue 查看文件

@@ -150,17 +150,21 @@ export default {
150 150
       console.log(NEW_ARR)
151 151
 
152 152
       getQuestionAnswer(
153
-        this.$store.state.user.appid,
154
-        query('gameId'),
153
+        'f5a47d178019bda33a370d7a6ed1e4c3',
154
+        // answerOpt: '22',
155
+        // answerText: '1',
156
+        // personId: this.$store.state.user.personId,
157
+        // questionId: 'f5a47d178019bda33a370d7a6ed1e4c3',
158
+        // score: '1'
155 159
         NEW_ARR
156 160
       ).then((e) => {
157 161
         console.log(e.score, e)
158
-        this.$store.commit('SET_USER_INFO', { scoreNumb: e.result.score })
159
-        this.$store.commit('SET_USER_INFO', { resultInfo: e.result.resultId })
162
+        // this.$store.commit('SET_USER_INFO', { scoreNumb: e.result.score })
163
+        // this.$store.commit('SET_USER_INFO', { resultInfo: e.result.resultId })
160 164
         this.LoadingShowAAA = false
161 165
         this.showPopup = false
162 166
 
163
-        this.$router.replace('/Leaderboard') //replace  不记录页面 ,无法返回
167
+        this.$router.go(-1) //replace  不记录页面 ,无法返回
164 168
       })
165 169
     },
166 170
 

+ 1
- 1
src/util/api.js 查看文件

@@ -58,7 +58,7 @@ export const getSchoolClass = (params) => request(`/api/wx/school-class?termId=$
58 58
  * @returns 
59 59
  * 
60 60
  */
61
-export const getCourse = (params) => request(`/api/wx/course`, { method: 'get' })
61
+export const getCourse = (params) => request(`/api/wx/course?pageSize=99999`, { method: 'get' })
62 62
 
63 63
 /**
64 64
  * 获取课程表详情