Baozhangchao 3 years ago
parent
commit
fea4d15b2d

BIN
src/assets/tabber/class.png View File


BIN
src/assets/tabber/class1.png View File


BIN
src/assets/tabber/photo.png View File


BIN
src/assets/tabber/photo1.png View File


BIN
src/assets/tabber/user.png View File


BIN
src/assets/tabber/user1.png View File


+ 23
- 6
src/layout/index.vue View File

4
     <router-view />
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
         v-for="item in tabbar"
9
         v-for="item in tabbar"
10
         :key="item.path"
10
         :key="item.path"
11
         :icon="item.icon"
11
         :icon="item.icon"
12
         :to="item.path"
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
     </van-tabbar>
22
     </van-tabbar>
15
   </div>
23
   </div>
16
 </template>
24
 </template>
31
         {
39
         {
32
           path: '/Course',
40
           path: '/Course',
33
           text: '培训通知',
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
           path: '/StrongPhoto',
48
           path: '/StrongPhoto',
38
           text: '精彩集锦',
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
           path: '/UserCenter',
56
           path: '/UserCenter',
43
           text: '个人中心',
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 View File

5
 
5
 
6
 import Course from '@/views/Course.vue'//课程
6
 import Course from '@/views/Course.vue'//课程
7
 import MyCollection from '@/views/MyCollection.vue'//收藏
7
 import MyCollection from '@/views/MyCollection.vue'//收藏
8
-import signIn from '@/views/signIn.vue'//打卡
8
+import SignIn from '@/views/SignIn.vue'//打卡
9
 import ClassInfo from '@/views/ClassInfo.vue'//课堂详情
9
 import ClassInfo from '@/views/ClassInfo.vue'//课堂详情
10
 import StrongPhoto from '@/views/StrongPhoto.vue'//精彩集锦
10
 import StrongPhoto from '@/views/StrongPhoto.vue'//精彩集锦
11
 import UserCenter from '@/views/UserCenter.vue'//我的页面
11
 import UserCenter from '@/views/UserCenter.vue'//我的页面
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 View File

5
     </div>
5
     </div>
6
 
6
 
7
     <!-- list -->
7
     <!-- list -->
8
+    <!-- 
9
+    <h1 @click="wen">问卷</h1>
10
+    <h1 @click="qian">签到</h1>-->
8
     <van-list
11
     <van-list
9
       class="mglr-10 course-list"
12
       class="mglr-10 course-list"
10
       v-model="loading"
13
       v-model="loading"
49
   },
52
   },
50
 
53
 
51
   methods: {
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
     goQuestion(courseId) {
67
     goQuestion(courseId) {
53
       this.$router.push({ name: 'ClassInfo', params: { courseId: courseId } })
68
       this.$router.push({ name: 'ClassInfo', params: { courseId: courseId } })
54
       // this.$router.push('/Questionnaire')
69
       // this.$router.push('/Questionnaire')

+ 23
- 23
src/views/Questionnaire.vue View File

1
 <template>
1
 <template>
2
   <div class="question-wrapper">
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
       <p style="margin: 2em">确定要提交答案吗?</p>
10
       <p style="margin: 2em">确定要提交答案吗?</p>
12
     </van-dialog>
11
     </van-dialog>
13
 
12
 
44
 </template>
43
 </template>
45
 
44
 
46
 <script>
45
 <script>
47
-import { Toast } from 'vant';
46
+import { Toast } from 'vant'
48
 import { getQuestionnaire, getQuestion, answerQuestionnaire } from '@/util/api'
47
 import { getQuestionnaire, getQuestion, answerQuestionnaire } from '@/util/api'
49
 
48
 
50
 export default {
49
 export default {
79
   watch: {
78
   watch: {
80
     '$route.query.id': {
79
     '$route.query.id': {
81
       handler(v) {
80
       handler(v) {
82
-        this.loadData(v)
81
+        this.loadData('f5a47d178019bda33a370d7a6ed1e4c3')
83
       },
82
       },
84
       immediate: true
83
       immediate: true
85
     }
84
     }
100
       })
99
       })
101
       // let sum = 0
100
       // let sum = 0
102
     },
101
     },
103
-  
102
+
104
     submitForm(e) {
103
     submitForm(e) {
105
       const toast = Toast.loading({
104
       const toast = Toast.loading({
106
         duration: 0, // 持续展示 toast
105
         duration: 0, // 持续展示 toast
107
         forbidClick: true,
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
 </script>
123
 </script>
125
 
126
 
126
 
127
 
127
 <style lang="less" scoped>
128
 <style lang="less" scoped>
128
-
129
 .question-wrapper {
129
 .question-wrapper {
130
   background-image: url('~@/assets/userImag/backImag.png');
130
   background-image: url('~@/assets/userImag/backImag.png');
131
   background-size: 100%;
131
   background-size: 100%;

+ 7
- 7
src/views/StrongPhoto.vue View File

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

+ 17
- 20
src/views/UserCenter.vue View File

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

+ 59
- 52
src/views/signIn.vue View File

38
   },
38
   },
39
   computed: {
39
   computed: {
40
     ...mapState({
40
     ...mapState({
41
-      person: s => s.user
41
+      person: (s) => s.user
42
     }),
42
     }),
43
     endTimeStr() {
43
     endTimeStr() {
44
-      if (!this.signInfo.endTime) return '未知';
44
+      if (!this.signInfo.endTime) return '未知'
45
 
45
 
46
       return parseTime(this.signInfo.endTime, '{y}年{m}月{d}日 {h}:{i}')
46
       return parseTime(this.signInfo.endTime, '{y}年{m}月{d}日 {h}:{i}')
47
     },
47
     },
68
     }, 1000)
68
     }, 1000)
69
   },
69
   },
70
   mounted() {
70
   mounted() {
71
-    const {phone} = this.person || {}
71
+    const { phone } = this.person || {}
72
 
72
 
73
     if (!phone) {
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
   beforeDestroy() {
83
   beforeDestroy() {
89
     //首先判断他有没有资格
91
     //首先判断他有没有资格
90
     //  this.$toast.success('修改成功!')
92
     //  this.$toast.success('修改成功!')
91
     onLoadSinInfo(id) {
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
     goSign() {
138
     goSign() {
136
       if (!this.canSign) {
139
       if (!this.canSign) {
137
-        this.$toast(this.noSignErr);
138
-        return;
140
+        this.$toast(this.noSignErr)
141
+        return
139
       }
142
       }
140
 
143
 
141
       postSignIn(this.$route.query.signId).then((e) => {
144
       postSignIn(this.$route.query.signId).then((e) => {
142
         console.log(e)
145
         console.log(e)
146
+        this.canSign = false
147
+        this.signInfo.isSigned = true
148
+        this.noSignErr = '您已签到'
149
+        this.shortErr = '已签到'
143
         this.$toast('签到成功')
150
         this.$toast('签到成功')
144
       })
151
       })
145
     }
152
     }

+ 1
- 5
src/views/userPages/SetUser.vue View File

97
     user: {
97
     user: {
98
       handler(nw) {
98
       handler(nw) {
99
         if (nw) {
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
           // this.personInfo.age = nw.age
101
           // this.personInfo.age = nw.age
106
         }
102
         }
107
       },
103
       },