Browse Source

7月14日修改

zhangli 2 years ago
parent
commit
160858ac01
3 changed files with 42 additions and 12 deletions
  1. 2 0
      config/api.js
  2. 3 0
      pages/member/index.vue
  3. 37 12
      pagesMain/subscribeInfo.vue

+ 2 - 0
config/api.js

@@ -98,6 +98,8 @@ module.exports = {
 	getSubscribeList: API_BASE + '/v2/admin/subscribe/getSubscribeClassEvaluateList',
 	// 查询场馆下 班级列表
 	getClassListByVenueId: API_BASE + '/course/getClassListByVenueId',
+	//  查询所有教练列表
+	getCoachListAll: API_BASE + '/coach/getCoachList.do',
 	//  查询教练列表
 	getCoachList: API_BASE + '/common/coach/getCoachList',
 	//  保存预约信息

+ 3 - 0
pages/member/index.vue

@@ -11,6 +11,9 @@
 					 :key="index2" class="class-card" @click="goToMyClass(site)">
 						<view class="class-content" slot="head" style="padding-top: 10px;">
 							<view class="student-name">{{site.studentName}}</view>
+							<view class="class-name">{{site.studentCode}}</view>
+						</view>
+						<view class="class-content" slot="head" style="padding-top: 10px;">
 							<view class="class-name">{{site.name}}</view>
 						</view>
 						<view class="class-content" slot="body">

+ 37 - 12
pagesMain/subscribeInfo.vue

@@ -26,7 +26,11 @@
 	<!-- 		<u-form-item label="体验日期" placeholder="请选择体验日期" prop="experience">
 				<u-input v-model="subscribelForm.experience" :select-open="experienceShow" type="select" @click="experienceShow = true" />
 				</u-form-item> -->
-			<u-form-item label="上课教练" placeholder="请选择上课教练" prop="coachName">
+			<u-form-item label="上课教练" placeholder="请选择上课教练" prop="coachName" v-if="subscribelForm.classId==0">
+				<u-search placeholder="请输入教练名" v-model="subscribelForm.coachName" focus :animation="false" @custom='handleCoachListShow' @search='handleCoachListShow' @clear="clear"/>
+				<!--<u-input v-if="!subscribelForm.experience" v-model="subscribelForm.coachName" type="select" @click="handleCoachListShow" />-->
+			</u-form-item>
+			<u-form-item v-else label="上课教练" placeholder="请选择上课教练" prop="coachName">
 				<u-input v-if="!subscribelForm.experience" v-model="subscribelForm.coachName" type="select" @click="handleCoachListShow" />
 				<text v-else>{{ subscribelForm.coachName }}</text>
 			</u-form-item>
@@ -125,6 +129,7 @@
 				NET.request(API.getClassListByVenueId, { id:this.venueId }, 'POST').then(res => {
 					if(res.status === 10000) {
 						this.classList = res.data.map( item => { return { id: item.id, text: item.name } })
+						this.classList = this.classList.reverse()
 						this.subscribelForm.coachId = ''
 						this.subscribelForm.coachName = ''
 					} else {
@@ -144,17 +149,37 @@
 			handleCoachListShow() {
 				this.coachList = []
 				this.coachShow = true
-				//  教练列表
-				NET.request(API.getCoachList, {venueId: this.venueId, classId: this.subscribelForm.classId }, 'POST').then(res=> {
-					if(res.status == 10000) {
-						this.coachList = res.data.map( item => { return { id: item.coachId, text: item.nickname }})
-					} else {
-						this.$refs.uTips.show({
-							title: res.message,
-							type: 'error',
-						})
-					}
-				})
+				if(this.subscribelForm.classId==0){
+					//  教练列表
+					NET.request(API.getCoachListAll, {}, 'GET').then(res=> {
+						if(res.status == 10000) {
+							var coachSearch = res.data.filter((item) => {
+							  return item.nickname.indexOf(this.subscribelForm.coachName)>-1;
+							});
+							this.coachList = coachSearch.map( item => {
+								return { id: item.coachId, text: item.nickname }
+							})
+							console.log(this.coachList)
+						} else {
+							this.$refs.uTips.show({
+								title: res.message,
+								type: 'error',
+							})
+						}
+					})
+				}else{
+					//  教练列表
+					NET.request(API.getCoachList, {venueId: this.venueId, classId: this.subscribelForm.classId }, 'POST').then(res=> {
+						if(res.status == 10000) {
+							this.coachList = res.data.map( item => { return { id: item.coachId, text: item.nickname }})
+						} else {
+							this.$refs.uTips.show({
+								title: res.message,
+								type: 'error',
+							})
+						}
+					})
+				}
 			},
 			//  选择教练
 			HandleChooseCoachClick(index) {