xtz 4 年之前
父节点
当前提交
ccc23084a0
共有 4 个文件被更改,包括 25 次插入16 次删除
  1. 2 2
      answer/.env.test
  2. 1 1
      answer/src/router/index.js
  3. 12 12
      answer/src/views/contest.vue
  4. 10 1
      answer/src/views/info.vue

+ 2 - 2
answer/.env.test

@@ -1,8 +1,8 @@
 // 测试环境
 module.exports={
   NODE_ENV = test
-  VUE_APP_API = http://47.100.59.52:7785
-  VUE_APP_IMG = http://cdn.info666.com
+  VUE_APP_API = http://118.24.176.28:8778
+  VUE_APP_IMG = http://118.24.176.28:8778
   VUE_APP_VER = 0.0.1
   VUE_APP_DAT = new Date().getTime()
   VUE_APP_DOMAIN = info666.com

+ 1 - 1
answer/src/router/index.js

@@ -37,7 +37,7 @@ const routes = [
   // redirect
   {
     path: '/',
-    redirect: '/login'
+    redirect: '/info'
   }
 ]
 

+ 12 - 12
answer/src/views/contest.vue

@@ -32,7 +32,7 @@
         <div class="button-group" v-else-if="!submitState">
             <div class="back-button" @click="page-=1">上一页</div>
             <div class="next-button" @click="page+=1" v-if="page!==5">下一页</div>
-            <div class="confim-button" @click="submit" v-else>提交</div>
+            <div class="confim-button" @click="submit(false)" v-else>提交</div>
         </div>
         <div class="bounced" :style="conTop" v-if="submitState">
             <img :src="icon" alt="">
@@ -57,7 +57,7 @@ export default {
       icon: require('../../public/img/contest/success.png'),
       page: 1,
       questions: [],
-      chooseList: [],
+      chooseList: new Array(50),
       paperId: null,
       timer: null,
       paperDuration: 0,
@@ -81,7 +81,7 @@ export default {
   methods: {
     getAttendContest () {
       this.$api.post('/mCompetition/attendContest', {
-        userId: 7
+        userId: 6
       }).then(r => {
         this.questions = r.object.questions
         this.paperId = r.object.paperId
@@ -92,10 +92,10 @@ export default {
       this.$set(this.chooseList, q, a)
     },
     // false 需确认 true 直接请求
-    submit (type) {
+    submit (type = false) {
       if (!type) {
-        if (!this.chooseList.every(item => item || item === 0)) {
-          return (this.submitState = 1)
+        for (let i = 0; i < this.chooseList.length; i++) {
+          if (this.chooseList[i] === undefined) return (this.submitState = 1)
         }
       }
       let paperScore = 0
@@ -119,9 +119,9 @@ export default {
           paperDuration,
           paperScore,
           questionWrong: JSON.stringify(questionWrong),
-          userId: 7
+          userId: 6
         },
-        userId: 7
+        userId: 6
       }).then(r => {
         this.submitState = 2
         clearInterval(this.timer)
@@ -338,8 +338,8 @@ export default {
 }
 
 .bounced {
-    width: 300px;
-    height: 300px;
+    width: 340px;
+    height: 340px;
     position: absolute;
     top: 50%;
     left: 50%;
@@ -349,13 +349,13 @@ export default {
     align-items: center;
 
     >img {
-        padding: 48px 0 24px 0;
+        padding: 63px 0 34px 0;
         width: 50px;
         height: 50px;
     }
 
     &-message {
-        margin-bottom: 28px;
+        margin-bottom: 33px;
         font-size: 18px;
         font-weight: 500;
         color: #161616;

+ 10 - 1
answer/src/views/info.vue

@@ -47,7 +47,7 @@
                 <el-input v-model="form.other" class="item-right" placeholder="请输入"></el-input>
             </div>
         </div>
-        <div class="confim-button">Start Now !</div>
+        <div class="confim-button" @click="submit">Start Now !</div>
     </div>
 </div>
 </template>
@@ -95,6 +95,15 @@ export default {
     },
     filterMethod (val) {
       this.schoolList = this.schoolData.filter(item => item.label.includes(val))
+    },
+    submit (e) {
+      // let {actualName,age,area,grade,other,school} = this.data.form
+      // let id = wx.getStorageSync('id')
+      // imine.updateUser({reqdata:{actualName,age,area,grade,other,school,id}},r => {
+      this.$router.push({
+        name: 'contest'
+      })
+      // })
     }
   },
   mounted () {