seamwang лет назад: 2
Родитель
Сommit
e475430eaf
3 измененных файлов с 120 добавлено и 106 удалено
  1. 38 34
      src/api/auth.js
  2. 21 12
      src/pages/mine/onlineService.vue
  3. 61 60
      src/pages/order/index.vue

+ 38 - 34
src/api/auth.js

@@ -1,70 +1,74 @@
1 1
 import fetch from '@/common/utils/fetch.js'
2 2
 
3 3
 // 微信登录接口,换取openid
4
-export function _login(params) {
5
-  return fetch('/parents/login/wx_login', params, 'post')
4
+export function _login (params) {
5
+	return fetch('/parents/login/wx_login', params, 'post')
6 6
 }
7 7
 // 换取用户详细信息
8
-export function _auth(params) {
9
-  return fetch('/parents/login/wx_auth', params, 'post')
8
+export function _auth (params) {
9
+	return fetch('/parents/login/wx_auth', params, 'post')
10 10
 }
11 11
 // 微信绑定用户手机
12
-export function _bindPhone(params) {
13
-  return fetch('/parents/login/wx_bindphone', params, 'post')
12
+export function _bindPhone (params) {
13
+	return fetch('/parents/login/wx_bindphone', params, 'post')
14 14
 }
15 15
 // 判断绑定手机号
16
-export function _getBindPhone() {
17
-  return fetch('/parents/login/getBindMobile')
16
+export function _getBindPhone () {
17
+	return fetch('/parents/login/getBindMobile')
18 18
 }
19 19
 // 修改用户信息
20
-export function _changeUserInfo(params) {
21
-  return fetch('/parents/init/parent_msg', params, 'post')
20
+export function _changeUserInfo (params) {
21
+	return fetch('/parents/init/parent_msg', params, 'post')
22 22
 }
23 23
 // 获取用户信息
24
-export function _getUserInfo(params) {
25
-  return fetch('/parents/init/get_parent', params, 'post')
24
+export function _getUserInfo (params) {
25
+	return fetch('/parents/init/get_parent', params, 'post')
26 26
 }
27 27
 // 获取验证码
28
-export function _getCode(params) {
29
-  return fetch('/index/index/wx_get_code', params, 'post')
28
+export function _getCode (params) {
29
+	return fetch('/index/index/wx_get_code', params, 'post')
30 30
 }
31 31
 // 修改手机号
32
-export function _changePhone(params) {
33
-  return fetch('/parents/login/wx_change_phone', params, 'post')
32
+export function _changePhone (params) {
33
+	return fetch('/parents/login/wx_change_phone', params, 'post')
34 34
 }
35 35
 // 初始化学生
36
-export function _getStudents(params) {
37
-  return fetch('/parents/init/get_students', params, 'post')
36
+export function _getStudents (params) {
37
+	return fetch('/parents/init/get_students', params, 'post')
38 38
 }
39 39
 // 绑定学生
40
-export function _bindStudent(params) {
41
-  return fetch('/parents/init/bind_student_by_id', params, 'post')
40
+export function _bindStudent (params) {
41
+	return fetch('/parents/init/bind_student_by_id', params, 'post')
42 42
 }
43 43
 // 解绑学生
44
-export function _unbindStudent(params) {
45
-  return fetch('/parents/init/unbindStudent', params)
44
+export function _unbindStudent (params) {
45
+	return fetch('/parents/init/unbindStudent', params)
46 46
 }
47 47
 // 获取接送人列表
48
-export function _getPickup(params) {
49
-  return fetch('/parents/Pickup/get_pickup', params, 'post')
48
+export function _getPickup (params) {
49
+	return fetch('/parents/Pickup/get_pickup', params, 'post')
50 50
 }
51 51
 // 增加授权人
52
-export function _addPickup(params) {
53
-  return fetch('/parents/Pickup/pickup_accredit', params, 'post')
52
+export function _addPickup (params) {
53
+	return fetch('/parents/Pickup/pickup_accredit', params, 'post')
54 54
 }
55 55
 // 获取老师数据
56
-export function _getTeacher(params) {
57
-  return fetch('/parents/teacher/get_teacher', params, 'post')
56
+export function _getTeacher (params) {
57
+	return fetch('/parents/teacher/get_teacher', params, 'post')
58 58
 }
59 59
 // 获取教育机构数据
60
-export function _getInstitution(params) {
61
-  return fetch('/parents/institution/get_institution', params, 'post')
60
+export function _getInstitution (params) {
61
+	return fetch('/parents/institution/get_institution', params, 'post')
62 62
 }
63 63
 // 获取系统通知
64
-export function _getNotice(params) {
65
-  return fetch('/parents/notice/get_notice', params, 'post')
64
+export function _getNotice (params) {
65
+	return fetch('/parents/notice/get_notice', params, 'post')
66 66
 }
67 67
 // 获取通知详情
68
-export function _noticeDetail(params) {
69
-  return fetch('/parents/notice/get_notice_details', params, 'post')
68
+export function _noticeDetail (params) {
69
+	return fetch('/parents/notice/get_notice_details', params, 'post')
70
+}
71
+//获取客服电话
72
+export function _getSchoolPhone () {
73
+	return fetch('/parents/hot/kefu')
70 74
 }

+ 21 - 12
src/pages/mine/onlineService.vue

@@ -2,22 +2,22 @@
2 2
   <view class="page">
3 3
     <cu-custom :isBack="true" title="在线客服"></cu-custom>
4 4
     <view class="flex justify-center bg-white padding-tb-sm">
5
-      <view class="link" style="background-color:#9aed6f;">
5
+      <view class="link" style="background-color: #9aed6f;">
6 6
         <button class="button" open-type="contact" @contact="handleContact"></button>
7 7
         <!-- <image src="/static/imgs/mine/wechat.png" mode="widthFix"></image> -->
8
-        <text class="iconfont" style="font-size:32px;">&#xe6c7;</text>
8
+        <text class="iconfont" style="font-size: 32px;">&#xe6c7;</text>
9 9
       </view>
10
-      <view class="link" @tap="call" style="background-color:#5fcfe0;margin-left:160rpx;">
10
+      <view class="link" @tap="call" style="background-color: #5fcfe0; margin-left: 160rpx;">
11 11
         <!-- <image src="/static/imgs/mine/tel.png" mode="widthFix"></image> -->
12
-        <text class="iconfont" style="font-size:32px;">&#xe612;</text>
12
+        <text class="iconfont" style="font-size: 32px;">&#xe612;</text>
13 13
       </view>
14 14
     </view>
15
-    <scroll-view class="questions margin-top-sm pardding-lr-sm  bg-white">
15
+    <scroll-view class="questions margin-top-sm pardding-lr-sm bg-white">
16 16
       <view class="cu-list menu">
17 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)">
18
+        <view class="cu-item arrow solid-bottom" v-for="(item, index) in list" :key="index" @tap="answer(item)">
19 19
           <view class="content margin-left-sm">
20
-            <text class="text-black">{{item.title}}</text>
20
+            <text class="text-black">{{ item.title }}</text>
21 21
           </view>
22 22
         </view>
23 23
       </view>
@@ -26,15 +26,17 @@
26 26
 </template>
27 27
 
28 28
 <script>
29
+import { _getSchoolPhone } from '@/api/auth'
29 30
 export default {
30
-  data () {
31
+  data() {
31 32
     return {
32 33
       phoneNumber: '07592222030',
33 34
       list: [
34 35
         {
35 36
           id: 1,
36 37
           title: '报课注意事项?',
37
-          content: '1、购买本课程后第三节课起不接受退课、退费申请;\n' +
38
+          content:
39
+            '1、购买本课程后第三节课起不接受退课、退费申请;\n' +
38 40
             '2、因节假日冲突未上的课程,会进行调课补回;\n' +
39 41
             '3、请假两次以内可安排补课,第三次起不予补课及退费;\n' +
40 42
             '4、本平台对以上细则有最终解释权。'
@@ -45,20 +47,27 @@ export default {
45 47
       ]
46 48
     }
47 49
   },
50
+  onShow() {
51
+    this.get_phone()
52
+  },
48 53
   methods: {
49
-    answer (item) {
54
+    get_phone() {
55
+      _getSchoolPhone().then(res => {
56
+        this.phoneNumber = res.data.phone || this.phoneNumber
57
+      })
58
+    },
59
+    answer(item) {
50 60
       uni.showModal({
51 61
         title: item.title,
52 62
         content: item.content,
53 63
         showCancel: false,
54 64
         success: res => {
55 65
           if (res.confirm) {
56
-
57 66
           }
58 67
         }
59 68
       })
60 69
     },
61
-    call () {
70
+    call() {
62 71
       uni.makePhoneCall({
63 72
         phoneNumber: this.phoneNumber
64 73
       })

+ 61 - 60
src/pages/order/index.vue

@@ -1,122 +1,127 @@
1 1
 <template>
2 2
   <view class="page">
3 3
     <cu-custom :isBack="true"></cu-custom>
4
-    <view class="header" :style="[{top:topHeader + 'px'}]">
4
+    <view class="header" :style="[{ top: topHeader + 'px' }]">
5 5
       <view class="header-title">
6 6
         <view class="header-title-main">
7
-          <view class="margin-bottom-xs">{{title}}</view>
7
+          <view class="margin-bottom-xs">{{ title }}</view>
8 8
           <view class="point"></view>
9 9
         </view>
10 10
       </view>
11 11
       <swiper-tab :menuList="menuList" @changeTab="changeTab" :activeTab="currentIndex"></swiper-tab>
12 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">
13
+    <scroll-view
14
+      scroll-y="true"
15
+      class="scroll-main"
16
+      :style="[{ height: 'calc(100vh - 74px - ' + topHeader + 'px)' }]"
17
+      :refresher-enabled="true"
18
+      :refresher-triggered="triggered"
19
+      @refresherrefresh="onRefresh"
20
+      @scrolltolower="loadMore"
21
+    >
22
+      <view class="list" v-if="params.type < 7">
23
+        <view class="cu-card margin-top margin-bottom shadow" v-for="(item, index) in orders" :key="index">
18 24
           <view class="cu-item">
19 25
             <view class="card-header flex justify-between solid-bottom">
20
-              <view>{{index}}</view>
26
+              <view>{{ index }}</view>
21 27
               <view class="text-student course-status">
22
-                {{item.status|status}}
28
+                {{ item.status | status }}
23 29
               </view>
24 30
             </view>
25
-            <view class="card-center" v-for="(course,i) in item.list" :key="i">
31
+            <view class="card-center" v-for="(course, i) in item.list" :key="i">
26 32
               <view class="card flex">
27 33
                 <view class="card-left">
28
-                  <img mode="scaleToFill" :src="course.image" alt="" class="card-image">
34
+                  <img mode="scaleToFill" :src="course.image" alt="" class="card-image" />
29 35
                 </view>
30 36
                 <view class="card-right flex-sub margin-left-sm text-sm">
31 37
                   <view class="card-title">
32
-                    <text>{{course.name}}</text>
38
+                    <text>{{ course.name }}</text>
33 39
                   </view>
34 40
                   <view class="card-item margin-top-xs">
35 41
                     <text class="card-label">时间:</text>
36
-                    <text class="card-text">{{course.attend_day}}</text>
42
+                    <text class="card-text">{{ course.attend_day }}</text>
37 43
                   </view>
38 44
                   <view class="card-item margin-top-xs">
39 45
                     <text class="card-label">课时:</text>
40
-                    <text class="card-text">{{course.class_total}}</text>
46
+                    <text class="card-text">{{ course.class_total }}</text>
41 47
                   </view>
42 48
                   <view class="card-item margin-top-xs">
43 49
                     <text class="card-label">学生:</text>
44
-                    <text class="card-text">{{course.student_name}}</text>
50
+                    <text class="card-text">{{ course.student_name }}</text>
45 51
                   </view>
46 52
                   <view class="card-item margin-top-xs">
47 53
                     <text class="card-label">老师:</text>
48
-                    <text class="card-text">{{course.teacher||'--'}}</text>
54
+                    <text class="card-text">{{ course.teacher || '--' }}</text>
49 55
                   </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>
56
+                  <view class="card-item margin-top-xs" v-if="dropStatus.includes(item.status) && course.is_return === 1">
57
+                    <view class="text-student text-right">{{ course.return_status }}</view>
52 58
                   </view>
53 59
                 </view>
54 60
               </view>
55 61
               <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>
62
+                <view v-for="(prop, k) in course.prop" :key="k" class="margin-right-xs">
63
+                  <text class="card-label">{{ prop.name }}:</text><text class="text-price">{{ prop.money }}</text>
58 64
                 </view>
59 65
               </view>
60 66
               <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>
67
+                <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">
68
+                  退课
69
+                </button>
63 70
                 <!-- <button @tap="droping" class="cu-btn round sm line-cyan" v-if="dropStatus.includes(item.status)&&course.is_return===1">退课中</button> -->
64 71
               </view>
65 72
             </view>
66 73
             <view class="card-bottom margin-top-xs flex justify-between">
67 74
               <view>
68
-                <text class="text-price text-red">{{item.sum_money}}</text>
75
+                <text class="text-price text-red">{{ item.sum_money }}</text>
69 76
               </view>
70 77
               <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>
78
+                <button @tap="pay(item.order_id)" class="cu-btn round bg-student text-white margin-right-sm" v-if="item.status === 0">立即付款</button>
79
+                <button @tap="cancel(item.order_id)" class="cu-btn round bg-gray" v-if="item.status === 0 && !isPaying">取消</button>
75 80
               </view>
76 81
             </view>
77 82
           </view>
78 83
         </view>
79 84
       </view>
80 85
       <view class="list" v-else>
81
-        <view class="cu-card margin-top margin-bottom shadow" v-for="(item,index) in list" :key="index">
86
+        <view class="cu-card margin-top margin-bottom shadow" v-for="(item, index) in list" :key="index">
82 87
           <view class="cu-item">
83 88
             <view class="card-header flex justify-between solid-bottom">
84
-              <view>{{item.refund_code}}</view>
89
+              <view>{{ item.refund_code }}</view>
85 90
               <view class="text-student course-status">
86
-                {{item.status|dropStatus}}
91
+                {{ item.status | dropStatus }}
87 92
               </view>
88 93
             </view>
89 94
             <view class="card flex">
90 95
               <view class="card-left">
91
-                <img mode="scaleToFill" :src="item.image" alt="" class="card-image">
96
+                <img mode="scaleToFill" :src="item.image" alt="" class="card-image" />
92 97
               </view>
93 98
               <view class="card-right flex-sub margin-left-sm text-sm">
94
-                <view class="card-title">{{item.name}}</view>
99
+                <view class="card-title">{{ item.attend_name }}</view>
95 100
                 <view class="card-item margin-top-xs">
96 101
                   <text class="card-label">时间:</text>
97
-                  <text class="card-text">{{item.day}}</text>
102
+                  <text class="card-text">{{ item.day }}</text>
98 103
                 </view>
99 104
                 <view class="card-item margin-top-xs">
100 105
                   <text class="card-label">课时:</text>
101
-                  <text class="card-text">{{item.class_total}}</text>
106
+                  <text class="card-text">{{ item.class_total }}</text>
102 107
                 </view>
103 108
                 <view class="card-item margin-top-xs">
104 109
                   <text class="card-label">学生:</text>
105
-                  <text class="card-text">{{item.student_name}}</text>
110
+                  <text class="card-text">{{ item.student_name }}</text>
106 111
                 </view>
107 112
                 <view class="card-item margin-top-xs">
108 113
                   <text class="card-label">老师:</text>
109
-                  <text class="card-text">{{item.teacher||'--'}}</text>
114
+                  <text class="card-text">{{ item.teacher || '--' }}</text>
110 115
                 </view>
111 116
                 <view class="card-item margin-top-xs">
112 117
                   <text class="card-label">订单:</text>
113
-                  <text class="card-text">{{item.code}}</text>
118
+                  <text class="card-text">{{ item.code }}</text>
114 119
                 </view>
115 120
               </view>
116 121
             </view>
117 122
             <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>
123
+              <view v-for="(prop, k) in course.prop" :key="k" class="margin-right-xs">
124
+                <text class="card-label">{{ prop.name }}:</text><text class="text-price">{{ prop.money }}</text>
120 125
               </view>
121 126
             </view>
122 127
           </view>
@@ -135,7 +140,7 @@ export default {
135 140
   components: {
136 141
     swiperTab
137 142
   },
138
-  data () {
143
+  data() {
139 144
     return {
140 145
       title: '订单',
141 146
       topHeader: this.globalCustomBarHeight,
@@ -182,11 +187,11 @@ export default {
182 187
           return '状态未知'
183 188
       }
184 189
     },
185
-    dropStatus (v) {
190
+    dropStatus(v) {
186 191
       return v === 0 ? '审核中' : v === 1 ? '审核通过' : '驳回'
187 192
     }
188 193
   },
189
-  onLoad (option) {
194
+  onLoad(option) {
190 195
     if (option.type) {
191 196
       const index = decodeURIComponent(option.type)
192 197
       this.changeTab(index)
@@ -195,7 +200,7 @@ export default {
195 200
     }
196 201
   },
197 202
   watch: {
198
-    ifReloadOrder (n, o) {
203
+    ifReloadOrder(n, o) {
199 204
       if (n) {
200 205
         this.changeTab(0)
201 206
         this.$store.dispatch('setReload', false)
@@ -203,23 +208,21 @@ export default {
203 208
     }
204 209
   },
205 210
   computed: {
206
-    ...mapGetters([
207
-      'ifReloadOrder'
208
-    ])
211
+    ...mapGetters(['ifReloadOrder'])
209 212
   },
210 213
   methods: {
211
-    refresh () {
214
+    refresh() {
212 215
       this.params.page = 1
213 216
       this.get_list()
214 217
     },
215
-    onRefresh () {
218
+    onRefresh() {
216 219
       this.triggered = true
217 220
       this.refresh()
218 221
       setTimeout(() => {
219 222
         this.triggered = false
220 223
       }, 1000)
221 224
     },
222
-    loadMore () {
225
+    loadMore() {
223 226
       if (this.noMore) {
224 227
         uni.showToast({ title: '没有更多了', icon: 'none' })
225 228
         return false
@@ -227,14 +230,14 @@ export default {
227 230
       this.params.page++
228 231
       this.get_list()
229 232
     },
230
-    get_list () {
233
+    get_list() {
231 234
       if (this.params.type < 7) {
232 235
         this.get_orders()
233 236
       } else {
234 237
         this.get_drops()
235 238
       }
236 239
     },
237
-    get_orders () {
240
+    get_orders() {
238 241
       _orderCenter(this.params).then(res => {
239 242
         if (this.params.page > 1) {
240 243
           if (Object.keys(res.data).length < this.page_size) this.noMore = true
@@ -245,7 +248,7 @@ export default {
245 248
         }
246 249
       })
247 250
     },
248
-    get_drops () {
251
+    get_drops() {
249 252
       _dropList({ page: this.params.page }).then(res => {
250 253
         if (this.params.page > 1) {
251 254
           if (!res.data.drop_course_data) {
@@ -260,10 +263,10 @@ export default {
260 263
         }
261 264
       })
262 265
     },
263
-    droping () {
266
+    droping() {
264 267
       this.changeTab(3)
265 268
     },
266
-    dropCourse (id) {
269
+    dropCourse(id) {
267 270
       const params = { order_info_id: id, refund_explanation: '', type_id: 0 }
268 271
       const _self = this
269 272
       uni.showModal({
@@ -281,14 +284,12 @@ export default {
281 284
         }
282 285
       })
283 286
     },
284
-    pay (id) {
287
+    pay(id) {
285 288
       const _self = this
286 289
       _self.isPaying = true
287 290
       uni.showModal({
288 291
         title: '温馨提示:',
289
-        content: '1、感谢您的购买;\n' +
290
-          '2、退费规则请咨询客服;\n' +
291
-          '3、本平台对以上细则有最终解释权。',
292
+        content: '1、感谢您的购买;\n' + '2、退费规则请咨询客服;\n' + '3、本平台对以上细则有最终解释权。',
292 293
         cancelText: '取消',
293 294
         confirmText: '确定',
294 295
         success: res => {
@@ -330,7 +331,7 @@ export default {
330 331
         }
331 332
       })
332 333
     },
333
-    cancel (id) {
334
+    cancel(id) {
334 335
       const _self = this
335 336
       uni.showModal({
336 337
         title: '提示',
@@ -347,7 +348,7 @@ export default {
347 348
         }
348 349
       })
349 350
     },
350
-    changeTab (index) {
351
+    changeTab(index) {
351 352
       this.orders = {}
352 353
       this.params.page = 1
353 354
       this.currentIndex = index