Baozhangchao 3 年前
父节点
当前提交
fea4d15b2d

二进制
src/assets/tabber/class.png 查看文件


二进制
src/assets/tabber/class1.png 查看文件


二进制
src/assets/tabber/photo.png 查看文件


二进制
src/assets/tabber/photo1.png 查看文件


二进制
src/assets/tabber/user.png 查看文件


二进制
src/assets/tabber/user1.png 查看文件


+ 23
- 6
src/layout/index.vue 查看文件

@@ -4,13 +4,21 @@
4 4
     <router-view />
5 5
 
6 6
     <!-- 底部导航栏 -->
7
-    <van-tabbar v-model="active" active-color="#000" inactive-color="#D9DEE4" >
8
-      <van-tabbar-item
7
+    <van-tabbar v-model="active" active-color="#000" inactive-color="#D9DEE4">
8
+      <!-- <van-tabbar-item
9 9
         v-for="item in tabbar"
10 10
         :key="item.path"
11 11
         :icon="item.icon"
12 12
         :to="item.path"
13
-      >{{ item.text }}</van-tabbar-item>
13
+      >{{ item.text }}</van-tabbar-item>-->
14
+      <!-- :icon="item.icon.inactive" -->
15
+
16
+      <van-tabbar-item v-for="item in tabbar" :key="item.path" :to="item.path">
17
+        <span>{{ item.text }}</span>
18
+        <template #icon="props">
19
+          <img :src="props.active ? item.icon.active : item.icon.inactive" />
20
+        </template>
21
+      </van-tabbar-item>
14 22
     </van-tabbar>
15 23
   </div>
16 24
 </template>
@@ -31,17 +39,26 @@ export default {
31 39
         {
32 40
           path: '/Course',
33 41
           text: '培训通知',
34
-          icon: 'home-o'
42
+          icon: {
43
+            active: require('../assets/tabber/class1.png'),
44
+            inactive: require('../assets/tabber/class.png')
45
+          }
35 46
         },
36 47
         {
37 48
           path: '/StrongPhoto',
38 49
           text: '精彩集锦',
39
-          icon: 'search'
50
+          icon: {
51
+            active: require('../assets/tabber/photo1.png'),
52
+            inactive: require('../assets/tabber/photo.png')
53
+          }
40 54
         },
41 55
         {
42 56
           path: '/UserCenter',
43 57
           text: '个人中心',
44
-          icon: 'volume-o'
58
+          icon: {
59
+            active: require('../assets/tabber/user1.png'),
60
+            inactive: require('../assets/tabber/user.png')
61
+          }
45 62
         }
46 63
       ]
47 64
     }

+ 4
- 4
src/router/index.js 查看文件

@@ -5,7 +5,7 @@ import Router from 'vue-router'
5 5
 
6 6
 import Course from '@/views/Course.vue'//课程
7 7
 import MyCollection from '@/views/MyCollection.vue'//收藏
8
-import signIn from '@/views/signIn.vue'//打卡
8
+import SignIn from '@/views/SignIn.vue'//打卡
9 9
 import ClassInfo from '@/views/ClassInfo.vue'//课堂详情
10 10
 import StrongPhoto from '@/views/StrongPhoto.vue'//精彩集锦
11 11
 import UserCenter from '@/views/UserCenter.vue'//我的页面
@@ -60,9 +60,9 @@ const router = new Router({
60 60
     },
61 61
     //打卡页面
62 62
     {
63
-      path: '/signIn',
64
-      name: 'signIn',
65
-      component: signIn,
63
+      path: '/SignIn',
64
+      name: 'SignIn',
65
+      component: SignIn,
66 66
     },
67 67
     //课程详情页面
68 68
     {

+ 15
- 0
src/views/Course.vue 查看文件

@@ -5,6 +5,9 @@
5 5
     </div>
6 6
 
7 7
     <!-- list -->
8
+    <!-- 
9
+    <h1 @click="wen">问卷</h1>
10
+    <h1 @click="qian">签到</h1>-->
8 11
     <van-list
9 12
       class="mglr-10 course-list"
10 13
       v-model="loading"
@@ -49,6 +52,18 @@ export default {
49 52
   },
50 53
 
51 54
   methods: {
55
+    wen() {
56
+      this.$router.push({
57
+        name: 'Questionnaire',
58
+        params: { id: 'f5a47d178019bda33a370d7a6ed1e4c3' }
59
+      })
60
+    },
61
+    qian() {
62
+      this.$router.push({
63
+        name: 'SignIn',
64
+        params: { signId: '4ed7a69dc0df0e9132679d58a58fbf5a' }
65
+      })
66
+    },
52 67
     goQuestion(courseId) {
53 68
       this.$router.push({ name: 'ClassInfo', params: { courseId: courseId } })
54 69
       // this.$router.push('/Questionnaire')

+ 23
- 23
src/views/Questionnaire.vue 查看文件

@@ -1,13 +1,12 @@
1 1
 <template>
2 2
   <div class="question-wrapper">
3
-    <QuestionnHome :show="showFirstScreen" :content="questionnaireContent" @confirm="showFirstScreen = false" />
4
-
5
-    <van-dialog
6
-      v-model="showPopup"
7
-      title="确定提交答案吗"
8
-      show-cancel-button
9
-      @confirm="submitForm()"
10
-    >
3
+    <QuestionnHome
4
+      :show="showFirstScreen"
5
+      :content="questionnaireContent"
6
+      @confirm="showFirstScreen = false"
7
+    />
8
+
9
+    <van-dialog v-model="showPopup" title="确定提交答案吗" show-cancel-button @confirm="submitForm()">
11 10
       <p style="margin: 2em">确定要提交答案吗?</p>
12 11
     </van-dialog>
13 12
 
@@ -44,7 +43,7 @@
44 43
 </template>
45 44
 
46 45
 <script>
47
-import { Toast } from 'vant';
46
+import { Toast } from 'vant'
48 47
 import { getQuestionnaire, getQuestion, answerQuestionnaire } from '@/util/api'
49 48
 
50 49
 export default {
@@ -79,7 +78,7 @@ export default {
79 78
   watch: {
80 79
     '$route.query.id': {
81 80
       handler(v) {
82
-        this.loadData(v)
81
+        this.loadData('f5a47d178019bda33a370d7a6ed1e4c3')
83 82
       },
84 83
       immediate: true
85 84
     }
@@ -100,23 +99,25 @@ export default {
100 99
       })
101 100
       // let sum = 0
102 101
     },
103
-  
102
+
104 103
     submitForm(e) {
105 104
       const toast = Toast.loading({
106 105
         duration: 0, // 持续展示 toast
107 106
         forbidClick: true,
108
-        message: '请稍后...',
109
-      });
110
-      answerQuestionnaire(this.$route.query.id, this.questionList).then(e => {
111
-        toast.clear();
112
-        Toast.success('感谢您的参与');
113
-        this.questionnaireContent.isAnswered = true
114
-        this.showFirstScreen = true
115
-      }).catch(e => {
116
-        toast.clear();
117
-        Toast.fail(e.message);
107
+        message: '请稍后...'
118 108
       })
119
-    },
109
+      answerQuestionnaire(this.$route.query.id, this.questionList)
110
+        .then((e) => {
111
+          toast.clear()
112
+          Toast.success('感谢您的参与')
113
+          this.questionnaireContent.isAnswered = true
114
+          this.showFirstScreen = true
115
+        })
116
+        .catch((e) => {
117
+          toast.clear()
118
+          Toast.fail(e.message)
119
+        })
120
+    }
120 121
   }
121 122
 }
122 123
 </script>
@@ -125,7 +126,6 @@ export default {
125 126
 
126 127
 
127 128
 <style lang="less" scoped>
128
-
129 129
 .question-wrapper {
130 130
   background-image: url('~@/assets/userImag/backImag.png');
131 131
   background-size: 100%;

+ 7
- 7
src/views/StrongPhoto.vue 查看文件

@@ -31,6 +31,7 @@
31 31
           v-for="(image, index) in item.res"
32 32
           :key="index"
33 33
           width="31vw"
34
+          height="13vh"
34 35
           :src="image.url"
35 36
           style="padding:0 3px 0 2px"
36 37
           @click="showBig(image.url)"
@@ -49,7 +50,7 @@ import { getBanner } from '@/util/api'
49 50
 
50 51
 export default {
51 52
   components: {
52
-    BannerSwipe: () => import('./components/BannerSwipe.vue'),
53
+    BannerSwipe: () => import('./components/BannerSwipe.vue')
53 54
   },
54 55
   data() {
55 56
     return {
@@ -122,7 +123,7 @@ export default {
122 123
       this.newArrImageList = newArr
123 124
     },
124 125
     onLoadSort() {
125
-      getPhotoSotr().then((e) => {
126
+      getPhotoSotr({ pageSize: 2000 }).then((e) => {
126 127
         this.buttList = e.records
127 128
       })
128 129
     },
@@ -144,7 +145,7 @@ export default {
144 145
     },
145 146
     onBanner() {
146 147
       getBanner('Wonderful').then((e) => {
147
-        this.photoBannerImages = (e.records || []).map(x => x.thumb)
148
+        this.photoBannerImages = (e.records || []).map((x) => x.thumb)
148 149
         // console.log(e)
149 150
       })
150 151
     }
@@ -162,13 +163,11 @@ export default {
162 163
   .Zhedie-box {
163 164
     padding: 0 4vw;
164 165
     overflow: hidden;
165
-    display: flex;
166
-    align-items: center;
167
-    flex-wrap: wrap;
168 166
     height: 7vw;
169 167
     transition: height 0.2s ease;
170 168
     &.expand {
171
-      height: 50vh;
169
+      height: 40vh;
170
+      overflow: scroll;
172 171
     }
173 172
 
174 173
     > div {
@@ -178,6 +177,7 @@ export default {
178 177
       margin-bottom: 1vw;
179 178
       text-align: center;
180 179
       font-size: 10px;
180
+      display: inline-block;
181 181
     }
182 182
     .clickStyle {
183 183
       color: #12a89f;

+ 17
- 20
src/views/UserCenter.vue 查看文件

@@ -4,18 +4,18 @@
4 4
       <div class="profile flex" v-if="divShow">
5 5
         <avatar />
6 6
         <div class="info-name flex-1">
7
-          <div class="title">
8
-            {{person.name}}
9
-          </div>
10
-          <div class="subtitle">
11
-            {{person.phone}}
12
-          </div>
7
+          <div class="title">{{person.name}}</div>
8
+          <div class="subtitle">{{person.phone}}</div>
13 9
           <div class="userInfo-button">一期架空线路工1班</div>
14 10
         </div>
15 11
       </div>
16 12
 
17 13
       <div v-else class="userInfo-button-zhuce" @click="seeUserInfo()">
18
-        <van-button round type="info" size="small">&nbsp;&nbsp;注&nbsp;&nbsp;&nbsp;&nbsp;册&nbsp;&nbsp;</van-button>
14
+        <van-button
15
+          round
16
+          type="info"
17
+          size="small"
18
+        >&nbsp;&nbsp;注&nbsp;&nbsp;&nbsp;&nbsp;册&nbsp;&nbsp;</van-button>
19 19
       </div>
20 20
     </div>
21 21
 
@@ -32,7 +32,6 @@
32 32
         />
33 33
       </van-cell-group>
34 34
     </div>
35
-
36 35
   </div>
37 36
 </template>
38 37
 
@@ -49,29 +48,29 @@ export default {
49 48
         {
50 49
           icon: require('@/assets/userImag/userInfo.png'),
51 50
           title: '我的信息',
52
-          path: '/SetUser',
51
+          path: '/SetUser'
53 52
         },
54 53
         {
55 54
           icon: require('@/assets/userImag/wenjuan.png'),
56 55
           title: '我的收藏',
57
-          path: '/MyCollection',
58
-        },
59
-        {
60
-          icon: require('@/assets/userImag/shoucang.png'),
61
-          title: '我的问卷',
62
-          path: '',
56
+          path: '/MyCollection'
63 57
         }
58
+        // {
59
+        //   icon: require('@/assets/userImag/shoucang.png'),
60
+        //   title: '我的问卷',
61
+        //   path: '',
62
+        // }
64 63
       ]
65 64
     }
66 65
   },
67 66
   computed: {
68 67
     ...mapState({
69
-      person: s => s.user,
68
+      person: (s) => s.user
70 69
     }),
71 70
     divShow() {
72 71
       return !!this.person?.phone
73 72
     }
74
-  },
73
+  }
75 74
 }
76 75
 </script>
77 76
 
@@ -127,9 +126,7 @@ export default {
127 126
           letter-spacing: 1px;
128 127
           background-color: #2cb698;
129 128
         }
130
-
131 129
       }
132
-
133 130
     }
134 131
     .userInfo-button-zhuce {
135 132
       margin: 0 auto;
@@ -162,7 +159,7 @@ export default {
162 159
 
163 160
     .van-icon {
164 161
       font-size: 20px;
165
-      
162
+
166 163
       & > img {
167 164
         padding-top: 2px;
168 165
       }

+ 59
- 52
src/views/signIn.vue 查看文件

@@ -38,10 +38,10 @@ export default {
38 38
   },
39 39
   computed: {
40 40
     ...mapState({
41
-      person: s => s.user
41
+      person: (s) => s.user
42 42
     }),
43 43
     endTimeStr() {
44
-      if (!this.signInfo.endTime) return '未知';
44
+      if (!this.signInfo.endTime) return '未知'
45 45
 
46 46
       return parseTime(this.signInfo.endTime, '{y}年{m}月{d}日 {h}:{i}')
47 47
     },
@@ -68,14 +68,16 @@ export default {
68 68
     }, 1000)
69 69
   },
70 70
   mounted() {
71
-    const {phone} = this.person || {}
71
+    const { phone } = this.person || {}
72 72
 
73 73
     if (!phone) {
74
-      this.$dialog.alert({
75
-        message: '请先维护您的个人信息',
76
-      }).then(() => {
77
-        this.$router.push({ name: 'SetUser' })
78
-      })
74
+      this.$dialog
75
+        .alert({
76
+          message: '请先维护您的个人信息'
77
+        })
78
+        .then(() => {
79
+          this.$router.push({ name: 'SetUser' })
80
+        })
79 81
     }
80 82
   },
81 83
   beforeDestroy() {
@@ -89,57 +91,62 @@ export default {
89 91
     //首先判断他有没有资格
90 92
     //  this.$toast.success('修改成功!')
91 93
     onLoadSinInfo(id) {
92
-      getSignInInfo(id).then((e) => {
93
-        this.signInfo = e
94
-        
95
-        // 必须属于签到池人员
96
-        if (!this.signInfo.canSign) {
97
-          this.canSign = false;
98
-          this.noSignErr = '当前活动您未参与';
99
-          this.shortErr = '未参与';
100
-          return;
101
-        }
102
-
103
-        if (this.signInfo.isSigned) {
104
-          this.canSign = false;
105
-          this.noSignErr = '您已签到';
106
-          this.shortErr = '已签到';
107
-          return;
108
-        }
109
-
110
-        // 必须是签到时间
111
-        const isGtStart = (this.now - new Date(this.signInfo.startTime)) > 0
112
-        const isLtEnd = (this.now - new Date(this.signInfo.endTime)) < 0
113
-        if (!isGtStart) {
114
-          this.canSign = false;
115
-          this.noSignErr = '签到未开始';
116
-          this.shortErr = '未开始';
117
-          return;
118
-        }
119
-
120
-        if (!isLtEnd) {
121
-          this.canSign = false;
122
-          this.noSignErr = '签到已结束';
123
-          this.shortErr = '已结束';
124
-          return;
125
-        }
126
-
127
-        this.canSign = true;
128
-        this.noSignErr = '';
129
-        this.shortErr = '';
130
-
131
-      }).catch(e => {
132
-        this.$toast(e.message)
133
-      })
94
+      getSignInInfo(id)
95
+        .then((e) => {
96
+          this.signInfo = e
97
+
98
+          // 必须属于签到池人员
99
+          if (!this.signInfo.canSign) {
100
+            this.canSign = false
101
+            this.noSignErr = '当前活动您未参与'
102
+            this.shortErr = '未参与'
103
+            return
104
+          }
105
+
106
+          if (this.signInfo.isSigned) {
107
+            this.canSign = false
108
+            this.noSignErr = '您已签到'
109
+            this.shortErr = '已签到'
110
+            return
111
+          }
112
+
113
+          // 必须是签到时间
114
+          const isGtStart = this.now - new Date(this.signInfo.startTime) > 0
115
+          const isLtEnd = this.now - new Date(this.signInfo.endTime) < 0
116
+          if (!isGtStart) {
117
+            this.canSign = false
118
+            this.noSignErr = '签到未开始'
119
+            this.shortErr = '未开始'
120
+            return
121
+          }
122
+
123
+          if (!isLtEnd) {
124
+            this.canSign = false
125
+            this.noSignErr = '签到已结束'
126
+            this.shortErr = '已结束'
127
+            return
128
+          }
129
+
130
+          this.canSign = true
131
+          this.noSignErr = ''
132
+          this.shortErr = ''
133
+        })
134
+        .catch((e) => {
135
+          this.$toast(e.message)
136
+        })
134 137
     },
135 138
     goSign() {
136 139
       if (!this.canSign) {
137
-        this.$toast(this.noSignErr);
138
-        return;
140
+        this.$toast(this.noSignErr)
141
+        return
139 142
       }
140 143
 
141 144
       postSignIn(this.$route.query.signId).then((e) => {
142 145
         console.log(e)
146
+        this.canSign = false
147
+        this.signInfo.isSigned = true
148
+        this.noSignErr = '您已签到'
149
+        this.shortErr = '已签到'
143 150
         this.$toast('签到成功')
144 151
       })
145 152
     }

+ 1
- 5
src/views/userPages/SetUser.vue 查看文件

@@ -97,11 +97,7 @@ export default {
97 97
     user: {
98 98
       handler(nw) {
99 99
         if (nw) {
100
-          this.personInfo.name = nw.name
101
-          this.personInfo.phone = nw.phone
102
-          this.personInfo.classId = nw.classId
103
-          this.personInfo.termId = nw.termId
104
-          this.personInfo.sex = nw.sex
100
+          this.personInfo = { ...nw }
105 101
           // this.personInfo.age = nw.age
106 102
         }
107 103
       },