diff --git a/newPages/schoolDetail/index.vue b/newPages/schoolDetail/index.vue index c0babe4..7abc034 100644 --- a/newPages/schoolDetail/index.vue +++ b/newPages/schoolDetail/index.vue @@ -7,7 +7,7 @@ + :src="imagesUrl + '/' + schoolInfo.photo" v-if="schoolInfo.photo" /> @@ -276,11 +276,18 @@ // 对数据进行排序 const sortedList = res.data.records.sort((a, b) => b.seniority - a.seniority); const coachId = auth.getCoachId() + const staffType = auth.getStaffType() console.log(coachId, 'coachId'); - const coach = res.data.records.find(item => item.userId == coachId) - console.log(coach, 'coach'); - if (coach) { - this.schoolCoachList.push(coach) + if (coachId && staffType === '02') { + const coach = res.data.records.find(item => item.userId == coachId) + console.log(coach, 'coach'); + if (coach) { + this.schoolCoachList.push(coach) + } else { + // 取排序后的前三条数据 + this.schoolCoachList = sortedList.slice(0, 3); + this.total = res.data.total; + } } else { // 取排序后的前三条数据 this.schoolCoachList = sortedList.slice(0, 3); diff --git a/pagesA/courseDetail/index.vue b/pagesA/courseDetail/index.vue index 018acec..b31e145 100644 --- a/pagesA/courseDetail/index.vue +++ b/pagesA/courseDetail/index.vue @@ -8,6 +8,9 @@ + v-if="courseDetails.photo" /> + + @@ -168,4 +171,4 @@ margin-top: 20rpx; padding: 10rpx; } - \ No newline at end of file + diff --git a/pagesA/register/index.vue b/pagesA/register/index.vue index b4cbdb7..47973fc 100644 --- a/pagesA/register/index.vue +++ b/pagesA/register/index.vue @@ -4,7 +4,7 @@ - + @@ -254,6 +254,10 @@ this.localCoachId = getCoachId() console.log('localCoachId', this.localCoachId); console.log('userId', this.userId); + if (this.localStaffType === '02') { + this.localCoachId = getCoachId() + console.log('localCoachId', this.localCoachId); + } }, onShow() { this.getListAll() @@ -361,34 +365,34 @@ tenantIdFlag: false }) console.log('data',res.data) - + // 过滤数据,只保留subject为2或3的教练 - const filteredData = res.data.filter(coach => + const filteredData = res.data.filter(coach => coach.subject === '2' || coach.subject === '3' ); // 去重处理 - 根据coachId去除重复教练 const uniqueCoaches = []; const coachIds = new Set(); - + filteredData.forEach(coach => { if (!coachIds.has(coach.coachId)) { coachIds.add(coach.coachId); uniqueCoaches.push(coach); } }); - + this.columnjl = [ filteredData.map(coach => ({ label: coach.coachName, value: coach })) ]; - + if (this.localStaffType === '02' && this.localCoachId) { console.log('123123',this.localStaffType) console.log('321321', this.localCoachId) console.log('coach', filteredData) - const defaultCoach = filteredData.find(coach => + const defaultCoach = filteredData.find(coach => String(coach.coachId) === String(this.localCoachId) ); console.log('111222333', defaultCoach) @@ -661,7 +665,7 @@ url: `/small/jxInfo/prepayment?type=jsapi&orderNo=${this.orderNo}&orderId=${this.orderId}&payType=${payType}`, method: 'get' }); - + const result = await this.handleWxPayment(res); if (result === 'success') { @@ -1341,4 +1345,4 @@ .size-lv { margin-right: 35px; } - \ No newline at end of file +