Kaynağa Gözat

预览样式修改

1
mo 3 yıl önce
ebeveyn
işleme
06fbb6f00b

+ 44 - 22
src/views/setQuestions/questionManger/component/Continuous.vue

@@ -6,16 +6,17 @@
           <van-loading type="spinner" size="20" />
         </template>
       </van-image>
-      <h2 class="title">校管乐团启蒙课 调查问卷</h2>
+       <h2 class="title">{{form.title}}</h2>
     </div>
     <studentInfo v-if="form.loginFlag" class="studentInfo" />
-    <van-form @submit="onSubmit"  ref="form">
+    <van-form @submit="onSubmit" ref="form">
       <div class="questions" v-for="(item, index) in questionList" :key="index">
         <van-tag class="form-mark" :color="themeColor" mark type="primary">{{
           item["type"] | formTypeFormat
         }}</van-tag>
         <van-cell-group :border="false">
           <van-cell
+           :class="noLine(item['type'])"
             :title-class="['questionName', item['isRequire'] ? 'require' : '']"
             :title="item['content']"
           />
@@ -44,10 +45,10 @@
                       :key="item.id"
                       :title="item.answerValue"
                       class="teacher-item"
-                      @click="toggle(item.id ||item.answerValue)"
+                      @click="toggle(item.id || item.answerValue)"
                     >
                       <template #right-icon>
-                        <van-radio :name="item.id||item.answerValue">
+                        <van-radio :name="item.id || item.answerValue">
                           <template #icon="props">
                             <!-- <img
                           class="img-icon"
@@ -58,7 +59,8 @@
                               class="iconfont"
                               :class="
                                 props.checked
-                                  ? 'icon-gouxuan' : 'icon-weigouxuan'
+                                  ? 'icon-gouxuan'
+                                  : 'icon-weigouxuan'
                               "
                               :style="{ color: themeColor }"
                             ></i>
@@ -79,7 +81,7 @@
                         'questionnaireQuestionItemList'
                       ]"
                       :clickable="true"
-                      :key="item.id||item.answerValue"
+                      :key="item.id || item.answerValue"
                       :title="item.answerValue"
                       class="teacher-item"
                       @click="toggle(index)"
@@ -101,7 +103,8 @@
                               class="iconfont"
                               :class="
                                 props.checked
-                                  ? 'icon-gouxuan' : 'icon-weigouxuan'
+                                  ? 'icon-gouxuan'
+                                  : 'icon-weigouxuan'
                               "
                               :style="{ color: themeColor }"
                             ></i>
@@ -272,7 +275,7 @@ import studentInfo from "../models/studentInfo.vue";
 // import { questionnaireUserResult, commitFlag } from "@/views/activeList/api";
 // import { browser } from "@/common/common";
 export default {
-  props: ['form'],
+  props: ["form"],
   components: { studentInfo },
   data() {
     const query = this.$route.query;
@@ -295,13 +298,13 @@ export default {
       textarea: null,
       checkList: [],
       templateType: 2,
-         questionList: [{type:'',content:''}],
-         list:''
+      questionList: [{ type: "", content: "" }],
+      list: "",
     };
   },
   async mounted() {
     this.templateType = this.form.templateType;
-    this.questionList = this.form.questionnaireQuestionList
+    this.questionList = this.form.questionnaireQuestionList;
   },
   computed: {
     planStatus() {
@@ -418,7 +421,7 @@ export default {
         this.$refs.checkboxes[index].toggle();
       }
     },
-      beforeRead(file, name) {
+    beforeRead(file, name) {
       const isLt2M = file.size / 1024 / 1024 < 5;
 
       if (!isLt2M) {
@@ -463,7 +466,7 @@ export default {
       }
     },
     async onSubmit() {
-      this.$emit('close')
+      this.$emit("close");
       // let selectList = this.questionList[this.currentIndex - 1];
       // if (selectList.type == "radio" && !this.check) {
       //   this.$toast("请回答当前问题");
@@ -536,7 +539,7 @@ export default {
         state.user.status = "init";
       }
     },
-        getErrorMsg(item) {
+    getErrorMsg(item) {
       if (item.type == "radio") {
         return "请选择此题目";
       } else if (item.type == "checkbox") {
@@ -545,6 +548,13 @@ export default {
         return "";
       }
     },
+    noLine(type) {
+      if (type == "radio" || type == "checkbox") {
+        return "Line";
+      } else {
+        return "noLine";
+      }
+    },
   },
   filters: {
     formTypeFormat(type) {
@@ -552,7 +562,7 @@ export default {
         radio: "单选",
         checkbox: "多选",
         textarea: "问答",
-          image: "图片",
+        image: "图片",
       };
       return template[type];
     },
@@ -590,7 +600,7 @@ export default {
     /deep/.van-image__loading {
       background: #e4efff;
     }
-     /deep/.van-image__img {
+    /deep/.van-image__img {
       width: 375px;
     }
     .title {
@@ -660,7 +670,7 @@ export default {
     position: inherit;
     padding: 0 15px;
     margin: 20px auto 28px;
-     background: #e4efff;
+    background: #e4efff;
     .van-goods-action-button--last,
     .van-goods-action-button--first {
       border-radius: 6px;
@@ -731,7 +741,7 @@ export default {
     /deep/.van-image__loading {
       background: #ffe7cd;
     }
-     /deep/.van-image__img {
+    /deep/.van-image__img {
       width: 375px;
     }
     .title {
@@ -801,7 +811,7 @@ export default {
     position: inherit;
     padding: 0 15px;
     margin: 20px auto 28px;
-      background: #ffe7cd;
+    background: #ffe7cd;
     .van-goods-action-button--last,
     .van-goods-action-button--first {
       border-radius: 6px;
@@ -871,7 +881,7 @@ export default {
     /deep/.van-image__loading {
       background: #e8f8e9;
     }
-     /deep/.van-image__img {
+    /deep/.van-image__img {
       width: 375px;
     }
     .title {
@@ -958,7 +968,7 @@ export default {
     position: inherit;
     padding: 0 15px;
     margin: 20px auto 28px;
-      background: #e8f8e9;
+    background: #e8f8e9;
     .van-goods-action-button--last,
     .van-goods-action-button--first {
       border-radius: 6px;
@@ -1028,7 +1038,7 @@ export default {
     /deep/.van-image__loading {
       background: #f9dfdf;
     }
-     /deep/.van-image__img {
+    /deep/.van-image__img {
       width: 375px;
     }
     .title {
@@ -1203,4 +1213,16 @@ export default {
   color: #999999;
   line-height: 24px;
 }
+.noLine {
+  &::after {
+    border: none;
+  }
+}
+/deep/.van-cell {
+  padding: 10px 28px 24px;
+}
+.Line,
+.noLine {
+  padding: 10px 28px 16px;
+}
 </style>

+ 22 - 2
src/views/setQuestions/questionManger/component/Progressive.vue

@@ -6,7 +6,7 @@
           <van-loading type="spinner" size="20" />
         </template>
       </van-image>
-      <h2 class="title">校管乐团启蒙课 调查问卷</h2>
+      <h2 class="title">{{form.title}}</h2>
     </div>
     <studentInfo v-if="form.loginFlag" class="studentInfo" />
     <div class="questions">
@@ -15,6 +15,7 @@
       }}</van-tag>
       <van-cell-group :border="false">
         <van-cell
+          :class="noLine(questionList[currentIndex - 1]['type'])"
           title-class="questionName"
           :title="questionList[currentIndex - 1]['content']"
         />
@@ -502,7 +503,7 @@ export default {
       // this.setLoading(true);
       let formData = new FormData();
       formData.append("file", file.file);
- this[name] = name;
+      this[name] = name;
       // try {
       //   await uploadFile(formData).then((res) => {
       //     let result = res.data;
@@ -520,6 +521,13 @@ export default {
       //   return false;
       // }
     },
+    noLine(type) {
+      if (type == "radio" || type == "checkbox") {
+        return "Line";
+      } else {
+        return "noLine";
+      }
+    },
   },
   filters: {
     formTypeFormat(type) {
@@ -1175,4 +1183,16 @@ export default {
   color: #999999;
   line-height: 24px;
 }
+.noLine {
+  &::after {
+    border: none;
+  }
+}
+/deep/.van-cell {
+  padding: 10px 28px 24px;
+}
+.Line,
+.noLine {
+  padding: 10px 28px 16px;
+}
 </style>