Baozhangchao 3 年之前
父節點
當前提交
975f8f8174

+ 40
- 6
src/components/ClassInfo.vue 查看文件

@@ -8,9 +8,12 @@
8 8
           <div
9 9
             class="class-box-body-top-Info-Time"
10 10
           >课程时间:{{parseTime(ClassContent.startDate,'{m}月{d}日 {h}:{i}')}}~{{parseTime(ClassContent.endDate,'{m}月{d}日 {h}:{i}')}}</div>
11
-          <div class="class-box-body-top-Info-Shoucang">
12
-            <img src="../assets/Collection/off.png" alt />
13
-            <span>已收藏</span>
11
+          <div
12
+            class="class-box-body-top-Info-Shoucang"
13
+            @click="ClassContent.isFavored==null? collectionHande():deleteColl()"
14
+          >
15
+            <img :src="ClassContent.isFavored?on:off" alt />
16
+            <span>{{ClassContent.isFavored?'已收藏':'收藏'}}</span>
14 17
           </div>
15 18
         </div>
16 19
       </div>
@@ -23,24 +26,56 @@
23 26
 </template>
24 27
 
25 28
 <script>
26
-import { getCourseInfof } from '../util/api'
29
+import { getCourseInfof, addCollection, deleteCollection } from '../util/api'
27 30
 import { parseTime, SignInTime } from '../util/formattingData'
28 31
 
29 32
 export default {
30 33
   data() {
31 34
     return {
32
-      ClassContent: null
35
+      ClassContent: null,
36
+      isShoucang: false,
37
+      courseIds: '',
38
+
39
+      on: require('../assets/Collection/on.png'),
40
+      off: require('../assets/Collection/off.png')
33 41
     }
34 42
   },
35 43
   mounted() {
36 44
     this.onloadClass()
45
+    this.courseIds = this.$route.params.courseId
37 46
   },
38 47
   methods: {
39 48
     parseTime,
40 49
     onloadClass() {
41 50
       getCourseInfof(this.$route.params.courseId).then((e) => {
42 51
         this.ClassContent = e
52
+        if (e.isFavored) {
53
+          this.isShoucang = true
54
+        }
55
+
56
+        console.log(e)
57
+      })
58
+    },
59
+    collectionHande() {
60
+      addCollection({
61
+        targetId: this.$route.params.courseId,
62
+        targetName: this.ClassContent.title,
63
+        targetType: 'course'
64
+      }).then((e) => {
65
+        console.log(e)
66
+        this.$toast('收藏成功')
67
+        this.onloadClass()
68
+      })
69
+    },
70
+    deleteColl() {
71
+      deleteCollection({
72
+        targetId: this.$route.params.courseId,
73
+        targetName: this.ClassContent.title,
74
+        targetType: 'course'
75
+      }).then((e) => {
43 76
         console.log(e)
77
+        this.$toast('取消收藏成功')
78
+        this.onloadClass()
44 79
       })
45 80
     }
46 81
   }
@@ -53,7 +88,6 @@ export default {
53 88
   height: 100%;
54 89
   &-body {
55 90
     width: 99%;
56
-    border: 1px solid red;
57 91
     border-radius: 30px;
58 92
     background-color: #fff;
59 93
     position: absolute;

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

@@ -54,8 +54,8 @@ export default {
54 54
 
55 55
   methods: {
56 56
     goQuestion(courseId) {
57
-      this.$router.push({ name: 'ClassInfo', params: { courseId: courseId } })
58
-      // this.$router.push('/signIn')
57
+      // this.$router.push({ name: 'ClassInfo', params: { courseId: courseId } })
58
+      this.$router.push('/Questionnaire')
59 59
     },
60 60
     parseTime, //时间格式化
61 61
 
@@ -113,7 +113,7 @@ export default {
113 113
     border-radius: 10px;
114 114
     margin: 10px auto;
115 115
     box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.2);
116
-
116
+    margin-bottom: 2em;
117 117
     height: 33vh;
118 118
     .van-swipe-item {
119 119
     }
@@ -123,10 +123,10 @@ export default {
123 123
   }
124 124
 
125 125
   .Card-box {
126
-    width: 95%;
126
+    width: 93%;
127 127
     border-radius: 10px;
128 128
     background-color: #fff;
129
-    margin: 1.8em auto 1em auto;
129
+    margin: 1em auto 0.4em auto;
130 130
     box-shadow: 0 0 15px rgb(214, 214, 214);
131 131
 
132 132
     .Card-box-top {

+ 80
- 3
src/components/MyCollection.vue 查看文件

@@ -1,26 +1,103 @@
1 1
 <template>
2
-  <h1>2</h1>
2
+  <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
3
+    <div class="Card-box" v-for="(item, index) in shoucangList" :key="index">
4
+      <div>
5
+        <div class="Card-box-top">
6
+          <!-- <img :src="item.content" alt /> -->
7
+          <div class="Card-box-top-box">
8
+            <div class="Card-box-top-title">{{item.targetName}}</div>
9
+            <div
10
+              class="Card-box-top-time"
11
+            >收藏时间:{{parseTime(item.createDate, '{y}年{m}月{d}日 {h}:{i}')}}</div>
12
+          </div>
13
+        </div>
14
+        <div class="Card-box-botton" @click="goQuestion(item.targetId)">
15
+          <div>查看详情</div>
16
+          <van-icon name="arrow" />
17
+        </div>
18
+      </div>
19
+    </div>
20
+  </van-list>
3 21
 </template>
4 22
 
5 23
 <script>
6 24
 import { getCollection, deleteCollection } from '../util/api'
25
+import { parseTime } from '../util/formattingData'
7 26
 
8 27
 export default {
9 28
   data() {
10
-    return {}
29
+    return {
30
+      loading: false,
31
+      finished: true,
32
+      shoucangList: []
33
+    }
11 34
   },
12 35
   mounted() {
13 36
     this.onLoadCollertion()
14 37
   },
15 38
   methods: {
39
+    parseTime,
16 40
     onLoadCollertion() {
17 41
       getCollection().then((e) => {
42
+        this.shoucangList = e.records
18 43
         console.log('收藏列表', e)
19 44
       })
20
-    }
45
+    },
46
+    onLoad() {}
21 47
   }
22 48
 }
23 49
 </script>
24 50
 
25 51
 <style lang="less" scoped>
52
+.Card-box {
53
+  width: 93%;
54
+  border-radius: 10px;
55
+  background-color: #fff;
56
+  margin: 1em auto 0.4em auto;
57
+  box-shadow: 0 0 15px rgb(214, 214, 214);
58
+  .Card-box-top {
59
+    display: flex;
60
+    align-items: center;
61
+    padding: 0.8em 0 0.6em 0.4em;
62
+    > img {
63
+      width: 65px;
64
+      height: 65px;
65
+      border-radius: 50%;
66
+
67
+      // padding: 20px;
68
+    }
69
+    &-box {
70
+      // width: 63vw;
71
+    }
72
+
73
+    &-title {
74
+      font-size: 16px;
75
+      font-weight: 700;
76
+      letter-spacing: 1px;
77
+      padding: 0 0 12px 10px;
78
+    }
79
+    &-time {
80
+      font-size: 12px;
81
+      color: rgb(133, 133, 133);
82
+      padding: 0px 0 0px 10px;
83
+    }
84
+  }
85
+  .Card-box-botton {
86
+    width: 90%;
87
+    margin: 0 auto;
88
+    border-top: 1px solid rgb(238, 238, 238);
89
+    display: flex;
90
+    color: rgb(133, 133, 133);
91
+    justify-content: space-between;
92
+    font-size: 10px;
93
+
94
+    > div {
95
+      padding: 10px 0 10px 0;
96
+    }
97
+    .van-icon {
98
+      position: relative;
99
+      top: 1.9vh;
100
+    }
101
+  }
102
+}
26 103
 </style>

+ 14
- 0
src/components/Question/TextAreas.vue 查看文件

@@ -0,0 +1,14 @@
1
+<template>
2
+  <div>
3
+    <textarea>
4
+      asdsadas
5
+    </textarea>
6
+  </div>
7
+</template>
8
+
9
+<script>
10
+export default {}
11
+</script>
12
+
13
+<style>
14
+</style>

+ 5
- 3
src/components/Question/Title.vue 查看文件

@@ -25,12 +25,14 @@ export default {
25 25
   methods: {
26 26
     formatType(typ) {
27 27
       switch (typ) {
28
-        case 'single':
28
+        case 'radio':
29 29
           return '单选'
30
-        case 'many':
30
+        case 'checkBox':
31 31
           return '多选'
32
-        case 'judgment':
32
+        case 'switch':
33 33
           return '判断'
34
+        case 'textarea':
35
+          return '简答题'
34 36
         default:
35 37
           return '未知题型'
36 38
       }

+ 24
- 14
src/components/Question/index.vue 查看文件

@@ -3,14 +3,16 @@
3 3
     <q-title v-bind="qTitleContent"></q-title>
4 4
     <div style="margin-top:3em;">
5 5
       <div class="scroll">
6
-        <answer
7
-          v-for="answer in question.answerList"
8
-          :key="answer.answerId"
9
-          :active="values.includes(answer.option)"
10
-          :option="answer.option"
11
-          :label="answer.content"
12
-          @click="handleAnswer(answer.option)"
13
-        ></answer>
6
+        <div v-for="answer in question.answerList" :key="answer.answerId">
7
+          <TextAreas v-if="answer.questionType=='textarea'" />
8
+          <answer
9
+            v-else
10
+            :active="values.includes(answer.optCode)"
11
+            :option="answer.optCode"
12
+            :label="answer.content"
13
+            @click="handleAnswer(answer.optCode)"
14
+          ></answer>
15
+        </div>
14 16
       </div>
15 17
     </div>
16 18
   </div>
@@ -21,7 +23,8 @@ export default {
21 23
   name: 'Question',
22 24
   components: {
23 25
     Answer: () => import('./Answer.vue'),
24
-    QTitle: () => import('./Title.vue')
26
+    QTitle: () => import('./Title.vue'),
27
+    TextAreas: () => import('./TextAreas.vue')
25 28
   },
26 29
   props: {
27 30
     value: {
@@ -37,6 +40,9 @@ export default {
37 40
     serialNo: {
38 41
       type: Number,
39 42
       required: true
43
+    },
44
+    types: {
45
+      type: String
40 46
     }
41 47
   },
42 48
   data() {
@@ -44,25 +50,29 @@ export default {
44 50
       answerValues: {}
45 51
     }
46 52
   },
53
+
47 54
   computed: {
48 55
     qTitleContent() {
49 56
       return {
50
-        serialNo: this.serialNo,
51
-        title: this.question.title,
52
-        qType: this.question.optType
57
+        serialNo: this.question.sortNo + 1,
58
+        title: this.question.content,
59
+        qType: this.question.questionType
53 60
       }
54 61
     },
62
+
55 63
     values() {
56 64
       // 为了便捷处理, 不同的问题类型。所有的答案统一处理为数组
57 65
       return Array.isArray(this.value) ? this.value : [this.value]
58 66
     }
59 67
   },
68
+
60 69
   methods: {
61 70
     handleAnswer(opt) {
71
+      console.log('🚀 ~ file: index.vue ~ line 68 ~ handleAnswer ~ opt', opt)
62 72
       const isChecked = this.values.includes(opt)
63 73
 
64 74
       // 如果是多选
65
-      if (this.question.optType === 'many') {
75
+      if (this.question.optType === 'checkBox') {
66 76
         if (isChecked) {
67 77
           this.$emit(
68 78
             'input',
@@ -84,7 +94,7 @@ export default {
84 94
   width: 80vw;
85 95
   margin: 0 auto;
86 96
   position: relative;
87
-  top: -15vh;
97
+  top: 5vh;
88 98
   left: -4%;
89 99
   background: white;
90 100
   box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);

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

@@ -0,0 +1,65 @@
1
+<template>
2
+  <div :class="{'QuestionnHome-box':true,'actveBox':isActve}">
3
+    <h1>{{Content.name||''}}</h1>
4
+    <div @click="goTop">点我消失</div>
5
+  </div>
6
+</template>
7
+
8
+<script>
9
+import { getQuestionnaire } from '../util/api'
10
+
11
+export default {
12
+  name: 'QuestionnHome',
13
+  props: {
14
+    active: Boolean
15
+  },
16
+  data() {
17
+    return {
18
+      isActve: false,
19
+      Content: null
20
+    }
21
+  },
22
+  mounted() {
23
+    this.onLoadQuestionn()
24
+  },
25
+  methods: {
26
+    goTop() {
27
+      if (this.Content.isAnswered) {
28
+        this.$toast('您已回答过此问卷!')
29
+      } else {
30
+        this.isActve = true
31
+      }
32
+    },
33
+    onLoadQuestionn() {
34
+      getQuestionnaire('f5a47d178019bda33a370d7a6ed1e4c3').then((e) => {
35
+        this.Content = e
36
+      })
37
+    }
38
+  }
39
+}
40
+</script>
41
+
42
+<style lang="less" scoped>
43
+.QuestionnHome-box {
44
+  width: 100vw;
45
+  height: 100vh;
46
+  z-index: 5000;
47
+  background-color: aquamarine;
48
+  display: flex;
49
+  position: absolute;
50
+  flex-direction: column;
51
+  top: 0;
52
+  transition: top 1.4s ease;
53
+
54
+  align-items: center;
55
+  & > div {
56
+    width: 100px;
57
+    height: 100px;
58
+    border: 1px solid red;
59
+    margin: 0 auto;
60
+  }
61
+}
62
+.actveBox {
63
+  top: -250vh;
64
+}
65
+</style>

+ 138
- 135
src/components/Questionnaire.vue 查看文件

@@ -1,5 +1,6 @@
1 1
 <template>
2 2
   <div>
3
+    <QuestionnHome />
3 4
     <!-- <img :src="backgeImg" class="ImagStyle" /> -->
4 5
     <popup
5 6
       :show="showPopup"
@@ -15,36 +16,37 @@
15 16
     </popup>
16 17
 
17 18
     <!-- 页面标题 -->
18
-    <div class="VSTD_box" v-if="question.length > 0">
19
+    <div class="VSTD_box" v-if="questionList.length > 0">
19 20
       <!-- 题的表单 -->
20 21
       <!-- 绑定表单的数据 ruleForm -->
21 22
       <!-- 绑定题的数组 ruleForm.resource[index] -->
22 23
 
23
-      <el-form class="demo-ruleForm">
24
+      <van-form class="demo-ruleForm">
24 25
         <!-- 循环后端  的所有题 -->
25 26
         <div class="VSTD_box_item">
26 27
           <question
28
+            :types="questionList[netx].questionType"
27 29
             :question="currentQuestion"
28 30
             :serial-no="netx + 1"
29 31
             v-model="currentQuestion.rightAnswer"
30 32
           ></question>
31 33
 
32 34
           <div class="but-box">
33
-            <el-form-item class="but-box-form-item">
34
-              <el-button class="butsize" v-show="ButPrevious" @click="PreviousBut">上一题</el-button>
35
-              <el-button
36
-                type="primary"
35
+            <van-form class="but-box-form-item">
36
+              <van-button class="butsize" v-show="ButPrevious" @click="PreviousBut">上一题</van-button>
37
+              <van-button
38
+                type="info"
37 39
                 class="butsize"
38 40
                 v-show="Butnetx"
39 41
                 @click="netxBut(currentQuestion.rightAnswer)"
40
-              >下一题</el-button>
41
-              <el-button type="primary" class="butsize" v-show="Butsubmit" @click="firstSubmit">提交</el-button>
42
-            </el-form-item>
42
+              >下一题</van-button>
43
+              <van-button type="info" class="butsize" v-show="Butsubmit" @click="firstSubmit">提交</van-button>
44
+            </van-form>
43 45
           </div>
44 46
         </div>
45 47
 
46 48
         <!-- 提交函数  -->
47
-      </el-form>
49
+      </van-form>
48 50
     </div>
49 51
 
50 52
     <!-- 如果没题就提示没题 -->
@@ -59,15 +61,17 @@
59 61
 </template>
60 62
 
61 63
 <script>
62
-// import { getQuestionList, submitAnswer } from '@/util/api'
63
-// import query from '../util/query'
64
+import { getQuestion, getQuestionInfo, getQuestionAnswer } from '../util/api'
65
+import query from '../util/query'
64 66
 
65 67
 export default {
66
-  name: 'Questionnaire',
68
+  name: 'HelloWorld',
67 69
   components: {
68 70
     Question: () => import('./Question'),
69
-    Popup: () => import('./Questionnaire/Popup.vue')
71
+    Popup: () => import('./Questionnaire/Popup.vue'),
72
+    QuestionnHome: () => import('./QuestionnHome.vue')
70 73
   },
74
+  props: {},
71 75
   data() {
72 76
     return {
73 77
       showPopup: false,
@@ -83,126 +87,116 @@ export default {
83 87
       indexSum: 0, //第indexSum题
84 88
       // questionId: '', //试题的id
85 89
       title: '', //返回的题目信息
86
-      question: [], //答题保存的数组
90
+      questionList: [], //答题保存的数组
87 91
 
88 92
       DSQ: null, //定时器,到时间自动提交
89 93
       DSQTime: 0 //后端返回的结束时间
90 94
     }
95
+  },
96
+  computed: {
97
+    currentQuestion: {
98
+      get: function () {
99
+        return this.questionList[this.netx]
100
+      },
101
+      set: function (val) {
102
+        this.$set(this.questionList, this.netx, val)
103
+      }
104
+    }
105
+  },
106
+  created() {
107
+    // findIndex 用来获取数组中第一个满足条件的元素下标
108
+    var v = this.questionList.findIndex((value, index, arr) => {
109
+      return value.a == '2'
110
+    })
111
+  },
112
+
113
+  mounted() {
114
+    this.onSearch()
115
+  },
116
+
117
+  methods: {
118
+    cancelForm() {
119
+      this.showPopup = false
120
+      console.log('点击了取消')
121
+    },
122
+
123
+    onSearch() {
124
+      getQuestion('f5a47d178019bda33a370d7a6ed1e4c3').then((res) => {
125
+        console.log('题目列表', res)
126
+        const { records, total } = res
127
+        this.questionList = records || []
128
+      })
129
+      // let sum = 0
130
+    },
131
+    firstSubmit() {
132
+      this.showPopup = true
133
+    },
134
+    submitForm(e) {
135
+      this.LoadingShowAAA = true
136
+      console.log('🚀 ~ f e', e)
137
+      // const { questionId, rightAnswer } = this.question
138
+      console.log(this.questionList)
139
+
140
+      let NEW_ARR = this.questionList.map((obj) => {
141
+        if (Array.isArray(obj.rightAnswer)) {
142
+          let sliceArray = obj.rightAnswer.slice(1)
143
+          let stringArray = sliceArray.sort().toLocaleString()
144
+
145
+          return { questionId: obj.questionId, answer: stringArray }
146
+        } else {
147
+          return { questionId: obj.questionId, answer: obj.rightAnswer }
148
+        }
149
+      })
150
+      console.log(NEW_ARR)
151
+
152
+      getQuestionAnswer(
153
+        this.$store.state.user.appid,
154
+        query('gameId'),
155
+        NEW_ARR
156
+      ).then((e) => {
157
+        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 })
160
+        this.LoadingShowAAA = false
161
+        this.showPopup = false
162
+
163
+        this.$router.replace('/Leaderboard') //replace  不记录页面 ,无法返回
164
+      })
165
+    },
166
+
167
+    netxBut(e) {
168
+      if (e !== null) {
169
+        if (this.netx >= this.questionList.length - 2) {
170
+          this.Butnetx = false
171
+          this.Butsubmit = true
172
+        }
173
+        if (this.netx <= this.questionList.length - 2) {
174
+          this.netx = this.netx + 1
175
+          this.ButPrevious = this.ButPrevious = true
176
+          this.indexSum = this.indexSum + 1
177
+        }
178
+      } else {
179
+        this.$message.warning('请选择至少一项')
180
+      }
181
+    },
182
+
183
+    PreviousBut() {
184
+      if (this.netx >= 1) {
185
+        this.Butnetx = true
186
+        this.Butsubmit = false
187
+      }
188
+      if (this.netx <= 1) {
189
+        this.ButPrevious = this.ButPrevious = false
190
+        this.Butnetx = true
191
+      }
192
+      if (this.netx <= 0) {
193
+        console.log('???', this.netx, this.questionList.length)
194
+      } else {
195
+        this.netx = this.netx - 1
196
+        this.indexSum = this.indexSum - 1
197
+      }
198
+    }
91 199
   }
92
-  //   computed: {
93
-  //     currentQuestion: {
94
-  //       get: function () {
95
-  //         return this.question[this.netx]
96
-  //       },
97
-  //       set: function (val) {
98
-  //         this.$set(this.question, this.netx, val)
99
-  //       }
100
-  //     }
101
-  //   },
102
-  //   created() {
103
-  //     // findIndex 用来获取数组中第一个满足条件的元素下标
104
-  //     var v = this.question.findIndex((value, index, arr) => {
105
-  //       return value.a == '2'
106
-  //     })
107
-  //   },
108
-
109
-  //   mounted() {
110
-  //     this.onSearch()
111
-  //   },
112
-
113
-  //   methods: {
114
-  //     cancelForm() {
115
-  //       this.showPopup = false
116
-  //       console.log('点击了取消')
117
-  //     },
118
-
119
-  //     onSearch() {
120
-  //       getQuestionList(this.$store.state.user.appid, query('gameId')).then(
121
-  //         (res) => {
122
-  //           console.log('题目列表', res)
123
-  //           const { questionId, title, optType } = res
124
-  //           this.question = res
125
-  //           this.questionId = questionId
126
-  //           this.title = title
127
-  //           let NBMMSSD = res.map((obj) => {
128
-  //             let start = 0
129
-  //             let sum = obj.score
130
-  //             start += sum
131
-  //             return start
132
-  //           })
133
-  //           let oversum = eval(NBMMSSD.join('+'))
134
-  //           this.$store.commit('SET_USER_INFO', { totalScore: oversum })
135
-  //         }
136
-  //       )
137
-  //       // let sum = 0
138
-  //     },
139
-  //     firstSubmit() {
140
-  //       this.showPopup = true
141
-  //     },
142
-  //     submitForm(e) {
143
-  //       this.LoadingShowAAA = true
144
-  //       console.log('🚀 ~ f e', e)
145
-  //       // const { questionId, rightAnswer } = this.question
146
-  //       console.log(this.question)
147
-
148
-  //       let NEW_ARR = this.question.map((obj) => {
149
-  //         if (Array.isArray(obj.rightAnswer)) {
150
-  //           let sliceArray = obj.rightAnswer.slice(1)
151
-  //           let stringArray = sliceArray.sort().toLocaleString()
152
-
153
-  //           return { questionId: obj.questionId, answer: stringArray }
154
-  //         } else {
155
-  //           return { questionId: obj.questionId, answer: obj.rightAnswer }
156
-  //         }
157
-  //       })
158
-  //       console.log(NEW_ARR)
159
-
160
-  //       submitAnswer(this.$store.state.user.appid, query('gameId'), NEW_ARR).then(
161
-  //         (e) => {
162
-  //           console.log(e.score, e)
163
-  //           this.$store.commit('SET_USER_INFO', { scoreNumb: e.result.score })
164
-  //           this.$store.commit('SET_USER_INFO', { resultInfo: e.result.resultId })
165
-  //           this.LoadingShowAAA = false
166
-  //           this.showPopup = false
167
-
168
-  //           this.$router.replace('/Leaderboard') //replace  不记录页面 ,无法返回
169
-  //         }
170
-  //       )
171
-  //     },
172
-
173
-  //     netxBut(e) {
174
-  //       if (e !== null) {
175
-  //         if (this.netx >= this.question.length - 2) {
176
-  //           this.Butnetx = false
177
-  //           this.Butsubmit = true
178
-  //         }
179
-  //         if (this.netx <= this.question.length - 2) {
180
-  //           this.netx = this.netx + 1
181
-  //           this.ButPrevious = this.ButPrevious = true
182
-  //           this.indexSum = this.indexSum + 1
183
-  //         }
184
-  //       } else {
185
-  //         this.$message.warning('请选择至少一项')
186
-  //       }
187
-  //     },
188
-
189
-  //     PreviousBut() {
190
-  //       if (this.netx >= 1) {
191
-  //         this.Butnetx = true
192
-  //         this.Butsubmit = false
193
-  //       }
194
-  //       if (this.netx <= 1) {
195
-  //         this.ButPrevious = this.ButPrevious = false
196
-  //         this.Butnetx = true
197
-  //       }
198
-  //       if (this.netx <= 0) {
199
-  //         console.log('???', this.netx, this.question.length)
200
-  //       } else {
201
-  //         this.netx = this.netx - 1
202
-  //         this.indexSum = this.indexSum - 1
203
-  //       }
204
-  //     }
205
-  //   }
206 200
 }
207 201
 </script>
208 202
 
@@ -218,16 +212,25 @@ export default {
218 212
   .demo-ruleForm {
219 213
     width: 80%;
220 214
     display: flex;
221
-    margin: auto;
215
+    margin: 0 auto;
222 216
     .VSTD_box_item {
217
+      display: flex;
218
+      flex-direction: column;
219
+      align-items: center;
220
+
223 221
       .but-box {
224
-        position: absolute;
225
-        width: 80%;
226
-        align-items: center;
227
-        bottom: 10px;
228
-        margin: auto;
222
+        width: 62vw;
223
+        .but-box-form-item {
224
+          text-align: center;
225
+
226
+          width: 100%;
227
+          margin: 0 auto;
228
+          top: -5vh;
229
+          position: relative;
230
+        }
229 231
         .butsize {
230 232
           height: 43px;
233
+          margin: 0 10px;
231 234
         }
232 235
       }
233 236
     }

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

@@ -10,9 +10,9 @@
10 10
         <span>(多选)</span>
11 11
       </p>
12 12
     </div>
13
-    <!-- v-model="ruleForm.ManyVal" -->
13
+    <!-- v-model="ruleForm.checkboxVal" -->
14 14
     <div class="group-box">
15
-      <el-form-item label=" " class="Single-radio">
15
+      <van-form label=" " class="Single-radio">
16 16
         <el-checkbox-group :change="changeVaal" style="display:grid">
17 17
           <el-checkbox
18 18
             :class="`Single-elradio animate__animated animate__bounceInUp `"
@@ -22,14 +22,14 @@
22 22
           >{{ item.option }}:{{item.content}}</el-checkbox>
23 23
           <!-- <el-checkbox label="F">{{ item.stSelectf }}</el-checkbox> -->
24 24
         </el-checkbox-group>
25
-      </el-form-item>
25
+      </van-form>
26 26
     </div>
27 27
   </div>
28 28
 </template>
29 29
 
30 30
 <script>
31 31
 export default {
32
-  name: 'Many', //多选题
32
+  name: 'checkbox', //多选题
33 33
   props: {
34 34
     item: {
35 35
       type: Object
@@ -54,7 +54,7 @@ export default {
54 54
         e,
55 55
         v
56 56
       )
57
-      console.log('🚀 ~ file: Many.vue ~ line 18 ~ ruleForm', this.ruleForm)
57
+      console.log('🚀 ~ file: checkbox.vue ~ line 18 ~ ruleForm', this.ruleForm)
58 58
     }
59 59
   }
60 60
 }

+ 1
- 1
src/components/Questionnaire/index.js 查看文件

@@ -8,7 +8,7 @@ import Loading from './Loading.vue'//单选
8 8
 const compoents = [
9 9
   PlayGame,
10 10
   // UserScore,
11
-  // Many,
11
+  // checkbox,
12 12
   Loading,
13 13
 ]
14 14
 

+ 35
- 38
src/components/StrongPhoto.vue 查看文件

@@ -8,18 +8,17 @@
8 8
         </van-swipe-item>
9 9
       </van-swipe>
10 10
     </div>
11
-    <div style="display: flex; aline-itme:center;margin-top: 30px;padding-left: 15px;
12
-    ">
11
+    <div style="display: flex; aline-itme:center;margin-top: 30px;padding-left: 15px; ">
13 12
       <!-- <div :class="`${classStyle?'Zhedie-box Donghua':'Zhedie-box'}`"> -->
14 13
       <div :class="{'Zhedie-box': true, 'expand': classStyle}">
15 14
         <!-- :class="`${clickStyle?'clickStyle':''}`" -->
16 15
 
17 16
         <div
18 17
           v-for="(item,i) in buttList"
19
-          :key="item"
20
-          @click="SeePhotos(i)"
18
+          :key="i"
19
+          @click="SeePhotos(i,item.packId)"
21 20
           :class="activeNum === i ? 'clickStyle':''"
22
-        >{{item}}</div>
21
+        >{{item.name}}</div>
23 22
       </div>
24 23
       <van-icon
25 24
         v-show="iconShow"
@@ -32,11 +31,11 @@
32 31
     <div class="PhotoList-box">
33 32
       <div class="PhotoList-box-text">
34 33
         <div></div>
35
-        <span>{{title.name}}</span>
34
+        <span>1122222</span>
36 35
       </div>
37 36
       <div class="PhotoList-box-images">
38
-        <span v-for="(image, index) in title.imageList" :key="index">
39
-          <van-image width="31vw" :src="image.a" style="padding:0 3px 0 2px" />
37
+        <span v-for="(image, index) in imageList" :key="index">
38
+          <van-image width="31vw" :src="image.url" style="padding:0 3px 0 2px" />
40 39
         </span>
41 40
       </div>
42 41
     </div>
@@ -44,6 +43,8 @@
44 43
 </template>
45 44
 
46 45
 <script>
46
+import { getPhotoSotr, getPhotos } from '../util/api'
47
+
47 48
 import { getBanner } from '../util/api'
48 49
 
49 50
 export default {
@@ -51,46 +52,40 @@ export default {
51 52
     return {
52 53
       classStyle: false,
53 54
       clickStyle: false,
54
-      iconShow: false,
55
+      iconShow: true,
55 56
       activeNum: 0, //下标
56
-      buttList: [
57
-        '一期培训',
58
-        '二期培训',
59
-        '三期培训',
60
-        '四期345啊啊',
61
-        '四期44啊啊',
62
-        '四期2啊啊',
63
-        '四期0啊啊'
64
-      ],
57
+      buttList: [],
65 58
       photoBannerImages: [],
66
-      title: {
67
-        name: '2022年02月22日',
68
-        imageList: [
69
-          { a: 'https://img.yzcdn.cn/vant/cat.jpeg' },
70
-          { a: 'https://img.yzcdn.cn/vant/cat.jpeg' },
71
-          { a: 'https://img.yzcdn.cn/vant/cat.jpeg' },
72
-          { a: 'https://img.yzcdn.cn/vant/cat.jpeg' },
73
-          { a: 'https://img.yzcdn.cn/vant/cat.jpeg' }
74
-          // { a: 'https://img.yzcdn.cn/vant/cat.jpeg' }
75
-        ]
76
-      }
59
+
60
+      imageList: []
77 61
     }
78 62
   },
79 63
   mounted() {
80 64
     this.onBanner()
65
+    this.onLoadSort()
81 66
 
82
-    if (this.buttList.length >= 5) {
83
-      this.iconShow = true
84
-    } else {
85
-      this.iconShow = false
86
-    }
67
+    // if (this.buttList.length >= 2) {
68
+    //   this.iconShow = true
69
+    // } else {
70
+    //   this.iconShow = false
71
+    // }
87 72
   },
88 73
   methods: {
74
+    onLoadSort() {
75
+      getPhotoSotr().then((e) => {
76
+        this.buttList = e.records
77
+        console.log(e.records)
78
+      })
79
+    },
89 80
     animations() {
90 81
       this.classStyle = !this.classStyle
91 82
     },
92
-    SeePhotos(i) {
83
+    SeePhotos(i, id) {
84
+      console.log('🚀 ~ file: StrongPhoto.vue ~ line 94 ~ SeePhotos ~ id', id)
93 85
       this.activeNum = i
86
+      getPhotos(id).then((e) => {
87
+        this.imageList = e.records
88
+      })
94 89
       // this.clickStyle = !this.clickStyle
95 90
     },
96 91
     onBanner() {
@@ -122,15 +117,14 @@ export default {
122 117
     display: flex;
123 118
     align-items: center;
124 119
     flex-wrap: wrap;
125
-    height: 30px;
120
+    height: 35px;
126 121
     transition: height 0.2s ease;
127 122
     &.expand {
128 123
       height: 50vh;
129 124
     }
130 125
 
131 126
     > div {
132
-      width: 75px;
133
-      height: 30px;
127
+      padding: 2px 10px;
134 128
       color: rgb(128, 128, 128);
135 129
       line-height: 28px;
136 130
       text-align: center;
@@ -149,6 +143,8 @@ export default {
149 143
   }
150 144
   .PhotoList-box {
151 145
     width: 100%;
146
+    height: auto;
147
+    background-color: #fff;
152 148
 
153 149
     .PhotoList-box-text {
154 150
       display: flex;
@@ -170,6 +166,7 @@ export default {
170 166
     .PhotoList-box-images {
171 167
       width: 97%;
172 168
       margin: 0 auto;
169
+      padding-bottom: 10vh;
173 170
     }
174 171
   }
175 172
 }

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

@@ -126,4 +126,84 @@ export const addCollection = (data) => request(`/api/wx/favorite`, { method: 'po
126 126
 * @returns 
127 127
 * 
128 128
 */
129
-export const deleteCollection = (id) => request(`/api/wx/favorite/${id}`, { method: 'delete' })
129
+export const deleteCollection = (data) => request(`/api/wx/favorite`, { method: 'delete', data })
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+/**
143
+* 照片分类
144
+* @param
145
+* @returns 
146
+* /api/{client}/attchPack
147
+*/
148
+export const getPhotoSotr = (data) => request(`/api/wx/attchPack`, { method: 'get', data })
149
+
150
+
151
+
152
+/**
153
+* 照片墙
154
+* @param
155
+* @returns 
156
+* /api/{client}/attachment
157
+*/
158
+export const getPhotos = (id, data) => request(`/api/wx/attachment?packId=${id}&pageSize=99999`, { method: 'get', data })
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+/**
172
+* 问卷
173
+* @param
174
+* @returns 
175
+* 
176
+*/
177
+export const getQuestionnaire = (id, data) => request(`/api/wx/questionnaire/${id}`, { method: 'get', data })
178
+
179
+
180
+/**
181
+* 问卷列表
182
+* @param
183
+* @returns 
184
+* 
185
+*/
186
+export const getQuestion = (id, data) => request(`/api/wx/question?queId=${id}&pageSize=99999`, { method: 'get', data })
187
+
188
+
189
+
190
+
191
+/**
192
+* 问卷详情
193
+* @param
194
+* @returns 
195
+* 
196
+*/
197
+export const getQuestionInfo = (id, data) => request(`/api/wx/question/${id}`, { method: 'get', data })
198
+
199
+
200
+
201
+
202
+/**
203
+* 问卷提交
204
+* @param
205
+* @returns 
206
+* 
207
+*/
208
+export const getQuestionAnswer = (id, data) => request(`/api/wx/questionnaire/${id}/answer`, { method: 'post', data })
209
+