Browse Source

fix:智能报课,代码格式化修改

seamwang 2 years ago
parent
commit
f231e18bd7

+ 51 - 51
.eslintrc.js

@@ -1,51 +1,51 @@
1
-module.exports = {
2
-  // 默认情况下,ESLint 会在所有父级目录里寻找配置文件,一直到根目录。ESLint 一旦发现配置文件中有 "root": true,它就会停止在父级目录中寻找。
3
-  root: true,
4
-  env: {
5
-    node: true,
6
-    browser: true
7
-  },
8
-  globals: {
9
-    uni: true,
10
-    wx: true,
11
-    App: true,
12
-    getApp: true,
13
-    Page: true,
14
-    getCurrentPages: true,
15
-    Component: true,
16
-    Behavior: true
17
-  },
18
-
19
-  extends: [
20
-    'plugin:vue/essential',
21
-    '@vue/standard',
22
-    '@vue/typescript',
23
-    '@vue/prettier/@typescript-eslint'
24
-  ],
25
-  plugins: ['@typescript-eslint'], // 定义了该eslint文件所依赖的插件
26
-  parserOptions: {
27
-    // 解析器选项
28
-    // 指定ESLint可以解析JSX语法
29
-    ecmaVersion: 2020,
30
-    sourceType: 'module',
31
-    ecmaFeatures: {
32
-      jsx: true
33
-    },
34
-    parser: '@typescript-eslint/parser' // 定义ESLint的解析器,才能正确的检测和规范TS代码
35
-  },
36
-  rules: {
37
-    'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
38
-    'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
39
-    'no-unused-vars': [
40
-      1,
41
-      {
42
-        vars: 'all',
43
-        args: 'none'
44
-      }
45
-    ],
46
-    'no-tabs': 0,
47
-    'no-mixed-spaces-and-tabs': 0,
48
-    indent: [2, 2, { SwitchCase: 1 }],
49
-    'space-before-function-paren': [0, 'never']
50
-  }
51
-}
1
+module.exports = {
2
+	// 默认情况下,ESLint 会在所有父级目录里寻找配置文件,一直到根目录。ESLint 一旦发现配置文件中有 "root": true,它就会停止在父级目录中寻找。
3
+	root: true,
4
+	env: {
5
+		node: true,
6
+		browser: true
7
+	},
8
+	globals: {
9
+		uni: true,
10
+		wx: true,
11
+		App: true,
12
+		getApp: true,
13
+		Page: true,
14
+		getCurrentPages: true,
15
+		Component: true,
16
+		Behavior: true
17
+	},
18
+
19
+	extends: [
20
+		'plugin:vue/essential',
21
+		'@vue/standard',
22
+		'@vue/typescript',
23
+		'@vue/prettier/@typescript-eslint'
24
+	],
25
+	plugins: ['@typescript-eslint'], // 定义了该eslint文件所依赖的插件
26
+	parserOptions: {
27
+		// 解析器选项
28
+		// 指定ESLint可以解析JSX语法
29
+		ecmaVersion: 2020,
30
+		sourceType: 'module',
31
+		ecmaFeatures: {
32
+			jsx: true
33
+		},
34
+		parser: '@typescript-eslint/parser' // 定义ESLint的解析器,才能正确的检测和规范TS代码
35
+	},
36
+	rules: {
37
+		'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
38
+		'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
39
+		'no-unused-vars': [
40
+			1,
41
+			{
42
+				vars: 'all',
43
+				args: 'none'
44
+			}
45
+		],
46
+		'no-tabs': 0,
47
+		'no-mixed-spaces-and-tabs': 0,
48
+		indent: [2, 2, { SwitchCase: 1 }],
49
+		'space-before-function-paren': [0, 'never']
50
+	}
51
+}

+ 64 - 53
src/api/course.js

@@ -1,107 +1,118 @@
1 1
 import fetch from '@/common/utils/fetch.js'
2 2
 
3 3
 // 获取课程列表
4
-export function _optionCourse(params) {
5
-  return fetch('/parents/Mycourses/option_course', params)
4
+export function _optionCourse (params) {
5
+	return fetch('/parents/Mycourses/option_course', params)
6
+}
7
+//智能报课获取周期
8
+export function _intelligentDates () {
9
+	return fetch('/parents/Intelligent/getLigentDate')
10
+}
11
+//智能报课获取兴趣
12
+export function _intelligentInterests () {
13
+	return fetch('/parents/Intelligent/getLigentCategory')
14
+}
15
+//智能报课获取课程
16
+export function _intelligentCourses (params) {
17
+	return fetch('/parents/Intelligent/pickLigentCourse', params)
6 18
 }
7
-
8 19
 // 获取课程筛选选项 parents/Mycourses/advanced_filter
9
-export function _filter(params) {
10
-  return fetch('/parents/Mycourses/advanced_filter', params)
20
+export function _filter (params) {
21
+	return fetch('/parents/Mycourses/advanced_filter', params)
11 22
 }
12 23
 // 课程详情 parents/Mycourses/course_details
13
-export function _detail(params) {
14
-  return fetch('/parents/Mycourses/course_details', params)
24
+export function _detail (params) {
25
+	return fetch('/parents/Mycourses/course_details', params)
15 26
 }
16 27
 // 课程套餐详情 parents/Mycourses/course_gift
17
-export function _gift(params) {
18
-  return fetch('/parents/Mycourses/course_gift', params)
28
+export function _gift (params) {
29
+	return fetch('/parents/Mycourses/course_gift', params)
19 30
 }
20 31
 // 课程评价 parents/Mycourses/now_details_comment
21
-export function _comments(params) {
22
-  return fetch('/parents/Mycourses/now_details_comment', params, 'POST', false)
32
+export function _comments (params) {
33
+	return fetch('/parents/Mycourses/now_details_comment', params, 'POST', false)
23 34
 }
24 35
 // 添加购物车 parents/Commit/join_shop
25
-export function _joinShop(params, showFail = true) {
26
-  return fetch('/parents/Commit/join_shop', params, 'POST', showFail)
36
+export function _joinShop (params, showFail = true) {
37
+	return fetch('/parents/Commit/join_shop', params, 'POST', showFail)
27 38
 }
28 39
 // 批量添加购物车
29
-export function _joinShops(params) {
30
-  return fetch('/parents/Commit/joinShopMulti', params)
40
+export function _joinShops (params) {
41
+	return fetch('/parents/Commit/joinShopMulti', params)
31 42
 }
32 43
 // 购物车列表 /parents/Shopping/index
33
-export function _shopList(params) {
34
-  return fetch('/parents/Shopping/index', params)
44
+export function _shopList (params) {
45
+	return fetch('/parents/Shopping/index', params)
35 46
 }
36 47
 // 删除购物车 /parents/Shopping/del_shopping
37
-export function _delShop(params) {
38
-  return fetch('/parents/Shopping/del_shopping', params)
48
+export function _delShop (params) {
49
+	return fetch('/parents/Shopping/del_shopping', params)
39 50
 }
40 51
 // 生成订单 parents/Commit/order
41
-export function _createOrder(params) {
42
-  return fetch('/parents/Commit/order', params)
52
+export function _createOrder (params) {
53
+	return fetch('/parents/Commit/order', params)
43 54
 }
44 55
 // 订单列表 parents/Ordercentre/index
45
-export function _orderCenter(params) {
46
-  return fetch('/parents/Ordercentre/index', params)
56
+export function _orderCenter (params) {
57
+	return fetch('/parents/Ordercentre/index', params)
47 58
 }
48 59
 // 退课数据 get_dropcourse_byorder
49
-export function _dropList(params) {
50
-  return fetch('/parents/dropcourse/get_dropcourse_byorder', params)
60
+export function _dropList (params) {
61
+	return fetch('/parents/dropcourse/get_dropcourse_byorder', params)
51 62
 }
52 63
 // 订单支付
53
-export function _payOrder(params) {
54
-  return fetch('/parents/pay/payment', params)
64
+export function _payOrder (params) {
65
+	return fetch('/parents/pay/payment', params)
55 66
 }
56 67
 // 取消订单 /parents/Ordercentre/del_order
57
-export function _cancelOrder(params) {
58
-  return fetch('/parents/Ordercentre/del_order', params)
68
+export function _cancelOrder (params) {
69
+	return fetch('/parents/Ordercentre/del_order', params)
59 70
 }
60 71
 // 进行退课 /parents/dropcourse/to_drop_course
61
-export function _dropCourse(params) {
62
-  return fetch('/parents/dropcourse/to_drop_course', params)
72
+export function _dropCourse (params) {
73
+	return fetch('/parents/dropcourse/to_drop_course', params)
63 74
 }
64 75
 // 历史课程 /parents/Mycourses/course_history
65
-export function _courseHistory(params) {
66
-  return fetch('/parents/Mycourses/course_history', params)
76
+export function _courseHistory (params) {
77
+	return fetch('/parents/Mycourses/course_history', params)
67 78
 }
68 79
 // 我的课程 /parents/Mycourses/course_history
69
-export function _nowCourse(params) {
70
-  return fetch('/parents/Mycourses/now_course', params)
80
+export function _nowCourse (params) {
81
+	return fetch('/parents/Mycourses/now_course', params)
71 82
 }
72 83
 // 课程表 /parents/Mycourses/date_course
73
-export function _dateCourse(params) {
74
-  return fetch('/parents/Mycourses/date_course', params)
84
+export function _dateCourse (params) {
85
+	return fetch('/parents/Mycourses/date_course', params)
75 86
 }
76 87
 // 考勤记录 /parents/attendance/get_attendance
77
-export function _attendance(params) {
78
-  return fetch('/parents/attendance/get_attendance', params)
88
+export function _attendance (params) {
89
+	return fetch('/parents/attendance/get_attendance', params)
79 90
 }
80 91
 // 课堂详情 /parents/dailyclass/get_dailyclass_details
81
-export function _dailiClass(params) {
82
-  return fetch('/parents/dailyclass/get_dailyclass_details', params)
92
+export function _dailiClass (params) {
93
+	return fetch('/parents/dailyclass/get_dailyclass_details', params)
83 94
 }
84 95
 // 安全交接情况 /parents/sign/get_sign
85
-export function _getSignIn(params) {
86
-  return fetch('/parents/sign/get_sign', params)
96
+export function _getSignIn (params) {
97
+	return fetch('/parents/sign/get_sign', params)
87 98
 }
88 99
 // 进行安全交接 /parents/sign/to_sign
89
-export function _toSignIn(params) {
90
-  return fetch('/parents/sign/to_sign', params)
100
+export function _toSignIn (params) {
101
+	return fetch('/parents/sign/to_sign', params)
91 102
 }
92 103
 // 进行评价 /parents/Todayclass/comment
93
-export function _tocomment(params) {
94
-  return fetch('/parents/Todayclass/comment', params)
104
+export function _tocomment (params) {
105
+	return fetch('/parents/Todayclass/comment', params)
95 106
 }
96 107
 // 评价详情
97
-export function _commentDetail(params) {
98
-  return fetch('/parents/dailyclass/get_satisfaction', params)
108
+export function _commentDetail (params) {
109
+	return fetch('/parents/dailyclass/get_satisfaction', params)
99 110
 }
100 111
 // 获取请假类型
101
-export function _leaveType(params) {
102
-  return fetch('/teacher/leave/get_leave_type', params)
112
+export function _leaveType (params) {
113
+	return fetch('/teacher/leave/get_leave_type', params)
103 114
 }
104 115
 // 申请请假 parents/schedule/student_leave
105
-export function _askLeave(params) {
106
-  return fetch('/parents/schedule/student_leave', params)
116
+export function _askLeave (params) {
117
+	return fetch('/parents/schedule/student_leave', params)
107 118
 }

+ 3 - 0
src/common/css/common.css

@@ -116,6 +116,9 @@ input{
116 116
 .text-student{
117 117
 	color:#5fd0e4;
118 118
 }
119
+.text-light{
120
+	font-weight:lighter;
121
+}
119 122
 .bg-student{
120 123
 	background-color:#5fd0e4;
121 124
 }

+ 29 - 29
src/common/urlMap.js

@@ -1,29 +1,29 @@
1
-// 路径匹配模式
2
-const urlMap = new Map()
3
-
4
-urlMap.set('index', '/pages/index/index')
5
-urlMap.set('mine', '/pages/mine/mine')
6
-urlMap.set('studentcenter', '/pages/studentcenter/index')
7
-urlMap.set('studentOperation', '/pages/studentcenter/operation')
8
-urlMap.set('studentVideo', '/pages/studentcenter/classVideo')
9
-urlMap.set('studentEvaluate', '/pages/studentcenter/evaluate')
10
-urlMap.set('studentSignin', '/pages/studentcenter/signIn')
11
-urlMap.set('studentWorks', '/pages/studentcenter/works')
12
-urlMap.set('studentAbsent', '/pages/studentcenter/absent')
13
-urlMap.set('myStudents', '/pages/myStudents/myStudents')
14
-urlMap.set('myTeachers', '/pages/mine/teachers')
15
-urlMap.set('myParents', '/pages/mine/parents')
16
-urlMap.set('myInstitution', '/pages/mine/institution')
17
-urlMap.set('setting', '/pages/mine/setting')
18
-urlMap.set('changePhone', '/pages/mine/changePhone')
19
-urlMap.set('message', '/pages/mine/message')
20
-urlMap.set('onlineService', '/pages/mine/onlineService')
21
-urlMap.set('login', '/pages/login/index')
22
-urlMap.set('classGift', '/pages/class/gift')
23
-urlMap.set('classDetail', '/pages/class/detail')
24
-urlMap.set('classCart', '/pages/class/shoppingCart')
25
-urlMap.set('bindPhone', '/pages/class/bindPhone')
26
-urlMap.set('order', '/pages/order/index')
27
-urlMap.set('agreement', '/pages/agreement/index')
28
-
29
-export default urlMap
1
+// 路径匹配模式
2
+const urlMap = new Map()
3
+
4
+urlMap.set('index', '/pages/index/index')
5
+urlMap.set('mine', '/pages/mine/mine')
6
+urlMap.set('studentcenter', '/pages/studentcenter/index')
7
+urlMap.set('studentOperation', '/pages/studentcenter/operation')
8
+urlMap.set('studentVideo', '/pages/studentcenter/classVideo')
9
+urlMap.set('studentEvaluate', '/pages/studentcenter/evaluate')
10
+urlMap.set('studentSignin', '/pages/studentcenter/signIn')
11
+urlMap.set('studentWorks', '/pages/studentcenter/works')
12
+urlMap.set('studentAbsent', '/pages/studentcenter/absent')
13
+urlMap.set('myStudents', '/pages/myStudents/myStudents')
14
+urlMap.set('myTeachers', '/pages/mine/teachers')
15
+urlMap.set('myParents', '/pages/mine/parents')
16
+urlMap.set('myInstitution', '/pages/mine/institution')
17
+urlMap.set('setting', '/pages/mine/setting')
18
+urlMap.set('changePhone', '/pages/mine/changePhone')
19
+urlMap.set('message', '/pages/mine/message')
20
+urlMap.set('onlineService', '/pages/mine/onlineService')
21
+urlMap.set('login', '/pages/login/index')
22
+urlMap.set('classGift', '/pages/class/gift')
23
+urlMap.set('classDetail', '/pages/class/detail')
24
+urlMap.set('classCart', '/pages/class/shoppingCart')
25
+urlMap.set('bindPhone', '/pages/class/bindPhone')
26
+urlMap.set('order', '/pages/order/index')
27
+urlMap.set('agreement', '/pages/agreement/index')
28
+
29
+export default urlMap

+ 12 - 12
src/components/shop-cart.vue

@@ -1,8 +1,8 @@
1 1
 <template>
2
-	<view class="shop" @tap="goCart">
3
-		<view class="cu-tag badge" v-if="carts.includes(class_attend_id)"></view>
4
-		<text class="cuIcon-cart text-student cart"></text>
5
-	</view>
2
+  <view class="shop" @tap="goCart">
3
+    <view class="cu-tag badge" v-if="carts.includes(class_attend_id)"></view>
4
+    <text class="cuIcon-cart text-student cart"></text>
5
+  </view>
6 6
 </template>
7 7
 
8 8
 <script>
@@ -18,7 +18,7 @@ export default {
18 18
       default: false
19 19
     }
20 20
   },
21
-  data() {
21
+  data () {
22 22
     return {
23 23
       key: 1212
24 24
     }
@@ -29,7 +29,7 @@ export default {
29 29
     ])
30 30
   },
31 31
   methods: {
32
-    goCart() {
32
+    goCart () {
33 33
       if (this.disableBtn) return false
34 34
       this.$emit('changeDisableBtn')// 改变按钮点击
35 35
       this.globalNavigateTo('classCart')
@@ -39,13 +39,13 @@ export default {
39 39
 </script>
40 40
 
41 41
 <style lang="scss" scoped>
42
-.shop{
43
-	position:relative;
42
+.shop {
43
+  position: relative;
44 44
 }
45
-.cart{
46
-	font-size:24px;
45
+.cart {
46
+  font-size: 24px;
47 47
 }
48
-.cu-tag.badge{
49
-	top:2px;
48
+.cu-tag.badge {
49
+  top: 2px;
50 50
 }
51 51
 </style>

+ 66 - 67
src/components/swiper-tab.vue

@@ -1,67 +1,66 @@
1
-<template>
2
-	<view class="swipeTab">
3
-		<view v-for="(item,index) in menuList" :key="index"
4
-		class="swipeTab-item" :class="{'tabTrue':currentIndex===index}"
5
-		@tap="changeTab(index)">
6
-			{{item}}
7
-		</view>
8
-	</view>
9
-</template>
10
-
11
-<script>
12
-export default {
13
-  props: {
14
-    menuList: {
15
-      type: Array,
16
-      default: () => {
17
-        return []
18
-      }
19
-    },
20
-    activeTab: {
21
-      type: Number,
22
-      default: 0
23
-    }
24
-  },
25
-  watch: {
26
-    activeTab(n, o) {
27
-      this.currentIndex = n
28
-    }
29
-  },
30
-  data() {
31
-    return {
32
-      currentIndex: 0
33
-    }
34
-  },
35
-  methods: {
36
-    changeTab(index) {
37
-      this.currentIndex = index
38
-      this.$emit('changeTab', index)
39
-    }
40
-  }
41
-}
42
-</script>
43
-
44
-<style lang="scss" scoped>
45
-.swipeTab{
46
-  z-index: 99999;
47
-  display: flex;
48
-  flex-direction: row;
49
-  width: 100%;
50
-  justify-content: space-around;
51
-  position: relative;
52
-  height: 22px;
53
-  background: #FFFFFF;
54
-  .swipeTab-item{
55
-    line-height: 1px;
56
-    color: #999;
57
-    border-radius: 999em;
58
-    padding: 10px 10px;
59
-    border: 1px solid #999;
60
-  }
61
-  .tabTrue{
62
-    color:#5fd0e4;
63
-    border: 1px solid #ebf8fc;
64
-    background: #ebf8fc;
65
-   }
66
- }
67
-</style>
1
+<template>
2
+  <view class="swipeTab">
3
+    <view v-for="(item,index) in menuList" :key="index" class="swipeTab-item" :class="{'tabTrue':currentIndex===index}"
4
+      @tap="changeTab(index)">
5
+      {{item}}
6
+    </view>
7
+  </view>
8
+</template>
9
+
10
+<script>
11
+export default {
12
+  props: {
13
+    menuList: {
14
+      type: Array,
15
+      default: () => {
16
+        return []
17
+      }
18
+    },
19
+    activeTab: {
20
+      type: Number,
21
+      default: 0
22
+    }
23
+  },
24
+  watch: {
25
+    activeTab (n, o) {
26
+      this.currentIndex = n
27
+    }
28
+  },
29
+  data () {
30
+    return {
31
+      currentIndex: 0
32
+    }
33
+  },
34
+  methods: {
35
+    changeTab (index) {
36
+      this.currentIndex = index
37
+      this.$emit('changeTab', index)
38
+    }
39
+  }
40
+}
41
+</script>
42
+
43
+<style lang="scss" scoped>
44
+.swipeTab {
45
+  z-index: 99999;
46
+  display: flex;
47
+  flex-direction: row;
48
+  width: 100%;
49
+  justify-content: space-around;
50
+  position: relative;
51
+  height: 22px;
52
+  background: #ffffff;
53
+  .swipeTab-item {
54
+    line-height: 1px;
55
+    color: #999;
56
+    border-radius: 999em;
57
+    padding: 10px 10px;
58
+    border: 1px solid #999;
59
+  }
60
+  .tabTrue {
61
+    color: #5fd0e4;
62
+    border: 1px solid #ebf8fc;
63
+    background: #ebf8fc;
64
+  }
65
+}
66
+</style>

+ 136 - 136
src/pages.json

@@ -1,136 +1,136 @@
1
-{
2
-    "pages": [
3
-			 {
4
-				 "path": "pages/index/index",
5
-				 "style": {}
6
-		    },
7
-				{
8
-					"path": "pages/class/gift",
9
-					"style": {}
10
-			  },
11
-				{
12
-					"path": "pages/class/detail",
13
-					"style": {}
14
-			  },
15
-				{
16
-					"path": "pages/class/shoppingCart",
17
-					"style": {}
18
-			  },
19
-				{
20
-					"path": "pages/class/bindPhone",
21
-					"style": {}
22
-			  },
23
-				{
24
-					"path": "pages/order/index",
25
-					"style": {}
26
-			  },
27
-			  {
28
-					"path": "pages/myStudents/myStudents",
29
-					"style": {}
30
-			  },
31
-				{
32
-					"path": "pages/studentcenter/index",
33
-					"style": {}
34
-			  },
35
-				{
36
-					"path": "pages/studentcenter/operation",
37
-					"style": {}
38
-			  },
39
-				{
40
-					"path": "pages/studentcenter/signIn",
41
-					"style": {}
42
-			  },
43
-				{
44
-					"path": "pages/studentcenter/classVideo",
45
-					"style": {}
46
-			  },
47
-				{
48
-					"path": "pages/studentcenter/works",
49
-					"style": {}
50
-			  },
51
-				{
52
-					"path": "pages/studentcenter/evaluate",
53
-					"style": {}
54
-			  },
55
-				{
56
-					"path": "pages/studentcenter/absent",
57
-					"style": {}
58
-			  },
59
-        {
60
-            "path": "pages/mine/mine",
61
-            "style": {}
62
-        },
63
-				{
64
-					"path": "pages/mine/parents",
65
-					"style": {}
66
-			  },
67
-				{
68
-					"path": "pages/mine/teachers",
69
-					"style": {}
70
-			  },
71
-				{
72
-					"path": "pages/mine/institution",
73
-					"style": {}
74
-			  },
75
-				{
76
-					"path": "pages/mine/setting",
77
-					"style": {}
78
-			  },
79
-				{
80
-					"path": "pages/mine/changePhone",
81
-					"style": {}
82
-			  },
83
-				{
84
-					"path": "pages/mine/message",
85
-					"style": {}
86
-			  },
87
-				{
88
-					"path": "pages/mine/onlineService",
89
-					"style": {}
90
-			  },
91
-				{
92
-					"path": "pages/login/index",
93
-					"style": {}
94
-				 },
95
-				 {
96
-					"path": "pages/agreement/index",
97
-					"style": {}
98
-				 }
99
-    ],
100
-    "globalStyle": {
101
-        "navigationBarBackgroundColor": "#FFFFFF",
102
-        "navigationBarTitleText": "1212",
103
-        "navigationStyle": "custom",
104
-        "navigationBarTextStyle": "black",
105
-        "animationType": "slide-out-right"
106
-    },
107
-    "tabBar": {
108
-        "custom": true,
109
-        "color": "#707070",
110
-        "selectedColor": "#3390F5",
111
-        "borderStyle": "black",
112
-        "backgroundColor": "#ffffff",
113
-        "list": [
114
-           {
115
-                "pagePath": "pages/index/index",
116
-                "iconPath": "/static/imgs/tabbar/xk1.png",
117
-                "selectedIconPath": "/static/imgs/tabbar/xk.png",
118
-                "text": "选课"
119
-            },
120
-						{
121
-							"pagePath": "pages/studentcenter/index",
122
-							"iconPath": "/static/imgs/tabbar/xszx1.png",
123
-							"selectedIconPath": "/static/imgs/tabbar/xszx.png",
124
-							"text": "学生中心"
125
-					  },
126
-            {
127
-                "pagePath": "pages/mine/mine",
128
-                "iconPath": "/static/imgs/tabbar/wd1.png",
129
-                "selectedIconPath": "/static/imgs/tabbar/wd.png",
130
-                "text": "我的"
131
-            }
132
-        ]
133
-    },
134
-    "usingComponts": true,
135
-    "sitemapLocation": "sitemap.json"
136
-}
1
+{
2
+  "pages": [
3
+    {
4
+      "path": "pages/index/index",
5
+      "style": {}
6
+    },
7
+    {
8
+      "path": "pages/class/gift",
9
+      "style": {}
10
+    },
11
+    {
12
+      "path": "pages/class/detail",
13
+      "style": {}
14
+    },
15
+    {
16
+      "path": "pages/class/shoppingCart",
17
+      "style": {}
18
+    },
19
+    {
20
+      "path": "pages/class/bindPhone",
21
+      "style": {}
22
+    },
23
+    {
24
+      "path": "pages/order/index",
25
+      "style": {}
26
+    },
27
+    {
28
+      "path": "pages/myStudents/myStudents",
29
+      "style": {}
30
+    },
31
+    {
32
+      "path": "pages/studentcenter/index",
33
+      "style": {}
34
+    },
35
+    {
36
+      "path": "pages/studentcenter/operation",
37
+      "style": {}
38
+    },
39
+    {
40
+      "path": "pages/studentcenter/signIn",
41
+      "style": {}
42
+    },
43
+    {
44
+      "path": "pages/studentcenter/classVideo",
45
+      "style": {}
46
+    },
47
+    {
48
+      "path": "pages/studentcenter/works",
49
+      "style": {}
50
+    },
51
+    {
52
+      "path": "pages/studentcenter/evaluate",
53
+      "style": {}
54
+    },
55
+    {
56
+      "path": "pages/studentcenter/absent",
57
+      "style": {}
58
+    },
59
+    {
60
+      "path": "pages/mine/mine",
61
+      "style": {}
62
+    },
63
+    {
64
+      "path": "pages/mine/parents",
65
+      "style": {}
66
+    },
67
+    {
68
+      "path": "pages/mine/teachers",
69
+      "style": {}
70
+    },
71
+    {
72
+      "path": "pages/mine/institution",
73
+      "style": {}
74
+    },
75
+    {
76
+      "path": "pages/mine/setting",
77
+      "style": {}
78
+    },
79
+    {
80
+      "path": "pages/mine/changePhone",
81
+      "style": {}
82
+    },
83
+    {
84
+      "path": "pages/mine/message",
85
+      "style": {}
86
+    },
87
+    {
88
+      "path": "pages/mine/onlineService",
89
+      "style": {}
90
+    },
91
+    {
92
+      "path": "pages/login/index",
93
+      "style": {}
94
+    },
95
+    {
96
+      "path": "pages/agreement/index",
97
+      "style": {}
98
+    }
99
+  ],
100
+  "globalStyle": {
101
+    "navigationBarBackgroundColor": "#FFFFFF",
102
+    "navigationBarTitleText": "1212",
103
+    "navigationStyle": "custom",
104
+    "navigationBarTextStyle": "black",
105
+    "animationType": "slide-out-right"
106
+  },
107
+  "tabBar": {
108
+    "custom": true,
109
+    "color": "#707070",
110
+    "selectedColor": "#3390F5",
111
+    "borderStyle": "black",
112
+    "backgroundColor": "#ffffff",
113
+    "list": [
114
+      {
115
+        "pagePath": "pages/index/index",
116
+        "iconPath": "/static/imgs/tabbar/xk1.png",
117
+        "selectedIconPath": "/static/imgs/tabbar/xk.png",
118
+        "text": "选课"
119
+      },
120
+      {
121
+        "pagePath": "pages/studentcenter/index",
122
+        "iconPath": "/static/imgs/tabbar/xszx1.png",
123
+        "selectedIconPath": "/static/imgs/tabbar/xszx.png",
124
+        "text": "学生中心"
125
+      },
126
+      {
127
+        "pagePath": "pages/mine/mine",
128
+        "iconPath": "/static/imgs/tabbar/wd1.png",
129
+        "selectedIconPath": "/static/imgs/tabbar/wd.png",
130
+        "text": "我的"
131
+      }
132
+    ]
133
+  },
134
+  "usingComponts": true,
135
+  "sitemapLocation": "sitemap.json"
136
+}

File diff suppressed because it is too large
+ 31 - 32
src/pages/agreement/index.vue


+ 38 - 38
src/pages/class/bindPhone.vue

@@ -1,27 +1,27 @@
1 1
 <template>
2
-	<view class="page">
3
-		<cu-custom :isBack="true"  title="绑定手机号"></cu-custom>
4
-		<view class="bind bg-white">
5
-			<view class="bind-img">
6
-					<image src="/static/imgs/phone.png" mode="widthFix" style="width:400rpx;" />
7
-			</view>
8
-			<view class="bind-text">请绑定手机号</view>
9
-			<view class="bind-tip" style="margin-top:10px;"> 为向您提供更优质的交易相关基本功能,我们将会获取您的手机号。</view>
10
-			<view class="bind-tip">
11
-			为了更好的保障个人权益,请您仔细阅读
12
-					<text style="color:#02a5b1"  class="text" @tap="goto('user')">《用户协议》</text>和
13
-					<text style="color:#02a5b1"  class="text" @tap="goto('privacy')">《隐私政策》</text>
14
-			</view>
15
-			<button class="bind-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">立即绑定</button>
16
-		</view>
17
-	</view>
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="绑定手机号"></cu-custom>
4
+    <view class="bind bg-white">
5
+      <view class="bind-img">
6
+        <image src="/static/imgs/phone.png" mode="widthFix" style="width:400rpx;" />
7
+      </view>
8
+      <view class="bind-text">请绑定手机号</view>
9
+      <view class="bind-tip" style="margin-top:10px;"> 为向您提供更优质的交易相关基本功能,我们将会获取您的手机号。</view>
10
+      <view class="bind-tip">
11
+        为了更好的保障个人权益,请您仔细阅读
12
+        <text style="color:#02a5b1" class="text" @tap="goto('user')">《用户协议》</text>和
13
+        <text style="color:#02a5b1" class="text" @tap="goto('privacy')">《隐私政策》</text>
14
+      </view>
15
+      <button class="bind-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">立即绑定</button>
16
+    </view>
17
+  </view>
18 18
 </template>
19 19
 
20 20
 <script>
21 21
 import { _bindPhone, _login, _getBindPhone } from '@/api/auth'
22 22
 import { mapGetters } from 'vuex'
23 23
 export default {
24
-  data() {
24
+  data () {
25 25
     return {
26 26
       key: '绑定手机号'
27 27
     }
@@ -32,10 +32,10 @@ export default {
32 32
     ])
33 33
   },
34 34
   methods: {
35
-    goto(type) {
35
+    goto (type) {
36 36
       this.globalNavigateTo('agreement', { type })
37 37
     },
38
-    getPhoneNumber(e) {
38
+    getPhoneNumber (e) {
39 39
       const detail = e.detail
40 40
       if (!detail.iv) {
41 41
         return false
@@ -48,11 +48,11 @@ export default {
48 48
         code: this.globalApp.code
49 49
       }
50 50
       uni.checkSession({
51
-        success() {
51
+        success () {
52 52
           params.session = _self.session
53 53
           _self.bindPhone(params)
54 54
         },
55
-        fail() {
55
+        fail () {
56 56
           uni.login({
57 57
             success: wxres => {
58 58
               _login({ code: wxres.code }).then(res => {
@@ -65,7 +65,7 @@ export default {
65 65
         }
66 66
       })
67 67
     },
68
-    bindPhone(params) {
68
+    bindPhone (params) {
69 69
       _bindPhone(params).then(res => {
70 70
         uni.showToast({ title: res.msg, icon: 'none' })
71 71
         const token = res.data.token
@@ -77,7 +77,7 @@ export default {
77 77
         })
78 78
       })
79 79
     },
80
-    getBindPhone() {
80
+    getBindPhone () {
81 81
       _getBindPhone().then(res => {
82 82
         this.$store.dispatch('setPhone', res.data.mobile)
83 83
       })
@@ -87,26 +87,26 @@ export default {
87 87
 </script>
88 88
 
89 89
 <style lang="scss" scoped>
90
-.bind{
91
-  padding:30px 44rpx 10px;
90
+.bind {
91
+  padding: 30px 44rpx 10px;
92 92
 }
93
-.bind-img{
94
-  margin:0 auto;
95
-  text-align:center;
93
+.bind-img {
94
+  margin: 0 auto;
95
+  text-align: center;
96 96
 }
97
-.bind-text{
98
-    margin-top:20px;
99
-    color:#000;
100
-    font-size:18px;
101
-    text-align:center;
97
+.bind-text {
98
+  margin-top: 20px;
99
+  color: #000;
100
+  font-size: 18px;
101
+  text-align: center;
102 102
 }
103
-.bind-tip{
104
-  font-size:14px;
103
+.bind-tip {
104
+  font-size: 14px;
105 105
 }
106
-.bind-btn{
106
+.bind-btn {
107 107
   margin-top: 30px;
108 108
   background: #5fd0e4;
109
-  border-radius:4px;
109
+  border-radius: 4px;
110 110
   color: #fff;
111 111
   width: 100%;
112 112
   padding: 0;
@@ -116,7 +116,7 @@ export default {
116 116
   align-items: center;
117 117
   height: 10vw;
118 118
 }
119
-.bind-btn:hover{
119
+.bind-btn:hover {
120 120
   background: #3f8b97;
121 121
 }
122 122
 </style>

+ 246 - 238
src/pages/class/detail.vue

@@ -1,166 +1,163 @@
1 1
 <template>
2
-	<view class="page">
3
-		<cu-custom :isBack="true"></cu-custom>
4
-		<view class="header" :style="[{top:topHeader + 'px'}]">
5
-			<view class="header-title">
6
-				<view class="header-title-main">
7
-						<view class="margin-bottom-xs">{{tabList[cate_type].title}}</view>
8
-						<view class="point"></view>
9
-				</view>
10
-			</view>
11
-			<swiper-tab :menuList="tabList[cate_type].list" @changeTab="changeTab"></swiper-tab>
12
-		</view>
13
-		<scroll-view v-if="currentIndex===0" :scroll-y="true"
14
-		:style="[{height:'calc(100vh - 70px - '+ topHeader+'px)'}]"
15
-		class="scroll-main">
16
-			<view class="content">
17
-				<view class="course-img">
18
-					<swiper class="swiper" :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay" :interval="swiper.interval" :duration="swiper.duration">
19
-						<swiper-item v-for="(item,index) in detail.image" :key="index">
20
-							<view class="swiper-item">
21
-								  <image :src="item" mode="widthFix"></image>
22
-							</view>
23
-						</swiper-item>
24
-					</swiper>
25
-				</view>
26
-				<!-- 详情 -->
27
-				<view class="detail">
28
-					<view class="detail-title">{{detail.name}}</view>
29
-					<view class="detail-item">
30
-						 <view class="detail-item-point"></view>
31
-						 <view class="detail-label">周期</view>
32
-						 <view class="detail-text">{{detail.period}}<text class="text-gray">({{detail.time[0]}})</text></view>
33
-					</view>
34
-					<view class="detail-item">
35
-						<view class="detail-item-point"></view>
36
-							<view class="detail-label">适用年级</view>
37
-						 <view class="detail-text">{{detail.grade}}年级通用</view>
38
-					</view>
39
-					<view class="detail-item">
40
-						<view class="detail-item-point"></view>
41
-							<view class="detail-label">课时</view>
42
-						 <view class="detail-text">{{detail.class_total}}课时</view>
43
-					</view>
44
-					<view class="detail-item">
45
-						<view class="detail-item-point"></view>
46
-							<view class="detail-label">单课时价</view>
47
-						 <view class="detail-text">¥{{detail.single_money}}</view>
48
-					</view>
49
-					<view class="detail-item">
50
-						<view class="detail-item-point"></view>
51
-							<view class="detail-label">补贴</view>
52
-						 <view class="detail-text">¥{{detail.subsidy}}/节课</view>
53
-					</view>
54
-					<view class="detail-item">
55
-						 <view class="detail-item-point"></view>
56
-							<view class="detail-label">培养目标</view>
57
-						 <view class="detail-text">{{detail.tenet}}</view>
58
-					</view>
59
-				</view>
60
-			</view>
61
-			<!-- 老师介绍 -->
62
-			<view class="teacher flex margin-top-sm shadow" v-if="cate_type===0">
63
-					<image mode="scaleToFill" :src="defaultTeacher" class="avatar lg"></image>
64
-					<view class="flex-sub margin-left">
65
-						 <view class="teacher-title">{{detail.teachers.username||''}}老师授课</view>
66
-						 <view class="teacher-item">毕业于{{detail.teachers.agency_name||''}}</view>
67
-						 <view class="teacher-item">所属机构:{{detail.teachers.orz||''}}</view>
68
-						 <view class="teacher-exp flex">
69
-							 <view class="exp-item">{{detail.teachers.honor||''}}</view>
70
-							 <view class="exp-item">{{detail.teachers.introduce||''}}</view>
71
-						 </view>
72
-					</view>
73
-			</view>
74
-			<!-- 道具选择 -->
75
-			<view class="shop margin-top-sm shadow" v-if="detail.prop&&detail.prop.length>0">
76
-					<view class="shop-title">请选择课程所需要的道具</view>
77
-					<radio-group @change="radioChange" class="margin-top-xs">
78
-						<label  v-for="radio in radios" :key="radio.value" class="tool-choose margin-right-sm">
79
-								<radio :value="radio.value" class="cyan" :checked="radio.checked" style="transform:scale(0.7)"/>{{radio.name}}
80
-						</label>
81
-					</radio-group>
82
-          <checkbox-group @change="checkboxChange" v-if="needTool==='1'" class="checkbox-group margin-top-xs">
83
-							<label v-for="prop in detail.prop" :key="prop.id">
84
-								<view class="tool-choose-item">
85
-									<checkbox :value="prop.id" class="cyan" style="transform:scale(0.7)" :checked="goods.props.includes(prop.id)"/>{{prop.name}}<text>¥{{prop.money}}</text>
86
-								</view>
87
-							</label>
88
-					</checkbox-group>
89
-			</view>
90
-			<!-- 评论 -->
91
-			<view class="comment">
92
-				<rich-text :nodes="detail.present"></rich-text>
93
-			</view>
94
-		</scroll-view>
95
-		<!-- 评价页 -->
96
-		<scroll-view
97
-		:style="[{height:'calc(100vh - 70px - '+ topHeader+'px)'}]"
98
-		class="scroll-main"
99
-		v-if="currentIndex===1">
100
-			<view class="cu-list menu-avatar comment">
101
-					<view class="cu-item" v-for="(comment,index) in comments" :key="index">
102
-						<image mode="scaleToFill" :src="comment.img" class="avatar md left"></image>
103
-						<view class="content">
104
-							<view class="text-grey">{{comment.name}}</view>
105
-							<view class="text-gray text-content text-df">
106
-								{{comment.content}}
107
-							</view>
108
-							<view class="margin-top-sm flex justify-between">
109
-								<view class="text-gray text-df">{{comment.date}}</view>
110
-								<!-- <view>
2
+  <view class="page">
3
+    <cu-custom :isBack="true"></cu-custom>
4
+    <view class="header" :style="[{top:topHeader + 'px'}]">
5
+      <view class="header-title">
6
+        <view class="header-title-main">
7
+          <view class="margin-bottom-xs">{{tabList[cate_type].title}}</view>
8
+          <view class="point"></view>
9
+        </view>
10
+      </view>
11
+      <swiper-tab :menuList="tabList[cate_type].list" @changeTab="changeTab"></swiper-tab>
12
+    </view>
13
+    <scroll-view v-if="currentIndex===0" :scroll-y="true" :style="[{height:'calc(100vh - 70px - '+ topHeader+'px)'}]"
14
+      class="scroll-main">
15
+      <view class="content">
16
+        <view class="course-img">
17
+          <swiper class="swiper" :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay"
18
+            :interval="swiper.interval" :duration="swiper.duration">
19
+            <swiper-item v-for="(item,index) in detail.image" :key="index">
20
+              <view class="swiper-item">
21
+                <image :src="item" mode="widthFix"></image>
22
+              </view>
23
+            </swiper-item>
24
+          </swiper>
25
+        </view>
26
+        <!-- 详情 -->
27
+        <view class="detail">
28
+          <view class="detail-title">{{detail.name}}</view>
29
+          <view class="detail-item">
30
+            <view class="detail-item-point"></view>
31
+            <view class="detail-label">周期</view>
32
+            <view class="detail-text">{{detail.period}}<text class="text-gray">({{detail.time[0]}})</text></view>
33
+          </view>
34
+          <view class="detail-item">
35
+            <view class="detail-item-point"></view>
36
+            <view class="detail-label">适用年级</view>
37
+            <view class="detail-text">{{detail.grade}}年级通用</view>
38
+          </view>
39
+          <view class="detail-item">
40
+            <view class="detail-item-point"></view>
41
+            <view class="detail-label">课时</view>
42
+            <view class="detail-text">{{detail.class_total}}课时</view>
43
+          </view>
44
+          <view class="detail-item">
45
+            <view class="detail-item-point"></view>
46
+            <view class="detail-label">单课时价</view>
47
+            <view class="detail-text">¥{{detail.single_money}}</view>
48
+          </view>
49
+          <view class="detail-item">
50
+            <view class="detail-item-point"></view>
51
+            <view class="detail-label">补贴</view>
52
+            <view class="detail-text">¥{{detail.subsidy}}/节课</view>
53
+          </view>
54
+          <view class="detail-item">
55
+            <view class="detail-item-point"></view>
56
+            <view class="detail-label">培养目标</view>
57
+            <view class="detail-text">{{detail.tenet}}</view>
58
+          </view>
59
+        </view>
60
+      </view>
61
+      <!-- 老师介绍 -->
62
+      <view class="teacher flex margin-top-sm shadow" v-if="cate_type===0">
63
+        <image mode="scaleToFill" :src="defaultTeacher" class="avatar lg"></image>
64
+        <view class="flex-sub margin-left">
65
+          <view class="teacher-title">{{detail.teachers.username||''}}老师授课</view>
66
+          <view class="teacher-item">毕业于{{detail.teachers.agency_name||''}}</view>
67
+          <view class="teacher-item">所属机构:{{detail.teachers.orz||''}}</view>
68
+          <view class="teacher-exp flex">
69
+            <view class="exp-item">{{detail.teachers.honor||''}}</view>
70
+            <view class="exp-item">{{detail.teachers.introduce||''}}</view>
71
+          </view>
72
+        </view>
73
+      </view>
74
+      <!-- 道具选择 -->
75
+      <view class="shop margin-top-sm shadow" v-if="detail.prop&&detail.prop.length>0">
76
+        <view class="shop-title">请选择课程所需要的道具</view>
77
+        <radio-group @change="radioChange" class="margin-top-xs">
78
+          <label v-for="radio in radios" :key="radio.value" class="tool-choose margin-right-sm">
79
+            <radio :value="radio.value" class="cyan" :checked="radio.checked" style="transform:scale(0.7)" />
80
+            {{radio.name}}
81
+          </label>
82
+        </radio-group>
83
+        <checkbox-group @change="checkboxChange" v-if="needTool==='1'" class="checkbox-group margin-top-xs">
84
+          <label v-for="prop in detail.prop" :key="prop.id">
85
+            <view class="tool-choose-item">
86
+              <checkbox :value="prop.id" class="cyan" style="transform:scale(0.7)"
87
+                :checked="goods.props.includes(prop.id)" />{{prop.name}}<text>¥{{prop.money}}</text>
88
+            </view>
89
+          </label>
90
+        </checkbox-group>
91
+      </view>
92
+      <!-- 评论 -->
93
+      <view class="comment">
94
+        <rich-text :nodes="detail.present"></rich-text>
95
+      </view>
96
+    </scroll-view>
97
+    <!-- 评价页 -->
98
+    <scroll-view :style="[{height:'calc(100vh - 70px - '+ topHeader+'px)'}]" class="scroll-main"
99
+      v-if="currentIndex===1">
100
+      <view class="cu-list menu-avatar comment">
101
+        <view class="cu-item" v-for="(comment,index) in comments" :key="index">
102
+          <image mode="scaleToFill" :src="comment.img" class="avatar md left"></image>
103
+          <view class="content">
104
+            <view class="text-grey">{{comment.name}}</view>
105
+            <view class="text-gray text-content text-df">
106
+              {{comment.content}}
107
+            </view>
108
+            <view class="margin-top-sm flex justify-between">
109
+              <view class="text-gray text-df">{{comment.date}}</view>
110
+              <!-- <view>
111 111
 									<text class="cuIcon-appreciatefill text-red"></text>
112 112
 									<text class="cuIcon-messagefill text-gray margin-left-sm"></text>
113 113
 								</view> -->
114
-							</view>
115
-						</view>
116
-					</view>
117
-			</view>
118
-		</scroll-view>
119
-		<!-- 视频页 -->
120
-		<scroll-view
121
-		:style="[{height:'calc(100vh - 70px - '+ topHeader+'px)'}]"
122
-		class="scroll-main"
123
-		v-if="currentIndex===2">
124
-				<view class="list">
125
-					<view class="cu-card case" v-for="(video,index) in detail.video" :key="index">
126
-						<view class="cu-item shadow">
127
-							<view class="image">
128
-								<video :src="video" style="width:100%;"></video>
129
-							</view>
130
-						</view>
131
-					</view>
132
-				</view>
133
-		</scroll-view>
134
-		<!-- 大纲页 -->
135
-		<scroll-view
136
-		:scroll-y="true"
137
-	  :style="[{height:'calc(100vh - 70px - '+ topHeader+'px)'}]"
138
-		class="scroll-main"
139
-		v-if="currentIndex===3">
140
-				<view class="cu-bar bg-white">
141
-					<view class="action border-title">
142
-						<text class="cuIcon-title text-student"></text>
143
-						<text class="text-xl text-bold">{{tabList[cate_type].list[currentIndex]}}</text>
144
-					</view>
145
-				</view>
146
-				<view class="bg-white padding-lr">
147
-					<view class="text-content text-lg" v-for="(outline,index) in detail.out_line" :key="index">
148
-						{{outline.course_content}}
149
-					</view>
150
-				</view>
151
-		</scroll-view>
152
-		<view class="static flex shadow">
153
-			<view class="static-price">
154
-				<text class="satic-label text-lg">小计:</text>
155
-				<text class="text-price text-red text-lg">{{goods.sum_money}}</text>
156
-			</view>
157
-			<view class="static-choose text-ellipsis" v-if="goods.choose.length>0">(已选:{{goods.choose.join(',')}})</view>
158
-			<view class="static-order flex align-center">
159
-				 <shop-cart :class_attend_id="attend_id" :disableBtn="disableBtn" @changeDisableBtn="changeDisableBtn"></shop-cart>
160
-				 <button class="cu-btn round bg-student text-white margin-left-xs" :class="{'disabled':carts.includes(attend_id)||!detail.enable}" @tap="addCart">报课</button>
161
-			</view>
162
-		</view>
163
-	</view>
114
+            </view>
115
+          </view>
116
+        </view>
117
+      </view>
118
+    </scroll-view>
119
+    <!-- 视频页 -->
120
+    <scroll-view :style="[{height:'calc(100vh - 70px - '+ topHeader+'px)'}]" class="scroll-main"
121
+      v-if="currentIndex===2">
122
+      <view class="list">
123
+        <view class="cu-card case" v-for="(video,index) in detail.video" :key="index">
124
+          <view class="cu-item shadow">
125
+            <view class="image">
126
+              <video :src="video" style="width:100%;"></video>
127
+            </view>
128
+          </view>
129
+        </view>
130
+      </view>
131
+    </scroll-view>
132
+    <!-- 大纲页 -->
133
+    <scroll-view :scroll-y="true" :style="[{height:'calc(100vh - 70px - '+ topHeader+'px)'}]" class="scroll-main"
134
+      v-if="currentIndex===3">
135
+      <view class="cu-bar bg-white">
136
+        <view class="action border-title">
137
+          <text class="cuIcon-title text-student"></text>
138
+          <text class="text-xl text-bold">{{tabList[cate_type].list[currentIndex]}}</text>
139
+        </view>
140
+      </view>
141
+      <view class="bg-white padding-lr">
142
+        <view class="text-content text-lg" v-for="(outline,index) in detail.out_line" :key="index">
143
+          {{outline.course_content}}
144
+        </view>
145
+      </view>
146
+    </scroll-view>
147
+    <view class="static flex shadow">
148
+      <view class="static-price">
149
+        <text class="satic-label text-lg">小计:</text>
150
+        <text class="text-price text-red text-lg">{{goods.sum_money}}</text>
151
+      </view>
152
+      <view class="static-choose text-ellipsis" v-if="goods.choose.length>0">(已选:{{goods.choose.join(',')}})</view>
153
+      <view class="static-order flex align-center">
154
+        <shop-cart :class_attend_id="attend_id" :disableBtn="disableBtn" @changeDisableBtn="changeDisableBtn">
155
+        </shop-cart>
156
+        <button class="cu-btn round bg-student text-white margin-left-xs"
157
+          :class="{'disabled':carts.includes(attend_id)||!detail.enable}" @tap="addCart">报课</button>
158
+      </view>
159
+    </view>
160
+  </view>
164 161
 </template>
165 162
 
166 163
 <script>
@@ -173,7 +170,7 @@ export default {
173 170
   components: {
174 171
     swiperTab, shopCart
175 172
   },
176
-  data() {
173
+  data () {
177 174
     return {
178 175
       topHeader: this.globalCustomBarHeight,
179 176
       swiper: {
@@ -251,10 +248,21 @@ export default {
251 248
       'carts'
252 249
     ])
253 250
   },
254
-  onShow() {
251
+  // 配置分享
252
+  onShareAppMessage (res) {
253
+    if (res.from === 'button') {
254
+      // 来自页面内分享按钮
255
+      console.log(res.target)
256
+    }
257
+    return {
258
+      title: '课程详情',
259
+      path: `/pages/class/detail?attend_id=${this.attend_id}`
260
+    }
261
+  },
262
+  onShow () {
255 263
     this.disableBtn = false
256 264
   },
257
-  onLoad(option) {
265
+  onLoad (option) {
258 266
     this.attend_id = Number(decodeURIComponent(option.attend_id))
259 267
     if (this.attend_id === 0) {
260 268
       uni.navigateBack()
@@ -263,7 +271,7 @@ export default {
263 271
     this.get_comments()
264 272
   },
265 273
   methods: {
266
-    get_detail() {
274
+    get_detail () {
267 275
       _detail({ class_attend_id: this.attend_id }).then(res => {
268 276
         this.detail = res.data
269 277
         this.money = res.data.sum_money
@@ -275,10 +283,10 @@ export default {
275 283
         }
276 284
       })
277 285
     },
278
-    changeDisableBtn() {
286
+    changeDisableBtn () {
279 287
       this.disableBtn = true
280 288
     },
281
-    addCart() {
289
+    addCart () {
282 290
       if (this.disableBtn) return false
283 291
       this.disableBtn = true
284 292
       if (!this.detail.enable) {
@@ -295,20 +303,20 @@ export default {
295 303
         }
296 304
       })
297 305
     },
298
-    setDefaultGoods(props) {
306
+    setDefaultGoods (props) {
299 307
       this.goods.props[0] = props[0].id
300 308
       this.goods.sum_money = NP.plus(this.money, props[0].money)
301 309
       this.goods.choose[0] = props[0].name
302 310
     },
303
-    get_comments() {
311
+    get_comments () {
304 312
       _comments({ class_attend_id: this.attend_id }).then(res => {
305 313
         this.comemnts = res.data
306 314
       })
307 315
     },
308
-    changeTab(index) {
316
+    changeTab (index) {
309 317
       this.currentIndex = index
310 318
     },
311
-    radioChange(e) {
319
+    radioChange (e) {
312 320
       const value = e.detail.value
313 321
       this.needTool = value
314 322
       if (value === '1') {
@@ -319,7 +327,7 @@ export default {
319 327
         this.goods.choose = []
320 328
       }
321 329
     },
322
-    checkboxChange(e) {
330
+    checkboxChange (e) {
323 331
       const values = e.detail.value
324 332
       const choose = []
325 333
       const props = []
@@ -342,86 +350,86 @@ export default {
342 350
 </script>
343 351
 
344 352
 <style lang="scss" scoped>
345
-.scroll-main{
346
-  padding-top:86px;
353
+.scroll-main {
354
+  padding-top: 86px;
347 355
 }
348
-.detail{
349
-	padding:20rpx;
350
-	background-color:#fff;
351
-	&-title{
352
-		margin-bottom:1rem;
353
-		font-size:22px;
354
-	}
355
-	&-item{
356
+.detail {
357
+  padding: 20rpx;
358
+  background-color: #fff;
359
+  &-title {
360
+    margin-bottom: 1rem;
361
+    font-size: 22px;
362
+  }
363
+  &-item {
356 364
     margin: 20rpx 0;
357 365
     display: flex;
358 366
     color: #999;
359
-		&-point{
360
-			margin-top: 7px;
361
-			margin-right: 7px;
362
-			border-radius: 50%;
363
-			width: 5px;
364
-			height: 5px;
365
-			background: #5ecfde;
366
-		}
367
-	}
368
-	&-label{
369
-		width: 66px;
367
+    &-point {
368
+      margin-top: 7px;
369
+      margin-right: 7px;
370
+      border-radius: 50%;
371
+      width: 5px;
372
+      height: 5px;
373
+      background: #5ecfde;
374
+    }
375
+  }
376
+  &-label {
377
+    width: 66px;
370 378
     padding-right: 6px;
371 379
     text-align: justify;
372 380
     text-align-last: justify;
373
-	}
374
-	&-text{
375
-		color:#000;
376
-	}
381
+  }
382
+  &-text {
383
+    color: #000;
384
+  }
377 385
 }
378
-.teacher{
379
-	padding:20rpx;
380
-	background:#fff;
381
-	font-size:14px;
382
-	color:#999;
383
-	&-title{
384
-		font-size:18px;
385
-		color:#000;
386
-	}
386
+.teacher {
387
+  padding: 20rpx;
388
+  background: #fff;
389
+  font-size: 14px;
390
+  color: #999;
391
+  &-title {
392
+    font-size: 18px;
393
+    color: #000;
394
+  }
387 395
 }
388
-.shop{
389
-	padding:20rpx;
390
-	background:#fff;
396
+.shop {
397
+  padding: 20rpx;
398
+  background: #fff;
391 399
 }
392
-.tool-choose{
393
-	padding:20rpx 20rpx 20rpx 0;
394
-	&-item{
395
-		padding:10rpx 0;
396
-	}
400
+.tool-choose {
401
+  padding: 20rpx 20rpx 20rpx 0;
402
+  &-item {
403
+    padding: 10rpx 0;
404
+  }
397 405
 }
398
-.checkbox-group{
399
-	height:100px;
400
-	overflow-y:scroll;
401
-	border:1px solid #f5f5f5;
406
+.checkbox-group {
407
+  height: 100px;
408
+  overflow-y: scroll;
409
+  border: 1px solid #f5f5f5;
402 410
 }
403
-.comment{
404
-	padding:20rpx;
405
-	min-height:60px;
411
+.comment {
412
+  padding: 20rpx;
413
+  min-height: 60px;
406 414
 }
407
-.static{
408
-    position: fixed;
409
-    left: 0;
410
-    right: 0;
411
-    bottom: 0;
412
-    display: flex;
413
-    background: #fff;
414
-    height: 70px;
415
-    align-items: center;
416
-    padding: 0 0.8rem;
417
-    justify-content: space-between;
418
-		&-price{
419
-			font-size:14px;
420
-		}
421
-		&-choose{
422
-      color: #666;
423
-			font-size: 12px;
424
-    	width: calc(100vw - 240px);
425
-		}
415
+.static {
416
+  position: fixed;
417
+  left: 0;
418
+  right: 0;
419
+  bottom: 0;
420
+  display: flex;
421
+  background: #fff;
422
+  height: 70px;
423
+  align-items: center;
424
+  padding: 0 0.8rem;
425
+  justify-content: space-between;
426
+  &-price {
427
+    font-size: 14px;
428
+  }
429
+  &-choose {
430
+    color: #666;
431
+    font-size: 12px;
432
+    width: calc(100vw - 240px);
433
+  }
426 434
 }
427 435
 </style>

+ 295 - 147
src/pages/class/gift.vue

@@ -1,61 +1,103 @@
1 1
 <template>
2
-	<view>
3
-		 <cu-custom :isBack="true" title="一键报课"></cu-custom>
4
-		 <view class="VerticalBox">
5
-			<scroll-view class="VerticalNav nav" scroll-y scroll-with-animation :scroll-top="verticalNavTop" :style="'height:calc(100vh - 70px - '+topHeader+'px)'">
6
-				<view class="cu-item" :class="index==tabCur?'text-green cur':''" v-for="(item,index) in attends" :key="index" @tap="TabSelect"
7
-				 :data-id="index">
8
-					{{weekList[index]}}
9
-				</view>
10
-			</scroll-view>
11
-			<scroll-view class="VerticalMain padding-sm" scroll-y scroll-with-animation :style="'height:calc(100vh - 70px - '+topHeader+'px)'"
12
-			 :scroll-into-view="'main-'+mainCur" @scroll="VerticalMain">
13
-       <radio-group @change="changeClass" style="width:100%;" v-for="(attend,i) in attends" :key="i">
14
-         <view class="cu-item bg-white padding margin-bottom-sm" v-for="(item,index) in attend" v-show="i==mainCur" :key="index" :id="'main-'+index">
15
-					<view class="cu-bar solid-bottom">
16
-						<view>
17
-							<label>
18
-								<view class="flex justify-between align-center">
19
-									<view><text>{{item.attend_name}}</text></view>
20
-										<view>
21
-											<radio :value="item.class_attend_id"
22
-											:disabled="!item.enable"
23
-											:class="{'disabled':!item.enable}"
24
-											:checked="checked.includes(item.class_attend_id)"  class="cyan" style="transform:scale(0.7)"/>
25
-										</view>
26
-									</view>
27
-							</label>
28
-						</view>
29
-					</view>
30
-					<view v-if="item.prop.length>0">
31
-							<checkbox-group  class="checkbox-group margin-top-xs" :data-id="item.class_attend_id" @change="propChange">
32
-									<label v-for="prop in item.prop" :key="prop.id">
33
-										<view>
34
-											<checkbox :value="prop.id"
35
-											:disabled="!item.enable"
36
-											:class="{'disabled':!item.enable}"
37
-											:checked="checked_props[mainCur].class_attend_id===item.class_attend_id&&checked_props[mainCur].prop.includes(prop.id+'')" class="cyan" style="transform:scale(0.7)"/>{{prop.name}}<text>¥{{prop.money}}</text>
38
-										</view>
39
-									</label>
40
-							</checkbox-group>
41
-					</view>
42
-				 </view>
43
-       </radio-group>
44
-			</scroll-view>
45
-		</view>
46
-		<view class="static shadow">
47
-			<view class="static-order flex">
48
-				 <shop-cart :class_attend_id="attend_id"  @changeDisableBtn="changeDisableBtn"></shop-cart>
49
-				 <button class="cu-btn round bg-student text-white margin-left-xs"  @tap="addCart">报课</button>
50
-			</view>
51
-		</view>
52
-	</view>
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="智能报课"></cu-custom>
4
+    <view class="steps padding-tb">
5
+      <view class="cu-steps">
6
+        <view class="cu-item" :class="index > cur ? '' : 'text-student'" v-for="(item, index) in numList" :key="index" @tap="changeStep(index)">
7
+          <text class="num" :data-index="index + 1"></text> {{ item.name }}
8
+        </view>
9
+      </view>
10
+    </view>
11
+    <view class="main bg-white" :style="[{ height: 'calc(100vh - 92px - ' + topHeader + 'px)' }]">
12
+      <swiper @change="swipeChange" :current="cur" class="swipe">
13
+        <swiper-item @touchmove.stop>
14
+          <view class="btn-check-group padding">
15
+            <checkbox-group @change="checkboxChange" class="flex justify-between" style="flex-wrap: wrap;" id="week">
16
+              <label class="btn-check-label margin" :class="{ 'bg-cyan': params.week.includes(item.key + '') }" v-for="item in days" :key="item.key">
17
+                <checkbox :value="item.key" />
18
+                {{ item.value }}
19
+              </label>
20
+            </checkbox-group>
21
+          </view>
22
+        </swiper-item>
23
+        <swiper-item @touchmove.stop>
24
+          <view class="btn-check-group padding">
25
+            <checkbox-group @change="checkboxChange" class="flex justify-between" style="flex-wrap: wrap;" id="hobby">
26
+              <label class="btn-check-label margin" :class="{ 'bg-cyan': params.hobby.includes(item.id + '') }" v-for="item in interests" :key="item.id">
27
+                <checkbox :value="item.id" />
28
+                {{ item.name }}
29
+              </label>
30
+            </checkbox-group>
31
+            <view class="margin">
32
+              <input v-model="params.hobbyOther" placeholder="输入其它兴趣内容(选填)" class="margin-top input-border" />
33
+            </view>
34
+          </view>
35
+        </swiper-item>
36
+        <swiper-item>
37
+          <view class="VerticalBox">
38
+            <scroll-view class="VerticalNav nav" scroll-y scroll-with-animation :scroll-top="verticalNavTop" :style="'height:calc(100vh - 70px - 90px - ' + topHeader + 'px)'">
39
+              <view class="cu-item" :class="index == tabCur ? 'text-green cur' : ''" v-for="(item, index) in attends" :key="index" @tap="TabSelect" :data-id="index">
40
+                {{ weekList[index] }}
41
+              </view>
42
+            </scroll-view>
43
+            <scroll-view
44
+              class="VerticalMain padding-sm"
45
+              scroll-y
46
+              scroll-with-animation
47
+              :style="'height:calc(100vh - 70px - 90px - ' + topHeader + 'px)'"
48
+              :scroll-into-view="'main-' + mainCur"
49
+              @scroll="VerticalMain"
50
+            >
51
+              <radio-group @change="changeClass" style="width: 100%;" v-for="(attend, i) in attends" :key="i">
52
+                <view class="cu-item bg-white padding margin-bottom-sm" v-for="(item, index) in attend.list" v-show="i == mainCur" :key="index" :id="'main-' + index">
53
+                  <view class="cu-bar solid-bottom">
54
+                    <view>
55
+                      <label>
56
+                        <view class="flex justify-between align-center">
57
+                          <view
58
+                            ><text>{{ item.attend_name }}</text></view
59
+                          >
60
+                          <view>
61
+                            <radio :value="item.class_attend_id" :checked="checked.includes(item.class_attend_id)" class="cyan" style="transform: scale(0.7);" />
62
+                          </view>
63
+                        </view>
64
+                      </label>
65
+                    </view>
66
+                  </view>
67
+                  <view v-if="item.prop.length > 0">
68
+                    <checkbox-group class="checkbox-group margin-top-xs" :data-id="item.class_attend_id" @change="propChange">
69
+                      <label v-for="prop in item.prop" :key="prop.id">
70
+                        <view>
71
+                          <checkbox
72
+                            :value="prop.id"
73
+                            class="cyan"
74
+                            :checked="checked_props[mainCur].class_attend_id === item.class_attend_id && checked_props[mainCur].prop.includes(prop.id + '')"
75
+                            style="transform: scale(0.7);"
76
+                          />{{ prop.name }}<text>¥{{ prop.money }}</text>
77
+                        </view>
78
+                      </label>
79
+                    </checkbox-group>
80
+                  </view>
81
+                </view>
82
+              </radio-group>
83
+            </scroll-view>
84
+          </view>
85
+          <view class="static shadow">
86
+            <view class="static-order flex">
87
+              <shop-cart :class_attend_id="attend_id" @changeDisableBtn="changeDisableBtn"></shop-cart>
88
+              <button class="cu-btn round bg-student text-white margin-left-xs" @tap="addCart">报课</button>
89
+            </view>
90
+          </view>
91
+        </swiper-item>
92
+      </swiper>
93
+    </view>
94
+  </view>
53 95
 </template>
54 96
 
55 97
 <script>
56
-import { _gift, _joinShops } from '@/api/course'
57
-import { mapGetters } from 'vuex'
98
+import { _intelligentDates, _intelligentInterests, _intelligentCourses, _joinShops } from '@/api/course'
58 99
 import shopCart from '@/components/shop-cart.vue'
100
+import { mapGetters } from 'vuex'
59 101
 export default {
60 102
   components: {
61 103
     shopCart
@@ -63,16 +105,36 @@ export default {
63 105
   data() {
64 106
     return {
65 107
       topHeader: this.globalCustomBarHeight,
66
-      package_id: 0,
67
-      attends: [],
68
-      weekList: [],
69
-      attend_id: 0, // 添加成功课程
108
+      numList: [
109
+        {
110
+          name: '选周期'
111
+        },
112
+        {
113
+          name: '选兴趣'
114
+        },
115
+        {
116
+          name: '确认选课'
117
+        }
118
+      ],
119
+      cur: 0,
120
+      days: [], //周期
121
+      interests: [], //兴趣
122
+      attends: [], //课程
123
+      weekList: [], //日期
124
+      params: {
125
+        week: [],
126
+        hobby: [],
127
+        student_id: '',
128
+        hobbyOther: ''
129
+      },
130
+      tabCur: 0,
131
+      mainCur: 0,
132
+      verticalNavTop: 0,
70 133
       checked: [], // 选中
71 134
       checked_props: [], // 选中工具
72
-      tabCur: 1,
73
-      mainCur: 1,
74
-      verticalNavTop: 0,
75
-      disableBtn: false // 避免多次重复点击
135
+      attend_id: 0, // 添加成功课程
136
+      disableBtn: false, // 避免多次重复点击
137
+      action: 'stopmove'
76 138
     }
77 139
   },
78 140
   computed: {
@@ -81,6 +143,7 @@ export default {
81 143
   onLoad(options) {
82 144
     const id = decodeURIComponent(options.package_id)
83 145
     this.package_id = id
146
+    this.params.student_id = this.kid
84 147
     this.init()
85 148
   },
86 149
   onShow() {
@@ -88,45 +151,66 @@ export default {
88 151
   },
89 152
   methods: {
90 153
     init() {
91
-      _gift({ class_package_id: this.package_id }).then(res => {
92
-        this.attends = res.data.attends
154
+      this.getDateConfig()
155
+      this.getHobbyConfig()
156
+    },
157
+    getDateConfig() {
158
+      _intelligentDates().then(res => {
159
+        this.days = res.data
160
+      })
161
+    },
162
+    getHobbyConfig() {
163
+      _intelligentInterests().then(res => {
164
+        this.interests = res.data
165
+      })
166
+    },
167
+    get_options() {
168
+      const params = Object.assign({}, this.params)
169
+      params.week = params.week.join(',')
170
+      params.hobby = params.hobby.join(',')
171
+      _intelligentCourses(params).then(res => {
172
+        this.attends = res.data
93 173
         Object.keys(this.attends).forEach(item => {
94 174
           this.$set(this.checked_props, item, { prop: [] })
95 175
         })
96
-        this.weekList = res.data.week_list
176
+        this.weekList = this.attends.map(item => item.week)
97 177
       })
98 178
     },
99
-    changeDisableBtn() {
100
-      this.disableBtn = true
179
+    checkboxChange(e) {
180
+      const type = e.target.id
181
+      const values = e.detail.value
182
+      switch (type) {
183
+        case 'week':
184
+          this.params.week = values
185
+          break
186
+        case 'hobby':
187
+          this.params.hobby = values
188
+          break
189
+        default:
190
+          console.log('error')
191
+      }
101 192
     },
102
-    addCart() {
103
-      if (this.disableBtn) return false
104
-      this.disableBtn = true
105
-      const _self = this
106
-      const list = this.checked_props.filter(item => item.class_attend_id).map(item => {
107
-        return {
108
-          class_attend_id: item.class_attend_id,
109
-          prop: item.prop.join(','),
110
-          student_id: this.kid
111
-        }
112
-      })
113
-      if (list.length < 1) {
114
-        uni.showToast({ title: '请先选择课程', icon: 'none' })
115
-        this.disableBtn = false
193
+    changeStep(index) {
194
+      if (index === 1 && this.params.week.length < 1) {
195
+        uni.showToast({ title: '请先选择周期', icon: 'none' })
116 196
         return false
117 197
       }
118
-      _joinShops({ list }).then(res => {
119
-        if (res.code === 1) {
120
-          _self.globalNavigateTo('classCart')
121
-        } else {
122
-          this.disableBtn = false
123
-        }
124
-      })
198
+      if (index === 2 && this.params.hobby.length < 1) {
199
+        uni.showToast({ title: '请先选择兴趣', icon: 'none' })
200
+        return false
201
+      }
202
+      const step = Math.abs(index - this.cur)
203
+      if (step > 1) return false
204
+      this.cur = index
125 205
     },
126
-    TabSelect(e) {
127
-      this.tabCur = e.currentTarget.dataset.id
128
-      this.mainCur = e.currentTarget.dataset.id
129
-      this.verticalNavTop = (e.currentTarget.dataset.id - 1) * 50
206
+    swipeChange(e) {
207
+      this.cur = e.detail.current
208
+      if (this.cur === 2) {
209
+        this.get_options()
210
+      }
211
+    },
212
+    changeDisableBtn() {
213
+      this.disableBtn = true
130 214
     },
131 215
     changeClass(e) {
132 216
       const value = Number(e.detail.value)
@@ -143,71 +227,135 @@ export default {
143 227
       const item = { class_attend_id: parentId, prop: values }
144 228
       this.$set(this.checked_props, this.mainCur, item)
145 229
     },
146
-    VerticalMain(e) {
147
-
230
+    TabSelect(e) {
231
+      this.tabCur = e.currentTarget.dataset.id
232
+      this.mainCur = e.currentTarget.dataset.id
233
+      this.verticalNavTop = (e.currentTarget.dataset.id - 1) * 50
234
+    },
235
+    addCart() {
236
+      if (this.disableBtn) return false
237
+      this.disableBtn = true
238
+      const _self = this
239
+      const list = this.checked_props
240
+        .filter(item => item.class_attend_id)
241
+        .map(item => {
242
+          return {
243
+            class_attend_id: item.class_attend_id,
244
+            prop: item.prop.join(','),
245
+            student_id: this.kid
246
+          }
247
+        })
248
+      if (list.length < 1) {
249
+        uni.showToast({ title: '请先选择课程', icon: 'none' })
250
+        this.disableBtn = false
251
+        return false
252
+      }
253
+      _joinShops({ list }).then(res => {
254
+        if (res.code === 1) {
255
+          _self.globalNavigateTo('classCart')
256
+        } else {
257
+          this.disableBtn = false
258
+        }
259
+      })
148 260
     }
149 261
   }
150 262
 }
151 263
 </script>
152 264
 
153 265
 <style lang="scss" scoped>
154
-	::v-deep radio.disabled::before,::v-deep checkbox.disabled::before{
155
-		color:#e1e1e1 !important;
156
-	}
157
-	.static{
158
-			position: fixed;
159
-			left: 0;
160
-			right: 0;
161
-			bottom: 0;
162
-			display: flex;
163
-			background: #fff;
164
-			height: 70px;
165
-			align-items: center;
166
-			padding: 0 0.8rem;
167
-			justify-content: flex-end;
168
-	}
169
-	.fixed {
170
-		position: fixed;
171
-		z-index: 99;
172
-	}
173
-	.VerticalNav.nav {
174
-		width: 200upx;
175
-		white-space: initial;
176
-	}
266
+.page {
267
+  height: 100vh;
268
+}
269
+.main {
270
+  .swipe {
271
+    height: 100%;
272
+  }
273
+}
274
+.btn-check-group {
275
+  checkbox {
276
+    display: none;
277
+  }
278
+  radio {
279
+    display: none;
280
+  }
281
+  label {
282
+    display: inline-block;
283
+    margin-right: 10rpx;
284
+    position: relative;
285
+    padding: 10rpx 30rpx;
286
+    line-height: 30px;
287
+    border-radius: 100rpx;
288
+    flex-wrap: nowrap;
289
+    border: 1px solid #eee;
290
+  }
291
+}
292
+.input-border {
293
+  height: 80rpx;
294
+  border-radius: 4px;
295
+  border: 1px solid #eee;
296
+  &:focus {
297
+    border: 1px solid #5fd0e4;
298
+  }
299
+}
177 300
 
178
-	.VerticalNav.nav .cu-item {
179
-		width: 100%;
180
-		text-align: center;
181
-		background-color: #fff;
182
-		margin: 0;
183
-		border: none;
184
-		height: 50px;
185
-		position: relative;
186
-	}
301
+::v-deep radio.disabled::before,
302
+::v-deep checkbox.disabled::before {
303
+  color: #e1e1e1 !important;
304
+}
305
+.static {
306
+  position: fixed;
307
+  left: 0;
308
+  right: 0;
309
+  bottom: 0;
310
+  display: flex;
311
+  background: #fff;
312
+  height: 70px;
313
+  align-items: center;
314
+  padding: 0 0.8rem;
315
+  justify-content: flex-end;
316
+}
317
+.fixed {
318
+  position: fixed;
319
+  z-index: 99;
320
+}
321
+.VerticalNav.nav {
322
+  width: 200upx;
323
+  white-space: initial;
324
+}
325
+
326
+.VerticalNav.nav .cu-item {
327
+  width: 100%;
328
+  text-align: center;
329
+  background-color: #fff;
330
+  margin: 0;
331
+  border: none;
332
+  height: 50px;
333
+  position: relative;
334
+}
187 335
 
188
-	.VerticalNav.nav .cu-item.cur {
189
-		background-color: #f1f1f1;
190
-	}
336
+.VerticalNav.nav .cu-item.cur {
337
+  background-color: #f1f1f1;
338
+}
191 339
 
192
-	.VerticalNav.nav .cu-item.cur::after {
193
-		content: "";
194
-		width: 8upx;
195
-		height: 30upx;
196
-		border-radius: 10upx 0 0 10upx;
197
-		position: absolute;
198
-		background-color: currentColor;
199
-		top: 0;
200
-		right: 0upx;
201
-		bottom: 0;
202
-		margin: auto;
203
-	}
340
+.VerticalNav.nav .cu-item.cur::after {
341
+  content: '';
342
+  width: 8upx;
343
+  height: 30upx;
344
+  border-radius: 10upx 0 0 10upx;
345
+  position: absolute;
346
+  background-color: currentColor;
347
+  top: 0;
348
+  right: 0upx;
349
+  bottom: 0;
350
+  margin: auto;
351
+}
204 352
 
205
-	.VerticalBox {
206
-		display: flex;
207
-	}
353
+.VerticalBox {
354
+  display: flex;
355
+}
208 356
 
209
-	.VerticalMain {
210
-		background-color: #f1f1f1;
211
-		flex: 1;
212
-	}
357
+.VerticalMain {
358
+  background-color: #f1f1f1;
359
+  flex: 1;
360
+}
213 361
 </style>

+ 229 - 0
src/pages/class/gift1.vue

@@ -0,0 +1,229 @@
1
+<template>
2
+  <view>
3
+    <cu-custom :isBack="true" title="一键报课"></cu-custom>
4
+    <view class="VerticalBox">
5
+      <scroll-view class="VerticalNav nav" scroll-y scroll-with-animation :scroll-top="verticalNavTop" :style="'height:calc(100vh - 70px - ' + topHeader + 'px)'">
6
+        <view class="cu-item" :class="index == tabCur ? 'text-green cur' : ''" v-for="(item, index) in attends" :key="index" @tap="TabSelect" :data-id="index">
7
+          {{ weekList[index] }}
8
+        </view>
9
+      </scroll-view>
10
+      <scroll-view
11
+        class="VerticalMain padding-sm"
12
+        scroll-y
13
+        scroll-with-animation
14
+        :style="'height:calc(100vh - 70px - ' + topHeader + 'px)'"
15
+        :scroll-into-view="'main-' + mainCur"
16
+        @scroll="VerticalMain"
17
+      >
18
+        <radio-group @change="changeClass" style="width: 100%;" v-for="(attend, i) in attends" :key="i">
19
+          <view class="cu-item bg-white padding margin-bottom-sm" v-for="(item, index) in attend" v-show="i == mainCur" :key="index" :id="'main-' + index">
20
+            <view class="cu-bar solid-bottom">
21
+              <view>
22
+                <label>
23
+                  <view class="flex justify-between align-center">
24
+                    <view
25
+                      ><text>{{ item.attend_name }}</text></view
26
+                    >
27
+                    <view>
28
+                      <radio
29
+                        :value="item.class_attend_id"
30
+                        :disabled="!item.enable"
31
+                        :class="{ disabled: !item.enable }"
32
+                        :checked="checked.includes(item.class_attend_id)"
33
+                        class="cyan"
34
+                        style="transform: scale(0.7);"
35
+                      />
36
+                    </view>
37
+                  </view>
38
+                </label>
39
+              </view>
40
+            </view>
41
+            <view v-if="item.prop.length > 0">
42
+              <checkbox-group class="checkbox-group margin-top-xs" :data-id="item.class_attend_id" @change="propChange">
43
+                <label v-for="prop in item.prop" :key="prop.id">
44
+                  <view>
45
+                    <checkbox
46
+                      :value="prop.id"
47
+                      :disabled="!item.enable"
48
+                      :class="{ disabled: !item.enable }"
49
+                      :checked="checked_props[mainCur].class_attend_id === item.class_attend_id && checked_props[mainCur].prop.includes(prop.id + '')"
50
+                      class="cyan"
51
+                      style="transform: scale(0.7);"
52
+                    />{{ prop.name }}<text>¥{{ prop.money }}</text>
53
+                  </view>
54
+                </label>
55
+              </checkbox-group>
56
+            </view>
57
+          </view>
58
+        </radio-group>
59
+      </scroll-view>
60
+    </view>
61
+    <view class="static shadow">
62
+      <view class="static-order flex">
63
+        <shop-cart :class_attend_id="attend_id" @changeDisableBtn="changeDisableBtn"></shop-cart>
64
+        <button class="cu-btn round bg-student text-white margin-left-xs" @tap="addCart">报课</button>
65
+      </view>
66
+    </view>
67
+  </view>
68
+</template>
69
+
70
+<script>
71
+import { _gift, _joinShops } from '@/api/course'
72
+import { mapGetters } from 'vuex'
73
+import shopCart from '@/components/shop-cart.vue'
74
+export default {
75
+  components: {
76
+    shopCart
77
+  },
78
+  data() {
79
+    return {
80
+      topHeader: this.globalCustomBarHeight,
81
+      package_id: 0,
82
+      attends: [],
83
+      weekList: [],
84
+      attend_id: 0, // 添加成功课程
85
+      checked: [], // 选中
86
+      checked_props: [], // 选中工具
87
+      tabCur: 1,
88
+      mainCur: 1,
89
+      verticalNavTop: 0,
90
+      disableBtn: false // 避免多次重复点击
91
+    }
92
+  },
93
+  computed: {
94
+    ...mapGetters(['kid'])
95
+  },
96
+  onLoad(options) {
97
+    const id = decodeURIComponent(options.package_id)
98
+    this.package_id = id
99
+    this.init()
100
+  },
101
+  onShow() {
102
+    this.disableBtn = false
103
+  },
104
+  methods: {
105
+    init() {
106
+      _gift({ class_package_id: this.package_id }).then(res => {
107
+        this.attends = res.data.attends
108
+        Object.keys(this.attends).forEach(item => {
109
+          this.$set(this.checked_props, item, { prop: [] })
110
+        })
111
+        this.weekList = res.data.week_list
112
+      })
113
+    },
114
+    changeDisableBtn() {
115
+      this.disableBtn = true
116
+    },
117
+    addCart() {
118
+      if (this.disableBtn) return false
119
+      this.disableBtn = true
120
+      const _self = this
121
+      const list = this.checked_props
122
+        .filter(item => item.class_attend_id)
123
+        .map(item => {
124
+          return {
125
+            class_attend_id: item.class_attend_id,
126
+            prop: item.prop.join(','),
127
+            student_id: this.kid
128
+          }
129
+        })
130
+      if (list.length < 1) {
131
+        uni.showToast({ title: '请先选择课程', icon: 'none' })
132
+        this.disableBtn = false
133
+        return false
134
+      }
135
+      _joinShops({ list }).then(res => {
136
+        if (res.code === 1) {
137
+          _self.globalNavigateTo('classCart')
138
+        } else {
139
+          this.disableBtn = false
140
+        }
141
+      })
142
+    },
143
+    TabSelect(e) {
144
+      this.tabCur = e.currentTarget.dataset.id
145
+      this.mainCur = e.currentTarget.dataset.id
146
+      this.verticalNavTop = (e.currentTarget.dataset.id - 1) * 50
147
+    },
148
+    changeClass(e) {
149
+      const value = Number(e.detail.value)
150
+      this.checked[this.mainCur] = value
151
+      this.$set(this.checked, this.mainCur, value)
152
+      this.$set(this.checked_props, this.mainCur, { class_attend_id: value, prop: [] })
153
+    },
154
+    propChange(e) {
155
+      const parentId = e.target.dataset.id
156
+      const values = e.detail.value
157
+      if (!this.checked.includes(parentId)) {
158
+        this.$set(this.checked, this.mainCur, parentId)
159
+      }
160
+      const item = { class_attend_id: parentId, prop: values }
161
+      this.$set(this.checked_props, this.mainCur, item)
162
+    },
163
+    VerticalMain(e) {}
164
+  }
165
+}
166
+</script>
167
+
168
+<style lang="scss" scoped>
169
+::v-deep radio.disabled::before,
170
+::v-deep checkbox.disabled::before {
171
+  color: #e1e1e1 !important;
172
+}
173
+.static {
174
+  position: fixed;
175
+  left: 0;
176
+  right: 0;
177
+  bottom: 0;
178
+  display: flex;
179
+  background: #fff;
180
+  height: 70px;
181
+  align-items: center;
182
+  padding: 0 0.8rem;
183
+  justify-content: flex-end;
184
+}
185
+.fixed {
186
+  position: fixed;
187
+  z-index: 99;
188
+}
189
+.VerticalNav.nav {
190
+  width: 200upx;
191
+  white-space: initial;
192
+}
193
+
194
+.VerticalNav.nav .cu-item {
195
+  width: 100%;
196
+  text-align: center;
197
+  background-color: #fff;
198
+  margin: 0;
199
+  border: none;
200
+  height: 50px;
201
+  position: relative;
202
+}
203
+
204
+.VerticalNav.nav .cu-item.cur {
205
+  background-color: #f1f1f1;
206
+}
207
+
208
+.VerticalNav.nav .cu-item.cur::after {
209
+  content: '';
210
+  width: 8upx;
211
+  height: 30upx;
212
+  border-radius: 10upx 0 0 10upx;
213
+  position: absolute;
214
+  background-color: currentColor;
215
+  top: 0;
216
+  right: 0upx;
217
+  bottom: 0;
218
+  margin: auto;
219
+}
220
+
221
+.VerticalBox {
222
+  display: flex;
223
+}
224
+
225
+.VerticalMain {
226
+  background-color: #f1f1f1;
227
+  flex: 1;
228
+}
229
+</style>

+ 0 - 126
src/pages/class/gift2.vue

@@ -1,126 +0,0 @@
1
-<template>
2
-	<view class="page">
3
-		<cu-custom :isBack="true" title="智能报课"></cu-custom>
4
-		<view class="steps">
5
-			<view class="cu-steps">
6
-				<view class="cu-item" :class="index>cur?'':'text-student'" v-for="(item,index) in numList" :key="index" @tap="changeStep(index)">
7
-					<text class="num"  :data-index="index + 1"></text> {{item.name}}
8
-				</view>
9
-			</view>
10
-		</view>
11
-		<view class="main bg-white" 	:style="[{height:'calc(100vh - 82px - '+ topHeader+'px)'}]">
12
-			<swiper @change="swipeChange" :current="cur" class="swipe">
13
-				<swiper-item>
14
-					<view class="btn-check-group padding">
15
-						<checkbox-group @change="checkboxChange" class="flex" style="flex-wrap: wrap;" id="day">
16
-							<label class="btn-check-label padding-lr margin" :class="{'bg-cyan':params.day.includes(item.id+'')}"
17
-								v-for="item in days" :key="item.id">
18
-								<checkbox :value="item.id"/>
19
-								{{item.name}}
20
-							</label>
21
-						</checkbox-group>
22
-					</view>
23
-				</swiper-item>
24
-				<swiper-item>2</swiper-item>
25
-				<swiper-item>3</swiper-item>
26
-			</swiper>
27
-		</view>
28
-	</view>
29
-</template>
30
-
31
-<script>
32
-import { mapGetters } from 'vuex'
33
-import shopCart from '@/components/shop-cart.vue'
34
-export default {
35
-  components: {
36
-    shopCart
37
-  },
38
-  data() {
39
-    return {
40
-      topHeader: this.globalCustomBarHeight,
41
-      numList: [{
42
-        name: '选周期'
43
-      }, {
44
-        name: '选兴趣'
45
-      }, {
46
-        name: '确认选课'
47
-      }],
48
-      cur: 0,
49
-      days: [
50
-        { id: 1, name: '周一' },
51
-        { id: 2, name: '周二' },
52
-        { id: 3, name: '周三' },
53
-        { id: 4, name: '周四' },
54
-        { id: 5, name: '周五' },
55
-        { id: 6, name: '周六' },
56
-        { id: 7, name: '周日' },
57
-        { id: 8, name: '托管' }
58
-      ],
59
-      params: {
60
-        day: []
61
-      }
62
-    }
63
-  },
64
-  computed: {
65
-    ...mapGetters(['kid'])
66
-  },
67
-  onLoad(options) {
68
-    const id = decodeURIComponent(options.package_id)
69
-    this.package_id = id
70
-    this.init()
71
-  },
72
-  onShow() {
73
-    this.disableBtn = false
74
-  },
75
-  methods: {
76
-    init() {
77
-
78
-    },
79
-    checkboxChange(e) {
80
-      const type = e.target.id
81
-      const values = e.detail.value
82
-      this.params.day = values
83
-    },
84
-    changeStep(index) {
85
-      const step = Math.abs(index - this.cur)
86
-      if (step > 1) return false
87
-      this.cur = index
88
-    },
89
-    swipeChange(e) {
90
-      this.cur = e.detail.current
91
-    }
92
-  }
93
-}
94
-</script>
95
-
96
-<style lang="scss" scoped>
97
-.page{
98
-	height:100vh;
99
-}
100
-.steps{
101
-	margin:10px 0;
102
-}
103
-.main{
104
- .swipe{
105
-		height:100%;
106
-  }
107
-}
108
-.btn-check-group {
109
-  checkbox {
110
-    display: none;
111
-  }
112
-	radio{
113
-		display:none;
114
-	}
115
-  label {
116
-    display: inline-block;
117
-		margin-right:10rpx;
118
-    position: relative;
119
-		padding:0 30rpx;
120
-    line-height: 30px;
121
-    border-radius: 100rpx;
122
-    flex-wrap: nowrap;
123
-    border: 1px solid #eee;
124
-  }
125
-}
126
-</style>

+ 133 - 135
src/pages/class/shoppingCart.vue

@@ -1,83 +1,82 @@
1 1
 <template>
2 2
   <view class="page">
3
-		<cu-custom :isBack="true"></cu-custom>
4
-		<view class="header" :style="[{top:topHeader + 'px'}]">
5
-			<view class="header-title">
6
-				<view class="header-title-main">
7
-						<view class="margin-bottom-xs">{{title}}</view>
8
-						<view class="point"></view>
9
-				</view>
10
-			</view>
11
-		</view>
12
-			<scroll-view  scroll-y="true"
13
-			:style="[{height:'calc(100vh - 64px - 70px - '+ topHeader+'px)'}]"
14
-			class="scroll-main">
15
-				<view class="list">
16
-					<checkbox-group @change="checkChange">
17
-						<view class="cu-card margin-bottom shadow" v-for="(item,index) in list" :key="index">
18
-								<label class="cu-item">
19
-									<view class="card-header flex justify-between solid-bottom">
20
-										<view>
21
-											<checkbox style="transform:scale(0.8)" class="round" :value="item.shopping_id" :checked="checkedIds.includes(item.shopping_id)"></checkbox>
22
-											{{item.student_name}}
23
-										</view>
24
-										<view @tap.stop=''>
25
-												<text class="cuIcon-delete text-red" @tap="del(item,index)"></text>
26
-										</view>
27
-									</view>
28
-									<view class="card flex">
29
-										<view class="card-left">
30
-											<img mode="scaleToFill" :src="item.image" alt="" class="card-image">
31
-										</view>
32
-										<view class="card-right flex-sub margin-left-sm text-sm">
33
-											<view class="card-title">{{item.class_attend_name}}</view>
34
-											<view class="text-price text-student text-xl margin-top-xs">{{item.price}}</view>
35
-											<view class="card-item">
36
-												<text class="card-label">机构:</text>
37
-												<text class="card-text">{{item.agency_name||'-'}}</text>
38
-											</view>
39
-											<view class="card-item margin-top-xs" v-if="item.cate_type===0">
40
-												<text class="card-label">老师:</text>
41
-												<text class="card-text">{{item.teacher_name||'-'}}</text>
42
-											</view>
43
-											<view class="card-item margin-top-xs">
44
-												<text class="card-label">总共:</text>
45
-												<text class="card-text">{{item.class_total||'-'}}</text>
46
-											</view>
47
-											<view class="card-item margin-top-xs">
48
-												<text class="card-label">时间:</text>
49
-												<text class="card-text">{{item.week_limit||'-'}}</text>
50
-											</view>
51
-										</view>
52
-									</view>
53
-									<view class="card-footer margin-top-xs" v-if="item.prop">
54
-										<view v-for="(tag,index) in item.prop" :key="index" class="cu-tag line-red">{{tag}}</view>
55
-									</view>
56
-									<view class="card-bottom margin-top-xs">
57
-										<!-- <button @tap="pay(item)" class="cu-btn round bg-student text-white">立即下单</button> -->
58
-									</view>
59
-								</label>
60
-						</view>
61
-					</checkbox-group>
62
-				</view>
63
-			</scroll-view>
64
-			<view class="static flex shadow">
65
-				<view class="static-price">
66
-				  <checkbox-group @change="chooseAll">
67
-						<label>
68
-							<checkbox class="round" :checked="checkAll" style="transform:scale(0.8);"/>全选
69
-						</label>
70
-				  </checkbox-group>
71
-				</view>
72
-				<view class="static-choose text-center" v-if="checkedIds.length>0">
73
-					  <text>已选:</text><text class="margin-right-xs">{{checkedIds.length}}</text>
74
-						<text>总价:</text><text class="text-price text-red">{{sum}}</text>
75
-				</view>
76
-				<view class="static-order flex align-center">
77
-					<button class="cu-btn round bg-student text-white margin-left-xs" @tap="pay">立即下单</button>
78
-				</view>
79
-		  </view>
80
-	</view>
3
+    <cu-custom :isBack="true"></cu-custom>
4
+    <view class="header" :style="[{top:topHeader + 'px'}]">
5
+      <view class="header-title">
6
+        <view class="header-title-main">
7
+          <view class="margin-bottom-xs">{{title}}</view>
8
+          <view class="point"></view>
9
+        </view>
10
+      </view>
11
+    </view>
12
+    <scroll-view scroll-y="true" :style="[{height:'calc(100vh - 64px - 70px - '+ topHeader+'px)'}]" class="scroll-main">
13
+      <view class="list">
14
+        <checkbox-group @change="checkChange">
15
+          <view class="cu-card margin-bottom shadow" v-for="(item,index) in list" :key="index">
16
+            <label class="cu-item">
17
+              <view class="card-header flex justify-between solid-bottom">
18
+                <view>
19
+                  <checkbox style="transform:scale(0.8)" class="round" :value="item.shopping_id"
20
+                    :checked="checkedIds.includes(item.shopping_id)"></checkbox>
21
+                  {{item.student_name}}
22
+                </view>
23
+                <view @tap.stop=''>
24
+                  <text class="cuIcon-delete text-red" @tap="del(item,index)"></text>
25
+                </view>
26
+              </view>
27
+              <view class="card flex">
28
+                <view class="card-left">
29
+                  <img mode="scaleToFill" :src="item.image" alt="" class="card-image">
30
+                </view>
31
+                <view class="card-right flex-sub margin-left-sm text-sm">
32
+                  <view class="card-title">{{item.class_attend_name}}</view>
33
+                  <view class="text-price text-student text-xl margin-top-xs">{{item.price}}</view>
34
+                  <view class="card-item">
35
+                    <text class="card-label">机构:</text>
36
+                    <text class="card-text">{{item.agency_name||'-'}}</text>
37
+                  </view>
38
+                  <view class="card-item margin-top-xs" v-if="item.cate_type===0">
39
+                    <text class="card-label">老师:</text>
40
+                    <text class="card-text">{{item.teacher_name||'-'}}</text>
41
+                  </view>
42
+                  <view class="card-item margin-top-xs">
43
+                    <text class="card-label">总共:</text>
44
+                    <text class="card-text">{{item.class_total||'-'}}</text>
45
+                  </view>
46
+                  <view class="card-item margin-top-xs">
47
+                    <text class="card-label">时间:</text>
48
+                    <text class="card-text">{{item.week_limit||'-'}}</text>
49
+                  </view>
50
+                </view>
51
+              </view>
52
+              <view class="card-footer margin-top-xs" v-if="item.prop">
53
+                <view v-for="(tag,index) in item.prop" :key="index" class="cu-tag line-red">{{tag}}</view>
54
+              </view>
55
+              <view class="card-bottom margin-top-xs">
56
+                <!-- <button @tap="pay(item)" class="cu-btn round bg-student text-white">立即下单</button> -->
57
+              </view>
58
+            </label>
59
+          </view>
60
+        </checkbox-group>
61
+      </view>
62
+    </scroll-view>
63
+    <view class="static flex shadow">
64
+      <view class="static-price">
65
+        <checkbox-group @change="chooseAll">
66
+          <label>
67
+            <checkbox class="round" :checked="checkAll" style="transform:scale(0.8);" />全选
68
+          </label>
69
+        </checkbox-group>
70
+      </view>
71
+      <view class="static-choose text-center" v-if="checkedIds.length>0">
72
+        <text>已选:</text><text class="margin-right-xs">{{checkedIds.length}}</text>
73
+        <text>总价:</text><text class="text-price text-red">{{sum}}</text>
74
+      </view>
75
+      <view class="static-order flex align-center">
76
+        <button class="cu-btn round bg-student text-white margin-left-xs" @tap="pay">立即下单</button>
77
+      </view>
78
+    </view>
79
+  </view>
81 80
 </template>
82 81
 
83 82
 <script>
@@ -87,7 +86,7 @@ import { deepClone } from '@/common/utils'
87 86
 import NP from 'number-precision'
88 87
 import socket from '@/common/webSocket'
89 88
 export default {
90
-  data() {
89
+  data () {
91 90
     return {
92 91
       title: '购物车',
93 92
       topHeader: this.globalCustomBarHeight,
@@ -104,29 +103,29 @@ export default {
104 103
       'carts', 'phone', 'ifConnectOrder'
105 104
     ])
106 105
   },
107
-  onShow() {
106
+  onShow () {
108 107
     this.get_list()
109 108
   },
110
-  onLoad(options) {
109
+  onLoad (options) {
111 110
     socket.initSocket()
112 111
   },
113 112
   methods: {
114
-    checkChange(e) {
113
+    checkChange (e) {
115 114
       this.checkedIds = e.detail.value.map(x => Number(x))
116 115
       this.shoppingList = this.list.filter(item => this.checkedIds.includes(item.shopping_id))
117 116
       this.sum_money()
118 117
     },
119
-    chooseAll() {
118
+    chooseAll () {
120 119
       this.checkAll = !this.checkAll
121 120
       this.checkedIds = this.checkAll ? this.all : []
122 121
       this.shoppingList = this.checkAll ? deepClone(this.list) : []
123 122
       this.sum_money()
124 123
     },
125
-    sum_money() {
124
+    sum_money () {
126 125
       const arr = this.shoppingList.map(item => item.price)
127 126
       this.sum = arr.reduce((x, y) => NP.plus(x, y), 0)
128 127
     },
129
-    get_list() {
128
+    get_list () {
130 129
       _shopList().then(res => {
131 130
         this.list = res.data
132 131
         this.all = this.list.map(item => item.shopping_id)// 统计全部
@@ -134,7 +133,7 @@ export default {
134 133
         this.$store.dispatch('setCarts', carts)// 刷新购物车
135 134
       })
136 135
     },
137
-    del(item, index) {
136
+    del (item, index) {
138 137
       const _self = this
139 138
       uni.showModal({
140 139
         title: '提示',
@@ -150,7 +149,7 @@ export default {
150 149
         }
151 150
       })
152 151
     },
153
-    pay() {
152
+    pay () {
154 153
       if (!this.phone) {
155 154
         return this.globalNavigateTo('bindPhone')
156 155
       }
@@ -183,58 +182,57 @@ export default {
183 182
 
184 183
 <style lang="scss" scoped>
185 184
 @import '~@/common/css/mixin.scss';
186
-.scroll-main{
187
-	margin-top:64px;
188
-	padding:20rpx;
185
+.scroll-main {
186
+  margin-top: 64px;
187
+  padding: 20rpx;
189 188
 }
190
-.cu-card{
191
-	.cu-item{
192
-		margin-top:10rpx;
193
-		padding:20rpx;
194
-		margin:0;
195
-	}
189
+.cu-card {
190
+  .cu-item {
191
+    margin-top: 10rpx;
192
+    padding: 20rpx;
193
+    margin: 0;
194
+  }
196 195
 }
197
-.card-header{
198
-	padding-bottom:10px;
199
-  @include title(10px,18px);
196
+.card-header {
197
+  padding-bottom: 10px;
198
+  @include title(10px, 18px);
200 199
 }
201
-.card{
202
-	&-title{
203
-		font-size:16px;
204
-	}
205
-	&-image{
206
-		width:35vw;
207
-		height:35vw;
208
-		border-radius:10rpx;
209
-	}
210
-	&-label{
211
-		color:#999;
212
-	}
213
-	&-text{
214
-		color:#333;
215
-	}
200
+.card {
201
+  &-title {
202
+    font-size: 16px;
203
+  }
204
+  &-image {
205
+    width: 35vw;
206
+    height: 35vw;
207
+    border-radius: 10rpx;
208
+  }
209
+  &-label {
210
+    color: #999;
211
+  }
212
+  &-text {
213
+    color: #333;
214
+  }
216 215
 }
217
-.card-bottom{
218
-	text-align:right;
216
+.card-bottom {
217
+  text-align: right;
219 218
 }
220
-.static{
221
-    position: fixed;
222
-    left: 0;
223
-    right: 0;
224
-    bottom: 0;
225
-    display: flex;
226
-    background: #fff;
227
-    height: 70px;
228
-    align-items: center;
229
-    padding: 0 0.8rem;
230
-    justify-content: space-between;
231
-		&-price{
232
-			font-size:14px;
233
-		}
234
-		&-choose{
235
-      color: #666;
236
-    	width: calc(100vw - 200px);
237
-		}
219
+.static {
220
+  position: fixed;
221
+  left: 0;
222
+  right: 0;
223
+  bottom: 0;
224
+  display: flex;
225
+  background: #fff;
226
+  height: 70px;
227
+  align-items: center;
228
+  padding: 0 0.8rem;
229
+  justify-content: space-between;
230
+  &-price {
231
+    font-size: 14px;
232
+  }
233
+  &-choose {
234
+    color: #666;
235
+    width: calc(100vw - 200px);
236
+  }
238 237
 }
239
-
240 238
 </style>

+ 33 - 33
src/pages/index/components/card.vue

@@ -1,18 +1,19 @@
1 1
 <template>
2
-	<view class="card flex" @tap="goDetail(item)">
3
-		<view class=card-left>
4
-			<img mode="aspectFill" :src="item.image" alt="">
5
-		</view>
6
-		<view class="card-right flex-sub">
7
-			<view class="card-title">{{item.attend_name}}</view>
8
-			<view class="text-gray text-sm flex justify-between"><text>{{item.day}}</text><text class="text-student">¥{{item.money}}</text></view>
9
-			<view class="text-gray text-sm">{{item.grade_desc}}</view>
10
-			<view class="margin-top-sm">
11
-				<button class="cu-btn round  bg-student text-white button-hover" v-if="item.enable">报课</button>
12
-				<button class="cu-btn round  bg-grey button-hover text-white disabled" v-else>停止</button>
13
-			</view>
14
-		</view>
15
-	</view>
2
+  <view class="card flex" @tap="goDetail(item)">
3
+    <view class=card-left>
4
+      <img mode="aspectFill" :src="item.image" alt="">
5
+    </view>
6
+    <view class="card-right flex-sub">
7
+      <view class="card-title flex justify-between"><text>{{item.attend_name}}</text><text
8
+          class="text-student text-light">¥{{item.money}}</text></view>
9
+      <view class="text-gray text-sm"><text>{{item.day}}</text></view>
10
+      <view class="text-gray text-sm">{{item.grade_desc}}</view>
11
+      <view class="margin-top-sm">
12
+        <button class="cu-btn round  bg-student text-white button-hover" v-if="item.enable">报课</button>
13
+        <button class="cu-btn round  bg-grey button-hover text-white disabled" v-else>停止</button>
14
+      </view>
15
+    </view>
16
+  </view>
16 17
 </template>
17 18
 
18 19
 <script>
@@ -20,18 +21,18 @@ export default {
20 21
   props: {
21 22
     item: {
22 23
       type: Object,
23
-      default() {
24
+      default () {
24 25
         return {}
25 26
       }
26 27
     }
27 28
   },
28
-  data() {
29
+  data () {
29 30
     return {
30 31
       key: 1212
31 32
     }
32 33
   },
33 34
   methods: {
34
-    goDetail(item) {
35
+    goDetail (item) {
35 36
       if (!item.enable) {
36 37
         uni.showToast({ title: '课程已停止!', icon: 'none' })
37 38
         return false
@@ -44,21 +45,20 @@ export default {
44 45
 
45 46
 <style lang="scss" scoped>
46 47
 @import '~@/common/css/mixin.scss';
47
-.card{
48
-	padding:30rpx;
49
-	width:100%;
50
-	&-title{
51
-		@include title(10px,14px);
52
-	}
53
-	&-left{
54
-		margin-right:20rpx;
55
-		width:240rpx;
56
-		image{
57
-			height:96px;
58
-		}
59
-	}
60
-	&-right{
61
-
62
-	}
48
+.card {
49
+  padding: 30rpx;
50
+  width: 100%;
51
+  &-title {
52
+    @include title(10px, 14px);
53
+  }
54
+  &-left {
55
+    margin-right: 20rpx;
56
+    width: 240rpx;
57
+    image {
58
+      height: 96px;
59
+    }
60
+  }
61
+  &-right {
62
+  }
63 63
 }
64 64
 </style>

+ 63 - 63
src/pages/index/components/course.vue

@@ -1,63 +1,63 @@
1
-<template>
2
-  <view :style="'background:'+course.background" class="course">
3
-		 <view class="course-tag" :class="{'un-catering':!course.applying}">{{course.applying?'报名中':'未开启'}}</view>
4
-		 <image class="course-back" mode="widthFix" :src="course.back"></image>
5
-	   <view class="course-ch text-xl">{{course.ch}}</view>
6
-		 <view class="course-en text-lg">{{course.en}}</view>
7
-  </view>
8
-</template>
9
-
10
-<script>
11
-export default {
12
-  props: {
13
-    course: {
14
-      type: Object,
15
-      default: function() {
16
-        return {}
17
-      }
18
-    }
19
-  },
20
-  data() {
21
-    return {
22
-      key: 1212
23
-    }
24
-  },
25
-  methods: {
26
-  }
27
-}
28
-</script>
29
-
30
-<style lang="scss" scoped>
31
-.course{
32
-	position:relative;
33
-	padding:24px;
34
-	width:100%;
35
-	border-radius:10px;
36
-	text-align:center;
37
-	&-tag{
38
-		    position: absolute;
39
-        right: 0;
40
-        top: 0;
41
-        font-size: 10px;
42
-        border-radius: 0 10px 0 18px;
43
-        background: #e93e32;
44
-        padding:2rpx 20rpx;
45
-				&.un-catering{
46
-					background:#d6d6d6;
47
-				}
48
-	}
49
-	&-back{
50
-        position: absolute;
51
-        width: 80px;
52
-        right: 0;
53
-        bottom: 0;
54
-	}
55
-	&-ch{
56
-		font-size:20px;
57
-	}
58
-	&-en{
59
-		margin-top:10px;
60
-		font-size:16px;
61
-	}
62
-}
63
-</style>
1
+<template>
2
+  <view :style="'background:'+course.background" class="course">
3
+    <view class="course-tag" :class="{'un-catering':!course.applying}">{{course.applying?'报名中':'未开启'}}</view>
4
+    <image class="course-back" mode="widthFix" :src="course.back"></image>
5
+    <view class="course-ch text-xl">{{course.ch}}</view>
6
+    <view class="course-en text-lg">{{course.en}}</view>
7
+  </view>
8
+</template>
9
+
10
+<script>
11
+export default {
12
+  props: {
13
+    course: {
14
+      type: Object,
15
+      default: function () {
16
+        return {}
17
+      }
18
+    }
19
+  },
20
+  data () {
21
+    return {
22
+      key: 1212
23
+    }
24
+  },
25
+  methods: {
26
+  }
27
+}
28
+</script>
29
+
30
+<style lang="scss" scoped>
31
+.course {
32
+  position: relative;
33
+  padding: 24px;
34
+  width: 100%;
35
+  border-radius: 10px;
36
+  text-align: center;
37
+  &-tag {
38
+    position: absolute;
39
+    right: 0;
40
+    top: 0;
41
+    font-size: 10px;
42
+    border-radius: 0 10px 0 18px;
43
+    background: #e93e32;
44
+    padding: 2rpx 20rpx;
45
+    &.un-catering {
46
+      background: #d6d6d6;
47
+    }
48
+  }
49
+  &-back {
50
+    position: absolute;
51
+    width: 80px;
52
+    right: 0;
53
+    bottom: 0;
54
+  }
55
+  &-ch {
56
+    font-size: 20px;
57
+  }
58
+  &-en {
59
+    margin-top: 10px;
60
+    font-size: 16px;
61
+  }
62
+}
63
+</style>

+ 189 - 181
src/pages/index/index.vue

@@ -3,121 +3,130 @@
3 3
   <view class="page">
4 4
     <cu-custom :isBack="false"></cu-custom>
5 5
     <view class="header" :style="[{top:topHeader + 'px'}]">
6
-			 <view class="header-box flex justify-end">
7
-						<view class="header-title">
8
-							<view class="header-title-main">
9
-									<view class="margin-bottom-xs">选课</view>
10
-									<view class="point"></view>
11
-							</view>
12
-						</view>
13
-						<view class="header-search flex-sub">
14
-							 <view class="flex justify-between">
15
-								 	<input type="text" v-model="params.course_name" class="header-search-input flex-sub" placeholder="搜索课程" @confirm="search">
16
-							 		<text class="cuIcon-search text-gray header-search-icon" @tap="search"></text>
17
-							 </view>
18
-						</view>
19
-			 </view>
20
-		</view>
21
-		<scroll-view :scroll-y="true" :refresher-enabled="true" class="scroll-main"
22
-		:refresher-triggered="triggered"
23
-		:style="[{height:'calc(100vh - 102px - '+ topHeader+'px)'}]"
24
-		@refresherrefresh="onRefresh" @scrolltolower="loadMore">
25
-			<view class="main">
26
-				<view class="main-title">活动和餐饮</view>
27
-				<view class="flex justify-around course">
28
-					<course v-for="(item,index) in courses" :key="index"
29
-					@tap="goCourse(item.type)"
30
-					:course="item" class="course-item flex-sub margin-xs"></course>
31
-				</view>
32
-				<view class="main-title margin-top-xs">一键报班</view>
33
-				<view class="apply-class flex">
34
-					<image mode="widthFix"  @tap="goGift" src="/static/imgs/index/baoban.png" class="flex-sub apply-class-img margin-xs"/>
35
-				</view>
36
-				<view class="recommend margin-top-xs">
37
-					<view class="recommend-title">推荐课程</view>
38
-					<view class="recommend-filter margin-top-xs flex">
39
-							<view class="filter-item text-center flex-sub" @tap="sort('home')" :class="{'text-sort':sortCur==='home'}">综合</view>
40
-							<view class="filter-item text-center flex-sub" @tap="sort('sales')" :class="{'text-sort':sortCur==='sales'}">销量
41
-								<image mode="widthFix" class="sort-icon" :src="sortCur==='sales'?(sortItem.sales===0?sortIcons.up:sortIcons.down):sortIcons.no"></image>
42
-							</view>
43
-							<view class="filter-item text-center flex-sub" @tap="sort('money')" :class="{'text-sort':sortCur==='money'}">价格
44
-								<image mode="widthFix" class="sort-icon" :src="sortCur==='money'?(sortItem.money===0?sortIcons.up:sortIcons.down):sortIcons.no"></image>
45
-							</view>
46
-							<view class="filter-item text-center flex-sub">{{grade_now}}</view>
47
-							<view class="filter-item text-right flex-sub" @tap="showModal" data-target="FilterModal">筛选
48
-								<text class="cuIcon-filter text-gray"></text>
49
-							</view>
50
-					</view>
51
-					<view class="list">
52
-							<view class="cu-card" v-for="(item,index) in list" :key="index">
53
-								<view class="cu-item">
54
-									<card :item="item"></card>
55
-								</view>
56
-							</view>
57
-					</view>
58
-				</view>
59
-			</view>
60
-		</scroll-view>
6
+      <view class="header-box flex justify-end">
7
+        <view class="header-title">
8
+          <view class="header-title-main">
9
+            <view class="margin-bottom-xs">选课</view>
10
+            <view class="point"></view>
11
+          </view>
12
+        </view>
13
+        <view class="header-search flex-sub">
14
+          <view class="flex justify-between">
15
+            <input type="text" v-model="params.course_name" class="header-search-input flex-sub" placeholder="搜索课程"
16
+              @confirm="search">
17
+            <text class="cuIcon-search text-gray header-search-icon" @tap="search"></text>
18
+          </view>
19
+        </view>
20
+      </view>
21
+    </view>
22
+    <scroll-view :scroll-y="true" :refresher-enabled="true" class="scroll-main" :refresher-triggered="triggered"
23
+      :style="[{height:'calc(100vh - 102px - '+ topHeader+'px)'}]" @refresherrefresh="onRefresh"
24
+      @scrolltolower="loadMore">
25
+      <view class="main">
26
+        <view class="main-title">活动和餐饮</view>
27
+        <view class="flex justify-around course">
28
+          <course v-for="(item,index) in courses" :key="index" @tap="goCourse(item.type)" :course="item"
29
+            class="course-item flex-sub margin-xs"></course>
30
+        </view>
31
+        <view class="main-title margin-top-xs">一键报班</view>
32
+        <view class="apply-class flex">
33
+          <image mode="widthFix" @tap="goGift" src="/static/imgs/index/baoban.png"
34
+            class="flex-sub apply-class-img margin-xs" />
35
+        </view>
36
+        <view class="recommend margin-top-xs">
37
+          <view class="recommend-title">推荐课程</view>
38
+          <view class="recommend-filter margin-top-xs flex">
39
+            <view class="filter-item text-center flex-sub" @tap="sort('home')" :class="{'text-sort':sortCur==='home'}">
40
+              综合</view>
41
+            <view class="filter-item text-center flex-sub" @tap="sort('sales')"
42
+              :class="{'text-sort':sortCur==='sales'}">销量
43
+              <image mode="widthFix" class="sort-icon"
44
+                :src="sortCur==='sales'?(sortItem.sales===0?sortIcons.up:sortIcons.down):sortIcons.no"></image>
45
+            </view>
46
+            <view class="filter-item text-center flex-sub" @tap="sort('money')"
47
+              :class="{'text-sort':sortCur==='money'}">价格
48
+              <image mode="widthFix" class="sort-icon"
49
+                :src="sortCur==='money'?(sortItem.money===0?sortIcons.up:sortIcons.down):sortIcons.no"></image>
50
+            </view>
51
+            <view class="filter-item text-center flex-sub">{{grade_now}}</view>
52
+            <view class="filter-item text-right flex-sub" @tap="showModal" data-target="FilterModal">筛选
53
+              <text class="cuIcon-filter text-gray"></text>
54
+            </view>
55
+          </view>
56
+          <view class="list">
57
+            <view class="cu-card" v-for="(item,index) in list" :key="index">
58
+              <view class="cu-item">
59
+                <card :item="item"></card>
60
+              </view>
61
+            </view>
62
+          </view>
63
+        </view>
64
+      </view>
65
+    </scroll-view>
61 66
     <view class="cu-modal drawer-modal justify-end" :class="modalName=='FilterModal'?'show':''" @tap="hideModal">
62 67
       <view class="cu-dialog basis-lg" @tap.stop=""
63 68
         :style="[{top:topHeader+'px',height:'calc(100vh - ' + topHeader + 'px)'}]">
64
-					<view class="filter-title">机构筛选</view>
65
-				  <view class="btn-check-group padding-lr">
66
-						<!-- <checkbox-group @change="checkboxChange" class="flex" style="flex-wrap: wrap;" id="agency">
69
+        <view class="filter-title">机构筛选</view>
70
+        <view class="btn-check-group padding-lr">
71
+          <!-- <checkbox-group @change="checkboxChange" class="flex" style="flex-wrap: wrap;" id="agency">
67 72
 							<label class="btn-check-label margin-top-sm padding-lr-xs text-sm text-ellipsis" :class="{'bg-cyan':params.agency.includes(item.id+'')}"
68 73
 								v-for="item in filters.agency" :key="item.id">
69 74
 								<checkbox :value="item.id"/>
70 75
 								{{item.name}}
71 76
 							</label>
72 77
 						</checkbox-group> -->
73
-						<radio-group  class="flex" style="flex-wrap: wrap;" id="agency">
74
-								<label class="btn-check-label margin-top-sm padding-lr-xs text-sm text-ellipsis" :class="{'bg-cyan':params.agency.includes(item.id)}"
75
-									v-for="item in filters.agency" :key="item.id" @tap="radioChange('agency',item.id)">
76
-									<radio :value="item.id"/>
77
-									{{item.name}}
78
-								</label>
79
-						</radio-group>
80
-        	</view>
81
-					<view class="filter-title">分类筛选</view>
82
-					<view class="btn-check-group padding-lr">
83
-						<radio-group  class="flex" style="flex-wrap: wrap;" id="category">
84
-								<label class="btn-check-label margin-top-sm padding-lr-xs text-sm text-ellipsis" :class="{'bg-cyan':params.category.includes(item.id)}"
85
-									v-for="item in filters.category" :key="item.id" @tap="radioChange('category',item.id)">
86
-									<radio :value="item.id"/>
87
-									{{item.name}}
88
-								</label>
89
-						</radio-group>
90
-        	</view>
91
-					<view class="filter-title">周期筛选</view>
92
-					<view class="btn-check-group padding-lr">
93
-						<!-- <checkbox-group @change="checkboxChange" class="flex" style="flex-wrap: wrap;" id="day">
78
+          <radio-group class="flex" style="flex-wrap: wrap;" id="agency">
79
+            <label class="btn-check-label margin-top-sm padding-lr-xs text-sm text-ellipsis"
80
+              :class="{'bg-cyan':params.agency.includes(item.id)}" v-for="item in filters.agency" :key="item.id"
81
+              @tap="radioChange('agency',item.id)">
82
+              <radio :value="item.id" />
83
+              {{item.name}}
84
+            </label>
85
+          </radio-group>
86
+        </view>
87
+        <view class="filter-title">分类筛选</view>
88
+        <view class="btn-check-group padding-lr">
89
+          <radio-group class="flex" style="flex-wrap: wrap;" id="category">
90
+            <label class="btn-check-label margin-top-sm padding-lr-xs text-sm text-ellipsis"
91
+              :class="{'bg-cyan':params.category.includes(item.id)}" v-for="item in filters.category" :key="item.id"
92
+              @tap="radioChange('category',item.id)">
93
+              <radio :value="item.id" />
94
+              {{item.name}}
95
+            </label>
96
+          </radio-group>
97
+        </view>
98
+        <view class="filter-title">周期筛选</view>
99
+        <view class="btn-check-group padding-lr">
100
+          <!-- <checkbox-group @change="checkboxChange" class="flex" style="flex-wrap: wrap;" id="day">
94 101
 							<label class="btn-check-label margin-top-sm padding-lr-xs text-sm" :class="{'bg-cyan':params.day.includes(index+'')}"
95 102
 								v-for="(item,index) in filters.week" :key="index">
96 103
 								<checkbox :value="index"/>
97 104
 								{{item}}
98 105
 							</label>
99 106
 						</checkbox-group> -->
100
-						<radio-group  class="flex" style="flex-wrap: wrap;" id="day">
101
-								<label class="btn-check-label margin-top-sm padding-lr-xs text-sm" :class="{'bg-cyan':params.day.includes(index+'')}"
102
-									v-for="(item,index) in filters.week" :key="index" @tap="radioChange('day',index)">
103
-									<radio :value="index"/>
104
-									{{item}}
105
-								</label>
106
-						</radio-group>
107
-        	</view>
108
-					<view class="filter-title">价格区间(元)</view>
109
-					<view class="btn-check-group padding-lr">
110
-						<radio-group  class="flex" style="flex-wrap: wrap;" id="price">
111
-							<label class="btn-check-label margin-top-sm padding-lr-xs text-sm" :class="{'bg-cyan':params.price===item.name}"
112
-								 v-for="item in filters.price_list" :key="item.id" @tap="radioChange('price',item.name)">
113
-								<radio :value="item.name"/>
114
-								{{item.name}}
115
-							</label>
116
-						</radio-group>
117
-        	</view>
118
-					<view class="padding-lr">
119
-							<button class="check-course cu-btn bg-cyan margin-tb-sm button-hover" @tap="check_course">确定</button>
120
-					</view>
107
+          <radio-group class="flex" style="flex-wrap: wrap;" id="day">
108
+            <label class="btn-check-label margin-top-sm padding-lr-xs text-sm"
109
+              :class="{'bg-cyan':params.day.includes(index+'')}" v-for="(item,index) in filters.week" :key="index"
110
+              @tap="radioChange('day',index)">
111
+              <radio :value="index" />
112
+              {{item}}
113
+            </label>
114
+          </radio-group>
115
+        </view>
116
+        <view class="filter-title">价格区间(元)</view>
117
+        <view class="btn-check-group padding-lr">
118
+          <radio-group class="flex" style="flex-wrap: wrap;" id="price">
119
+            <label class="btn-check-label margin-top-sm padding-lr-xs text-sm"
120
+              :class="{'bg-cyan':params.price===item.name}" v-for="item in filters.price_list" :key="item.id"
121
+              @tap="radioChange('price',item.name)">
122
+              <radio :value="item.name" />
123
+              {{item.name}}
124
+            </label>
125
+          </radio-group>
126
+        </view>
127
+        <view class="padding-lr">
128
+          <button class="check-course cu-btn bg-cyan margin-tb-sm button-hover" @tap="check_course">确定</button>
129
+        </view>
121 130
       </view>
122 131
     </view>
123 132
     <mp-tabbar :outerSelected="0" />
@@ -210,7 +219,7 @@ export default {
210 219
       'kid', 'token'
211 220
     ])
212 221
   },
213
-  onShow() {
222
+  onShow () {
214 223
     // 登录后才进入后续操作
215 224
     this.checkLogin().then(res => {
216 225
       if (res) {
@@ -223,7 +232,7 @@ export default {
223 232
     })
224 233
   },
225 234
   methods: {
226
-    checkLogin() {
235
+    checkLogin () {
227 236
       return new Promise((resolve, reject) => {
228 237
         if (this.token) { // 跳转至登录页
229 238
           resolve(true)
@@ -241,11 +250,11 @@ export default {
241 250
         }
242 251
       })
243 252
     },
244
-    goCourse(type) {
253
+    goCourse (type) {
245 254
       this.params.list_type = type
246 255
       this.search()
247 256
     },
248
-    loadFilter() { // 加载筛选项
257
+    loadFilter () { // 加载筛选项
249 258
       const params = {}
250 259
       _filter(params).then(res => {
251 260
         this.filters = res.data
@@ -259,7 +268,7 @@ export default {
259 268
     hideModal (e) {
260 269
       this.modalName = null
261 270
     },
262
-    radioChange(type, v) {
271
+    radioChange (type, v) {
263 272
       switch (type) {
264 273
         case 'agency':
265 274
           this.params.agency = this.params.agency[0] === v ? [] : [v]
@@ -277,7 +286,7 @@ export default {
277 286
           console.log('error')
278 287
       }
279 288
     },
280
-    checkboxChange(e) {
289
+    checkboxChange (e) {
281 290
       const type = e.target.id
282 291
       const values = e.detail.value
283 292
       switch (type) {
@@ -294,16 +303,16 @@ export default {
294 303
           console.log('error')
295 304
       }
296 305
     },
297
-    search() { // 搜索课程
306
+    search () { // 搜索课程
298 307
       this.params.page_num = 1
299 308
       this.get_list()
300 309
     },
301
-    check_course() { // 筛选课程
310
+    check_course () { // 筛选课程
302 311
       this.params.page_num = 1
303 312
       this.get_list()
304 313
       this.hideModal()
305 314
     },
306
-    onRefresh() { // 下拉刷新
315
+    onRefresh () { // 下拉刷新
307 316
       this.triggered = true
308 317
       this.params.page_num = 1
309 318
       this.params.list_type = 0
@@ -312,7 +321,7 @@ export default {
312 321
         this.triggered = false
313 322
       }, 1000)
314 323
     },
315
-    loadMore() {
324
+    loadMore () {
316 325
       if (this.noMore) {
317 326
         uni.showToast({ title: '暂无更多课程数据', icon: 'none' })
318 327
         return false
@@ -320,7 +329,7 @@ export default {
320 329
       this.params.page_num++
321 330
       this.get_list()
322 331
     },
323
-    sort(type) { // 排序搜索
332
+    sort (type) { // 排序搜索
324 333
       const sorts = {
325 334
         home: 0,
326 335
         sales: 0,
@@ -338,7 +347,7 @@ export default {
338 347
       this.params.page_num = 1
339 348
       this.get_list()
340 349
     },
341
-    get_list(init = false) {
350
+    get_list (init = false) {
342 351
       let params = deepClone(this.params)
343 352
       params = filterParams(params)
344 353
       if (params.day.length > 0) {
@@ -371,7 +380,7 @@ export default {
371 380
         if (init) this.loadFilter()
372 381
       })
373 382
     },
374
-    goGift() {
383
+    goGift () {
375 384
       this.globalNavigateTo('classGift', { package_id: 0 })
376 385
     }
377 386
   }
@@ -380,102 +389,101 @@ export default {
380 389
 
381 390
 <style lang="scss">
382 391
 @import '~@/common/css/mixin.scss';
383
-.page{
384
- height:100vh;
392
+.page {
393
+  height: 100vh;
385 394
 }
386
-.scroll-main{
387
-	margin-top:54px;
395
+.scroll-main {
396
+  margin-top: 54px;
388 397
 }
389
-.header{
390
-	position:fixed;
391
-	height:54px;
392
-	left:0;
393
-	right:0;
394
-	z-index:999;
395
-	padding:20rpx;
396
-	background:#fff;
397
-	&-box{
398
-		align-items: center;
399
-	}
400
-	&-search{
401
-		margin-left:60rpx;
402
-		align-items: center;
403
-		&-input{
404
-			background: #ededed;
405
-    	border-radius: 999em;
406
-			padding-left:30rpx;
407
-      line-height:32px;
408
-			height:32px;
409
-    	font-size: 14px;
410
-		}
411
-		&-icon{
412
-			margin:0 30rpx;
413
-			line-height:32px;
414
-			font-size:24px;
415
-		}
416
-	}
398
+.header {
399
+  position: fixed;
400
+  height: 54px;
401
+  left: 0;
402
+  right: 0;
403
+  z-index: 999;
404
+  padding: 20rpx;
405
+  background: #fff;
406
+  &-box {
407
+    align-items: center;
408
+  }
409
+  &-search {
410
+    margin-left: 60rpx;
411
+    align-items: center;
412
+    &-input {
413
+      background: #ededed;
414
+      border-radius: 999em;
415
+      padding-left: 30rpx;
416
+      line-height: 32px;
417
+      height: 32px;
418
+      font-size: 14px;
419
+    }
420
+    &-icon {
421
+      margin: 0 30rpx;
422
+      line-height: 32px;
423
+      font-size: 24px;
424
+    }
425
+  }
417 426
 }
418
-.main{
419
-	padding:20rpx;
420
-
427
+.main {
428
+  padding: 20rpx;
421 429
 }
422
-.main-title{
430
+.main-title {
423 431
   font-size: 12px;
424 432
   margin-bottom: 10px;
425 433
   color: #999;
426 434
 }
427
-.search-box{
428
-	margin-left:20rpx;
435
+.search-box {
436
+  margin-left: 20rpx;
429 437
 }
430
-.course-item{
438
+.course-item {
431 439
   border-radius: 10px;
432 440
   color: #fff;
433 441
 }
434
-.recommend{
435
-	&-title{
436
-		@include title(10px,18px);
437
-	}
438
-	&-filter{
439
-		.filter-item{
440
-			position:relative;
441
-		}
442
-	}
443
-	.sort-icon{
444
-		margin-left:6rpx;
445
-		width:15rpx;
446
-	}
442
+.recommend {
443
+  &-title {
444
+    @include title(10px, 18px);
445
+  }
446
+  &-filter {
447
+    .filter-item {
448
+      position: relative;
449
+    }
450
+  }
451
+  .sort-icon {
452
+    margin-left: 6rpx;
453
+    width: 15rpx;
454
+  }
447 455
 }
448 456
 .btn-check-group {
449 457
   checkbox {
450 458
     display: none;
451 459
   }
452
-	radio{
453
-		display:none;
454
-	}
460
+  radio {
461
+    display: none;
462
+  }
455 463
   label {
456 464
     display: inline-block;
457
-		margin-right:10rpx;
465
+    margin-right: 10rpx;
458 466
     position: relative;
459
-		padding:0 20rpx;
467
+    padding: 0 20rpx;
460 468
     line-height: 30px;
461 469
     border-radius: 100rpx;
462 470
     flex-wrap: nowrap;
463 471
     border: 1px solid #eee;
464 472
   }
465 473
 }
466
-.filter-title{
467
-	padding-left:30rpx;
468
-	margin-top:10px;
469
-	text-align:left;
470
-	@include title(0,14px)
474
+.filter-title {
475
+  padding-left: 30rpx;
476
+  margin-top: 10px;
477
+  text-align: left;
478
+  @include title(0, 14px);
471 479
 }
472
-.check-course{
473
-	width:100%;
480
+.check-course {
481
+  width: 100%;
474 482
 }
475
-.cu-modal.drawer-modal .cu-dialog{
476
-	min-width:300rpx;
483
+.cu-modal.drawer-modal .cu-dialog {
484
+  min-width: 300rpx;
477 485
 }
478
-.cu-card>.cu-item{
479
-	margin:10rpx;
486
+.cu-card > .cu-item {
487
+  margin: 10rpx;
480 488
 }
481 489
 </style>

+ 46 - 46
src/pages/login/index.vue

@@ -1,41 +1,41 @@
1 1
 <template>
2
-	<view class="page">
3
-		<cu-custom :isBack="false" :isHome="true">
4
-		</cu-custom>
5
-		<view class="main">
6
-			<image src="/static/imgs/login.png" class="logo"></image>
7
-			<view class="title">课后百科</view>
8
-			<view class="action margin-top-xl">
9
-						<view class="des margin-top">您尚未登录需要获取您的授权后进入</view>
10
-			      <!-- <button class="cu-btn block round bg-grey lg margin-top" @tap="back">暂不登录</button> -->
11
-			      <button class="cu-btn block round bg-cyan lg margin-top" @tap="login">立即登录</button>
12
-						<view class="margin-top text-cyan lh-30" @tap="back">暂不登录</view>
13
-			</view>
14
-			<view class="agreement margin-top-lg">
15
-				<checkbox-group @change="agreement=!agreement" style="display:inline-block;">
16
-					<label>
17
-							<checkbox class="cyan check-agreement"></checkbox>
18
-							<text class="text">阅读并同意以下条款</text>
19
-					</label>
2
+  <view class="page">
3
+    <cu-custom :isBack="false" :isHome="true">
4
+    </cu-custom>
5
+    <view class="main">
6
+      <image src="/static/imgs/login.png" class="logo"></image>
7
+      <view class="title">课后百科</view>
8
+      <view class="action margin-top-xl">
9
+        <view class="des margin-top">您尚未登录需要获取您的授权后进入</view>
10
+        <!-- <button class="cu-btn block round bg-grey lg margin-top" @tap="back">暂不登录</button> -->
11
+        <button class="cu-btn block round bg-cyan lg margin-top" @tap="login">立即登录</button>
12
+        <view class="margin-top text-cyan lh-30" @tap="back">暂不登录</view>
13
+      </view>
14
+      <view class="agreement margin-top-lg">
15
+        <checkbox-group @change="agreement=!agreement" style="display:inline-block;">
16
+          <label>
17
+            <checkbox class="cyan check-agreement"></checkbox>
18
+            <text class="text">阅读并同意以下条款</text>
19
+          </label>
20 20
         </checkbox-group>
21
-				<text class="text-cyan"  @tap="goto('user')">《用户协议》</text>
22
-				<text class="text-cyan" @tap="goto('privacy')">《隐私政策》</text>
23
-			</view>
24
-		</view>
25
-	</view>
21
+        <text class="text-cyan" @tap="goto('user')">《用户协议》</text>
22
+        <text class="text-cyan" @tap="goto('privacy')">《隐私政策》</text>
23
+      </view>
24
+    </view>
25
+  </view>
26 26
 </template>
27 27
 
28 28
 <script>
29 29
 import { _login, _auth, _getBindPhone } from '@/api/auth'
30 30
 import socket from '@/common/webSocket'
31 31
 export default {
32
-  data() {
32
+  data () {
33 33
     return {
34 34
       agreement: false,
35 35
       wxCode: ''
36 36
     }
37 37
   },
38
-  onLoad(options) {
38
+  onLoad (options) {
39 39
     uni.login({
40 40
       success: wxres => {
41 41
         this.wxCode = wxres.code
@@ -43,15 +43,15 @@ export default {
43 43
     })
44 44
   },
45 45
   methods: {
46
-    back() {
46
+    back () {
47 47
       uni.navigateBack({
48 48
         delta: 0
49 49
       })
50 50
     },
51
-    goto(type) {
51
+    goto (type) {
52 52
       this.globalNavigateTo('agreement', { type })
53 53
     },
54
-    login() {
54
+    login () {
55 55
       if (!this.agreement) {
56 56
         uni.showToast({ title: '请先阅读并勾选协议', icon: 'none' })
57 57
         return
@@ -64,7 +64,7 @@ export default {
64 64
         }
65 65
       })
66 66
     },
67
-    flashToken(wxConfig) {
67
+    flashToken (wxConfig) {
68 68
       _login({ code: this.wxCode }).then(res => {
69 69
         const { openid, session_key: session } = res.data
70 70
         this.$store.dispatch('setSession', session)
@@ -84,7 +84,7 @@ export default {
84 84
         })
85 85
       })
86 86
     },
87
-    getBindPhone() {
87
+    getBindPhone () {
88 88
       _getBindPhone().then(res => {
89 89
         this.$store.dispatch('setPhone', res.data.mobile)
90 90
       })
@@ -95,28 +95,28 @@ export default {
95 95
 
96 96
 <style lang="scss" scoped>
97 97
 @import '~@/common/css/mixin.scss';
98
-.page{
99
-	background-color:#fff;
98
+.page {
99
+  background-color: #fff;
100 100
 }
101
-.main{
102
-	padding-top:50px;
103
-	text-align:center;
101
+.main {
102
+  padding-top: 50px;
103
+  text-align: center;
104 104
 }
105 105
 .title {
106
-	margin:12px auto;
106
+  margin: 12px auto;
107 107
   @include title(32px, 20px);
108
-	width:80px;
109
-	border-bottom:4px solid #00d2e330;
108
+  width: 80px;
109
+  border-bottom: 4px solid #00d2e330;
110 110
 }
111
-.logo{
112
-	width:100px;
113
-	height:100px;
111
+.logo {
112
+  width: 100px;
113
+  height: 100px;
114 114
 }
115
-.action{
116
-	margin:0 auto;
117
-	width:80%;
115
+.action {
116
+  margin: 0 auto;
117
+  width: 80%;
118 118
 }
119
-.check-agreement{
120
-	transform: scale(0.7);
119
+.check-agreement {
120
+  transform: scale(0.7);
121 121
 }
122 122
 </style>

+ 102 - 102
src/pages/mine/changePhone.vue

@@ -1,102 +1,102 @@
1
-<template>
2
-	<view class="page">
3
-		<cu-custom :isBack="true" title="修改手机">
4
-		</cu-custom>
5
-		<form>
6
-			<view class="cu-form-group margin-top-sm">
7
-				<input placeholder="请输入手机号" v-model="form.user_phone" @input="changePhone"/>
8
-        <text class="text-cyan" :class="{'text-gray':disableSendMsgBtn}" :disabled="disableSendMsgBtn"
9
-            @tap="getCode">{{sendMsg}}</text>
10
-			</view>
11
-			 <view class="cu-form-group">
12
-				<input placeholder="请输入验证码"  v-model="form.captcha"/>
13
-			</view>
14
-			<view class="solids-bottom radius bg-student text-center padding text-white margin-top" @tap="save">
15
-					保存
16
-			</view>
17
-		</form>
18
-	</view>
19
-</template>
20
-
21
-<script>
22
-import { _changePhone, _getCode } from '@/api/auth'
23
-import validate from '@/common/utils/ys-validate'
24
-export default {
25
-  data() {
26
-    return {
27
-      sendTime: 60,
28
-      disableSendMsgBtn: true,
29
-      sendMsg: '获取验证码',
30
-      leftTime: 0, // 倒计时
31
-      form: {
32
-        user_phone: '',
33
-        captcha: ''
34
-      },
35
-      rules: [
36
-        { name: 'user_phone', required: true, type: 'phone', errmsg: '请输入正确手机号' },
37
-        { name: 'captcha', required: true, type: 'number', errmsg: '请输入正确的验证码' }
38
-      ]
39
-    }
40
-  },
41
-  methods: {
42
-    save() {
43
-      const validRes = validate.validate(this.form, this.rules)
44
-      if (!validRes.isOk) {
45
-        uni.showToast({
46
-          icon: 'none',
47
-          title: validRes.errmsg
48
-        })
49
-        return false
50
-      }
51
-      _changePhone(this.form).then(res => {
52
-        this.$store.dispatch('setToken', res.data.token)
53
-        uni.showToast({ title: '保存成功', icon: 'success' })
54
-        setTimeout(() => {
55
-          uni.navigateBack()
56
-        }, 800)
57
-      })
58
-    },
59
-    changePhone(e) {
60
-      if (/^[1]([3-9])[0-9]{9}$/.test(e.detail.value)) {
61
-        this.disableSendMsgBtn = false
62
-      } else {
63
-        this.disableSendMsgBtn = true
64
-      }
65
-    },
66
-    getCode() {
67
-      if (!this.disableSendMsgBtn) {
68
-        this.leftTime = this.sendTime
69
-        this.timing(this.leftTime)
70
-        _getCode({ phone: this.form.user_phone }).then(res => {
71
-          uni.showToast({
72
-            title: '验证码发送成功! 请注意查收!',
73
-            duration: 3000
74
-          })
75
-        })
76
-      }
77
-    },
78
-    timing () {
79
-      this.disableSendMsgBtn = true
80
-      const temSendMsgText = this.sendMsg
81
-      this.sendMsg = this.leftTime + '秒后重试'
82
-      this.timeInterval = setInterval(() => {
83
-        this.leftTime--
84
-        this.sendMsg = this.leftTime + '秒后重试'
85
-        if (this.leftTime <= 0) {
86
-          this.sendMsg = temSendMsgText
87
-          clearInterval(this.timeInterval)
88
-          if (/^[1]([3-9])[0-9]{9}$/.test(this.form.phone)) {
89
-            this.disableSendMsgBtn = false
90
-          }
91
-        }
92
-      }, 1000)
93
-    }
94
-  }
95
-}
96
-</script>
97
-
98
-<style lang="scss" scoped>
99
-.page{
100
-	height:100vh;
101
-}
102
-</style>
1
+<template>
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="修改手机">
4
+    </cu-custom>
5
+    <form>
6
+      <view class="cu-form-group margin-top-sm">
7
+        <input placeholder="请输入手机号" v-model="form.user_phone" @input="changePhone" />
8
+        <text class="text-cyan" :class="{'text-gray':disableSendMsgBtn}" :disabled="disableSendMsgBtn"
9
+          @tap="getCode">{{sendMsg}}</text>
10
+      </view>
11
+      <view class="cu-form-group">
12
+        <input placeholder="请输入验证码" v-model="form.captcha" />
13
+      </view>
14
+      <view class="solids-bottom radius bg-student text-center padding text-white margin-top" @tap="save">
15
+        保存
16
+      </view>
17
+    </form>
18
+  </view>
19
+</template>
20
+
21
+<script>
22
+import { _changePhone, _getCode } from '@/api/auth'
23
+import validate from '@/common/utils/ys-validate'
24
+export default {
25
+  data () {
26
+    return {
27
+      sendTime: 60,
28
+      disableSendMsgBtn: true,
29
+      sendMsg: '获取验证码',
30
+      leftTime: 0, // 倒计时
31
+      form: {
32
+        user_phone: '',
33
+        captcha: ''
34
+      },
35
+      rules: [
36
+        { name: 'user_phone', required: true, type: 'phone', errmsg: '请输入正确手机号' },
37
+        { name: 'captcha', required: true, type: 'number', errmsg: '请输入正确的验证码' }
38
+      ]
39
+    }
40
+  },
41
+  methods: {
42
+    save () {
43
+      const validRes = validate.validate(this.form, this.rules)
44
+      if (!validRes.isOk) {
45
+        uni.showToast({
46
+          icon: 'none',
47
+          title: validRes.errmsg
48
+        })
49
+        return false
50
+      }
51
+      _changePhone(this.form).then(res => {
52
+        this.$store.dispatch('setToken', res.data.token)
53
+        uni.showToast({ title: '保存成功', icon: 'success' })
54
+        setTimeout(() => {
55
+          uni.navigateBack()
56
+        }, 800)
57
+      })
58
+    },
59
+    changePhone (e) {
60
+      if (/^[1]([3-9])[0-9]{9}$/.test(e.detail.value)) {
61
+        this.disableSendMsgBtn = false
62
+      } else {
63
+        this.disableSendMsgBtn = true
64
+      }
65
+    },
66
+    getCode () {
67
+      if (!this.disableSendMsgBtn) {
68
+        this.leftTime = this.sendTime
69
+        this.timing(this.leftTime)
70
+        _getCode({ phone: this.form.user_phone }).then(res => {
71
+          uni.showToast({
72
+            title: '验证码发送成功! 请注意查收!',
73
+            duration: 3000
74
+          })
75
+        })
76
+      }
77
+    },
78
+    timing () {
79
+      this.disableSendMsgBtn = true
80
+      const temSendMsgText = this.sendMsg
81
+      this.sendMsg = this.leftTime + '秒后重试'
82
+      this.timeInterval = setInterval(() => {
83
+        this.leftTime--
84
+        this.sendMsg = this.leftTime + '秒后重试'
85
+        if (this.leftTime <= 0) {
86
+          this.sendMsg = temSendMsgText
87
+          clearInterval(this.timeInterval)
88
+          if (/^[1]([3-9])[0-9]{9}$/.test(this.form.phone)) {
89
+            this.disableSendMsgBtn = false
90
+          }
91
+        }
92
+      }, 1000)
93
+    }
94
+  }
95
+}
96
+</script>
97
+
98
+<style lang="scss" scoped>
99
+.page {
100
+  height: 100vh;
101
+}
102
+</style>

+ 58 - 58
src/pages/mine/institution.vue

@@ -1,58 +1,58 @@
1
-<template>
2
-	<view class="page">
3
-		<cu-custom :isBack="true" title="我的机构">
4
-		</cu-custom>
5
-		<scroll-view scroll-x="false" scroll-y="true" :style="'height:calc(100vh -'+topHeader+'px)'">
6
-			<view class="cu-card" v-for="ins in list" :key="ins.id">
7
-				<view class="cu-item shadow">
8
-						<view class="image card-img">
9
-							<image src="/static/imgs/mine/teacher4.png" mode="widthFix" style="width:100%;"></image>
10
-							<view class="flex card-main align-center">
11
-								<image mode="scaleToFill" :src="ins.image||defaultAvatar" class="avatar md"></image>
12
-								 <view class="text-xl text-white margin-left-sm">{{ins.name}}</view>
13
-							</view>
14
-						</view>
15
-					  <rich-text :nodes="ins.content"></rich-text>
16
-				</view>
17
-			</view>
18
-		</scroll-view>
19
-	</view>
20
-</template>
21
-
22
-<script>
23
-import { _getInstitution } from '@/api/auth'
24
-export default {
25
-  data() {
26
-    return {
27
-      topHeader: this.globalCustomBarHeight,
28
-      list: [],
29
-      defaultAvatar: 'http://parent.kehoubaike.com/static/img/7f4e775d2e04234d1e1994b13146f6b.e5c47f3.png'
30
-    }
31
-  },
32
-  onLoad() {
33
-    this.get_list()
34
-  },
35
-  methods: {
36
-    get_list() {
37
-      _getInstitution().then(res => {
38
-        this.list = res.data.edu_agency_data
39
-      })
40
-    }
41
-  }
42
-}
43
-</script>
44
-
45
-<style lang="scss" scoped>
46
-.page{
47
-	height:100vh;
48
-	background-color:#fff;
49
-}
50
-.card-img{
51
-	position:relative;
52
-}
53
-.card-main{
54
-	position:absolute;
55
-	top:20rpx;
56
-	left:20rpx;
57
-}
58
-</style>
1
+<template>
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="我的机构">
4
+    </cu-custom>
5
+    <scroll-view scroll-x="false" scroll-y="true" :style="'height:calc(100vh -'+topHeader+'px)'">
6
+      <view class="cu-card" v-for="ins in list" :key="ins.id">
7
+        <view class="cu-item shadow">
8
+          <view class="image card-img">
9
+            <image src="/static/imgs/mine/teacher4.png" mode="widthFix" style="width:100%;"></image>
10
+            <view class="flex card-main align-center">
11
+              <image mode="scaleToFill" :src="ins.image||defaultAvatar" class="avatar md"></image>
12
+              <view class="text-xl text-white margin-left-sm">{{ins.name}}</view>
13
+            </view>
14
+          </view>
15
+          <rich-text :nodes="ins.content"></rich-text>
16
+        </view>
17
+      </view>
18
+    </scroll-view>
19
+  </view>
20
+</template>
21
+
22
+<script>
23
+import { _getInstitution } from '@/api/auth'
24
+export default {
25
+  data () {
26
+    return {
27
+      topHeader: this.globalCustomBarHeight,
28
+      list: [],
29
+      defaultAvatar: 'http://parent.kehoubaike.com/static/img/7f4e775d2e04234d1e1994b13146f6b.e5c47f3.png'
30
+    }
31
+  },
32
+  onLoad () {
33
+    this.get_list()
34
+  },
35
+  methods: {
36
+    get_list () {
37
+      _getInstitution().then(res => {
38
+        this.list = res.data.edu_agency_data
39
+      })
40
+    }
41
+  }
42
+}
43
+</script>
44
+
45
+<style lang="scss" scoped>
46
+.page {
47
+  height: 100vh;
48
+  background-color: #fff;
49
+}
50
+.card-img {
51
+  position: relative;
52
+}
53
+.card-main {
54
+  position: absolute;
55
+  top: 20rpx;
56
+  left: 20rpx;
57
+}
58
+</style>

+ 41 - 41
src/pages/mine/message.vue

@@ -1,40 +1,40 @@
1 1
 <template>
2
-	<view class="page">
3
-		<cu-custom :isBack="true" title="消息中心"></cu-custom>
4
-		<view class="cu-list box-shadow menu">
5
-		  <view class="cu-item arrow margin-top-xs" v-for="message in list" :key="message.id">
6
-					<text class="cuIcon-notice lg text-gray" style="font-size:18px;"></text>
7
-        	<view class="content margin-left-sm">
8
-						<view>系统通知</view>
9
-          	<text class="text-black">{{message.title}}</text>
10
-        	</view>
11
-			</view>
12
-			<view class="cu-item arrow margin-top-xs" @tap="report">
13
-					<text class="cuIcon-notice lg text-gray" style="font-size:18px;"></text>
14
-        	<view class="content margin-left-sm">
15
-          	<text class="text-black">学生综合素质报告</text>
16
-        	</view>
17
-			</view>
18
-		</view>
19
-	</view>
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="消息中心"></cu-custom>
4
+    <view class="cu-list box-shadow menu">
5
+      <view class="cu-item arrow margin-top-xs" v-for="message in list" :key="message.id">
6
+        <text class="cuIcon-notice lg text-gray" style="font-size:18px;"></text>
7
+        <view class="content margin-left-sm">
8
+          <view>系统通知</view>
9
+          <text class="text-black">{{message.title}}</text>
10
+        </view>
11
+      </view>
12
+      <view class="cu-item arrow margin-top-xs" @tap="report">
13
+        <text class="cuIcon-notice lg text-gray" style="font-size:18px;"></text>
14
+        <view class="content margin-left-sm">
15
+          <text class="text-black">学生综合素质报告</text>
16
+        </view>
17
+      </view>
18
+    </view>
19
+  </view>
20 20
 </template>
21 21
 
22 22
 <script>
23 23
 import { _getNotice } from '@/api/auth'
24 24
 export default {
25
-  data() {
25
+  data () {
26 26
     return {
27 27
       list: []
28 28
     }
29 29
   },
30
-  onLoad() {
30
+  onLoad () {
31 31
     this.get_list()
32 32
   },
33 33
   methods: {
34
-    report() {
34
+    report () {
35 35
       uni.showToast({ title: '学期末才能领取对应的学生综合素质报告,敬请期待!', icon: 'none', duration: 2000 })
36 36
     },
37
-    get_list() {
37
+    get_list () {
38 38
       _getNotice().then(res => {
39 39
         this.list = res.data.notice_data
40 40
       })
@@ -44,26 +44,26 @@ export default {
44 44
 </script>
45 45
 
46 46
 <style lang="scss" scoped>
47
-.page{
48
-	height:100vh;
47
+.page {
48
+  height: 100vh;
49 49
 }
50 50
 .g-container {
51
-    position: relative;
52
-    margin: auto;
53
-    height: 200px;
54
-    padding-top: 100px;
55
-    filter: contrast(20);
56
-    background-color: #fff;
57
-    overflow: hidden;
58
-    &::before {
59
-        content: "";
60
-        position: absolute;
61
-        top: 0;
62
-        left: 0;
63
-        bottom: 0;
64
-        right: 0;
65
-        backdrop-filter: blur(10px);
66
-        z-index: 1;
67
-    }
51
+  position: relative;
52
+  margin: auto;
53
+  height: 200px;
54
+  padding-top: 100px;
55
+  filter: contrast(20);
56
+  background-color: #fff;
57
+  overflow: hidden;
58
+  &::before {
59
+    content: '';
60
+    position: absolute;
61
+    top: 0;
62
+    left: 0;
63
+    bottom: 0;
64
+    right: 0;
65
+    backdrop-filter: blur(10px);
66
+    z-index: 1;
67
+  }
68 68
 }
69 69
 </style>

+ 139 - 137
src/pages/mine/mine.vue

@@ -2,92 +2,95 @@
2 2
   <view>
3 3
     <cu-custom :isBack="false"></cu-custom>
4 4
     <view class="main">
5
-			<view class="main-top">
6
-				<view class="title flex justify-between">
7
-					<view>{{user.nickName||'未更新用户信息'}}</view>
8
-					<text class="cuIcon-settings lg text-gray" @tap="goto('setting')"></text>
9
-				</view>
10
-			<view class="user">
11
-			 <view class="user-info flex">
12
-				 		<image mode="scaleToFill" :src="user.avatarUrl||defaultAvatar" class="avatar"></image>
13
-						<view class="study-info">
14
-							  <view class="user-name" @tap="switchStudent" v-if="isLogin&&user.nickName">
15
-									{{ kid_info.name + '-' + kid_info.school_name }}
16
-									<text class="iconfont margin-left-xs" style="font-size:18px;">&#xe600;</text>
17
-								</view>
18
-								<view  class="user-name"  @tap="login" v-else>
19
-									 	 切换学生
20
-										 <text class="iconfont margin-left-xs" style="font-size:18px;">&#xe716;</text>
21
-								</view>
22
-								 <view class="user-learn">已学习{{info.parent_data.learn_day}}天</view>
23
-						</view>
24
-			 </view>
25
-			 <view class="user-relative flex justify-between" v-if="isLogin">
26
-				  <view v-for="(relate,index) in courseRelates" :key="index" class="course-item" :style="'background:'+relate.background"
27
-					@tap="goto(relate.page)">
28
-						 <text class="iconfont back-img" style="font-size:32px;">{{relate.icon}}</text>
29
-						 <view class="text-df">{{relate.name}}</view>
30
-					</view>
31
-			 </view>
32
-			 <view class="user-relative flex justify-between" v-else>
33
-				  <view class="course-item relate-item" v-for="(course,index) in courses" :key="index" :style="'background:'+course.background">
34
-						<text class="iconfont back-img" style="font-size:40px;">{{course.icon}}</text>
35
-						<view class="text-lg">{{course.title}}</view>
36
-						<view class="text-xxl margin-top-xs">{{course.name}}</view>
37
-					</view>
38
-			 </view>
39
-			</view>
40
-			<view class="order">
41
-				 <view class="order-title solid-bottom">我的订单</view>
42
-				 <view class="order-info flex justify-between">
43
-					  <view v-for="(order,index) in menuList" :key="index" @tap="toOrder(index)">
44
-							  <view class="order-image">
45
-									<text class="iconfont text-student" style="font-size:32px;">{{order.icon}}</text>
46
-								</view>
47
-							  {{order.title}}
48
-							</view>
49
-				 </view>
50
-			</view>
51
-			</view>
52
-			<view class="margin cu-list box-shadow menu margin-top-lg bg-white">
53
-				<view class="cu-item arrow" @tap="goto('classCart')">
54
-					<text class="cuIcon-cart lg text-gray" style="font-size:18px;"></text>
55
-        	<view class="content margin-left-sm">
56
-          	<text class="text-black">购物车</text>
57
-        	</view>
5
+      <view class="main-top">
6
+        <view class="title flex justify-between">
7
+          <view>{{user.nickName||'未更新用户信息'}}</view>
8
+          <text class="cuIcon-settings lg text-gray" @tap="goto('setting')"></text>
9
+        </view>
10
+        <view class="user">
11
+          <view class="user-info flex">
12
+            <image mode="scaleToFill" :src="user.avatarUrl||defaultAvatar" class="avatar"></image>
13
+            <view class="study-info">
14
+              <view class="user-name" @tap="switchStudent" v-if="isLogin&&user.nickName">
15
+                {{ kid_info.name + '-' + kid_info.school_name }}
16
+                <text class="iconfont margin-left-xs" style="font-size:18px;">&#xe600;</text>
17
+              </view>
18
+              <view class="user-name" @tap="login" v-else>
19
+                切换学生
20
+                <text class="iconfont margin-left-xs" style="font-size:18px;">&#xe716;</text>
21
+              </view>
22
+              <view class="user-learn">已学习{{info.parent_data.learn_day}}天</view>
23
+            </view>
24
+          </view>
25
+          <view class="user-relative flex justify-between" v-if="isLogin">
26
+            <view v-for="(relate,index) in courseRelates" :key="index" class="course-item"
27
+              :style="'background:'+relate.background" @tap="goto(relate.page)">
28
+              <text class="iconfont back-img" style="font-size:32px;">{{relate.icon}}</text>
29
+              <view class="text-df">{{relate.name}}</view>
30
+            </view>
31
+          </view>
32
+          <view class="user-relative flex justify-between" v-else>
33
+            <view class="course-item relate-item" v-for="(course,index) in courses" :key="index"
34
+              :style="'background:'+course.background">
35
+              <text class="iconfont back-img" style="font-size:40px;">{{course.icon}}</text>
36
+              <view class="text-lg">{{course.title}}</view>
37
+              <view class="text-xxl margin-top-xs">{{course.name}}</view>
38
+            </view>
39
+          </view>
40
+        </view>
41
+        <view class="order">
42
+          <view class="order-title solid-bottom">我的订单</view>
43
+          <view class="order-info flex justify-between">
44
+            <view v-for="(order,index) in menuList" :key="index" @tap="toOrder(index)">
45
+              <view class="order-image">
46
+                <text class="iconfont text-student" style="font-size:32px;">{{order.icon}}</text>
47
+              </view>
48
+              {{order.title}}
49
+            </view>
50
+          </view>
51
+        </view>
52
+      </view>
53
+      <view class="margin cu-list box-shadow menu margin-top-lg bg-white">
54
+        <view class="cu-item arrow" @tap="goto('classCart')">
55
+          <text class="cuIcon-cart lg text-gray" style="font-size:18px;"></text>
56
+          <view class="content margin-left-sm">
57
+            <text class="text-black">购物车</text>
58
+          </view>
58 59
           <view class="action"></view>
59 60
         </view>
60
-				<view class="cu-item arrow" @tap="goto('message')">
61
-        	<text class="cuIcon-message lg text-gray" style="font-size:18px;"></text>
62
-        	<view class="content margin-left-sm">
63
-          	<text class="text-black">消息中心</text>
64
-        	</view>
61
+        <view class="cu-item arrow" @tap="goto('message')">
62
+          <text class="cuIcon-message lg text-gray" style="font-size:18px;"></text>
63
+          <view class="content margin-left-sm">
64
+            <text class="text-black">消息中心</text>
65
+          </view>
65 66
           <view class="action"></view>
66 67
         </view>
67
-			  <view class="cu-item arrow" @tap="goto('onlineService')">
68
-					<text class="iconfont text-gray" style="font-size:18px;">&#xe726;</text>
69
-        	<view class="content margin-left-sm">
70
-          	<text class="text-black">在线客服</text>
71
-        	</view>
68
+        <view class="cu-item arrow" @tap="goto('onlineService')">
69
+          <text class="iconfont text-gray" style="font-size:18px;">&#xe726;</text>
70
+          <view class="content margin-left-sm">
71
+            <text class="text-black">在线客服</text>
72
+          </view>
72 73
         </view>
73
-			</view>
74
+      </view>
74 75
     </view>
75 76
     <mp-tabbar :outerSelected="2" />
76
-   <view class="cu-modal drawer-modal justify-start" :class="modalName=='showStudent'?'show':''" @tap="hideModal">
77
+    <view class="cu-modal drawer-modal justify-start" :class="modalName=='showStudent'?'show':''" @tap="hideModal">
77 78
       <scroll-view :scroll-y="true" class="cu-dialog basis-lg" @tap.stop=""
78 79
         :style="[{top:topHeader+'px',height:'calc(100vh - 48px - ' + topHeader + 'px)'}]">
79 80
         <view class="student-list padding-left">
80
-          <view class="student margin-top-sm" v-for="(student,index) in students" :key="index" @tap="chooseKid(student.id)">
81
-						 <view class="flex align-center">
82
-								<image mode="scaleToFill" :src="defaultAvatar" class="avatar md"></image>
83
-								<view class="margin-left-sm">{{student.name}}</view>
84
-								<text class="cuIcon-check text-student margin-left" style="font-size:22px;" v-if="kid===student.id"></text>
85
-						 </view>
86
-						 <view class="flex">
87
-							 <view class="cu-tag line-green margin-top-xs">
88
-								{{student.school_name ? student.school_name : ''}}-{{student.grade_name}}-{{student.class_name}}
89
-								</view>
90
-						 </view>
81
+          <view class="student margin-top-sm" v-for="(student,index) in students" :key="index"
82
+            @tap="chooseKid(student.id)">
83
+            <view class="flex align-center">
84
+              <image mode="scaleToFill" :src="defaultAvatar" class="avatar md"></image>
85
+              <view class="margin-left-sm">{{student.name}}</view>
86
+              <text class="cuIcon-check text-student margin-left" style="font-size:22px;"
87
+                v-if="kid===student.id"></text>
88
+            </view>
89
+            <view class="flex">
90
+              <view class="cu-tag line-green margin-top-xs">
91
+                {{student.school_name ? student.school_name : ''}}-{{student.grade_name}}-{{student.class_name}}
92
+              </view>
93
+            </view>
91 94
           </view>
92 95
         </view>
93 96
       </scroll-view>
@@ -186,20 +189,20 @@ export default {
186 189
       kid: 'kid'
187 190
     })
188 191
   },
189
-  onShow() {
192
+  onShow () {
190 193
     this.get_info()
191 194
   },
192 195
   methods: {
193
-    login() {
196
+    login () {
194 197
       this.globalNavigateTo('login')
195 198
     },
196
-    get_info() {
199
+    get_info () {
197 200
       _getUserInfo().then(res => {
198 201
         this.info = res.data
199 202
         this.get_students()
200 203
       })
201 204
     },
202
-    get_students() {
205
+    get_students () {
203 206
       _getStudents().then(res => {
204 207
         if (res.data.length < 1) {
205 208
           this.globalNavigateTo('myStudents')
@@ -217,23 +220,23 @@ export default {
217 220
     hideModal (e) {
218 221
       this.modalName = null
219 222
     },
220
-    setkidInfo(kid) { // 设置学生信息
223
+    setkidInfo (kid) { // 设置学生信息
221 224
       this.kid_info = this.students.find(item => item.id === kid)
222 225
     },
223
-    switchStudent() {
226
+    switchStudent () {
224 227
       this.modalName = 'showStudent'
225 228
     },
226
-    goto(page) {
229
+    goto (page) {
227 230
       if (!this.isLogin) {
228 231
         this.globalNavigateTo('login')
229 232
       } else {
230 233
         this.globalNavigateTo(page)
231 234
       }
232 235
     },
233
-    toOrder(index) {
236
+    toOrder (index) {
234 237
       this.globalNavigateTo('order', { type: index })
235 238
     },
236
-    chooseKid(id) {
239
+    chooseKid (id) {
237 240
       uni.showModal({
238 241
         title: '',
239 242
         content: '确定选择该学生?',
@@ -253,73 +256,72 @@ export default {
253 256
 
254 257
 <style lang="scss">
255 258
 @import '~@/common/css/mixin.scss';
256
-.title{
257
-	@include title(10px,22px);
259
+.title {
260
+  @include title(10px, 22px);
258 261
 }
259
-.main{
260
-	padding-top:10px;
262
+.main {
263
+  padding-top: 10px;
261 264
 }
262
-.main-top{
263
-	padding:0 30rpx;
265
+.main-top {
266
+  padding: 0 30rpx;
264 267
 }
265
-.user{
266
-
268
+.user {
267 269
 }
268
-.user-info{
269
-	margin-bottom:10px;
270
+.user-info {
271
+  margin-bottom: 10px;
270 272
 }
271
-.study-info{
272
-	margin-left:40rpx;
273
-	padding-top:6px;
273
+.study-info {
274
+  margin-left: 40rpx;
275
+  padding-top: 6px;
274 276
 }
275
-.user-name{
276
-	@include title(10px,16px);
277
+.user-name {
278
+  @include title(10px, 16px);
277 279
 }
278
-.user-learn{
279
-	margin-top:20px;
280
+.user-learn {
281
+  margin-top: 20px;
280 282
 }
281
-.user-relative{
282
-	width:100%;
283
+.user-relative {
284
+  width: 100%;
283 285
 }
284
-.course-item{
285
-	position:relative;
286
-	border-radius:10px;
287
-	padding:16rpx;
288
-	width:24%;
289
-	min-height:52px;
290
-	color:#fff;
286
+.course-item {
287
+  position: relative;
288
+  border-radius: 10px;
289
+  padding: 16rpx;
290
+  width: 24%;
291
+  min-height: 52px;
292
+  color: #fff;
291 293
 }
292
-.course-item.relate-item{
293
-	width:48%;
294
+.course-item.relate-item {
295
+  width: 48%;
294 296
 }
295
-.back-img{
296
-	position:absolute;
297
-	bottom:8px;
298
-	right:6px;
299
-	opacity: .4;
297
+.back-img {
298
+  position: absolute;
299
+  bottom: 8px;
300
+  right: 6px;
301
+  opacity: 0.4;
300 302
 }
301
-.order{
302
-	margin-top:10px;
303
+.order {
304
+  margin-top: 10px;
303 305
 }
304
-.order-info{
305
-	padding:0 30rpx;
306
+.order-info {
307
+  padding: 0 30rpx;
306 308
 }
307
-.order-image{
308
-	margin:10rpx auto;
309
-	width:30px;
310
-	height:30px;
311
-	image{
312
-		width:100%;
313
-		height:100%;
314
-	}
309
+.order-image {
310
+  margin: 10rpx auto;
311
+  width: 30px;
312
+  height: 30px;
313
+  image {
314
+    width: 100%;
315
+    height: 100%;
316
+  }
315 317
 }
316
-.order-title{
317
-	padding-bottom:10px;
318
-	@include title(10px,16px);
318
+.order-title {
319
+  padding-bottom: 10px;
320
+  @include title(10px, 16px);
319 321
 }
320
-.switch-icon{
321
-	margin-left:10rpx;
322
-	width:1em;
323
-	height:1em;
322
+.switch-icon {
323
+  margin-left: 10rpx;
324
+  width: 1em;
325
+  height: 1em;
324 326
 }
325 327
 </style>

+ 45 - 45
src/pages/mine/onlineService.vue

@@ -1,33 +1,33 @@
1 1
 <template>
2
-	<view class="page">
3
-		  <cu-custom :isBack="true" title="在线客服"></cu-custom>
4
-			<view class="flex justify-center bg-white padding-tb-sm">
5
-				 <view class="link" style="background-color:#9aed6f;">
6
-					  <button class="button" open-type="contact" @contact="handleContact"></button>
7
-					 	<!-- <image src="/static/imgs/mine/wechat.png" mode="widthFix"></image> -->
8
-						<text class="iconfont" style="font-size:32px;">&#xe6c7;</text>
9
-				 </view>
10
-				 <view class="link" @tap="call" style="background-color:#5fcfe0;margin-left:160rpx;">
11
-					 <!-- <image src="/static/imgs/mine/tel.png" mode="widthFix"></image> -->
12
-					 <text class="iconfont" style="font-size:32px;">&#xe612;</text>
13
-				 </view>
14
-			</view>
15
-			<scroll-view class="questions margin-top-sm pardding-lr-sm  bg-white">
16
-				 <view class="cu-list menu">
17
-					<view class="questions-title margin-top">热点问题</view>
18
-					<view class="cu-item arrow solid-bottom" v-for="(item,index) in list" :key="index" @tap="answer(item)">
19
-						<view class="content margin-left-sm">
20
-							<text class="text-black">{{item.title}}</text>
21
-						</view>
22
-					</view>
23
-				 </view>
24
-			</scroll-view>
25
-	</view>
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="在线客服"></cu-custom>
4
+    <view class="flex justify-center bg-white padding-tb-sm">
5
+      <view class="link" style="background-color:#9aed6f;">
6
+        <button class="button" open-type="contact" @contact="handleContact"></button>
7
+        <!-- <image src="/static/imgs/mine/wechat.png" mode="widthFix"></image> -->
8
+        <text class="iconfont" style="font-size:32px;">&#xe6c7;</text>
9
+      </view>
10
+      <view class="link" @tap="call" style="background-color:#5fcfe0;margin-left:160rpx;">
11
+        <!-- <image src="/static/imgs/mine/tel.png" mode="widthFix"></image> -->
12
+        <text class="iconfont" style="font-size:32px;">&#xe612;</text>
13
+      </view>
14
+    </view>
15
+    <scroll-view class="questions margin-top-sm pardding-lr-sm  bg-white">
16
+      <view class="cu-list menu">
17
+        <view class="questions-title margin-top">热点问题</view>
18
+        <view class="cu-item arrow solid-bottom" v-for="(item,index) in list" :key="index" @tap="answer(item)">
19
+          <view class="content margin-left-sm">
20
+            <text class="text-black">{{item.title}}</text>
21
+          </view>
22
+        </view>
23
+      </view>
24
+    </scroll-view>
25
+  </view>
26 26
 </template>
27 27
 
28 28
 <script>
29 29
 export default {
30
-  data() {
30
+  data () {
31 31
     return {
32 32
       phoneNumber: '07592222030',
33 33
       list: [
@@ -46,7 +46,7 @@ export default {
46 46
     }
47 47
   },
48 48
   methods: {
49
-    answer(item) {
49
+    answer (item) {
50 50
       uni.showModal({
51 51
         title: item.title,
52 52
         content: item.content,
@@ -58,7 +58,7 @@ export default {
58 58
         }
59 59
       })
60 60
     },
61
-    call() {
61
+    call () {
62 62
       uni.makePhoneCall({
63 63
         phoneNumber: this.phoneNumber
64 64
       })
@@ -69,18 +69,18 @@ export default {
69 69
 
70 70
 <style lang="scss" scoped>
71 71
 @import '~@/common/css/mixin.scss';
72
-.page{
73
-	height:100vh;
72
+.page {
73
+  height: 100vh;
74 74
 }
75
-.link{
76
-	position:relative;
77
-	width:60px;
78
-	height:60px;
79
-	line-height:60px;
80
-	color:#fff;
81
-	text-align:center;
82
-	border-radius:40%;
83
-	.button{
75
+.link {
76
+  position: relative;
77
+  width: 60px;
78
+  height: 60px;
79
+  line-height: 60px;
80
+  color: #fff;
81
+  text-align: center;
82
+  border-radius: 40%;
83
+  .button {
84 84
     height: 75px;
85 85
     width: 75px;
86 86
     text-align: center;
@@ -90,13 +90,13 @@ export default {
90 90
     border: none;
91 91
     outline: none;
92 92
     opacity: 0;
93
-	}
93
+  }
94 94
 }
95
-.questions{
96
-	height:calc(100vh - 240px);
97
-	&-title{
98
-		@include title(0,16px);
99
-		padding-left:40rpx;
100
-	}
95
+.questions {
96
+  height: calc(100vh - 240px);
97
+  &-title {
98
+    @include title(0, 16px);
99
+    padding-left: 40rpx;
100
+  }
101 101
 }
102 102
 </style>

+ 109 - 109
src/pages/mine/parents.vue

@@ -1,75 +1,75 @@
1 1
 <template>
2
-	<view class="page">
3
-		<cu-custom :isBack="true" title="授权接送">
4
-		</cu-custom>
5
-		<scroll-view>
6
-			<view class="cu-card case no-card">
7
-				<view class="cu-item shadow">
8
-					<view class="image">
9
-      			<image src="/static/imgs/mine/img.png" mode="widthFix"></image>
10
-						 <view class="image-tag">应趣教育 课后百科</view>
11
-					</view>
12
-				</view>
13
-			</view>
14
-			<view class="cu-card">
15
-					<view class="cu-item shadhow">
16
-						  <view class="students-title flex justify-between align-center">
17
-								 <view class="text-lg">监护人列表</view>
18
-								 <view class="text-xs text-grey">
19
-									 <text class="cuIcon-roundaddfill text-cyan margin-left-xl add-icon"
20
-									 @tap="showModal" data-target="ChooseModal"
21
-									 ></text>
22
-								 </view>
23
-							</view>
24
-							<view class="cu-list menu-avatar">
25
-									<view class="cu-item" v-for="parent in parents" :key="parent.id">
26
-										<image mode="scaleToFill" :src="parent.avatar||defaultAvatar" class="avatar md left"></image>
27
-										<view class="content">
28
-											<view>{{parent.username}}</view>
29
-											<view class="text-gray">{{parent.mobile}}</view>
30
-										</view>
31
-									</view>
32
-							</view>
33
-					 </view>
34
-			</view>
35
-		</scroll-view>
36
-		<!-- 添加授权人 -->
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="授权接送">
4
+    </cu-custom>
5
+    <scroll-view>
6
+      <view class="cu-card case no-card">
7
+        <view class="cu-item shadow">
8
+          <view class="image">
9
+            <image src="/static/imgs/mine/img.png" mode="widthFix"></image>
10
+            <view class="image-tag">应趣教育 课后百科</view>
11
+          </view>
12
+        </view>
13
+      </view>
14
+      <view class="cu-card">
15
+        <view class="cu-item shadhow">
16
+          <view class="students-title flex justify-between align-center">
17
+            <view class="text-lg">监护人列表</view>
18
+            <view class="text-xs text-grey">
19
+              <text class="cuIcon-roundaddfill text-cyan margin-left-xl add-icon" @tap="showModal"
20
+                data-target="ChooseModal"></text>
21
+            </view>
22
+          </view>
23
+          <view class="cu-list menu-avatar">
24
+            <view class="cu-item" v-for="parent in parents" :key="parent.id">
25
+              <image mode="scaleToFill" :src="parent.avatar||defaultAvatar" class="avatar md left"></image>
26
+              <view class="content">
27
+                <view>{{parent.username}}</view>
28
+                <view class="text-gray">{{parent.mobile}}</view>
29
+              </view>
30
+            </view>
31
+          </view>
32
+        </view>
33
+      </view>
34
+    </scroll-view>
35
+    <!-- 添加授权人 -->
37 36
     <view class="cu-modal" :class="modalName=='ChooseModal'?'show':''" @tap="hideModal">
38 37
       <view class="cu-dialog bg-student" @tap.stop=''>
39 38
         <view class="cu-bar justify-around">
40 39
           <view class="content modal-title">添加授权人</view>
41 40
         </view>
42 41
         <view class="padding-xl text-left modal-body">
43
-				  <view>
44
-            <input type="text"  v-model.trim="params.username" placeholder="请输入授权人姓名" class="student-input text-black text-lg">
42
+          <view>
43
+            <input type="text" v-model.trim="params.username" placeholder="请输入授权人姓名"
44
+              class="student-input text-black text-lg">
45
+          </view>
46
+          <view class="margin-top">
47
+            <input type="text" v-model.trim="params.mobile" @input="changePhone" placeholder="请输入授权人手机号"
48
+              class="student-input text-black text-lg">
45 49
           </view>
46
-					<view class="margin-top">
47
-            <input type="text"  v-model.trim="params.mobile"
48
-						@input="changePhone"
49
-						 placeholder="请输入授权人手机号" class="student-input text-black text-lg">
50
+          <view class="margin-top auth-item">
51
+            <input type="text" v-model.trim="params.captcha" placeholder="请输入验证码"
52
+              class="student-input text-black text-lg">
53
+            <text class="auth-code text-cyan" :class="{'text-gray':disableSendMsgBtn}" :disabled="disableSendMsgBtn"
54
+              @tap="getCode">{{sendMsg}}</text>
50 55
           </view>
51
-					<view class="margin-top auth-item">
52
-            <input type="text"  v-model.trim="params.captcha" placeholder="请输入验证码" class="student-input text-black text-lg">
53
-						 <text class="auth-code text-cyan" :class="{'text-gray':disableSendMsgBtn}" :disabled="disableSendMsgBtn"
54
-            @tap="getCode">{{sendMsg}}</text>
56
+          <view class="margin-top">
57
+            <button class="student-input text-student text-center" @tap="save">确认授权</button>
55 58
           </view>
56
-					<view class="margin-top">
57
-						 <button class="student-input text-student text-center" @tap="save">确认授权</button>
58
-					</view>
59 59
         </view>
60 60
         <view class="cu-bar modal-footer">
61 61
           <view class="action"></view>
62 62
         </view>
63 63
       </view>
64 64
     </view>
65
-	</view>
65
+  </view>
66 66
 </template>
67 67
 
68 68
 <script>
69 69
 import { _getPickup, _getCode, _addPickup } from '@/api/auth'
70 70
 import validate from '@/common/utils/ys-validate'
71 71
 export default {
72
-  data() {
72
+  data () {
73 73
     return {
74 74
       modalName: null,
75 75
       parents: [],
@@ -89,17 +89,17 @@ export default {
89 89
       defaultAvatar: 'http://parent.kehoubaike.com/static/img/7f4e775d2e04234d1e1994b13146f6b.e5c47f3.png'
90 90
     }
91 91
   },
92
-  onLoad(options) {
92
+  onLoad (options) {
93 93
     this.get_list()
94 94
   },
95 95
   methods: {
96
-    showModal(e) {
96
+    showModal (e) {
97 97
       this.modalName = e.currentTarget.dataset.target
98 98
     },
99
-    hideModal(e) {
99
+    hideModal (e) {
100 100
       this.modalName = null
101 101
     },
102
-    save() {
102
+    save () {
103 103
       const validRes = validate.validate(this.params, this.rules)
104 104
       if (!validRes.isOk) {
105 105
         uni.showToast({
@@ -113,14 +113,14 @@ export default {
113 113
         this.get_list()
114 114
       })
115 115
     },
116
-    changePhone(e) {
116
+    changePhone (e) {
117 117
       if (/^[1]([3-9])[0-9]{9}$/.test(e.detail.value)) {
118 118
         this.disableSendMsgBtn = false
119 119
       } else {
120 120
         this.disableSendMsgBtn = true
121 121
       }
122 122
     },
123
-    getCode() {
123
+    getCode () {
124 124
       if (!this.disableSendMsgBtn) {
125 125
         this.leftTime = this.sendTime
126 126
         this.timing(this.leftTime)
@@ -148,7 +148,7 @@ export default {
148 148
         }
149 149
       }, 1000)
150 150
     },
151
-    get_list() {
151
+    get_list () {
152 152
       _getPickup().then(res => {
153 153
         this.parents = res.data.pickup_data
154 154
       })
@@ -158,70 +158,70 @@ export default {
158 158
 </script>
159 159
 
160 160
 <style lang="scss" scoped>
161
-.page{
162
-	height:100vh;
161
+.page {
162
+  height: 100vh;
163 163
 }
164
-.image{
165
-	padding-bottom:20px;
164
+.image {
165
+  padding-bottom: 20px;
166 166
 }
167
-.image-tag{
168
-	position:absolute;
169
-	top:10px;
170
-	left:10px;
171
-	font-size:24px;
172
-	font-weight:bold;
173
-	color: #6d4f26;
167
+.image-tag {
168
+  position: absolute;
169
+  top: 10px;
170
+  left: 10px;
171
+  font-size: 24px;
172
+  font-weight: bold;
173
+  color: #6d4f26;
174 174
 }
175
-.students-title{
176
-	padding:30rpx;
175
+.students-title {
176
+  padding: 30rpx;
177 177
 }
178
-.add-icon{
179
-	display:inline-block;
180
-	width:40px;
181
-	height:40px;
182
-	line-height:40px;
183
-	text-align:center;
184
-	font-size:22px;
178
+.add-icon {
179
+  display: inline-block;
180
+  width: 40px;
181
+  height: 40px;
182
+  line-height: 40px;
183
+  text-align: center;
184
+  font-size: 22px;
185 185
 }
186
-.student-input{
187
-	height:40px;
188
-	line-height:40px;
189
-	border-radius:20px;
190
-	background-color:#fff;
186
+.student-input {
187
+  height: 40px;
188
+  line-height: 40px;
189
+  border-radius: 20px;
190
+  background-color: #fff;
191 191
 }
192
-.radius-student{
193
-	border-radius:20rpx;
192
+.radius-student {
193
+  border-radius: 20rpx;
194 194
 }
195
-.cu-inner{
196
-	margin:10rpx;
197
-	display:flex;
198
-	align-items:center;
199
-	width:100%;
195
+.cu-inner {
196
+  margin: 10rpx;
197
+  display: flex;
198
+  align-items: center;
199
+  width: 100%;
200 200
 }
201
-.cu-inner.checked{
202
-    background: #5fd0e4;
203
-    color: #fff;
204
-    border-radius: 20rpx;
201
+.cu-inner.checked {
202
+  background: #5fd0e4;
203
+  color: #fff;
204
+  border-radius: 20rpx;
205 205
 }
206
-.cu-dialog{
207
-	width:90%;
206
+.cu-dialog {
207
+  width: 90%;
208 208
 }
209
-.modal-title{
210
-    font-weight: bold;
211
-    color: #516029;
212
-    font-size: 20px;
209
+.modal-title {
210
+  font-weight: bold;
211
+  color: #516029;
212
+  font-size: 20px;
213 213
 }
214
-.font-check{
215
-	font-size:22px;
214
+.font-check {
215
+  font-size: 22px;
216 216
 }
217
-.auth-item{
218
-	position:relative;
217
+.auth-item {
218
+  position: relative;
219 219
 }
220
-.auth-code{
221
-	position:absolute;
222
-	z-index:99;
223
-	top:10px;
224
-	right:20rpx;
225
-	font-size:14px;
220
+.auth-code {
221
+  position: absolute;
222
+  z-index: 99;
223
+  top: 10px;
224
+  right: 20rpx;
225
+  font-size: 14px;
226 226
 }
227 227
 </style>

+ 28 - 28
src/pages/mine/setting.vue

@@ -1,44 +1,44 @@
1 1
 <template>
2
-	<view class="page">
3
-		<cu-custom :isBack="true" title="个人信息">
4
-		</cu-custom>
5
-		<view class="cu-list menu  bg-white">
6
-        <view class="cu-item flex justify-between">
7
-          <view class="content margin-left-sm">
8
-						<text class="text-black">头像</text>
9
-          </view>
10
-					<image mode="scaleToFill" :src="user.avatarUrl" class="avatar lg" v-if="user.avatarUrl"></image>
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="个人信息">
4
+    </cu-custom>
5
+    <view class="cu-list menu  bg-white">
6
+      <view class="cu-item flex justify-between">
7
+        <view class="content margin-left-sm">
8
+          <text class="text-black">头像</text>
11 9
         </view>
12
-        <view class="cu-item flex justify-between">
13
-          <view class="content margin-left-sm">
14
-            <text class="text-black">昵称</text>
15
-          </view>
16
-					<view>{{user.nickName}}</view>
10
+        <image mode="scaleToFill" :src="user.avatarUrl" class="avatar lg" v-if="user.avatarUrl"></image>
11
+      </view>
12
+      <view class="cu-item flex justify-between">
13
+        <view class="content margin-left-sm">
14
+          <text class="text-black">昵称</text>
17 15
         </view>
18
-        <!-- <view class="cu-item flex justify-between">
16
+        <view>{{user.nickName}}</view>
17
+      </view>
18
+      <!-- <view class="cu-item flex justify-between">
19 19
           <view class="content margin-left-sm">
20 20
             <text class="text-black">性别</text>
21 21
           </view>
22 22
           <view>{{user.gender?'女':'男'}}</view>
23 23
         </view> -->
24
-        <view class="cu-item" :class="phone?'':'arrow'" @tap="toBind">
25
-          <view class="content margin-left-sm">
26
-            <text class="text-black">手机号</text>
27
-          </view>
28
-					<view>{{phone|hideIdCard(3,4)}}</view>
24
+      <view class="cu-item" :class="phone?'':'arrow'" @tap="toBind">
25
+        <view class="content margin-left-sm">
26
+          <text class="text-black">手机号</text>
29 27
         </view>
30
-		</view>
28
+        <view>{{phone|hideIdCard(3,4)}}</view>
29
+      </view>
30
+    </view>
31 31
     <view class="solids-bottom bg-white text-center padding text-red margin-top" @tap="logOut">
32
-        退出登录
32
+      退出登录
33 33
     </view>
34
-	</view>
34
+  </view>
35 35
 </template>
36 36
 
37 37
 <script>
38 38
 import { mapGetters } from 'vuex'
39 39
 import { hideIdCard } from '@/common/utils/filter'
40 40
 export default {
41
-  data() {
41
+  data () {
42 42
     return {
43 43
       params: {
44 44
         sex: 1
@@ -54,7 +54,7 @@ export default {
54 54
     hideIdCard
55 55
   },
56 56
   methods: {
57
-    logOut() {
57
+    logOut () {
58 58
       const _self = this
59 59
       uni.showModal({
60 60
         title: '',
@@ -70,7 +70,7 @@ export default {
70 70
         }
71 71
       })
72 72
     },
73
-    toBind() {
73
+    toBind () {
74 74
       if (!this.phone) {
75 75
         this.globalNavigateTo('bindPhone')
76 76
       }
@@ -80,7 +80,7 @@ export default {
80 80
 </script>
81 81
 
82 82
 <style lang="scss" scoped>
83
-.page{
84
-	height:100vh;
83
+.page {
84
+  height: 100vh;
85 85
 }
86 86
 </style>

+ 96 - 97
src/pages/mine/teachers.vue

@@ -1,97 +1,96 @@
1
-<template>
2
-	<view class="page">
3
-		<cu-custom :isBack="true" title="我的老师">
4
-		</cu-custom>
5
-		<scroll-view scroll-y="true" style="height:100vh">
6
-    <view class="list">
7
-      <view class="card" v-for="(item,index) in teachers" :key="index">
8
-        <image class="img" :src="teacherImg" mode="widthFix"></image>
9
-        <view class="content">
10
-          <view class="name_ava" >
11
-						<image mode="scaleToFill" :src="item.avatar||defaultAvatar" class="avatar lg"></image>
12
-            <view class="name">{{ item.username }}</view>
13
-          </view>
14
-          <view class="title">{{ item.portrait }}</view>
15
-          <view class="school">{{ item.agency_name }}</view>
16
-          <view class="des">{{ item.introduce }}</view>
17
-        </view>
18
-      </view>
19
-    </view>
20
-		</scroll-view>
21
-	</view>
22
-</template>
23
-
24
-<script>
25
-import { _getTeacher } from '@/api/auth'
26
-export default {
27
-  data() {
28
-    return {
29
-      teachers: [],
30
-      teacherImg: '/static/imgs/mine/teacher1.png',
31
-      defaultAvatar: '/static/imgs/mine/teacheravatar.png'
32
-    }
33
-  },
34
-  onLoad() {
35
-    this.get_list()
36
-  },
37
-  methods: {
38
-    get_list() {
39
-      _getTeacher().then(res => {
40
-        this.teachers = res.data.teacher_data
41
-      })
42
-    }
43
-  }
44
-}
45
-</script>
46
-
47
-<style lang="scss" scoped>
48
-.page {
49
-  background: #fff;
50
-}
51
-.list {
52
-  padding: 0 0.8rem;
53
-  padding-bottom: 2rem;
54
-}
55
-.card {
56
-  position: relative;
57
-  margin-top: 1rem;
58
-}
59
-.card .img {
60
-  width: 100%;
61
-}
62
-.card .content {
63
-  position: absolute;
64
-  top: 0;
65
-  padding: 0 0.8rem;
66
-  padding-top: 0.6rem;
67
-  color: #fff;
68
-}
69
-.card .content .name_ava {
70
-  display: flex;
71
-  align-items: center;
72
-}
73
-.card .content .name_ava .name {
74
-  margin-left: 0.4rem;
75
-  z-index: 99;
76
-  color: #fff;
77
-}
78
-.card .content .title {
79
-  font-weight: bold;
80
-  font-size: 20px;
81
-  margin-top: 0.2rem;
82
-}
83
-.card .content .school {
84
-  font-size: 14px;
85
-  margin-top: 0.2rem;
86
-}
87
-.card .content .des {
88
-  font-size: 14px;
89
-  margin-top: 0.2rem;
90
-  overflow: hidden;
91
-  text-overflow: ellipsis;
92
-  display: -webkit-box;
93
-  -webkit-line-clamp: 2;
94
-  -webkit-box-orient: vertical;
95
-}
96
-
97
-</style>
1
+<template>
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="我的老师">
4
+    </cu-custom>
5
+    <scroll-view scroll-y="true" style="height:100vh">
6
+      <view class="list">
7
+        <view class="card" v-for="(item,index) in teachers" :key="index">
8
+          <image class="img" :src="teacherImg" mode="widthFix"></image>
9
+          <view class="content">
10
+            <view class="name_ava">
11
+              <image mode="scaleToFill" :src="item.avatar||defaultAvatar" class="avatar lg"></image>
12
+              <view class="name">{{ item.username }}</view>
13
+            </view>
14
+            <view class="title">{{ item.portrait }}</view>
15
+            <view class="school">{{ item.agency_name }}</view>
16
+            <view class="des">{{ item.introduce }}</view>
17
+          </view>
18
+        </view>
19
+      </view>
20
+    </scroll-view>
21
+  </view>
22
+</template>
23
+
24
+<script>
25
+import { _getTeacher } from '@/api/auth'
26
+export default {
27
+  data () {
28
+    return {
29
+      teachers: [],
30
+      teacherImg: '/static/imgs/mine/teacher1.png',
31
+      defaultAvatar: '/static/imgs/mine/teacheravatar.png'
32
+    }
33
+  },
34
+  onLoad () {
35
+    this.get_list()
36
+  },
37
+  methods: {
38
+    get_list () {
39
+      _getTeacher().then(res => {
40
+        this.teachers = res.data.teacher_data
41
+      })
42
+    }
43
+  }
44
+}
45
+</script>
46
+
47
+<style lang="scss" scoped>
48
+.page {
49
+  background: #fff;
50
+}
51
+.list {
52
+  padding: 0 0.8rem;
53
+  padding-bottom: 2rem;
54
+}
55
+.card {
56
+  position: relative;
57
+  margin-top: 1rem;
58
+}
59
+.card .img {
60
+  width: 100%;
61
+}
62
+.card .content {
63
+  position: absolute;
64
+  top: 0;
65
+  padding: 0 0.8rem;
66
+  padding-top: 0.6rem;
67
+  color: #fff;
68
+}
69
+.card .content .name_ava {
70
+  display: flex;
71
+  align-items: center;
72
+}
73
+.card .content .name_ava .name {
74
+  margin-left: 0.4rem;
75
+  z-index: 99;
76
+  color: #fff;
77
+}
78
+.card .content .title {
79
+  font-weight: bold;
80
+  font-size: 20px;
81
+  margin-top: 0.2rem;
82
+}
83
+.card .content .school {
84
+  font-size: 14px;
85
+  margin-top: 0.2rem;
86
+}
87
+.card .content .des {
88
+  font-size: 14px;
89
+  margin-top: 0.2rem;
90
+  overflow: hidden;
91
+  text-overflow: ellipsis;
92
+  display: -webkit-box;
93
+  -webkit-line-clamp: 2;
94
+  -webkit-box-orient: vertical;
95
+}
96
+</style>

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

@@ -1,97 +1,97 @@
1 1
 <template>
2
-	<view class="page">
3
-		<cu-custom :isBack="false" :isHome="true">
4
-			 <view slot="content">我的学生</view>
5
-		</cu-custom>
6
-		<view>
7
-			<view class="cu-card case no-card">
8
-				<view class="cu-item shadow">
9
-					<view class="image">
10
-      			<image src="/static/imgs/mine/img.png" mode="widthFix"></image>
11
-						 <view class="image-tag">应趣教育 课后百科</view>
12
-					</view>
13
-				</view>
14
-			</view>
15
-				<view class="cu-card">
16
-					 <view class="cu-item shadow">
17
-						  <view class="students-title flex justify-between align-center">
18
-								 <view class="text-lg">学生列表</view>
19
-								 <view class="text-xs text-grey">
20
-									 <text class="text-red">点击选择,左滑删除,右侧添加</text>
21
-									 <text class="cuIcon-roundaddfill text-cyan margin-left-xl add-icon"
22
-									 @tap="showModal" data-target="ChooseModal"
23
-									 ></text>
24
-								 </view>
25
-							</view>
26
-							<view class="padding-lr text-right" v-if="!phone">
27
-								  <text class="text-red text-xs">右侧点击绑定手机号,直接获取绑定学生列表</text>
28
-									<text class="cuIcon-mobile text-cyan add-icon margin-left-xl" @tap="globalNavigateTo('bindPhone')"></text>
29
-							</view>
30
-							<scroll-view scroll-y :style="[{height:'calc(100vh - 230px - '+ topHeader+'px)'}]">
31
-								<view class="cu-list menu-avatar">
32
-									<view class="cu-item" :class="moveModel=='move-box-'+ index?'move-cur':''"
33
-									v-for="(item,index) in result.student_data" :key="index"
34
-									@touchstart="ListTouchStart" @touchmove="ListTouchMove"
35
-									@touchend="ListTouchEnd" :data-target="'move-box-' + index"
36
-									@tap="chooseKid(item.id)">
37
-									 <image mode="scaleToFill" :src="defaultAvatar" class="avatar md left"></image>
38
-										<view class="content">
39
-											<view>{{item.name}}</view>
40
-											<view class="text-gray">{{item.school_name}}-{{item.grade_name}}-{{item.class_name}}</view>
41
-										</view>
42
-										<view class="action">
43
-											<text class="cuIcon-check text-student font-check" v-if="item.id===kid"></text>
44
-										</view>
45
-										<view class="move student-move">
46
-											<view class="bg-red" @tap.stop="unbind(item.id)">删除</view>
47
-										</view>
48
-									</view>
49
-								</view>
50
-							</scroll-view>
51
-					 </view>
52
-				</view>
53
-		</view>
54
-		<!-- 选择学生列表 -->
55
-		<view class="cu-modal" :class="modalName=='showStudents'?'show':''" @tap="hideModal">
56
-			<view class="cu-dialog bg-student" @tap.stop=''>
57
-				<view class="padding text-left modal-body radius-student">
58
-					<view class="cu-list menu-avatar">
59
-							<view class="cu-item"  v-for="(item,index) in chooseList" :key="index" @tap="save(item.id)">
60
-								<view class="cu-inner" :class="{'checked':item.id===selectKid}">
61
-									<image mode="scaleToFill" :src="defaultAvatar" class="avatar md left"></image>
62
-									<view class="content">
63
-											<view>{{item.name}}</view>
64
-											<view class="text-gray">{{item.school_name}}-{{item.grade_name}}-{{item.class_name}}</view>
65
-									</view>
66
-								</view>
67
-						</view>
68
-					</view>
69
-				</view>
70
-			</view>
71
-		</view>
72
-		<!--添加学生-->
2
+  <view class="page">
3
+    <cu-custom :isBack="false" :isHome="true">
4
+      <view slot="content">我的学生</view>
5
+    </cu-custom>
6
+    <view>
7
+      <view class="cu-card case no-card">
8
+        <view class="cu-item shadow">
9
+          <view class="image">
10
+            <image src="/static/imgs/mine/img.png" mode="widthFix"></image>
11
+            <view class="image-tag">应趣教育 课后百科</view>
12
+          </view>
13
+        </view>
14
+      </view>
15
+      <view class="cu-card">
16
+        <view class="cu-item shadow">
17
+          <view class="students-title flex justify-between align-center">
18
+            <view class="text-lg">学生列表</view>
19
+            <view class="text-xs text-grey">
20
+              <text class="text-red">点击选择,左滑删除,右侧添加</text>
21
+              <text class="cuIcon-roundaddfill text-cyan margin-left-xl add-icon" @tap="showModal"
22
+                data-target="ChooseModal"></text>
23
+            </view>
24
+          </view>
25
+          <view class="padding-lr text-right" v-if="!phone">
26
+            <text class="text-red text-xs">右侧点击绑定手机号,直接获取绑定学生列表</text>
27
+            <text class="cuIcon-mobile text-cyan add-icon margin-left-xl" @tap="globalNavigateTo('bindPhone')"></text>
28
+          </view>
29
+          <scroll-view scroll-y :style="[{height:'calc(100vh - 230px - '+ topHeader+'px)'}]">
30
+            <view class="cu-list menu-avatar">
31
+              <view class="cu-item" :class="moveModel=='move-box-'+ index?'move-cur':''"
32
+                v-for="(item,index) in result.student_data" :key="index" @touchstart="ListTouchStart"
33
+                @touchmove="ListTouchMove" @touchend="ListTouchEnd" :data-target="'move-box-' + index"
34
+                @tap="chooseKid(item.id)">
35
+                <image mode="scaleToFill" :src="defaultAvatar" class="avatar md left"></image>
36
+                <view class="content">
37
+                  <view>{{item.name}}</view>
38
+                  <view class="text-gray">{{item.school_name}}-{{item.grade_name}}-{{item.class_name}}</view>
39
+                </view>
40
+                <view class="action">
41
+                  <text class="cuIcon-check text-student font-check" v-if="item.id===kid"></text>
42
+                </view>
43
+                <view class="move student-move">
44
+                  <view class="bg-red" @tap.stop="unbind(item.id)">删除</view>
45
+                </view>
46
+              </view>
47
+            </view>
48
+          </scroll-view>
49
+        </view>
50
+      </view>
51
+    </view>
52
+    <!-- 选择学生列表 -->
53
+    <view class="cu-modal" :class="modalName=='showStudents'?'show':''" @tap="hideModal">
54
+      <view class="cu-dialog bg-student" @tap.stop=''>
55
+        <view class="padding text-left modal-body radius-student">
56
+          <view class="cu-list menu-avatar">
57
+            <view class="cu-item" v-for="(item,index) in chooseList" :key="index" @tap="save(item.id)">
58
+              <view class="cu-inner" :class="{'checked':item.id===selectKid}">
59
+                <image mode="scaleToFill" :src="defaultAvatar" class="avatar md left"></image>
60
+                <view class="content">
61
+                  <view>{{item.name}}</view>
62
+                  <view class="text-gray">{{item.school_name}}-{{item.grade_name}}-{{item.class_name}}</view>
63
+                </view>
64
+              </view>
65
+            </view>
66
+          </view>
67
+        </view>
68
+      </view>
69
+    </view>
70
+    <!--添加学生-->
73 71
     <view class="cu-modal" :class="modalName=='ChooseModal'?'show':''" @tap="hideModal">
74 72
       <view class="cu-dialog bg-student" @tap.stop=''>
75 73
         <view class="cu-bar justify-around">
76 74
           <view class="content modal-title">添加学生</view>
77 75
         </view>
78 76
         <view class="padding-xl text-left modal-body">
79
-				  <view>
80
-            <input type="text"  v-model.trim="student.student_name" placeholder="请输入学生名字" class="student-input text-black text-lg">
77
+          <view>
78
+            <input type="text" v-model.trim="student.student_name" placeholder="请输入学生名字"
79
+              class="student-input text-black text-lg">
80
+          </view>
81
+          <view class="margin-top" v-if="student.student_name">
82
+            <input type="text" v-model.trim="student.school_name" placeholder="请输入学校名称"
83
+              class="student-input text-black text-lg">
81 84
           </view>
82
-					<view class="margin-top" v-if="student.student_name">
83
-            <input type="text"  v-model.trim="student.school_name" placeholder="请输入学校名称" class="student-input text-black text-lg">
85
+          <view class="margin-top">
86
+            <button class="student-input text-student text-left" @tap="get_students">获取学生</button>
84 87
           </view>
85
-					<view class="margin-top">
86
-						 <button class="student-input text-student text-left" @tap="get_students">获取学生</button>
87
-					</view>
88 88
         </view>
89 89
         <view class="cu-bar modal-footer">
90 90
           <view class="action"></view>
91 91
         </view>
92 92
       </view>
93 93
     </view>
94
-	</view>
94
+  </view>
95 95
 </template>
96 96
 
97 97
 <script>
@@ -99,7 +99,7 @@ import { _getStudents, _bindStudent, _unbindStudent } from '@/api/auth'
99 99
 import { _shopList } from '@/api/course'
100 100
 import { mapGetters } from 'vuex'
101 101
 export default {
102
-  data() {
102
+  data () {
103 103
     return {
104 104
       showAdd: false,
105 105
       topHeader: this.globalCustomBarHeight,
@@ -122,9 +122,9 @@ export default {
122 122
       'kid', 'phone'
123 123
     ])
124 124
   },
125
-  onLoad() {
125
+  onLoad () {
126 126
   },
127
-  onShow() {
127
+  onShow () {
128 128
     this.get_list()
129 129
     const kid = this.kid
130 130
     if (kid) {
@@ -141,18 +141,18 @@ export default {
141 141
     }
142 142
   },
143 143
   methods: {
144
-    showModal(e) {
144
+    showModal (e) {
145 145
       this.modalName = e.currentTarget.dataset.target
146 146
     },
147
-    hideModal(e) {
147
+    hideModal (e) {
148 148
       this.modalName = null
149 149
     },
150
-    get_list() {
150
+    get_list () {
151 151
       _getStudents().then(res => {
152 152
         this.result = res.data
153 153
       })
154 154
     },
155
-    get_students() {
155
+    get_students () {
156 156
       if (!this.student.student_name) return uni.showToast({ title: '请输入学生姓名', icon: 'none' })
157 157
       if (!this.student.school_name) return uni.showToast({ title: '请输入学校名称', icon: 'none' })
158 158
       _getStudents(this.student).then(res => {
@@ -165,7 +165,7 @@ export default {
165 165
         }
166 166
       })
167 167
     },
168
-    save(id) {
168
+    save (id) {
169 169
       this.selectKid = id
170 170
       uni.showModal({
171 171
         title: '确定绑定?',
@@ -182,7 +182,7 @@ export default {
182 182
         }
183 183
       })
184 184
     },
185
-    unbind(id) {
185
+    unbind (id) {
186 186
       const _self = this
187 187
       uni.showModal({
188 188
         title: '确定解绑?',
@@ -200,7 +200,7 @@ export default {
200 200
         }
201 201
       })
202 202
     },
203
-    chooseKid(id) {
203
+    chooseKid (id) {
204 204
       uni.showModal({
205 205
         title: '确定选择学生',
206 206
         message: '确定选择该学生?',
@@ -214,19 +214,19 @@ export default {
214 214
         }
215 215
       })
216 216
     },
217
-    setCarts() { // 刷新购物车
217
+    setCarts () { // 刷新购物车
218 218
       _shopList().then(res => {
219 219
         const carts = res.data.map(item => item.class_attend_id)
220 220
         this.$store.dispatch('setCarts', carts)
221 221
       })
222 222
     },
223
-    ListTouchStart(e) {
223
+    ListTouchStart (e) {
224 224
       this.listTouchStart = e.touches[0].pageX
225 225
     },
226
-    ListTouchMove(e) {
226
+    ListTouchMove (e) {
227 227
       this.listTouchDirection = e.touches[0].pageX - this.listTouchStart > 0 ? 'right' : 'left'
228 228
     },
229
-    ListTouchEnd(e) {
229
+    ListTouchEnd (e) {
230 230
       if (this.listTouchDirection === 'left') {
231 231
         this.moveModel = e.currentTarget.dataset.target
232 232
       } else {
@@ -239,67 +239,67 @@ export default {
239 239
 </script>
240 240
 
241 241
 <style lang="scss" scoped>
242
-.page{
243
-	height:100vh;
242
+.page {
243
+  height: 100vh;
244 244
 }
245
-.image{
246
-	padding-bottom:20px;
245
+.image {
246
+  padding-bottom: 20px;
247 247
 }
248
-.image-tag{
249
-	position:absolute;
250
-	top:10px;
251
-	left:10px;
252
-	font-size:24px;
253
-	font-weight:bold;
254
-	color: #6d4f26;
248
+.image-tag {
249
+  position: absolute;
250
+  top: 10px;
251
+  left: 10px;
252
+  font-size: 24px;
253
+  font-weight: bold;
254
+  color: #6d4f26;
255 255
 }
256
-.students-title{
257
-	padding:0 30rpx;
256
+.students-title {
257
+  padding: 0 30rpx;
258 258
 }
259
-.add-icon{
260
-	display:inline-block;
261
-	width:40px;
262
-	height:40px;
263
-	line-height:40px;
264
-	text-align:center;
265
-	font-size:22px;
259
+.add-icon {
260
+  display: inline-block;
261
+  width: 40px;
262
+  height: 40px;
263
+  line-height: 40px;
264
+  text-align: center;
265
+  font-size: 22px;
266 266
 }
267
-.student-input{
268
-	height:40px;
269
-	line-height:40px;
270
-	border-radius:20px;
271
-	background-color:#fff;
267
+.student-input {
268
+  height: 40px;
269
+  line-height: 40px;
270
+  border-radius: 20px;
271
+  background-color: #fff;
272 272
 }
273
-.radius-student{
274
-	border-radius:20rpx;
273
+.radius-student {
274
+  border-radius: 20rpx;
275 275
 }
276
-.cu-inner{
277
-	margin:10rpx;
278
-	display:flex;
279
-	align-items:center;
280
-	width:100%;
276
+.cu-inner {
277
+  margin: 10rpx;
278
+  display: flex;
279
+  align-items: center;
280
+  width: 100%;
281 281
 }
282
-.cu-inner.checked{
283
-    background: #5fd0e4;
284
-    color: #fff;
285
-    border-radius: 20rpx;
282
+.cu-inner.checked {
283
+  background: #5fd0e4;
284
+  color: #fff;
285
+  border-radius: 20rpx;
286 286
 }
287
-.cu-dialog{
288
-	width:90%;
287
+.cu-dialog {
288
+  width: 90%;
289 289
 }
290
-.modal-title{
291
-    font-weight: bold;
292
-    color: #516029;
293
-    font-size: 20px;
290
+.modal-title {
291
+  font-weight: bold;
292
+  color: #516029;
293
+  font-size: 20px;
294 294
 }
295
-.font-check{
296
-	font-size:22px;
295
+.font-check {
296
+  font-size: 22px;
297 297
 }
298
-.cu-list>.cu-item .move.student-move{
299
-	width:130rpx;
300
-	text-align:center;
298
+.cu-list > .cu-item .move.student-move {
299
+  width: 130rpx;
300
+  text-align: center;
301 301
 }
302
-.cu-list>.cu-item.move-cur{
303
-	transform: translateX(-130rpx);
302
+.cu-list > .cu-item.move-cur {
303
+  transform: translateX(-130rpx);
304 304
 }
305 305
 </style>

+ 171 - 170
src/pages/order/index.vue

@@ -1,128 +1,129 @@
1 1
 <template>
2 2
   <view class="page">
3 3
     <cu-custom :isBack="true"></cu-custom>
4
-		<view class="header" :style="[{top:topHeader + 'px'}]">
5
-			<view class="header-title">
6
-				<view class="header-title-main">
7
-						<view class="margin-bottom-xs">{{title}}</view>
8
-						<view class="point"></view>
9
-				</view>
10
-			</view>
11
-			<swiper-tab :menuList="menuList" @changeTab="changeTab" :activeTab="currentIndex"></swiper-tab>
12
-		</view>
13
-		<scroll-view  scroll-y="true" class="scroll-main"
14
-		:style="[{height:'calc(100vh - 74px - '+ topHeader+'px)'}]"
15
-		:refresher-enabled="true"
16
-		 :refresher-triggered="triggered"
17
-		@refresherrefresh="onRefresh" @scrolltolower="loadMore">
18
-			<view class="list" v-if="params.type<7">
19
-				<view class="cu-card margin-top margin-bottom shadow" v-for="(item,index) in orders" :key="index">
20
-					<view class="cu-item">
21
-						<view class="card-header flex justify-between solid-bottom">
22
-							<view>{{index}}</view>
23
-							<view class="text-student course-status">
24
-									{{item.status|status}}
25
-							</view>
26
-						</view>
27
-						<view class="card-center" v-for="(course,i) in item.list" :key="i">
28
-								<view class="card flex">
29
-									<view class="card-left">
30
-										<img mode="scaleToFill" :src="course.image" alt="" class="card-image">
31
-									</view>
32
-									<view class="card-right flex-sub margin-left-sm text-sm">
33
-										<view class="card-title">
34
-											<text>{{course.name}}</text>
35
-										</view>
36
-										<view class="card-item margin-top-xs">
37
-											<text class="card-label">时间:</text>
38
-											<text class="card-text">{{course.attend_day}}</text>
39
-										</view>
40
-										<view class="card-item margin-top-xs" >
41
-											<text class="card-label">课时:</text>
42
-											<text class="card-text">{{course.class_total}}</text>
43
-										</view>
44
-										<view class="card-item margin-top-xs">
45
-											<text class="card-label">学生:</text>
46
-											<text class="card-text">{{course.student_name}}</text>
47
-										</view>
48
-										<view class="card-item margin-top-xs">
49
-											<text class="card-label">老师:</text>
50
-											<text class="card-text">{{course.teacher||'--'}}</text>
51
-										</view>
52
-										<view class="card-item margin-top-xs" v-if="dropStatus.includes(item.status)&&course.is_return===1">
53
-											<view class="text-student text-right">{{course.return_status}}</view>
54
-										</view>
55
-									</view>
56
-								</view>
57
-								<view class="flex card-footer solid-bottom padding-bottom-xs">
58
-											<view v-for="(prop,k) in course.prop" :key="k" class="margin-right-xs">
59
-												<text class="card-label">{{prop.name}}:</text><text class="text-price">{{prop.money}}</text>
60
-											</view>
61
-								</view>
62
-								<view class="card-bottom flex justify-end margin-top-xs">
63
-										<button @tap="dropCourse(course.order_info_id)" class="cu-btn round bg-student text-white" v-if="dropStatus.includes(item.status)&&course.is_return===0">退课</button>
64
-										<!-- <button @tap="droping" class="cu-btn round sm line-cyan" v-if="dropStatus.includes(item.status)&&course.is_return===1">退课中</button> -->
65
-								</view>
66
-						</view>
67
-						<view class="card-bottom margin-top-xs flex justify-between">
68
-									<view>
69
-										<text class="text-price text-red">{{item.sum_money}}</text>
70
-									</view>
71
-									<view>
72
-											<button @tap="pay(item.order_id)" class="cu-btn round bg-student text-white margin-right-sm" v-if="item.status===0">立即付款</button>
73
-											<button @tap="cancel(item.order_id)" class="cu-btn round bg-gray" v-if="item.status===0&&!isPaying">取消</button>
74
-									</view>
75
-						</view>
76
-					</view>
77
-				</view>
78
-			</view>
79
-			<view class="list" v-else>
80
-				<view class="cu-card margin-top margin-bottom shadow" v-for="(item,index) in list" :key="index">
81
-						<view class="cu-item">
82
-								<view class="card-header flex justify-between solid-bottom">
83
-								 <view>{{item.refund_code}}</view>
84
-								 <view class="text-student course-status">
85
-									  {{item.status|dropStatus}}
86
-								 </view>
87
-							</view>
88
-							<view class="card flex">
89
-									<view class="card-left">
90
-										<img mode="scaleToFill" :src="item.image" alt="" class="card-image">
91
-									</view>
92
-									<view class="card-right flex-sub margin-left-sm text-sm">
93
-										<view class="card-title">{{item.name}}</view>
94
-										<view class="card-item margin-top-xs">
95
-											<text class="card-label">时间:</text>
96
-											<text class="card-text">{{item.day}}</text>
97
-										</view>
98
-										<view class="card-item margin-top-xs" >
99
-											<text class="card-label">课时:</text>
100
-											<text class="card-text">{{item.class_total}}</text>
101
-										</view>
102
-										<view class="card-item margin-top-xs">
103
-											<text class="card-label">学生:</text>
104
-											<text class="card-text">{{item.student_name}}</text>
105
-										</view>
106
-										<view class="card-item margin-top-xs">
107
-											<text class="card-label">老师:</text>
108
-											<text class="card-text">{{item.teacher||'--'}}</text>
109
-										</view>
110
-										<view class="card-item margin-top-xs">
111
-											<text class="card-label">订单:</text>
112
-											<text class="card-text">{{item.code}}</text>
113
-										</view>
114
-									</view>
115
-							</view>
116
-							<view class="flex card-footer padding-bottom-xs">
117
-									<view v-for="(prop,k) in course.prop" :key="k" class="margin-right-xs">
118
-										<text class="card-label">{{prop.name}}:</text><text class="text-price">{{prop.money}}</text>
119
-									</view>
120
-							</view>
121
-						</view>
122
-				</view>
123
-			</view>
124
-		</scroll-view>
125
-		<web-view v-if="showForm" :src="payurl"></web-view>
4
+    <view class="header" :style="[{top:topHeader + 'px'}]">
5
+      <view class="header-title">
6
+        <view class="header-title-main">
7
+          <view class="margin-bottom-xs">{{title}}</view>
8
+          <view class="point"></view>
9
+        </view>
10
+      </view>
11
+      <swiper-tab :menuList="menuList" @changeTab="changeTab" :activeTab="currentIndex"></swiper-tab>
12
+    </view>
13
+    <scroll-view scroll-y="true" class="scroll-main" :style="[{height:'calc(100vh - 74px - '+ topHeader+'px)'}]"
14
+      :refresher-enabled="true" :refresher-triggered="triggered" @refresherrefresh="onRefresh"
15
+      @scrolltolower="loadMore">
16
+      <view class="list" v-if="params.type<7">
17
+        <view class="cu-card margin-top margin-bottom shadow" v-for="(item,index) in orders" :key="index">
18
+          <view class="cu-item">
19
+            <view class="card-header flex justify-between solid-bottom">
20
+              <view>{{index}}</view>
21
+              <view class="text-student course-status">
22
+                {{item.status|status}}
23
+              </view>
24
+            </view>
25
+            <view class="card-center" v-for="(course,i) in item.list" :key="i">
26
+              <view class="card flex">
27
+                <view class="card-left">
28
+                  <img mode="scaleToFill" :src="course.image" alt="" class="card-image">
29
+                </view>
30
+                <view class="card-right flex-sub margin-left-sm text-sm">
31
+                  <view class="card-title">
32
+                    <text>{{course.name}}</text>
33
+                  </view>
34
+                  <view class="card-item margin-top-xs">
35
+                    <text class="card-label">时间:</text>
36
+                    <text class="card-text">{{course.attend_day}}</text>
37
+                  </view>
38
+                  <view class="card-item margin-top-xs">
39
+                    <text class="card-label">课时:</text>
40
+                    <text class="card-text">{{course.class_total}}</text>
41
+                  </view>
42
+                  <view class="card-item margin-top-xs">
43
+                    <text class="card-label">学生:</text>
44
+                    <text class="card-text">{{course.student_name}}</text>
45
+                  </view>
46
+                  <view class="card-item margin-top-xs">
47
+                    <text class="card-label">老师:</text>
48
+                    <text class="card-text">{{course.teacher||'--'}}</text>
49
+                  </view>
50
+                  <view class="card-item margin-top-xs" v-if="dropStatus.includes(item.status)&&course.is_return===1">
51
+                    <view class="text-student text-right">{{course.return_status}}</view>
52
+                  </view>
53
+                </view>
54
+              </view>
55
+              <view class="flex card-footer solid-bottom padding-bottom-xs">
56
+                <view v-for="(prop,k) in course.prop" :key="k" class="margin-right-xs">
57
+                  <text class="card-label">{{prop.name}}:</text><text class="text-price">{{prop.money}}</text>
58
+                </view>
59
+              </view>
60
+              <view class="card-bottom flex justify-end margin-top-xs">
61
+                <button @tap="dropCourse(course.order_info_id)" class="cu-btn round bg-student text-white"
62
+                  v-if="dropStatus.includes(item.status)&&course.is_return===0">退课</button>
63
+                <!-- <button @tap="droping" class="cu-btn round sm line-cyan" v-if="dropStatus.includes(item.status)&&course.is_return===1">退课中</button> -->
64
+              </view>
65
+            </view>
66
+            <view class="card-bottom margin-top-xs flex justify-between">
67
+              <view>
68
+                <text class="text-price text-red">{{item.sum_money}}</text>
69
+              </view>
70
+              <view>
71
+                <button @tap="pay(item.order_id)" class="cu-btn round bg-student text-white margin-right-sm"
72
+                  v-if="item.status===0">立即付款</button>
73
+                <button @tap="cancel(item.order_id)" class="cu-btn round bg-gray"
74
+                  v-if="item.status===0&&!isPaying">取消</button>
75
+              </view>
76
+            </view>
77
+          </view>
78
+        </view>
79
+      </view>
80
+      <view class="list" v-else>
81
+        <view class="cu-card margin-top margin-bottom shadow" v-for="(item,index) in list" :key="index">
82
+          <view class="cu-item">
83
+            <view class="card-header flex justify-between solid-bottom">
84
+              <view>{{item.refund_code}}</view>
85
+              <view class="text-student course-status">
86
+                {{item.status|dropStatus}}
87
+              </view>
88
+            </view>
89
+            <view class="card flex">
90
+              <view class="card-left">
91
+                <img mode="scaleToFill" :src="item.image" alt="" class="card-image">
92
+              </view>
93
+              <view class="card-right flex-sub margin-left-sm text-sm">
94
+                <view class="card-title">{{item.name}}</view>
95
+                <view class="card-item margin-top-xs">
96
+                  <text class="card-label">时间:</text>
97
+                  <text class="card-text">{{item.day}}</text>
98
+                </view>
99
+                <view class="card-item margin-top-xs">
100
+                  <text class="card-label">课时:</text>
101
+                  <text class="card-text">{{item.class_total}}</text>
102
+                </view>
103
+                <view class="card-item margin-top-xs">
104
+                  <text class="card-label">学生:</text>
105
+                  <text class="card-text">{{item.student_name}}</text>
106
+                </view>
107
+                <view class="card-item margin-top-xs">
108
+                  <text class="card-label">老师:</text>
109
+                  <text class="card-text">{{item.teacher||'--'}}</text>
110
+                </view>
111
+                <view class="card-item margin-top-xs">
112
+                  <text class="card-label">订单:</text>
113
+                  <text class="card-text">{{item.code}}</text>
114
+                </view>
115
+              </view>
116
+            </view>
117
+            <view class="flex card-footer padding-bottom-xs">
118
+              <view v-for="(prop,k) in course.prop" :key="k" class="margin-right-xs">
119
+                <text class="card-label">{{prop.name}}:</text><text class="text-price">{{prop.money}}</text>
120
+              </view>
121
+            </view>
122
+          </view>
123
+        </view>
124
+      </view>
125
+    </scroll-view>
126
+    <web-view v-if="showForm" :src="payurl"></web-view>
126 127
   </view>
127 128
 </template>
128 129
 
@@ -161,7 +162,7 @@ export default {
161 162
     }
162 163
   },
163 164
   filters: {
164
-    status: function(value) {
165
+    status: function (value) {
165 166
       switch (value) {
166 167
         case 0:
167 168
           return '未付款'
@@ -181,7 +182,7 @@ export default {
181 182
           return '状态未知'
182 183
       }
183 184
     },
184
-    dropStatus(v) {
185
+    dropStatus (v) {
185 186
       return v === 0 ? '审核中' : v === 1 ? '审核通过' : '驳回'
186 187
     }
187 188
   },
@@ -194,7 +195,7 @@ export default {
194 195
     }
195 196
   },
196 197
   watch: {
197
-    ifReloadOrder(n, o) {
198
+    ifReloadOrder (n, o) {
198 199
       if (n) {
199 200
         this.changeTab(0)
200 201
         this.$store.dispatch('setReload', false)
@@ -207,18 +208,18 @@ export default {
207 208
     ])
208 209
   },
209 210
   methods: {
210
-    refresh() {
211
+    refresh () {
211 212
       this.params.page = 1
212 213
       this.get_list()
213 214
     },
214
-    onRefresh() {
215
+    onRefresh () {
215 216
       this.triggered = true
216 217
       this.refresh()
217 218
       setTimeout(() => {
218 219
         this.triggered = false
219 220
       }, 1000)
220 221
     },
221
-    loadMore() {
222
+    loadMore () {
222 223
       if (this.noMore) {
223 224
         uni.showToast({ title: '没有更多了', icon: 'none' })
224 225
         return false
@@ -226,14 +227,14 @@ export default {
226 227
       this.params.page++
227 228
       this.get_list()
228 229
     },
229
-    get_list() {
230
+    get_list () {
230 231
       if (this.params.type < 7) {
231 232
         this.get_orders()
232 233
       } else {
233 234
         this.get_drops()
234 235
       }
235 236
     },
236
-    get_orders() {
237
+    get_orders () {
237 238
       _orderCenter(this.params).then(res => {
238 239
         if (this.params.page > 1) {
239 240
           if (Object.keys(res.data).length < this.page_size) this.noMore = true
@@ -244,10 +245,10 @@ export default {
244 245
         }
245 246
       })
246 247
     },
247
-    get_drops() {
248
+    get_drops () {
248 249
       _dropList({ page: this.params.page }).then(res => {
249 250
         if (this.params.page > 1) {
250
-	        if (!res.data.drop_course_data) {
251
+          if (!res.data.drop_course_data) {
251 252
             this.noMore = true
252 253
             return
253 254
           }
@@ -259,10 +260,10 @@ export default {
259 260
         }
260 261
       })
261 262
     },
262
-    droping() {
263
+    droping () {
263 264
       this.changeTab(3)
264 265
     },
265
-    dropCourse(id) {
266
+    dropCourse (id) {
266 267
       const params = { order_info_id: id, refund_explanation: '', type_id: 0 }
267 268
       const _self = this
268 269
       uni.showModal({
@@ -280,14 +281,14 @@ export default {
280 281
         }
281 282
       })
282 283
     },
283
-    pay(id) {
284
+    pay (id) {
284 285
       const _self = this
285 286
       _self.isPaying = true
286 287
       uni.showModal({
287 288
         title: '温馨提示:',
288 289
         content: '1、感谢您的购买;\n' +
289
-                  '2、退费规则请咨询客服;\n' +
290
-                  '3、本平台对以上细则有最终解释权。',
290
+          '2、退费规则请咨询客服;\n' +
291
+          '3、本平台对以上细则有最终解释权。',
291 292
         cancelText: '取消',
292 293
         confirmText: '确定',
293 294
         success: res => {
@@ -318,7 +319,7 @@ export default {
318 319
                   _self.isPaying = false
319 320
                   _self.changeTab(0)
320 321
                 },
321
-                fail: function(res) {
322
+                fail: function (res) {
322 323
                   _self.isPaying = false
323 324
                 }
324 325
               })
@@ -329,7 +330,7 @@ export default {
329 330
         }
330 331
       })
331 332
     },
332
-    cancel(id) {
333
+    cancel (id) {
333 334
       const _self = this
334 335
       uni.showModal({
335 336
         title: '提示',
@@ -346,7 +347,7 @@ export default {
346 347
         }
347 348
       })
348 349
     },
349
-    changeTab(index) {
350
+    changeTab (index) {
350 351
       this.orders = {}
351 352
       this.params.page = 1
352 353
       this.currentIndex = index
@@ -359,39 +360,39 @@ export default {
359 360
 
360 361
 <style lang="scss">
361 362
 @import '~@/common/css/mixin.scss';
362
-.scroll-main{
363
-	margin-top:74px;
364
-	padding:20rpx;
363
+.scroll-main {
364
+  margin-top: 74px;
365
+  padding: 20rpx;
365 366
 }
366
-.cu-card{
367
-	.cu-item{
368
-		margin-top:10rpx;
369
-		padding:20rpx;
370
-		margin:0;
371
-	}
367
+.cu-card {
368
+  .cu-item {
369
+    margin-top: 10rpx;
370
+    padding: 20rpx;
371
+    margin: 0;
372
+  }
372 373
 }
373
-.card-header{
374
-	padding-bottom:10px;
375
-  @include title(10px,16px);
374
+.card-header {
375
+  padding-bottom: 10px;
376
+  @include title(10px, 16px);
376 377
 }
377
-.card{
378
-	&-title{
379
-		font-size:16px;
380
-	}
381
-	&-image{
382
-		width:35vw;
383
-		height:35vw;
384
-		border-radius:10rpx;
385
-	}
386
-	&-label{
387
-		color:#999;
388
-	}
389
-	&-text{
390
-		color:#333;
391
-	}
378
+.card {
379
+  &-title {
380
+    font-size: 16px;
381
+  }
382
+  &-image {
383
+    width: 35vw;
384
+    height: 35vw;
385
+    border-radius: 10rpx;
386
+  }
387
+  &-label {
388
+    color: #999;
389
+  }
390
+  &-text {
391
+    color: #333;
392
+  }
392 393
 }
393
-.course-status{
394
-	font-size:14px;
395
-	font-weight:normal;
394
+.course-status {
395
+  font-size: 14px;
396
+  font-weight: normal;
396 397
 }
397 398
 </style>

+ 26 - 26
src/pages/studentcenter/absent.vue

@@ -1,31 +1,31 @@
1 1
 <template>
2
-	<view class="page">
3
-		<cu-custom :isBack="true" title="请假"></cu-custom>
4
-		<form>
5
-			<view class="cu-form-group">
6
-				<view class="title">请假类型</view>
7
-				<picker @change="changeType" :value="index" :range="types" range-key="name">
8
-					<view class="picker">
9
-						{{index>-1? types[index].name:'请选择请假类型'}}
10
-					</view>
11
-				</picker>
12
-			</view>
13
-			<view class="cu-form-group align-start">
14
-				<view class="title">请假理由</view>
15
-				<textarea maxlength="-1"  placeholder="请输入请假理由" v-model="params.reason"></textarea>
16
-			</view>
17
-		</form>
18
-		<view class="solids-bottom bg-white text-center padding text-student margin-top" @tap="apply">
19
-        提交申请
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="请假"></cu-custom>
4
+    <form>
5
+      <view class="cu-form-group">
6
+        <view class="title">请假类型</view>
7
+        <picker @change="changeType" :value="index" :range="types" range-key="name">
8
+          <view class="picker">
9
+            {{index>-1? types[index].name:'请选择请假类型'}}
10
+          </view>
11
+        </picker>
12
+      </view>
13
+      <view class="cu-form-group align-start">
14
+        <view class="title">请假理由</view>
15
+        <textarea maxlength="-1" placeholder="请输入请假理由" v-model="params.reason"></textarea>
16
+      </view>
17
+    </form>
18
+    <view class="solids-bottom bg-white text-center padding text-student margin-top" @tap="apply">
19
+      提交申请
20 20
     </view>
21
-	</view>
21
+  </view>
22 22
 </template>
23 23
 
24 24
 <script>
25 25
 import { _leaveType, _askLeave } from '@/api/course'
26 26
 import validate from '@/common/utils/ys-validate'
27 27
 export default {
28
-  data() {
28
+  data () {
29 29
     return {
30 30
       key: 1212,
31 31
       index: -1,
@@ -41,23 +41,23 @@ export default {
41 41
       ]
42 42
     }
43 43
   },
44
-  onLoad(options) {
44
+  onLoad (options) {
45 45
     const id = decodeURIComponent(options.id)
46 46
     if (!id) uni.navigateBack()
47 47
     this.params.plan_id = id
48 48
     this.getTypes()
49 49
   },
50 50
   methods: {
51
-    getTypes() {
51
+    getTypes () {
52 52
       _leaveType().then(res => {
53 53
         this.types = res.data.leave_type_data
54 54
       })
55 55
     },
56
-    changeType(e) {
56
+    changeType (e) {
57 57
       this.index = e.detail.value
58 58
       this.params.type_id = this.types[this.index].id
59 59
     },
60
-    apply() {
60
+    apply () {
61 61
       const validRes = validate.validate(this.params, this.rules)
62 62
       if (!validRes.isOk) {
63 63
         uni.showToast({
@@ -80,7 +80,7 @@ export default {
80 80
 </script>
81 81
 
82 82
 <style lang="scss" scoped>
83
-.page{
84
-	height:100vh;
83
+.page {
84
+  height: 100vh;
85 85
 }
86 86
 </style>

+ 37 - 37
src/pages/studentcenter/classVideo.vue

@@ -1,43 +1,43 @@
1 1
 <template>
2 2
   <view class="page">
3
-		<cu-custom :isBack="true" title="课堂视频"></cu-custom>
4
-		<scroll-view scroll-y="true"
5
-			:style="[{height:'calc(100vh - '+ topHeader+'px)'}]">
6
-			<view class="content">
7
-				<view class="course-img">
8
-					<swiper class="swiper" :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay" :interval="swiper.interval" :duration="swiper.duration">
9
-						<swiper-item v-for="(item,index) in detail.course_data.image" :key="index">
10
-							<view class="swiper-item">
11
-								  <image :src="item" mode="widthFix"></image>
12
-							</view>
13
-						</swiper-item>
14
-					</swiper>
15
-				</view>
16
-				<view>
17
-					<view class="title flex align-center">
18
-						<text class="iconfont" style="font-size:24px;">&#xe76d;</text>课堂视频
19
-					</view>
20
-					<view class="list" v-if='detail.moments_data'>
21
-						<view class="cu-card case" v-for="(video,index) in detail.moments_data.data" :key="index">
22
-							<view class="cu-item shadow">
23
-								<view class="image">
24
-									<image :src="video.images" v-if="checkTypes(video.images,'imgs')" style="width:100%;"></image>
25
-									<video :src="video.images" v-if="checkTypes(video.images,'video')" style="width:100%;"></video>
26
-									<view class="padding-xs">{{video.content}}</view>
27
-								</view>
28
-							</view>
29
-						</view>
30
-					</view>
31
-				</view>
32
-			</view>
33
-		</scroll-view>
34
-	</view>
3
+    <cu-custom :isBack="true" title="课堂视频"></cu-custom>
4
+    <scroll-view scroll-y="true" :style="[{height:'calc(100vh - '+ topHeader+'px)'}]">
5
+      <view class="content">
6
+        <view class="course-img">
7
+          <swiper class="swiper" :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay"
8
+            :interval="swiper.interval" :duration="swiper.duration">
9
+            <swiper-item v-for="(item,index) in detail.course_data.image" :key="index">
10
+              <view class="swiper-item">
11
+                <image :src="item" mode="widthFix"></image>
12
+              </view>
13
+            </swiper-item>
14
+          </swiper>
15
+        </view>
16
+        <view>
17
+          <view class="title flex align-center">
18
+            <text class="iconfont" style="font-size:24px;">&#xe76d;</text>课堂视频
19
+          </view>
20
+          <view class="list" v-if='detail.moments_data'>
21
+            <view class="cu-card case" v-for="(video,index) in detail.moments_data.data" :key="index">
22
+              <view class="cu-item shadow">
23
+                <view class="image">
24
+                  <image :src="video.images" v-if="checkTypes(video.images,'imgs')" style="width:100%;"></image>
25
+                  <video :src="video.images" v-if="checkTypes(video.images,'video')" style="width:100%;"></video>
26
+                  <view class="padding-xs">{{video.content}}</view>
27
+                </view>
28
+              </view>
29
+            </view>
30
+          </view>
31
+        </view>
32
+      </view>
33
+    </scroll-view>
34
+  </view>
35 35
 </template>
36 36
 
37 37
 <script>
38 38
 import { checkTypes } from '@/common/utils/index'
39 39
 export default {
40
-  data() {
40
+  data () {
41 41
     return {
42 42
       topHeader: this.globalCustomBarHeight,
43 43
       detail: {},
@@ -49,12 +49,12 @@ export default {
49 49
       }
50 50
     }
51 51
   },
52
-  onLoad() {
52
+  onLoad () {
53 53
     this.init()
54 54
   },
55 55
   methods: {
56 56
     checkTypes,
57
-    init() {
57
+    init () {
58 58
       this.detail = JSON.parse(uni.getStorageSync('daily_class'))
59 59
     }
60 60
   }
@@ -62,7 +62,7 @@ export default {
62 62
 </script>
63 63
 
64 64
 <style lang="scss" scoped>
65
-.page{
66
-	height:100vh;
65
+.page {
66
+  height: 100vh;
67 67
 }
68 68
 </style>

+ 63 - 59
src/pages/studentcenter/evaluate.vue

@@ -1,58 +1,62 @@
1 1
 <template>
2
-	<view class="page">
3
-		<cu-custom :isBack="true" title="评价"></cu-custom>
4
-		<view class="teacher flex bg-white padding">
5
-			<image mode="scaleToFill" :src="teacher_avatar" class="avatar lg"></image>
6
-				<view class="flex-sub margin-left">
7
-					<view class="teacher-title">{{teacher.username||''}}老师授课</view>
8
-					<view class="teacher-item">所属机构:{{teacher.agency_name||''}}</view>
9
-				<view class="teacher-exp flex">
10
-					<view class="exp-item">{{teacher.honor||''}}</view>
11
-					<view class="exp-item">{{teacher.introduce||''}}</view>
12
-				</view>
13
-			</view>
14
-		</view>
15
-		<view class="comment bg-white margin-top padding-lr padding-tb-lg">
16
-			<view>{{satisfaction.satisfaction?'已评价':'请评价'}}</view>
17
-			<view class="flex text-center margin-top" style="padding-left:80rpx;">
18
-					<view class="flex-sub">
19
-						<img src="/static/imgs/class/satisfaction.png" mode="widthFix" style="width:70px;">
20
-						<view>满意</view>
21
-					</view>
22
-					<view class="flex-sub">
23
-						<img src="/static/imgs/class/unsatisfaction.png" mode="widthFix" style="width:70px;">
24
-						<view>一般</view>
25
-					</view>
26
-			</view>
27
-			<view class="flex margin-top-sm">
28
-				<view style="width:80rpx;line-height:32px;">课程</view>
29
-				<view class="flex-sub text-center">
30
-					<button class="cu-btn" :class="params.agency_statisfaction===2?'bg-cyan':'line-cyan'"  @tap="evaluate('agency_statisfaction',2)">满意</button>
31
-				</view>
32
-				<view class="flex-sub text-center">
33
-					<button class="cu-btn" :class="params.agency_statisfaction===1?'bg-cyan':'line-cyan'"  @tap="evaluate('agency_statisfaction',1)">一般</button>
34
-				</view>
35
-			</view>
36
-			<view class="flex margin-top-sm">
37
-				<view style="width:80rpx;line-height:32px;">老师</view>
38
-				<view class="flex-sub text-center"  @tap="params.statisfaction=2">
39
-					<button class="cu-btn" :class="params.statisfaction===2?'bg-cyan':'line-cyan'"  @tap="evaluate('statisfaction',2)">满意</button>
40
-				</view>
41
-				<view class="flex-sub text-center" @tap="params.statisfaction=1">
42
-					<button class="cu-btn" :class="params.statisfaction===1?'bg-cyan':'line-cyan'"  @tap="evaluate('statisfaction',1)">一般</button>
43
-				</view>
44
-			</view>
45
-			<view class="margin-top-lg" v-if="!satisfaction.satisfaction">
46
-				<button class="cu-btn bg-cyan lg" style="width:100%;" @tap="comment">提交评价</button>
47
-			</view>
48
-		</view>
49
-	</view>
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="评价"></cu-custom>
4
+    <view class="teacher flex bg-white padding">
5
+      <image mode="scaleToFill" :src="teacher_avatar" class="avatar lg"></image>
6
+      <view class="flex-sub margin-left">
7
+        <view class="teacher-title">{{teacher.username||''}}老师授课</view>
8
+        <view class="teacher-item">所属机构:{{teacher.agency_name||''}}</view>
9
+        <view class="teacher-exp flex">
10
+          <view class="exp-item">{{teacher.honor||''}}</view>
11
+          <view class="exp-item">{{teacher.introduce||''}}</view>
12
+        </view>
13
+      </view>
14
+    </view>
15
+    <view class="comment bg-white margin-top padding-lr padding-tb-lg">
16
+      <view>{{satisfaction.satisfaction?'已评价':'请评价'}}</view>
17
+      <view class="flex text-center margin-top" style="padding-left:80rpx;">
18
+        <view class="flex-sub">
19
+          <img src="/static/imgs/class/satisfaction.png" mode="widthFix" style="width:70px;">
20
+          <view>满意</view>
21
+        </view>
22
+        <view class="flex-sub">
23
+          <img src="/static/imgs/class/unsatisfaction.png" mode="widthFix" style="width:70px;">
24
+          <view>一般</view>
25
+        </view>
26
+      </view>
27
+      <view class="flex margin-top-sm">
28
+        <view style="width:80rpx;line-height:32px;">课程</view>
29
+        <view class="flex-sub text-center">
30
+          <button class="cu-btn" :class="params.agency_statisfaction===2?'bg-cyan':'line-cyan'"
31
+            @tap="evaluate('agency_statisfaction',2)">满意</button>
32
+        </view>
33
+        <view class="flex-sub text-center">
34
+          <button class="cu-btn" :class="params.agency_statisfaction===1?'bg-cyan':'line-cyan'"
35
+            @tap="evaluate('agency_statisfaction',1)">一般</button>
36
+        </view>
37
+      </view>
38
+      <view class="flex margin-top-sm">
39
+        <view style="width:80rpx;line-height:32px;">老师</view>
40
+        <view class="flex-sub text-center" @tap="params.statisfaction=2">
41
+          <button class="cu-btn" :class="params.statisfaction===2?'bg-cyan':'line-cyan'"
42
+            @tap="evaluate('statisfaction',2)">满意</button>
43
+        </view>
44
+        <view class="flex-sub text-center" @tap="params.statisfaction=1">
45
+          <button class="cu-btn" :class="params.statisfaction===1?'bg-cyan':'line-cyan'"
46
+            @tap="evaluate('statisfaction',1)">一般</button>
47
+        </view>
48
+      </view>
49
+      <view class="margin-top-lg" v-if="!satisfaction.satisfaction">
50
+        <button class="cu-btn bg-cyan lg" style="width:100%;" @tap="comment">提交评价</button>
51
+      </view>
52
+    </view>
53
+  </view>
50 54
 </template>
51 55
 
52 56
 <script>
53 57
 import { _commentDetail, _tocomment } from '@/api/course'
54 58
 export default {
55
-  data() {
59
+  data () {
56 60
     return {
57 61
       teacher: {},
58 62
       satisfaction: {},
@@ -65,14 +69,14 @@ export default {
65 69
       teacher_avatar: '/static/imgs/class/logo0.png'
66 70
     }
67 71
   },
68
-  onLoad(options) {
72
+  onLoad (options) {
69 73
     const id = decodeURIComponent(options.plan_id)
70 74
     if (!id) uni.navigateBack()
71 75
     this.params.plan_id = id
72 76
     this.init()
73 77
   },
74 78
   methods: {
75
-    init() {
79
+    init () {
76 80
       _commentDetail({ plan_id: this.params.plan_id }).then(res => {
77 81
         this.teacher = res.data.teacher_data
78 82
         this.params.teacher_id = this.teacher.teacher_id
@@ -81,10 +85,10 @@ export default {
81 85
         this.params.agency_statisfaction = this.satisfaction.agency_satisfaction
82 86
       })
83 87
     },
84
-    evaluate(type, value) { // 评价
88
+    evaluate (type, value) { // 评价
85 89
       this.params[type] = value
86 90
     },
87
-    comment() {
91
+    comment () {
88 92
       _tocomment(this.params).then(res => {
89 93
         uni.showToast({ title: res.msg, icon: 'success' })
90 94
         setTimeout(() => {
@@ -98,12 +102,12 @@ export default {
98 102
 
99 103
 <style lang="scss" scoped>
100 104
 @import '~@/common/css/mixin.scss';
101
-.page{
102
-	height:100vh;
105
+.page {
106
+  height: 100vh;
103 107
 }
104
-.teacher{
105
-	&-title{
106
-		@include title(4px,18px);
107
-	}
108
+.teacher {
109
+  &-title {
110
+    @include title(4px, 18px);
111
+  }
108 112
 }
109 113
 </style>

+ 206 - 207
src/pages/studentcenter/index.vue

@@ -1,143 +1,143 @@
1 1
 <template>
2 2
   <view class="page">
3 3
     <cu-custom :isBack="false"></cu-custom>
4
-		<view class="header" :style="[{top:topHeader + 'px'}]">
5
-			<view class="header-title header-switch">
6
-				<view class="header-title-main" @tap="changeTab('schedule')" :class="{'cur':type==='schedule'}">
7
-						<view class="margin-bottom-xs">日程表</view>
8
-						<view class="point"></view>
9
-				</view>
10
-				<view class="header-title-main margin-left-lg" @tap="changeTab('mine')" :class="{'cur':type==='mine'}">
11
-						<view class="margin-bottom-xs">我的</view>
12
-						<view class="point"></view>
13
-				</view>
14
-			</view>
15
-			 <view style="width:120px;" v-if="type==='mine'">
16
-				 	<swiper-tab :menuList="menuList" @changeTab="swipe" :activeTab="currentIndex"></swiper-tab>
17
-			 </view>
18
-		</view>
19
-		<!-- 日程表 -->
20
-		<view v-if="type==='schedule'">
21
-			<scroll-view scroll-y="true"
22
-			:style="[{marginTop:'56px',height:'calc(100vh - 114px - '+ topHeader+'px)'}]">
23
-				<view class="calendar padding-tb solid-bottom bg-white">
24
-					<view class="calendar-header flex justify-between padding-lr-sm">
25
-							<view>
26
-									<picker mode="date" :value="info.chooseDate" :fields="info.fields"
27
-											@change="bindDateChange"
28
-											:start="info.start" :end="info.end">
29
-												<view class="picker text-student text-xl">
30
-													{{info.chooseDate}}
31
-													<text class="cuIcon-right lg"></text>
32
-												</view>
33
-										</picker>
34
-							</view>
35
-							<view>
36
-								共{{present.attendance_data.length}}天
37
-							</view>
38
-					</view>
39
-					<view class="calendar-main">
40
-						<calendar :year="year" :month="month"  :showBusiness="true" @changeDate="chooseDay" ref="calendar"></calendar>
41
-					</view>
42
-					<view class="calendar-marks flex justify-end padding-lr-sm">
43
-							<view class="margin-left-sm">
44
-								<view class="cu-tag bg-blue margin-right-sm"></view><text class="text-sm">请假</text>
45
-							</view>
46
-							<view class="margin-left-sm">
47
-								<view class="cu-tag bg-yellow margin-right-sm"></view><text class="text-sm">迟到</text>
48
-							</view>
49
-							<view class="margin-left-sm">
50
-								<view class="cu-tag bg-normal margin-right-sm"></view><text class="text-sm">正常</text>
51
-							</view>
52
-							<view class="margin-left-sm">
53
-								<view class="cu-tag bg-red margin-right-sm"></view><text class="text-sm">旷课</text>
54
-							</view>
55
-					</view>
56
-				</view>
57
-				<view class="cu-card margin-top-xs padding-xs">
58
-					<view class="cu-item day-info">
59
-						<view class="day-title flex justify-between solid-bottom padding text-lg">
60
-							 <view>应到上课节数:{{present.be_section_num}}节</view>
61
-							 <view>实际上课节数: {{present.actual_section_num}}节</view>
62
-						</view>
63
-						<view class="day-chart flex justify-between padding">
64
-							<view v-for="(chart,key) in attendance" :key="key" class="flex-sub">
65
-									<canvas :canvas-id="key" style="margin:0 auto;width:100%;height:80px;"></canvas>
66
-									<view style="margin-left:18px;">{{chart.title}}</view>
67
-							</view>
68
-						</view>
69
-					</view>
70
-				</view>
71
-				<view class="list margin-top-xs">
72
-					<view class="cu-card margin-top margin-bottom shadow" v-for="(item,index) in classList" :key="index">
73
-						<view class="cu-item" v-for="(mark,i) in item.mark" :key="i">
74
-							<view class="card-header flex justify-end solid-bottom">
75
-									<view class="text-student course-status">
76
-											{{mark.status_desc}}
77
-									</view>
78
-							</view>
79
-							<view class="card flex">
80
-									<view class="card-left">
81
-										<img mode="scaleToFill" :src="mark.avatar" alt="" class="card-image">
82
-									</view>
83
-									<view class="card-right margin-left-sm">
84
-										<view class="card-title">{{mark.course_name}}</view>
85
-										<view class="card-item margin-top-xs" >
86
-										 	<text class="card-text">{{mark.start_at}}</text>
87
-									  </view>
88
-										<view class="card-item margin-top-xs" >
89
-										 	<text class="card-text">{{mark.end_at}}</text>
90
-									  </view>
91
-										<view class="card-item margin-top-xs">
92
-											<button class="cu-btn round line-cyan button-hover" @tap="classOperation(mark.class_plan_id)">
93
-												{{mark.status==-1?'查看':'去上课'}}
94
-											</button>
95
-											<button class="cu-btn round line-red button-hover margin-left" @tap="askLeave(mark.class_plan_id)" v-if="mark.status!==-1">去请假</button>
96
-										</view>
97
-									</view>
98
-								</view>
99
-						</view>
100
-					</view>
101
-				</view>
102
-		  </scroll-view>
103
-		</view>
104
-		<!-- 我的 -->
105
-		<view v-if="type==='mine'">
106
-			<scroll-view scroll-y="true" @scrolltolower="loadMore" class="scroll-main"
107
-			:style="[{height:'calc(100vh - 114px - '+ topHeader+'px)'}]">
108
-				<view class="list">
109
-						<view class="cu-card margin-top margin-bottom shadow" v-for="(item,index) in list" :key="index">
110
-							<view class="cu-item">
111
-								<view class="card-header flex justify-between solid-bottom">
112
-									<view v-if="item.day">{{item.day}}</view>
113
-									<view class="text-student course-status" v-if="item.status">
114
-											{{item.status}}
115
-									</view>
116
-									<view class="text-student course-status" v-if="currentIndex===1">
117
-											已完结
118
-									</view>
119
-								</view>
120
-								<view class="card flex">
121
-									<view class="card-left">
122
-										<img mode="scaleToFill" :src="item.image" alt="" class="card-image">
123
-									</view>
124
-									<view class="card-right margin-left-sm">
125
-										<view class="card-title">{{item.attend_name}}</view>
126
-										<view class="card-item margin-top-xs">
127
-											<text class="card-label">机构:</text>
128
-										 	<text class="card-text">{{item.agency_name||'-'}}</text>
129
-									  </view>
130
-										<view class="card-item margin-top-xs">
131
-											<text class="card-label">老师:</text>
132
-										 	<text class="card-text">{{item.teacher||'-'}}</text>
133
-									  </view>
134
-									</view>
135
-								</view>
136
-							</view>
137
-						</view>
138
-				</view>
139
-			</scroll-view>
140
-		</view>
4
+    <view class="header" :style="[{top:topHeader + 'px'}]">
5
+      <view class="header-title header-switch">
6
+        <view class="header-title-main" @tap="changeTab('schedule')" :class="{'cur':type==='schedule'}">
7
+          <view class="margin-bottom-xs">日程表</view>
8
+          <view class="point"></view>
9
+        </view>
10
+        <view class="header-title-main margin-left-lg" @tap="changeTab('mine')" :class="{'cur':type==='mine'}">
11
+          <view class="margin-bottom-xs">我的</view>
12
+          <view class="point"></view>
13
+        </view>
14
+      </view>
15
+      <view style="width:120px;" v-if="type==='mine'">
16
+        <swiper-tab :menuList="menuList" @changeTab="swipe" :activeTab="currentIndex"></swiper-tab>
17
+      </view>
18
+    </view>
19
+    <!-- 日程表 -->
20
+    <view v-if="type==='schedule'">
21
+      <scroll-view scroll-y="true" :style="[{marginTop:'56px',height:'calc(100vh - 114px - '+ topHeader+'px)'}]">
22
+        <view class="calendar padding-tb solid-bottom bg-white">
23
+          <view class="calendar-header flex justify-between padding-lr-sm">
24
+            <view>
25
+              <picker mode="date" :value="info.chooseDate" :fields="info.fields" @change="bindDateChange"
26
+                :start="info.start" :end="info.end">
27
+                <view class="picker text-student text-xl">
28
+                  {{info.chooseDate}}
29
+                  <text class="cuIcon-right lg"></text>
30
+                </view>
31
+              </picker>
32
+            </view>
33
+            <view>
34
+              共{{present.attendance_data.length}}天
35
+            </view>
36
+          </view>
37
+          <view class="calendar-main">
38
+            <calendar :year="year" :month="month" :showBusiness="true" @changeDate="chooseDay" ref="calendar">
39
+            </calendar>
40
+          </view>
41
+          <view class="calendar-marks flex justify-end padding-lr-sm">
42
+            <view class="margin-left-sm">
43
+              <view class="cu-tag bg-blue margin-right-sm"></view><text class="text-sm">请假</text>
44
+            </view>
45
+            <view class="margin-left-sm">
46
+              <view class="cu-tag bg-yellow margin-right-sm"></view><text class="text-sm">迟到</text>
47
+            </view>
48
+            <view class="margin-left-sm">
49
+              <view class="cu-tag bg-normal margin-right-sm"></view><text class="text-sm">正常</text>
50
+            </view>
51
+            <view class="margin-left-sm">
52
+              <view class="cu-tag bg-red margin-right-sm"></view><text class="text-sm">旷课</text>
53
+            </view>
54
+          </view>
55
+        </view>
56
+        <view class="cu-card margin-top-xs padding-xs">
57
+          <view class="cu-item day-info">
58
+            <view class="day-title flex justify-between solid-bottom padding text-lg">
59
+              <view>应到上课节数:{{present.be_section_num}}节</view>
60
+              <view>实际上课节数: {{present.actual_section_num}}节</view>
61
+            </view>
62
+            <view class="day-chart flex justify-between padding">
63
+              <view v-for="(chart,key) in attendance" :key="key" class="flex-sub">
64
+                <canvas :canvas-id="key" style="margin:0 auto;width:100%;height:80px;"></canvas>
65
+                <view style="margin-left:18px;">{{chart.title}}</view>
66
+              </view>
67
+            </view>
68
+          </view>
69
+        </view>
70
+        <view class="list margin-top-xs">
71
+          <view class="cu-card margin-top margin-bottom shadow" v-for="(item,index) in classList" :key="index">
72
+            <view class="cu-item" v-for="(mark,i) in item.mark" :key="i">
73
+              <view class="card-header flex justify-end solid-bottom">
74
+                <view class="text-student course-status">
75
+                  {{mark.status_desc}}
76
+                </view>
77
+              </view>
78
+              <view class="card flex">
79
+                <view class="card-left">
80
+                  <img mode="scaleToFill" :src="mark.avatar" alt="" class="card-image">
81
+                </view>
82
+                <view class="card-right margin-left-sm">
83
+                  <view class="card-title">{{mark.course_name}}</view>
84
+                  <view class="card-item margin-top-xs">
85
+                    <text class="card-text">{{mark.start_at}}</text>
86
+                  </view>
87
+                  <view class="card-item margin-top-xs">
88
+                    <text class="card-text">{{mark.end_at}}</text>
89
+                  </view>
90
+                  <view class="card-item margin-top-xs">
91
+                    <button class="cu-btn round line-cyan button-hover" @tap="classOperation(mark.class_plan_id)">
92
+                      {{mark.status==-1?'查看':'去上课'}}
93
+                    </button>
94
+                    <button class="cu-btn round line-red button-hover margin-left" @tap="askLeave(mark.class_plan_id)"
95
+                      v-if="mark.status!==-1">去请假</button>
96
+                  </view>
97
+                </view>
98
+              </view>
99
+            </view>
100
+          </view>
101
+        </view>
102
+      </scroll-view>
103
+    </view>
104
+    <!-- 我的 -->
105
+    <view v-if="type==='mine'">
106
+      <scroll-view scroll-y="true" @scrolltolower="loadMore" class="scroll-main"
107
+        :style="[{height:'calc(100vh - 114px - '+ topHeader+'px)'}]">
108
+        <view class="list">
109
+          <view class="cu-card margin-top margin-bottom shadow" v-for="(item,index) in list" :key="index">
110
+            <view class="cu-item">
111
+              <view class="card-header flex justify-between solid-bottom">
112
+                <view v-if="item.day">{{item.day}}</view>
113
+                <view class="text-student course-status" v-if="item.status">
114
+                  {{item.status}}
115
+                </view>
116
+                <view class="text-student course-status" v-if="currentIndex===1">
117
+                  已完结
118
+                </view>
119
+              </view>
120
+              <view class="card flex">
121
+                <view class="card-left">
122
+                  <img mode="scaleToFill" :src="item.image" alt="" class="card-image">
123
+                </view>
124
+                <view class="card-right margin-left-sm">
125
+                  <view class="card-title">{{item.attend_name}}</view>
126
+                  <view class="card-item margin-top-xs">
127
+                    <text class="card-label">机构:</text>
128
+                    <text class="card-text">{{item.agency_name||'-'}}</text>
129
+                  </view>
130
+                  <view class="card-item margin-top-xs">
131
+                    <text class="card-label">老师:</text>
132
+                    <text class="card-text">{{item.teacher||'-'}}</text>
133
+                  </view>
134
+                </view>
135
+              </view>
136
+            </view>
137
+          </view>
138
+        </view>
139
+      </scroll-view>
140
+    </view>
141 141
     <mp-tabbar :outerSelected="1" />
142 142
   </view>
143 143
 </template>
@@ -197,7 +197,7 @@ export default {
197 197
       }
198 198
     }
199 199
   },
200
-  onShow() {
200
+  onShow () {
201 201
     const today = getDate(new Date(), 0)
202 202
     this.info.year = this.info.year || today.year
203 203
     this.info.month = this.info.month || today.month
@@ -208,14 +208,14 @@ export default {
208 208
     this.init()
209 209
   },
210 210
   methods: {
211
-    init() {
211
+    init () {
212 212
       if (this.type === 'mine') {
213 213
         this.get_list()
214 214
       } else {
215 215
         this.getSehedule()
216 216
       }
217 217
     },
218
-    getSehedule() {
218
+    getSehedule () {
219 219
       this.setCalendar()
220 220
       this.get_attend().then(res => {
221 221
         this.present = res.data
@@ -225,13 +225,13 @@ export default {
225 225
         this.get_dateCourse()// 获取日期课程列表
226 226
       })
227 227
     },
228
-    classOperation(id) { // 上课
228
+    classOperation (id) { // 上课
229 229
       this.globalNavigateTo('studentOperation', { id })
230 230
     },
231
-    askLeave(id) { // 请假
231
+    askLeave (id) { // 请假
232 232
       this.globalNavigateTo('studentAbsent', { id })
233 233
     },
234
-    loadMore() {
234
+    loadMore () {
235 235
       if (this.noMore) {
236 236
         uni.showToast({ title: '没有更多了', icon: 'none' })
237 237
         return false
@@ -239,18 +239,18 @@ export default {
239 239
       this.page_num++
240 240
       this.get_list()
241 241
     },
242
-    get_list() {
242
+    get_list () {
243 243
       if (this.currentIndex === 0) {
244 244
         this.get_course()
245 245
       } else {
246 246
         this.get_history()
247 247
       }
248 248
     },
249
-    chooseDay(day) {
249
+    chooseDay (day) {
250 250
       this.classList = this.courses.filter(item => item.date.replace(/-/g, '') === day)// 匹配当天数据
251 251
       this.classList = this.classList.length > 0 ? this.classList : deepClone(this.courses)
252 252
     },
253
-    get_course() {
253
+    get_course () {
254 254
       _nowCourse({ page_num: this.page_num }).then(res => {
255 255
         if (this.page_num > 1) {
256 256
           if (res.data.length < this.page_size) this.noMore = true
@@ -261,7 +261,7 @@ export default {
261 261
         }
262 262
       })
263 263
     },
264
-    get_history() {
264
+    get_history () {
265 265
       _courseHistory({ page_num: this.page_num }).then(res => {
266 266
         if (this.page_num > 1) {
267 267
           if (res.data.length < this.page_size) this.noMore = true
@@ -272,23 +272,23 @@ export default {
272 272
         }
273 273
       })
274 274
     },
275
-    drawChart() {
275
+    drawChart () {
276 276
       for (var key in this.attendance) {
277 277
         this.draw(this.attendance[key], key)
278 278
       }
279 279
     },
280
-    changeTab(type) {
280
+    changeTab (type) {
281 281
       this.type = type
282 282
       this.$nextTick(() => {
283 283
         this.init()
284 284
       })
285 285
     },
286
-    swipe(index) {
286
+    swipe (index) {
287 287
       this.currentIndex = index
288 288
       this.page_num = 1
289 289
       this.get_list()
290 290
     },
291
-    bindDateChange(e) {
291
+    bindDateChange (e) {
292 292
       const value = e.detail.value
293 293
       const [year, month] = value.split('-')
294 294
       this.info.year = year
@@ -296,26 +296,26 @@ export default {
296 296
       this.info.chooseDate = value
297 297
       this.getSehedule()
298 298
     },
299
-    setCalendar() {
299
+    setCalendar () {
300 300
       this.$refs.calendar.selCalendar(this.info.year, this.info.month)
301 301
     },
302
-    setAttendance(attendance) { // 补充出席情况
302
+    setAttendance (attendance) { // 补充出席情况
303 303
       if (!attendance) return
304 304
       this.$refs.calendar.setAttendance(attendance)
305 305
     },
306
-    get_attend() { // 获取出席情况
306
+    get_attend () { // 获取出席情况
307 307
       const date = this.info.year + '-' + this.info.month
308 308
       return new Promise((resolve, reject) => {
309 309
         const info = _attendance({ date })
310 310
         resolve(info)
311 311
       })
312 312
     },
313
-    fix_attend(info) { // 补充出席实际数据
313
+    fix_attend (info) { // 补充出席实际数据
314 314
       Object.keys(this.attendance).forEach(key => {
315 315
         this.attendance[key].times = info[key]
316 316
       })
317 317
     },
318
-    get_dateCourse() { // 获取对应日期数据
318
+    get_dateCourse () { // 获取对应日期数据
319 319
       _dateCourse({ year: this.info.year, month: this.info.month }).then(res => {
320 320
         this.classList = res.data
321 321
         this.courses = res.data
@@ -351,63 +351,62 @@ export default {
351 351
 
352 352
 <style lang="scss">
353 353
 @import '~@/common/css/mixin.scss';
354
-.page{
355
-	height:100vh;
354
+.page {
355
+  height: 100vh;
356 356
 }
357
-.header-switch{
358
-	justify-content:start;
359
-	.header-title-main{
360
-		font-size:18px;
361
-		color:#999;
362
-		.point{
363
-			opacity: 0;
364
-		}
365
-		&.cur{
366
-			transition: font-size .3s;
367
-			font-size:24px;
368
-			color:#000;
369
-			.point{
370
-				opacity: 1;
371
-		  }
372
-		}
373
-	}
357
+.header-switch {
358
+  justify-content: start;
359
+  .header-title-main {
360
+    font-size: 18px;
361
+    color: #999;
362
+    .point {
363
+      opacity: 0;
364
+    }
365
+    &.cur {
366
+      transition: font-size 0.3s;
367
+      font-size: 24px;
368
+      color: #000;
369
+      .point {
370
+        opacity: 1;
371
+      }
372
+    }
373
+  }
374 374
 }
375
-.day-info{
376
-
375
+.day-info {
377 376
 }
378
-.scroll-main{
379
-	margin-top:78px;
380
-	padding:20rpx;
377
+.scroll-main {
378
+  margin-top: 78px;
379
+  padding: 20rpx;
381 380
 }
382
-.cu-card{
383
-	.cu-item{
384
-		margin-top:10rpx;
385
-		padding:20rpx;
386
-		margin:0;
387
-	}
381
+.cu-card {
382
+  .cu-item {
383
+    margin-top: 10rpx;
384
+    padding: 20rpx;
385
+    margin: 0;
386
+  }
388 387
 }
389
-.card-header{
390
-	padding-bottom:10px;
391
-  @include title(10px,18px);
388
+.card-header {
389
+  padding-bottom: 10px;
390
+  @include title(10px, 18px);
392 391
 }
393
-.card{
394
-	&-title{
395
-		font-size:16px;
396
-	}
397
-	&-image{
398
-		width:35vw;
399
-		height:25vw;
400
-		border-radius:2vw;
401
-	}
402
-	&-label{
403
-		color:#999;
404
-	}
405
-	&-text{
406
-		color:#333;
407
-	}
392
+.card {
393
+  &-title {
394
+    font-size: 16px;
395
+  }
396
+  &-image {
397
+    width: 35vw;
398
+    height: 25vw;
399
+    border-radius: 2vw;
400
+  }
401
+  &-label {
402
+    color: #999;
403
+  }
404
+  &-text {
405
+    color: #333;
406
+  }
408 407
 }
409
-.course-status{
410
-	font-size:14px;
411
-	font-weight:normal;
408
+.course-status {
409
+  font-size: 14px;
410
+  font-weight: normal;
412 411
 }
413 412
 </style>

+ 123 - 122
src/pages/studentcenter/operation.vue

@@ -1,111 +1,112 @@
1 1
 <template>
2
-	<view class="page">
3
-		<cu-custom :isBack="true" title="课堂操作"></cu-custom>
4
-		<scroll-view scroll-y="true"
5
-			:style="[{height:'calc(100vh - '+ topHeader+'px)'}]">
6
-			<view class="content">
7
-				<view class="course-img">
8
-					<swiper class="swiper" :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay" :interval="swiper.interval" :duration="swiper.duration">
9
-						<swiper-item v-for="(item,index) in detail.course_data.image" :key="index">
10
-							<view class="swiper-item">
11
-								  <image :src="item" mode="widthFix"></image>
12
-							</view>
13
-						</swiper-item>
14
-					</swiper>
15
-				</view>
16
-				<view class="detail bg-white padding">
17
-					<view class="detail-title">{{detail.course_data.attend_name}}</view>
18
-					<view class="detail-item">
19
-						<text class="cuIcon-title text-student"></text>
20
-						<text class="text-gray">周期</text>
21
-						<text class="text-black margin-left-xs">{{detail.course_data.start_at}}</text>
22
-					</view>
23
-					<view class="detail-item flex">
24
-						<text class="text-gray" style="width:40px;"></text>
25
-						<text class="text-black margin-left-xs">{{detail.course_data.end_at}}</text>
26
-					</view>
27
-					<view class="detail-item margin-top-xs">
28
-						<text class="cuIcon-title text-student"></text>
29
-						<text class="text-gray">年级</text>
30
-						<text class="text-black margin-left-xs">{{detail.course_data.grade}}</text>
31
-					</view>
32
-				</view>
33
-				<view class="teacher flex bg-white padding margin-tb-sm">
34
-					<image mode="scaleToFill" :src="teacher_avatar" class="avatar lg"></image>
35
-					<view class="flex-sub margin-left">
36
-						 <view class="teacher-title">{{detail.teacher.username||''}}老师授课</view>
37
-						 <view class="teacher-item">所属机构:{{detail.teacher.agency_name||''}}</view>
38
-						<view class="teacher-exp flex">
39
-							 <view class="exp-item">{{detail.teacher.honor||''}}</view>
40
-							 <view class="exp-item">{{detail.teacher.introduce||''}}</view>
41
-						 </view>
42
-					</view>
43
-				</view>
44
-				<view class="cu-timeline">
45
-					<view class="cu-time">详情</view>
46
-					<view class="cu-item">
47
-						<view class="cu-content time-item flex justify-between">
48
-							<view class="time-left text-black flex-sub">评价</view>
49
-							<view class="time-right text-student" v-if="detail.teacher&&detail.teacher.username" @tap="check('studentEvaluate')">
50
-								查看
51
-							</view>
52
-						</view>
53
-					</view>
54
-					<view class="cu-item">
55
-						<view class="cu-content time-item flex justify-between">
56
-							<view class="time-left text-black flex-sub">上课时间
57
-								<view>{{detail.course_data.start_at}}</view>
58
-							</view>
59
-						</view>
60
-					</view>
61
-					<view class="cu-item">
62
-						<view class="cu-content time-item flex justify-between">
63
-							<view class="time-left text-black flex-sub">课堂签到
64
-								<view>{{detail.call_status.title}}</view>
65
-							</view>
66
-						</view>
67
-					</view>
68
-					<view class="cu-item">
69
-						<view class="cu-content time-item flex justify-between">
70
-							<view class="time-left text-black flex-sub">课堂视频</view>
71
-							<view class="time-right text-student" @tap="check('studentVideo')">
72
-								查看
73
-							</view>
74
-						</view>
75
-					</view>
76
-					<view class="cu-item">
77
-						<view class="cu-content time-item flex justify-between">
78
-							<view class="time-left text-black flex-sub">课堂作品</view>
79
-							<view class="time-right text-student" @tap="check('studentWorks')">
80
-								查看
81
-							</view>
82
-						</view>
83
-					</view>
84
-					<view class="cu-item">
85
-						<view class="cu-content time-item flex justify-between">
86
-							<view class="time-left text-black flex-sub">下课时间
87
-								<view>{{detail.course_data.end_at}}</view>
88
-							</view>
89
-						</view>
90
-					</view>
91
-					<view class="cu-item">
92
-						<view class="cu-content time-item flex justify-between">
93
-							<view class="time-left text-black flex-sub">安全交接</view>
94
-							<view class="time-right text-student" @tap="check('studentSignin')">
95
-								查看
96
-							</view>
97
-						</view>
98
-					</view>
99
-				</view>
100
-			</view>
101
-		</scroll-view>
102
-	</view>
2
+  <view class="page">
3
+    <cu-custom :isBack="true" title="课堂操作"></cu-custom>
4
+    <scroll-view scroll-y="true" :style="[{height:'calc(100vh - '+ topHeader+'px)'}]">
5
+      <view class="content">
6
+        <view class="course-img">
7
+          <swiper class="swiper" :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay"
8
+            :interval="swiper.interval" :duration="swiper.duration">
9
+            <swiper-item v-for="(item,index) in detail.course_data.image" :key="index">
10
+              <view class="swiper-item">
11
+                <image :src="item" mode="widthFix"></image>
12
+              </view>
13
+            </swiper-item>
14
+          </swiper>
15
+        </view>
16
+        <view class="detail bg-white padding">
17
+          <view class="detail-title">{{detail.course_data.attend_name}}</view>
18
+          <view class="detail-item">
19
+            <text class="cuIcon-title text-student"></text>
20
+            <text class="text-gray">周期</text>
21
+            <text class="text-black margin-left-xs">{{detail.course_data.start_at}}</text>
22
+          </view>
23
+          <view class="detail-item flex">
24
+            <text class="text-gray" style="width:40px;"></text>
25
+            <text class="text-black margin-left-xs">{{detail.course_data.end_at}}</text>
26
+          </view>
27
+          <view class="detail-item margin-top-xs">
28
+            <text class="cuIcon-title text-student"></text>
29
+            <text class="text-gray">年级</text>
30
+            <text class="text-black margin-left-xs">{{detail.course_data.grade}}</text>
31
+          </view>
32
+        </view>
33
+        <view class="teacher flex bg-white padding margin-tb-sm">
34
+          <image mode="scaleToFill" :src="teacher_avatar" class="avatar lg"></image>
35
+          <view class="flex-sub margin-left">
36
+            <view class="teacher-title">{{detail.teacher.username||''}}老师授课</view>
37
+            <view class="teacher-item">所属机构:{{detail.teacher.agency_name||''}}</view>
38
+            <view class="teacher-exp flex">
39
+              <view class="exp-item">{{detail.teacher.honor||''}}</view>
40
+              <view class="exp-item">{{detail.teacher.introduce||''}}</view>
41
+            </view>
42
+          </view>
43
+        </view>
44
+        <view class="cu-timeline">
45
+          <view class="cu-time">详情</view>
46
+          <view class="cu-item">
47
+            <view class="cu-content time-item flex justify-between">
48
+              <view class="time-left text-black flex-sub">评价</view>
49
+              <view class="time-right text-student" v-if="detail.teacher&&detail.teacher.username"
50
+                @tap="check('studentEvaluate')">
51
+                查看
52
+              </view>
53
+            </view>
54
+          </view>
55
+          <view class="cu-item">
56
+            <view class="cu-content time-item flex justify-between">
57
+              <view class="time-left text-black flex-sub">上课时间
58
+                <view>{{detail.course_data.start_at}}</view>
59
+              </view>
60
+            </view>
61
+          </view>
62
+          <view class="cu-item">
63
+            <view class="cu-content time-item flex justify-between">
64
+              <view class="time-left text-black flex-sub">课堂签到
65
+                <view>{{detail.call_status.title}}</view>
66
+              </view>
67
+            </view>
68
+          </view>
69
+          <view class="cu-item">
70
+            <view class="cu-content time-item flex justify-between">
71
+              <view class="time-left text-black flex-sub">课堂视频</view>
72
+              <view class="time-right text-student" @tap="check('studentVideo')">
73
+                查看
74
+              </view>
75
+            </view>
76
+          </view>
77
+          <view class="cu-item">
78
+            <view class="cu-content time-item flex justify-between">
79
+              <view class="time-left text-black flex-sub">课堂作品</view>
80
+              <view class="time-right text-student" @tap="check('studentWorks')">
81
+                查看
82
+              </view>
83
+            </view>
84
+          </view>
85
+          <view class="cu-item">
86
+            <view class="cu-content time-item flex justify-between">
87
+              <view class="time-left text-black flex-sub">下课时间
88
+                <view>{{detail.course_data.end_at}}</view>
89
+              </view>
90
+            </view>
91
+          </view>
92
+          <view class="cu-item">
93
+            <view class="cu-content time-item flex justify-between">
94
+              <view class="time-left text-black flex-sub">安全交接</view>
95
+              <view class="time-right text-student" @tap="check('studentSignin')">
96
+                查看
97
+              </view>
98
+            </view>
99
+          </view>
100
+        </view>
101
+      </view>
102
+    </scroll-view>
103
+  </view>
103 104
 </template>
104 105
 
105 106
 <script>
106 107
 import { _dailiClass } from '@/api/course'
107 108
 export default {
108
-  data() {
109
+  data () {
109 110
     return {
110 111
       topHeader: this.globalCustomBarHeight,
111 112
       plan_id: 0,
@@ -119,17 +120,17 @@ export default {
119 120
       teacher_avatar: '/static/imgs/class/logo0.png'
120 121
     }
121 122
   },
122
-  onLoad(options) {
123
+  onLoad (options) {
123 124
     const id = decodeURIComponent(options.id)
124 125
     if (!id) uni.navigateBack()
125 126
     this.plan_id = id
126 127
     this.init()
127 128
   },
128 129
   methods: {
129
-    check(page) {
130
+    check (page) {
130 131
       this.globalNavigateTo(page, { plan_id: this.plan_id })
131 132
     },
132
-    init() {
133
+    init () {
133 134
       _dailiClass({ plan_id: this.plan_id }).then(res => {
134 135
         this.detail = res.data
135 136
         uni.setStorage({
@@ -144,25 +145,25 @@ export default {
144 145
 
145 146
 <style lang="scss" scoped>
146 147
 @import '~@/common/css/mixin.scss';
147
-.page{
148
-	height:100vh;
148
+.page {
149
+  height: 100vh;
149 150
 }
150
-.detail{
151
-	&-title{
152
-		@include title(10px,22px);
153
-	}
151
+.detail {
152
+  &-title {
153
+    @include title(10px, 22px);
154
+  }
154 155
 }
155
-.teacher{
156
-	&-title{
157
-		@include title(4px,18px);
158
-	}
156
+.teacher {
157
+  &-title {
158
+    @include title(4px, 18px);
159
+  }
159 160
 }
160
-.time-item{
161
-	line-height:32px;
162
-	.time-left{
163
-	}
164
-	.time-right{
165
-		width:120rpx;
166
-	}
161
+.time-item {
162
+  line-height: 32px;
163
+  .time-left {
164
+  }
165
+  .time-right {
166
+    width: 120rpx;
167
+  }
167 168
 }
168 169
 </style>

+ 80 - 80
src/pages/studentcenter/signIn.vue

@@ -1,50 +1,50 @@
1 1
 <template>
2 2
   <view class="page">
3
-		<cu-custom :isBack="true" title="上课签到"></cu-custom>
4
-		<view class="header bg-white" 	:style="[{top:topHeader + 'px'}]">
5
-			<view class="icon_title flex align-center justify-between solid-bottom">
6
-				<view class="info flex align-center justify-between">
7
-					 <image mode="scaleToFill" :src="user.avatarUrl" class="avatar lg" v-if="user.avatarUrl"></image>
8
-			  	 <view class="username">{{user.nickName}}</view>
9
-				</view>
10
-				<view style="color:#00D2E3">{{info.status_desc}}</view>
11
-    	</view>
12
-			<view class="class_info">
13
-				<view style="font-size:15px;margin-top: .6rem;">{{info.start_at}}</view>
14
-				<view class="class_title">{{info.course_name}}</view>
15
-				<view class="address flex align-center">
16
-					<image src="/static/imgs/school.png" mode="widthFix" style="width:18px;"/>
17
-					<view style="margin-left: 10px;margin-right: 20px">{{info.school_name}}</view>
18
-					<image src="/static/imgs/address.png" mode="widthFix" style="width:14px;"/>
19
-					<view style="margin-left: 10px">{{info.classroom_name}}</view>
20
-				</view>
21
-    	</view>
22
-		</view>
23
-		<view class="content" v-if="info.status">
24
-			<view class="content_title">签到说明</view>
25
-    	<view>接到学生后请“点击签到”按钮作为签到</view>
26
-			<view class="button" :style="checked?'background: #ddd':''"  hover-class="button_hover" @tap="signIn">
27
-				<view class="text" :style="checked?'color: #aaa':''"> {{checked?'已签到':'点击签到'}}</view>
28
-				<view class="pulse" v-if="!checked"></view>
29
-				<view class="pulse1" v-if="!checked"></view>
30
-    	</view>
31
-     	<view class="des_title">
32
-				<view class="line"></view>
33
-				<view>注意事项</view>
34
-				<view class="line"></view>
35
-    	</view>
36
-			<view>为确保学校每个学生的接送安全,平台特将接送学生的有关的 安全细则及注意事项重申如下,希望相关监护人及学生遵照执 行: </view>
37
-			<view>1.要遵守校规,按时到校,听从教师的教导。 </view>
38
-			<view>2.上课要自觉遵守课堂纪律,认真听讲,积极思维,好好学习。</view>
39
-		</view>
40
-	</view>
3
+    <cu-custom :isBack="true" title="上课签到"></cu-custom>
4
+    <view class="header bg-white" :style="[{top:topHeader + 'px'}]">
5
+      <view class="icon_title flex align-center justify-between solid-bottom">
6
+        <view class="info flex align-center justify-between">
7
+          <image mode="scaleToFill" :src="user.avatarUrl" class="avatar lg" v-if="user.avatarUrl"></image>
8
+          <view class="username">{{user.nickName}}</view>
9
+        </view>
10
+        <view style="color:#00D2E3">{{info.status_desc}}</view>
11
+      </view>
12
+      <view class="class_info">
13
+        <view style="font-size:15px;margin-top: .6rem;">{{info.start_at}}</view>
14
+        <view class="class_title">{{info.course_name}}</view>
15
+        <view class="address flex align-center">
16
+          <image src="/static/imgs/school.png" mode="widthFix" style="width:18px;" />
17
+          <view style="margin-left: 10px;margin-right: 20px">{{info.school_name}}</view>
18
+          <image src="/static/imgs/address.png" mode="widthFix" style="width:14px;" />
19
+          <view style="margin-left: 10px">{{info.classroom_name}}</view>
20
+        </view>
21
+      </view>
22
+    </view>
23
+    <view class="content" v-if="info.status">
24
+      <view class="content_title">签到说明</view>
25
+      <view>接到学生后请“点击签到”按钮作为签到</view>
26
+      <view class="button" :style="checked?'background: #ddd':''" hover-class="button_hover" @tap="signIn">
27
+        <view class="text" :style="checked?'color: #aaa':''"> {{checked?'已签到':'点击签到'}}</view>
28
+        <view class="pulse" v-if="!checked"></view>
29
+        <view class="pulse1" v-if="!checked"></view>
30
+      </view>
31
+      <view class="des_title">
32
+        <view class="line"></view>
33
+        <view>注意事项</view>
34
+        <view class="line"></view>
35
+      </view>
36
+      <view>为确保学校每个学生的接送安全,平台特将接送学生的有关的 安全细则及注意事项重申如下,希望相关监护人及学生遵照执 行: </view>
37
+      <view>1.要遵守校规,按时到校,听从教师的教导。 </view>
38
+      <view>2.上课要自觉遵守课堂纪律,认真听讲,积极思维,好好学习。</view>
39
+    </view>
40
+  </view>
41 41
 </template>
42 42
 
43 43
 <script>
44 44
 import { _getSignIn, _toSignIn } from '@/api/course'
45 45
 import { mapGetters } from 'vuex'
46 46
 export default {
47
-  data() {
47
+  data () {
48 48
     return {
49 49
       topHeader: this.globalCustomBarHeight,
50 50
       checked: false,
@@ -58,20 +58,20 @@ export default {
58 58
       'user'
59 59
     ])
60 60
   },
61
-  onLoad(options) {
61
+  onLoad (options) {
62 62
     const id = decodeURIComponent(options.plan_id)
63 63
     if (!id) uni.navigateBack()
64 64
     this.plan_id = id
65 65
     this.init()
66 66
   },
67 67
   methods: {
68
-    init() {
68
+    init () {
69 69
       _getSignIn({ plan_id: this.plan_id }).then(res => {
70 70
         this.info = res.data.sign_data
71 71
         this.checked = this.info.status === 1
72 72
       })
73 73
     },
74
-    signIn() {
74
+    signIn () {
75 75
       if (this.checked) return false
76 76
       _toSignIn({ clock_in_id: this.info.clock_in_id }).then(res => {
77 77
         if (res.code === 1) {
@@ -84,47 +84,47 @@ export default {
84 84
 </script>
85 85
 
86 86
 <style lang="scss" scoped>
87
-.header{
88
-	position:static;
87
+.header {
88
+  position: static;
89 89
   border-radius: 0 0 10px 10px;
90
-  padding: .8rem;
91
-  .icon_title{
92
-    .info{
93
-      .username{
90
+  padding: 0.8rem;
91
+  .icon_title {
92
+    .info {
93
+      .username {
94 94
         font-size: 21px;
95 95
         margin-left: 15px;
96 96
       }
97 97
     }
98 98
   }
99
-  .class_info{
100
-    margin-left: .8rem;
99
+  .class_info {
100
+    margin-left: 0.8rem;
101 101
   }
102
-  .class_title{
102
+  .class_title {
103 103
     font-size: 20px;
104 104
     font-weight: 550;
105
-    margin-top: .6rem;
105
+    margin-top: 0.6rem;
106 106
   }
107
-  .address{
107
+  .address {
108 108
     display: flex;
109 109
     align-items: center;
110
-    color: #898E96;
110
+    color: #898e96;
111 111
     font-size: 14px;
112
-    margin-top: .6rem;
112
+    margin-top: 0.6rem;
113 113
   }
114 114
 }
115
-.content{
116
-  margin-top: .2rem;
115
+.content {
116
+  margin-top: 0.2rem;
117 117
   background: #fff;
118 118
   color: #888;
119 119
   padding: 2rem;
120 120
   font-size: 14px;
121
-  .content_title{
121
+  .content_title {
122 122
     font-size: 15px;
123 123
     font-weight: 600;
124 124
     color: #000;
125
-    margin-bottom: .4rem;
125
+    margin-bottom: 0.4rem;
126 126
   }
127
-  .button{
127
+  .button {
128 128
     margin: 2rem auto;
129 129
     width: 30vw;
130 130
     height: 30vw;
@@ -136,26 +136,26 @@ export default {
136 136
     color: #fff;
137 137
     font-weight: 600;
138 138
     position: relative;
139
-    .text{
140
-			position: absolute;
141
-			top: 50%;
139
+    .text {
140
+      position: absolute;
141
+      top: 50%;
142 142
       left: 50%;
143
-      transform: translate(-50%,-50%);
144
-		  width: 30vw;
143
+      transform: translate(-50%, -50%);
144
+      width: 30vw;
145 145
       z-index: 999;
146 146
     }
147
-    .pulse{
147
+    .pulse {
148 148
       position: absolute;
149 149
       top: 0;
150 150
       left: 0;
151 151
       width: 30vw;
152 152
       height: 30vw;
153 153
       border-radius: 50%;
154
-      animation: warn1 2s linear .5s infinite;
154
+      animation: warn1 2s linear 0.5s infinite;
155 155
       background: #bfeff7;
156 156
       z-index: 1;
157 157
     }
158
-    .pulse1{
158
+    .pulse1 {
159 159
       position: absolute;
160 160
       top: 0;
161 161
       left: 0;
@@ -167,12 +167,12 @@ export default {
167 167
       z-index: 1;
168 168
     }
169 169
   }
170
-  .des_title{
170
+  .des_title {
171 171
     display: flex;
172 172
     justify-content: center;
173 173
     align-items: center;
174 174
     margin-bottom: 1rem;
175
-    .line{
175
+    .line {
176 176
       border: 1px solid #aaa;
177 177
       width: 20vw;
178 178
       margin: 0 15px;
@@ -182,24 +182,24 @@ export default {
182 182
 
183 183
 @keyframes warn1 {
184 184
   0% {
185
-  transform: scale(1);
186
-  opacity: 0;
185
+    transform: scale(1);
186
+    opacity: 0;
187 187
   }
188 188
   25% {
189
-  transform: scale(1);
190
-  opacity: .1;
189
+    transform: scale(1);
190
+    opacity: 0.1;
191 191
   }
192 192
   50% {
193
-  transform: scale(1);
194
-  opacity: .3;
193
+    transform: scale(1);
194
+    opacity: 0.3;
195 195
   }
196 196
   75% {
197
-  transform: scale(1.1);
198
-  opacity: .5;
197
+    transform: scale(1.1);
198
+    opacity: 0.5;
199 199
   }
200 200
   100% {
201
-  transform: scale(1.3);
202
-  opacity: 0;
201
+    transform: scale(1.3);
202
+    opacity: 0;
203 203
   }
204 204
 }
205 205
 </style>

+ 36 - 36
src/pages/studentcenter/works.vue

@@ -1,42 +1,42 @@
1 1
 <template>
2 2
   <view class="page">
3
-		<cu-custom :isBack="true" title="课堂作品"></cu-custom>
4
-		<scroll-view scroll-y="true"
5
-			:style="[{height:'calc(100vh - '+ topHeader+'px)'}]">
6
-			<view class="content">
7
-				<view class="course-img">
8
-					<swiper class="swiper" :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay" :interval="swiper.interval" :duration="swiper.duration">
9
-						<swiper-item v-for="(item,index) in detail.course_data.image" :key="index">
10
-							<view class="swiper-item">
11
-								  <image :src="item" mode="widthFix"></image>
12
-							</view>
13
-						</swiper-item>
14
-					</swiper>
15
-				</view>
16
-				<view>
17
-					<view class="title margin-top-sm">课堂作品</view>
18
-					<view class="list">
19
-						<view class="cu-card case" v-for="(item,index) in detail.student_comment_data.data" :key="index">
20
-							<view class="cu-item shadow">
21
-								<view class="image">
22
-									<view v-for="(img,i) in item.images" :key="i">
23
-										 <image :src="img" v-if="checkTypes(img,'imgs')" mode="aspectFit" style="width:100%;"></image>
24
-									   <video :src="img" v-if="checkTypes(img,'video')"  style="width:100%;"></video>
25
-									</view>
26
-								</view>
27
-							</view>
28
-						</view>
29
-					</view>
30
-				</view>
31
-			</view>
32
-		</scroll-view>
33
-	</view>
3
+    <cu-custom :isBack="true" title="课堂作品"></cu-custom>
4
+    <scroll-view scroll-y="true" :style="[{height:'calc(100vh - '+ topHeader+'px)'}]">
5
+      <view class="content">
6
+        <view class="course-img">
7
+          <swiper class="swiper" :indicator-dots="swiper.indicatorDots" :autoplay="swiper.autoplay"
8
+            :interval="swiper.interval" :duration="swiper.duration">
9
+            <swiper-item v-for="(item,index) in detail.course_data.image" :key="index">
10
+              <view class="swiper-item">
11
+                <image :src="item" mode="widthFix"></image>
12
+              </view>
13
+            </swiper-item>
14
+          </swiper>
15
+        </view>
16
+        <view>
17
+          <view class="title margin-top-sm">课堂作品</view>
18
+          <view class="list">
19
+            <view class="cu-card case" v-for="(item,index) in detail.student_comment_data.data" :key="index">
20
+              <view class="cu-item shadow">
21
+                <view class="image">
22
+                  <view v-for="(img,i) in item.images" :key="i">
23
+                    <image :src="img" v-if="checkTypes(img,'imgs')" mode="aspectFit" style="width:100%;"></image>
24
+                    <video :src="img" v-if="checkTypes(img,'video')" style="width:100%;"></video>
25
+                  </view>
26
+                </view>
27
+              </view>
28
+            </view>
29
+          </view>
30
+        </view>
31
+      </view>
32
+    </scroll-view>
33
+  </view>
34 34
 </template>
35 35
 
36 36
 <script>
37 37
 import { checkTypes } from '@/common/utils/index'
38 38
 export default {
39
-  data() {
39
+  data () {
40 40
     return {
41 41
       topHeader: this.globalCustomBarHeight,
42 42
       detail: {},
@@ -48,12 +48,12 @@ export default {
48 48
       }
49 49
     }
50 50
   },
51
-  onLoad() {
51
+  onLoad () {
52 52
     this.init()
53 53
   },
54 54
   methods: {
55 55
     checkTypes,
56
-    init() {
56
+    init () {
57 57
       this.detail = JSON.parse(uni.getStorageSync('daily_class'))
58 58
     }
59 59
   }
@@ -61,7 +61,7 @@ export default {
61 61
 </script>
62 62
 
63 63
 <style lang="scss" scoped>
64
-.page{
65
-	height:100vh;
64
+.page {
65
+  height: 100vh;
66 66
 }
67 67
 </style>