Browse Source

no message

seamwang 2 years ago
parent
commit
31ec884af9
3 changed files with 77 additions and 58 deletions
  1. 23 23
      src/api/course.js
  2. 52 33
      src/pages/class/gift.vue
  3. 2 2
      src/pages/myStudents/myStudents.vue

+ 23 - 23
src/api/course.js

@@ -20,23 +20,23 @@ export function _intelligentGetKeys (params) {
20
 export function _intelligentCourses (params) {
20
 export function _intelligentCourses (params) {
21
 	return fetch('/parents/Intelligent/pickLigentCourse', params)
21
 	return fetch('/parents/Intelligent/pickLigentCourse', params)
22
 }
22
 }
23
-// 获取课程筛选选项 parents/Mycourses/advanced_filter
23
+// 获取课程筛选选项
24
 export function _filter (params) {
24
 export function _filter (params) {
25
 	return fetch('/parents/Mycourses/advanced_filter', params)
25
 	return fetch('/parents/Mycourses/advanced_filter', params)
26
 }
26
 }
27
-// 课程详情 parents/Mycourses/course_details
27
+// 课程详情
28
 export function _detail (params) {
28
 export function _detail (params) {
29
 	return fetch('/parents/Mycourses/course_details', params)
29
 	return fetch('/parents/Mycourses/course_details', params)
30
 }
30
 }
31
-// 课程套餐详情 parents/Mycourses/course_gift
31
+// 课程套餐详情
32
 export function _gift (params) {
32
 export function _gift (params) {
33
 	return fetch('/parents/Mycourses/course_gift', params)
33
 	return fetch('/parents/Mycourses/course_gift', params)
34
 }
34
 }
35
-// 课程评价 parents/Mycourses/now_details_comment
35
+// 课程评价
36
 export function _comments (params) {
36
 export function _comments (params) {
37
 	return fetch('/parents/Mycourses/now_details_comment', params, 'POST', false)
37
 	return fetch('/parents/Mycourses/now_details_comment', params, 'POST', false)
38
 }
38
 }
39
-// 添加购物车 parents/Commit/join_shop
39
+// 添加购物车
40
 export function _joinShop (params, showFail = true) {
40
 export function _joinShop (params, showFail = true) {
41
 	return fetch('/parents/Commit/join_shop', params, 'POST', showFail)
41
 	return fetch('/parents/Commit/join_shop', params, 'POST', showFail)
42
 }
42
 }
@@ -44,23 +44,23 @@ export function _joinShop (params, showFail = true) {
44
 export function _joinShops (params) {
44
 export function _joinShops (params) {
45
 	return fetch('/parents/Commit/joinShopMulti', params)
45
 	return fetch('/parents/Commit/joinShopMulti', params)
46
 }
46
 }
47
-// 购物车列表 /parents/Shopping/index
47
+// 购物车列表
48
 export function _shopList (params) {
48
 export function _shopList (params) {
49
 	return fetch('/parents/Shopping/index', params)
49
 	return fetch('/parents/Shopping/index', params)
50
 }
50
 }
51
-// 删除购物车 /parents/Shopping/del_shopping
51
+// 删除购物车
52
 export function _delShop (params) {
52
 export function _delShop (params) {
53
 	return fetch('/parents/Shopping/del_shopping', params)
53
 	return fetch('/parents/Shopping/del_shopping', params)
54
 }
54
 }
55
-// 生成订单 parents/Commit/order
55
+// 生成订单
56
 export function _createOrder (params) {
56
 export function _createOrder (params) {
57
 	return fetch('/parents/Commit/order', params)
57
 	return fetch('/parents/Commit/order', params)
58
 }
58
 }
59
-// 订单列表 parents/Ordercentre/index
59
+// 订单列表
60
 export function _orderCenter (params) {
60
 export function _orderCenter (params) {
61
 	return fetch('/parents/Ordercentre/index', params)
61
 	return fetch('/parents/Ordercentre/index', params)
62
 }
62
 }
63
-// 退课数据 get_dropcourse_byorder
63
+// 退课数据
64
 export function _dropList (params) {
64
 export function _dropList (params) {
65
 	return fetch('/parents/dropcourse/get_dropcourse_byorder', params)
65
 	return fetch('/parents/dropcourse/get_dropcourse_byorder', params)
66
 }
66
 }
@@ -68,43 +68,43 @@ export function _dropList (params) {
68
 export function _payOrder (params) {
68
 export function _payOrder (params) {
69
 	return fetch('/parents/pay/payment', params)
69
 	return fetch('/parents/pay/payment', params)
70
 }
70
 }
71
-// 取消订单 /parents/Ordercentre/del_order
71
+// 取消订单
72
 export function _cancelOrder (params) {
72
 export function _cancelOrder (params) {
73
 	return fetch('/parents/Ordercentre/del_order', params)
73
 	return fetch('/parents/Ordercentre/del_order', params)
74
 }
74
 }
75
-// 进行退课 /parents/dropcourse/to_drop_course
75
+// 进行退课
76
 export function _dropCourse (params) {
76
 export function _dropCourse (params) {
77
 	return fetch('/parents/dropcourse/to_drop_course', params)
77
 	return fetch('/parents/dropcourse/to_drop_course', params)
78
 }
78
 }
79
-// 历史课程 /parents/Mycourses/course_history
79
+// 历史课程
80
 export function _courseHistory (params) {
80
 export function _courseHistory (params) {
81
 	return fetch('/parents/Mycourses/course_history', params)
81
 	return fetch('/parents/Mycourses/course_history', params)
82
 }
82
 }
83
-// 我的课程 /parents/Mycourses/course_history
83
+// 我的课程
84
 export function _nowCourse (params) {
84
 export function _nowCourse (params) {
85
 	return fetch('/parents/Mycourses/now_course', params)
85
 	return fetch('/parents/Mycourses/now_course', params)
86
 }
86
 }
87
-// 课程表 /parents/Mycourses/date_course
87
+// 课程表
88
 export function _dateCourse (params) {
88
 export function _dateCourse (params) {
89
 	return fetch('/parents/Mycourses/date_course', params)
89
 	return fetch('/parents/Mycourses/date_course', params)
90
 }
90
 }
91
-// 考勤记录 /parents/attendance/get_attendance
91
+// 考勤记录
92
 export function _attendance (params) {
92
 export function _attendance (params) {
93
 	return fetch('/parents/attendance/get_attendance', params)
93
 	return fetch('/parents/attendance/get_attendance', params)
94
 }
94
 }
95
-// 课堂详情 /parents/dailyclass/get_dailyclass_details
95
+// 课堂详情
96
 export function _dailiClass (params) {
96
 export function _dailiClass (params) {
97
 	return fetch('/parents/dailyclass/get_dailyclass_details', params)
97
 	return fetch('/parents/dailyclass/get_dailyclass_details', params)
98
 }
98
 }
99
-// 安全交接情况 /parents/sign/get_sign
99
+// 安全交接情况
100
 export function _getSignIn (params) {
100
 export function _getSignIn (params) {
101
 	return fetch('/parents/sign/get_sign', params)
101
 	return fetch('/parents/sign/get_sign', params)
102
 }
102
 }
103
-// 进行安全交接 /parents/sign/to_sign
103
+// 进行安全交接
104
 export function _toSignIn (params) {
104
 export function _toSignIn (params) {
105
 	return fetch('/parents/sign/to_sign', params)
105
 	return fetch('/parents/sign/to_sign', params)
106
 }
106
 }
107
-// 进行评价 /parents/Todayclass/comment
107
+// 进行评价
108
 export function _tocomment (params) {
108
 export function _tocomment (params) {
109
 	return fetch('/parents/Todayclass/comment', params)
109
 	return fetch('/parents/Todayclass/comment', params)
110
 }
110
 }
@@ -126,13 +126,13 @@ export function _getStudentFiles (params) {
126
 }
126
 }
127
 //获取年级
127
 //获取年级
128
 export function _getGrades () {
128
 export function _getGrades () {
129
-	return fetch('/parents/init/get_grades')
129
+	return fetch('/parents/student/grade_list')
130
 }
130
 }
131
 //获取班级
131
 //获取班级
132
 export function _getClasses (params) {
132
 export function _getClasses (params) {
133
-	return fetch('/parents/init/get_classes', params)
133
+	return fetch('/parents/student/class_list', params)
134
 }
134
 }
135
 //修改信息
135
 //修改信息
136
 export function _fixStudent (params) {
136
 export function _fixStudent (params) {
137
-	return fetch('/parents/init/edit_student', params)
137
+	return fetch('/parents/student/update', params)
138
 }
138
 }

+ 52 - 33
src/pages/class/gift.vue

@@ -38,7 +38,7 @@
38
                 <input v-model="serachKey" placeholder="输入兴趣内容  如:画画" class="margin-top input-border" @confirm="search" />
38
                 <input v-model="serachKey" placeholder="输入兴趣内容  如:画画" class="margin-top input-border" @confirm="search" />
39
                 <text class="cuIcon-search margin-left" style="font-size: 36rpx;" @tap="search"></text>
39
                 <text class="cuIcon-search margin-left" style="font-size: 36rpx;" @tap="search"></text>
40
               </view>
40
               </view>
41
-              <view class="flex margin-top-sm">
41
+              <view class="margin-top-sm">
42
                 <view v-for="(h, i) in params.hobbyOther" :key="i" class="hobby"
42
                 <view v-for="(h, i) in params.hobbyOther" :key="i" class="hobby"
43
                   >{{ h }}
43
                   >{{ h }}
44
                   <text class="cuIcon-close del-hobby text-red" @tap="delHobby(h)"></text>
44
                   <text class="cuIcon-close del-hobby text-red" @tap="delHobby(h)"></text>
@@ -59,7 +59,7 @@
59
                     class="btn-check-label margin"
59
                     class="btn-check-label margin"
60
                     :style="{
60
                     :style="{
61
                       color: params.hobbyOther.includes(item) ? '#fff' : '#000',
61
                       color: params.hobbyOther.includes(item) ? '#fff' : '#000',
62
-                      backgroundColor: params.hobbyOther.includes(item) ? colors[index % 4] : '#f0f0f0'
62
+                      backgroundColor: params.hobbyOther.includes(item) ? colors[3] : '#f0f0f0'
63
                     }"
63
                     }"
64
                   >
64
                   >
65
                     <checkbox :value="item" />
65
                     <checkbox :value="item" />
@@ -91,34 +91,37 @@
91
               >
91
               >
92
                 <checkbox-group style="width: 100%;" v-model="checked">
92
                 <checkbox-group style="width: 100%;" v-model="checked">
93
                   <view class="cu-item bg-white padding margin-bottom-sm" v-for="(item, i) in attends" :key="i">
93
                   <view class="cu-item bg-white padding margin-bottom-sm" v-for="(item, i) in attends" :key="i">
94
-                    <view class="cu-bar solid-bottom">
95
-                      <view>
96
-                        <label @tap="classChange(item.class_attend_id, i)">
97
-                          <view class="flex justify-between align-center">
98
-                            <view
99
-                              ><text>{{ item.attend_name }}</text></view
100
-                            >
94
+                    <view>{{ item.week }}</view>
95
+                    <view v-for="(course, c) in item.list" :key="c">
96
+                      <view class="cu-bar solid-bottom">
97
+                        <view>
98
+                          <label @tap="classChange(course.class_attend_id, i)">
99
+                            <view class="flex justify-between align-center">
100
+                              <view
101
+                                ><text>{{ course.attend_name }}</text></view
102
+                              >
103
+                              <view>
104
+                                <checkbox :value="course.class_attend_id" :checked="checked.includes(course.class_attend_id)" class="round cyan" style="transform: scale(0.7);" />
105
+                              </view>
106
+                            </view>
107
+                          </label>
108
+                        </view>
109
+                      </view>
110
+                      <view v-if="course.prop.length > 0">
111
+                        <checkbox-group class="checkbox-group margin-top-xs" :data-id="course.class_attend_id" @change="e => propChange(e, i)">
112
+                          <label v-for="prop in course.prop" :key="prop.id">
101
                             <view>
113
                             <view>
102
-                              <checkbox :value="item.class_attend_id" :checked="checked.includes(item.class_attend_id)" class="round cyan" style="transform: scale(0.7);" />
114
+                              <checkbox
115
+                                :value="prop.id"
116
+                                class="cyan"
117
+                                style="transform: scale(0.7);"
118
+                                :checked="checked_props[i].class_attend_id === course.class_attend_id && checked_props[i].prop.includes(prop.id)"
119
+                              />{{ prop.name }}<text>¥{{ prop.money }}</text>
103
                             </view>
120
                             </view>
104
-                          </view>
105
-                        </label>
121
+                          </label>
122
+                        </checkbox-group>
106
                       </view>
123
                       </view>
107
                     </view>
124
                     </view>
108
-                    <view v-if="item.prop.length > 0">
109
-                      <checkbox-group class="checkbox-group margin-top-xs" :data-id="item.class_attend_id" @change="propChange">
110
-                        <label v-for="prop in item.prop" :key="prop.id">
111
-                          <view>
112
-                            <checkbox
113
-                              :value="prop.id"
114
-                              class="cyan"
115
-                              style="transform: scale(0.7);"
116
-                              :checked="checked_props[i].class_attend_id === item.class_attend_id && checked_props[i].prop.includes(prop.id)"
117
-                            />{{ prop.name }}<text>¥{{ prop.money }}</text>
118
-                          </view>
119
-                        </label>
120
-                      </checkbox-group>
121
-                    </view>
122
                   </view>
125
                   </view>
123
                 </checkbox-group>
126
                 </checkbox-group>
124
               </scroll-view>
127
               </scroll-view>
@@ -218,7 +221,8 @@ export default {
218
         // this.interests = res.data
221
         // this.interests = res.data
219
         const choose = res.data[res.data.length - 1]
222
         const choose = res.data[res.data.length - 1]
220
         this.params.hobby = [choose.id]
223
         this.params.hobby = [choose.id]
221
-        this.keys = choose.names
224
+        this.keys = [...new Set(choose.names)].filter(e => e)
225
+        if (this.interests.length < 1) this.interests = this.keys.slice(0, 5)
222
       })
226
       })
223
     },
227
     },
224
     search() {
228
     search() {
@@ -249,10 +253,11 @@ export default {
249
       params.hobby = params.hobby.join(',')
253
       params.hobby = params.hobby.join(',')
250
       params.hobbyOther = params.hobbyOther.join(',')
254
       params.hobbyOther = params.hobbyOther.join(',')
251
       _intelligentCourses(params).then(res => {
255
       _intelligentCourses(params).then(res => {
252
-        this.attends = res.data
256
+        this.attends = res.data.filter(t => t.list.length > 0)
253
         this.checked = [] //初始化选项
257
         this.checked = [] //初始化选项
254
         if (this.attends.length > 0) {
258
         if (this.attends.length > 0) {
255
-          this.attends.map((item, index) => {
259
+          this.attends.map((course, index) => {
260
+            const item = course.list[0]
256
             const class_attend_id = item.class_attend_id
261
             const class_attend_id = item.class_attend_id
257
             this.$set(this.checked, index, class_attend_id)
262
             this.$set(this.checked, index, class_attend_id)
258
             const prop = item.prop.length > 0 ? [item.prop[0].id] : []
263
             const prop = item.prop.length > 0 ? [item.prop[0].id] : []
@@ -322,15 +327,14 @@ export default {
322
         this.$set(this.checked_props, i, { class_attend_id: class_attend_id, prop: [] })
327
         this.$set(this.checked_props, i, { class_attend_id: class_attend_id, prop: [] })
323
       }
328
       }
324
     },
329
     },
325
-    propChange(e) {
330
+    propChange(e, i) {
326
       const parentId = e.target.dataset.id
331
       const parentId = e.target.dataset.id
327
       const values = e.detail.value.map(item => Number(item))
332
       const values = e.detail.value.map(item => Number(item))
328
       if (values.length > 0 && !this.checked.includes(parentId)) {
333
       if (values.length > 0 && !this.checked.includes(parentId)) {
329
-        this.$set(this.checked, this.checked.length, parentId)
334
+        this.$set(this.checked, i, parentId)
330
       }
335
       }
331
-      let index = this.checked.findIndex(e => e == parentId)
332
       const item = { class_attend_id: parentId, prop: values }
336
       const item = { class_attend_id: parentId, prop: values }
333
-      this.$set(this.checked_props, index, item)
337
+      this.$set(this.checked_props, i, item)
334
     },
338
     },
335
     TabSelect(e) {
339
     TabSelect(e) {
336
       this.tabCur = e.currentTarget.dataset.id
340
       this.tabCur = e.currentTarget.dataset.id
@@ -394,13 +398,28 @@ export default {
394
 }
398
 }
395
 .hobby {
399
 .hobby {
396
   position: relative;
400
   position: relative;
401
+  display: inline-block;
397
   margin-left: 20rpx;
402
   margin-left: 20rpx;
403
+  padding: 10rpx 40rpx;
404
+  border-radius: 100rpx;
405
+  border: 1px solid #eee;
406
+  color: #fff;
407
+  background-color: #09e294;
398
   .del-hobby {
408
   .del-hobby {
399
     position: absolute;
409
     position: absolute;
400
     top: -6rpx;
410
     top: -6rpx;
401
     right: -20rpx;
411
     right: -20rpx;
402
   }
412
   }
403
 }
413
 }
414
+.week-card {
415
+  width: 160rpx;
416
+  height: 100rpx;
417
+  text-align: center;
418
+  line-height: 100rpx;
419
+  border-radius: 20rpx;
420
+  color: #333;
421
+  background-color: #fff;
422
+}
404
 .interests {
423
 .interests {
405
   position: relative;
424
   position: relative;
406
   .interest {
425
   .interest {

+ 2 - 2
src/pages/myStudents/myStudents.vue

@@ -148,7 +148,7 @@ export default {
148
         school_name: ''
148
         school_name: ''
149
       },
149
       },
150
       info: {
150
       info: {
151
-        id: '',
151
+        student_id: '',
152
         name: '',
152
         name: '',
153
         school_id: '',
153
         school_id: '',
154
         grade_id: '',
154
         grade_id: '',
@@ -232,7 +232,7 @@ export default {
232
       })
232
       })
233
     },
233
     },
234
     fixStudent(item) {
234
     fixStudent(item) {
235
-      this.info.id = item.id
235
+      this.info.student_id = item.id
236
       this.info.name = item.name
236
       this.info.name = item.name
237
       this.info.school_id = item.school
237
       this.info.school_id = item.school
238
       this.gradeIndex = this.grades.findIndex(e => e.name === item.grade_name)
238
       this.gradeIndex = this.grades.findIndex(e => e.name === item.grade_name)