seamwang 1 anno fa
parent
commit
31ec884af9
3 ha cambiato i file con 77 aggiunte e 58 eliminazioni
  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 20
 export function _intelligentCourses (params) {
21 21
 	return fetch('/parents/Intelligent/pickLigentCourse', params)
22 22
 }
23
-// 获取课程筛选选项 parents/Mycourses/advanced_filter
23
+// 获取课程筛选选项
24 24
 export function _filter (params) {
25 25
 	return fetch('/parents/Mycourses/advanced_filter', params)
26 26
 }
27
-// 课程详情 parents/Mycourses/course_details
27
+// 课程详情
28 28
 export function _detail (params) {
29 29
 	return fetch('/parents/Mycourses/course_details', params)
30 30
 }
31
-// 课程套餐详情 parents/Mycourses/course_gift
31
+// 课程套餐详情
32 32
 export function _gift (params) {
33 33
 	return fetch('/parents/Mycourses/course_gift', params)
34 34
 }
35
-// 课程评价 parents/Mycourses/now_details_comment
35
+// 课程评价
36 36
 export function _comments (params) {
37 37
 	return fetch('/parents/Mycourses/now_details_comment', params, 'POST', false)
38 38
 }
39
-// 添加购物车 parents/Commit/join_shop
39
+// 添加购物车
40 40
 export function _joinShop (params, showFail = true) {
41 41
 	return fetch('/parents/Commit/join_shop', params, 'POST', showFail)
42 42
 }
@@ -44,23 +44,23 @@ export function _joinShop (params, showFail = true) {
44 44
 export function _joinShops (params) {
45 45
 	return fetch('/parents/Commit/joinShopMulti', params)
46 46
 }
47
-// 购物车列表 /parents/Shopping/index
47
+// 购物车列表
48 48
 export function _shopList (params) {
49 49
 	return fetch('/parents/Shopping/index', params)
50 50
 }
51
-// 删除购物车 /parents/Shopping/del_shopping
51
+// 删除购物车
52 52
 export function _delShop (params) {
53 53
 	return fetch('/parents/Shopping/del_shopping', params)
54 54
 }
55
-// 生成订单 parents/Commit/order
55
+// 生成订单
56 56
 export function _createOrder (params) {
57 57
 	return fetch('/parents/Commit/order', params)
58 58
 }
59
-// 订单列表 parents/Ordercentre/index
59
+// 订单列表
60 60
 export function _orderCenter (params) {
61 61
 	return fetch('/parents/Ordercentre/index', params)
62 62
 }
63
-// 退课数据 get_dropcourse_byorder
63
+// 退课数据
64 64
 export function _dropList (params) {
65 65
 	return fetch('/parents/dropcourse/get_dropcourse_byorder', params)
66 66
 }
@@ -68,43 +68,43 @@ export function _dropList (params) {
68 68
 export function _payOrder (params) {
69 69
 	return fetch('/parents/pay/payment', params)
70 70
 }
71
-// 取消订单 /parents/Ordercentre/del_order
71
+// 取消订单
72 72
 export function _cancelOrder (params) {
73 73
 	return fetch('/parents/Ordercentre/del_order', params)
74 74
 }
75
-// 进行退课 /parents/dropcourse/to_drop_course
75
+// 进行退课
76 76
 export function _dropCourse (params) {
77 77
 	return fetch('/parents/dropcourse/to_drop_course', params)
78 78
 }
79
-// 历史课程 /parents/Mycourses/course_history
79
+// 历史课程
80 80
 export function _courseHistory (params) {
81 81
 	return fetch('/parents/Mycourses/course_history', params)
82 82
 }
83
-// 我的课程 /parents/Mycourses/course_history
83
+// 我的课程
84 84
 export function _nowCourse (params) {
85 85
 	return fetch('/parents/Mycourses/now_course', params)
86 86
 }
87
-// 课程表 /parents/Mycourses/date_course
87
+// 课程表
88 88
 export function _dateCourse (params) {
89 89
 	return fetch('/parents/Mycourses/date_course', params)
90 90
 }
91
-// 考勤记录 /parents/attendance/get_attendance
91
+// 考勤记录
92 92
 export function _attendance (params) {
93 93
 	return fetch('/parents/attendance/get_attendance', params)
94 94
 }
95
-// 课堂详情 /parents/dailyclass/get_dailyclass_details
95
+// 课堂详情
96 96
 export function _dailiClass (params) {
97 97
 	return fetch('/parents/dailyclass/get_dailyclass_details', params)
98 98
 }
99
-// 安全交接情况 /parents/sign/get_sign
99
+// 安全交接情况
100 100
 export function _getSignIn (params) {
101 101
 	return fetch('/parents/sign/get_sign', params)
102 102
 }
103
-// 进行安全交接 /parents/sign/to_sign
103
+// 进行安全交接
104 104
 export function _toSignIn (params) {
105 105
 	return fetch('/parents/sign/to_sign', params)
106 106
 }
107
-// 进行评价 /parents/Todayclass/comment
107
+// 进行评价
108 108
 export function _tocomment (params) {
109 109
 	return fetch('/parents/Todayclass/comment', params)
110 110
 }
@@ -126,13 +126,13 @@ export function _getStudentFiles (params) {
126 126
 }
127 127
 //获取年级
128 128
 export function _getGrades () {
129
-	return fetch('/parents/init/get_grades')
129
+	return fetch('/parents/student/grade_list')
130 130
 }
131 131
 //获取班级
132 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 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 38
                 <input v-model="serachKey" placeholder="输入兴趣内容  如:画画" class="margin-top input-border" @confirm="search" />
39 39
                 <text class="cuIcon-search margin-left" style="font-size: 36rpx;" @tap="search"></text>
40 40
               </view>
41
-              <view class="flex margin-top-sm">
41
+              <view class="margin-top-sm">
42 42
                 <view v-for="(h, i) in params.hobbyOther" :key="i" class="hobby"
43 43
                   >{{ h }}
44 44
                   <text class="cuIcon-close del-hobby text-red" @tap="delHobby(h)"></text>
@@ -59,7 +59,7 @@
59 59
                     class="btn-check-label margin"
60 60
                     :style="{
61 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 65
                     <checkbox :value="item" />
@@ -91,34 +91,37 @@
91 91
               >
92 92
                 <checkbox-group style="width: 100%;" v-model="checked">
93 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 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 120
                             </view>
104
-                          </view>
105
-                        </label>
121
+                          </label>
122
+                        </checkbox-group>
106 123
                       </view>
107 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 125
                   </view>
123 126
                 </checkbox-group>
124 127
               </scroll-view>
@@ -218,7 +221,8 @@ export default {
218 221
         // this.interests = res.data
219 222
         const choose = res.data[res.data.length - 1]
220 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 228
     search() {
@@ -249,10 +253,11 @@ export default {
249 253
       params.hobby = params.hobby.join(',')
250 254
       params.hobbyOther = params.hobbyOther.join(',')
251 255
       _intelligentCourses(params).then(res => {
252
-        this.attends = res.data
256
+        this.attends = res.data.filter(t => t.list.length > 0)
253 257
         this.checked = [] //初始化选项
254 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 261
             const class_attend_id = item.class_attend_id
257 262
             this.$set(this.checked, index, class_attend_id)
258 263
             const prop = item.prop.length > 0 ? [item.prop[0].id] : []
@@ -322,15 +327,14 @@ export default {
322 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 331
       const parentId = e.target.dataset.id
327 332
       const values = e.detail.value.map(item => Number(item))
328 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 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 339
     TabSelect(e) {
336 340
       this.tabCur = e.currentTarget.dataset.id
@@ -394,13 +398,28 @@ export default {
394 398
 }
395 399
 .hobby {
396 400
   position: relative;
401
+  display: inline-block;
397 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 408
   .del-hobby {
399 409
     position: absolute;
400 410
     top: -6rpx;
401 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 423
 .interests {
405 424
   position: relative;
406 425
   .interest {

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

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