Browse Source

使问候语一直展示(已点击、已开始、已完成)

Mask96 4 years ago
parent
commit
10c40d20b4
1 changed files with 16 additions and 12 deletions
  1. 16 12
      src/components/WebQn.vue

+ 16 - 12
src/components/WebQn.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <!-- page title -->
-    <div v-if="stage == 0">
+    <div v-if="showHello">
       <mt-header type="default" title="问卷调查-问候语" fixed></mt-header>
     </div>
     <div v-else-if="stage == 1">
@@ -17,7 +17,7 @@
     </div>
 
     <!-- 问候语 -->
-    <div v-if="stage == 0">
+    <div v-if="showHello">
       <p style="margin: 80px 0;">{{questionaire.info.hello}}</p>
       <mt-button type="primary" @click="start" class="button-bottom">继续</mt-button>
     </div>
@@ -73,7 +73,7 @@
                 <Label class="body" :text="questionaire.info.bye" textWrap="true" verticalAlignment="top" />
                 <Button text="继续" @tap="onFinishTap" row="1" />
     </div>-->
-    <div v-if="stage == 2">
+    <div v-else-if="stage == 2">
       <p style="margin: 80px 0;">{{questionaire.info.bye}}</p>
     </div>
   </div>
@@ -94,6 +94,7 @@ export default {
   name: "WebQn",
   data: function() {
     return {
+      showHello: true,
       webQuestionaire: {},
       questionaire: { info: {} },
       questionHEAD: 0,
@@ -377,16 +378,19 @@ export default {
     //     }
     // },
     start() {
-      if (this.openWay == "Project") {
-        // 匿名方式打开
-        this.webQuestionaire.status = 2;
-      } else {
-        // 登录状态打开方式
-        this.webQuestionaire.status = 2;
-        axios
-          .put(this.webQnUrl, { status: 2 })
-          .then(() => console.log("update status success"));
+      if (this.stage < 2) {
+        if (this.openWay == "Project") {
+          // 匿名方式打开
+          this.webQuestionaire.status = 2;
+        } else {
+          // 登录状态打开方式
+          this.webQuestionaire.status = 2;
+          axios
+            .put(this.webQnUrl, { status: 2 })
+            .then(() => console.log("update status success"));
+        }
       }
+      this.showHello = false;
     },
     getUserName() {
       if (this.openWay == "Project") {