|
@@ -4,69 +4,67 @@
|
4
|
4
|
<view class="main">
|
5
|
5
|
<view class="main-top">
|
6
|
6
|
<view class="title flex justify-between">
|
7
|
|
- <view>{{user.nickName||'未更新用户信息'}}</view>
|
|
7
|
+ <view>{{ user.nickName || '未更新用户信息' }}</view>
|
8
|
8
|
<text class="cuIcon-settings lg text-gray" @tap="goto('setting')"></text>
|
9
|
9
|
</view>
|
10
|
10
|
<view class="user">
|
11
|
11
|
<view class="user-info flex">
|
12
|
|
- <image mode="scaleToFill" :src="user.avatarUrl||defaultAvatar" class="avatar"></image>
|
|
12
|
+ <image mode="scaleToFill" :src="user.avatarUrl || defaultAvatar" class="avatar"></image>
|
13
|
13
|
<view class="study-info">
|
14
|
|
- <view class="user-name" @tap="switchStudent" v-if="isLogin&&user.nickName">
|
|
14
|
+ <view class="user-name" @tap="switchStudent" v-if="isLogin && user.nickName">
|
15
|
15
|
{{ kid_info.name + '-' + kid_info.school_name }}
|
16
|
|
- <text class="iconfont margin-left-xs" style="font-size:18px;"></text>
|
|
16
|
+ <text class="iconfont margin-left-xs" style="font-size: 18px;"></text>
|
17
|
17
|
</view>
|
18
|
18
|
<view class="user-name" @tap="login" v-else>
|
19
|
19
|
切换学生
|
20
|
|
- <text class="iconfont margin-left-xs" style="font-size:18px;"></text>
|
|
20
|
+ <text class="iconfont margin-left-xs" style="font-size: 18px;"></text>
|
21
|
21
|
</view>
|
22
|
|
- <view class="user-learn">已学习{{info.parent_data.learn_day}}天</view>
|
|
22
|
+ <view class="user-learn">已学习{{ info.parent_data.learn_day }}天</view>
|
23
|
23
|
</view>
|
24
|
24
|
</view>
|
25
|
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>
|
|
26
|
+ <view v-for="(relate, index) in courseRelates" :key="index" class="course-item" :style="'background:' + relate.background" @tap="goto(relate.page)">
|
|
27
|
+ <text class="iconfont back-img" style="font-size: 32px;">{{ relate.icon }}</text>
|
|
28
|
+ <view class="text-df">{{ relate.name }}</view>
|
30
|
29
|
</view>
|
31
|
30
|
</view>
|
32
|
31
|
<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>
|
|
32
|
+ <view class="course-item relate-item" v-for="(course, index) in courses" :key="index" :style="'background:' + course.background">
|
|
33
|
+ <text class="iconfont back-img" style="font-size: 40px;">{{ course.icon }}</text>
|
|
34
|
+ <view class="text-lg">{{ course.title }}</view>
|
|
35
|
+ <view class="text-xxl margin-top-xs">{{ course.name }}</view>
|
38
|
36
|
</view>
|
39
|
37
|
</view>
|
40
|
38
|
</view>
|
41
|
39
|
<view class="order">
|
42
|
40
|
<view class="order-title solid-bottom">我的订单</view>
|
43
|
41
|
<view class="order-info flex justify-between">
|
44
|
|
- <view v-for="(order,index) in menuList" :key="index" @tap="toOrder(index)">
|
|
42
|
+ <view v-for="(order, index) in menuList" :key="index" @tap="toOrder(index)">
|
45
|
43
|
<view class="order-image">
|
46
|
|
- <text class="iconfont text-student" style="font-size:32px;">{{order.icon}}</text>
|
|
44
|
+ <text class="iconfont text-student" style="font-size: 32px;">{{ order.icon }}</text>
|
47
|
45
|
</view>
|
48
|
|
- {{order.title}}
|
|
46
|
+ {{ order.title }}
|
49
|
47
|
</view>
|
50
|
48
|
</view>
|
51
|
49
|
</view>
|
52
|
50
|
</view>
|
53
|
51
|
<view class="margin cu-list box-shadow menu margin-top-lg bg-white">
|
54
|
52
|
<view class="cu-item arrow" @tap="goto('classCart')">
|
55
|
|
- <text class="cuIcon-cart lg text-gray" style="font-size:18px;"></text>
|
|
53
|
+ <text class="cuIcon-cart lg text-gray" style="font-size: 18px;"></text>
|
56
|
54
|
<view class="content margin-left-sm">
|
57
|
55
|
<text class="text-black">购物车</text>
|
58
|
56
|
</view>
|
59
|
57
|
<view class="action"></view>
|
60
|
58
|
</view>
|
61
|
59
|
<view class="cu-item arrow" @tap="goto('message')">
|
62
|
|
- <text class="cuIcon-message lg text-gray" style="font-size:18px;"></text>
|
|
60
|
+ <text class="cuIcon-message lg text-gray" style="font-size: 18px;"></text>
|
63
|
61
|
<view class="content margin-left-sm">
|
64
|
62
|
<text class="text-black">消息中心</text>
|
65
|
63
|
</view>
|
66
|
64
|
<view class="action"></view>
|
67
|
65
|
</view>
|
68
|
66
|
<view class="cu-item arrow" @tap="goto('onlineService')">
|
69
|
|
- <text class="iconfont text-gray" style="font-size:18px;"></text>
|
|
67
|
+ <text class="iconfont text-gray" style="font-size: 18px;"></text>
|
70
|
68
|
<view class="content margin-left-sm">
|
71
|
69
|
<text class="text-black">在线客服</text>
|
72
|
70
|
</view>
|
|
@@ -74,22 +72,17 @@
|
74
|
72
|
</view>
|
75
|
73
|
</view>
|
76
|
74
|
<mp-tabbar :outerSelected="2" />
|
77
|
|
- <view class="cu-modal drawer-modal justify-start" :class="modalName=='showStudent'?'show':''" @tap="hideModal">
|
78
|
|
- <scroll-view :scroll-y="true" class="cu-dialog basis-lg" @tap.stop=""
|
79
|
|
- :style="[{top:topHeader+'px',height:'calc(100vh - 48px - ' + topHeader + 'px)'}]">
|
|
75
|
+ <view class="cu-modal drawer-modal justify-start" :class="modalName == 'showStudent' ? 'show' : ''" @tap="hideModal">
|
|
76
|
+ <scroll-view :scroll-y="true" class="cu-dialog basis-lg" @tap.stop="" :style="[{ top: topHeader + 'px', height: 'calc(100vh - 48px - ' + topHeader + 'px)' }]">
|
80
|
77
|
<view class="student-list padding-left">
|
81
|
|
- <view class="student margin-top-sm" v-for="(student,index) in students" :key="index"
|
82
|
|
- @tap="chooseKid(student.id)">
|
|
78
|
+ <view class="student margin-top-sm" v-for="(student, index) in students" :key="index" @tap="chooseKid(student.id)">
|
83
|
79
|
<view class="flex align-center">
|
84
|
80
|
<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>
|
|
81
|
+ <view class="margin-left-sm">{{ student.name }}</view>
|
|
82
|
+ <text class="cuIcon-check text-student margin-left" style="font-size: 22px;" v-if="kid === student.id"></text>
|
88
|
83
|
</view>
|
89
|
84
|
<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>
|
|
85
|
+ <view class="cu-tag line-green margin-top-xs"> {{ student.school_name ? student.school_name : '' }}-{{ student.grade_name }}-{{ student.class_name }} </view>
|
93
|
86
|
</view>
|
94
|
87
|
</view>
|
95
|
88
|
</view>
|
|
@@ -102,7 +95,7 @@
|
102
|
95
|
import { mapGetters } from 'vuex'
|
103
|
96
|
import { _getStudents, _getUserInfo } from '@/api/auth'
|
104
|
97
|
export default {
|
105
|
|
- data () {
|
|
98
|
+ data() {
|
106
|
99
|
return {
|
107
|
100
|
topHeader: this.globalCustomBarHeight,
|
108
|
101
|
info: {},
|
|
@@ -189,20 +182,20 @@ export default {
|
189
|
182
|
kid: 'kid'
|
190
|
183
|
})
|
191
|
184
|
},
|
192
|
|
- onShow () {
|
|
185
|
+ onShow() {
|
193
|
186
|
this.get_info()
|
194
|
187
|
},
|
195
|
188
|
methods: {
|
196
|
|
- login () {
|
|
189
|
+ login() {
|
197
|
190
|
this.globalNavigateTo('login')
|
198
|
191
|
},
|
199
|
|
- get_info () {
|
|
192
|
+ get_info() {
|
200
|
193
|
_getUserInfo().then(res => {
|
201
|
194
|
this.info = res.data
|
202
|
195
|
this.get_students()
|
203
|
196
|
})
|
204
|
197
|
},
|
205
|
|
- get_students () {
|
|
198
|
+ get_students() {
|
206
|
199
|
_getStudents().then(res => {
|
207
|
200
|
if (res.data.length < 1) {
|
208
|
201
|
this.globalNavigateTo('myStudents')
|
|
@@ -217,26 +210,27 @@ export default {
|
217
|
210
|
this.setkidInfo(kid)
|
218
|
211
|
})
|
219
|
212
|
},
|
220
|
|
- hideModal (e) {
|
|
213
|
+ hideModal(e) {
|
221
|
214
|
this.modalName = null
|
222
|
215
|
},
|
223
|
|
- setkidInfo (kid) { // 设置学生信息
|
|
216
|
+ setkidInfo(kid) {
|
|
217
|
+ // 设置学生信息
|
224
|
218
|
this.kid_info = this.students.find(item => item.id === kid)
|
225
|
219
|
},
|
226
|
|
- switchStudent () {
|
|
220
|
+ switchStudent() {
|
227
|
221
|
this.modalName = 'showStudent'
|
228
|
222
|
},
|
229
|
|
- goto (page) {
|
|
223
|
+ goto(page) {
|
230
|
224
|
if (!this.isLogin) {
|
231
|
225
|
this.globalNavigateTo('login')
|
232
|
226
|
} else {
|
233
|
227
|
this.globalNavigateTo(page)
|
234
|
228
|
}
|
235
|
229
|
},
|
236
|
|
- toOrder (index) {
|
|
230
|
+ toOrder(index) {
|
237
|
231
|
this.globalNavigateTo('order', { type: index })
|
238
|
232
|
},
|
239
|
|
- chooseKid (id) {
|
|
233
|
+ chooseKid(id) {
|
240
|
234
|
uni.showModal({
|
241
|
235
|
title: '',
|
242
|
236
|
content: '确定选择该学生?',
|