|
@@ -1,58 +1,58 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
<view class="head">
|
|
|
- <u-search placeholder="搜索课程" :show-action="false" height="80" :disabled="true"
|
|
|
- @click="toSearchResult"></u-search>
|
|
|
+ <u-search placeholder="搜索课程" :show-action="false" height="80" @focus="toSearchResult"></u-search>
|
|
|
</view>
|
|
|
<view class="main">
|
|
|
<!-- <u-swiper :list="list"></u-swiper> -->
|
|
|
|
|
|
<view class="content">
|
|
|
<view class="classify">
|
|
|
- <view class="item" v-for="(m,index) in courseMenu" :key="index"
|
|
|
- :class="active==index ? 'chosen' : ''" @click="courseChose(m,index)">
|
|
|
+ <view class="item" v-for="(m,index) in courseMenu" :key="index" :class="active==index ? 'chosen' : ''"
|
|
|
+ @click="courseChose(m,index)">
|
|
|
{{m.name}}
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="details">
|
|
|
<view class="classes">
|
|
|
- <view class="item checked" >
|
|
|
+ <view class="item" @click="categorize = 1" :class="categorize==1 ? 'checked' : ''">
|
|
|
按课程
|
|
|
</view>
|
|
|
- <view class="item" >
|
|
|
+ <view class="item" @click="categorize = 2" :class="categorize==2 ? 'checked' : ''">
|
|
|
按老师
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="infos-box2">
|
|
|
- <view class="teacher-item" v-for="item in 2">
|
|
|
+ <view class="details-box" v-if="categorize==1">
|
|
|
+ <view class="item" v-for="(item,index) in courseBaseList" :key="index"
|
|
|
+ @click="toSearchResultById(item)">
|
|
|
+ {{item.name}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="teacher-item" v-for="(item,index) in teacherList" :key="index" v-if="categorize==2"
|
|
|
+ @click="toTeacherHomepage(item)">
|
|
|
<view class="photo">
|
|
|
- <img src="../../../assets/img/photo2.png" alt="">
|
|
|
+ <u-avatar class="avatar" mode="square"
|
|
|
+ :src="item.headPhoto != null ? item.headPhoto : '../../assets/img/head.png'" size="96">
|
|
|
+ </u-avatar>
|
|
|
</view>
|
|
|
<view class="infos">
|
|
|
<view class="name">
|
|
|
- 瞿老师
|
|
|
+ {{item.employeeName}}
|
|
|
</view>
|
|
|
<view class="course1">
|
|
|
- 足球、篮球、羽球等
|
|
|
+ {{item.courseName}}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="more">
|
|
|
<u-icon name="arrow-right"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <u-divider v-if="reCoursesList.length == recordsTotal && recordsTotal != 0" style="margin-top: 10px">没有更多了</u-divider>
|
|
|
</view>
|
|
|
- <view class="infos-box" v-for="(item,index) in reCoursesList" :key="index"
|
|
|
+ <view class="infos-box" v-for="(item,index) in reCoursesList" :key="index"
|
|
|
@click="gotoUrl('pages/parents/course/courseDetails?id='+item.course_id+'&classId='+item.class_id)">
|
|
|
- <!-- <view class="picture" v-if="item.posterUrl != null">
|
|
|
- <img :src="item.posterUrl" alt="">
|
|
|
- </view>
|
|
|
- <view class="picture" v-else>
|
|
|
- <img src="../../../assets/img/classify1.png" alt="">
|
|
|
- </view> -->
|
|
|
-
|
|
|
<view class="infos">
|
|
|
<view class="name">
|
|
|
{{item.className}}
|
|
@@ -67,31 +67,18 @@
|
|
|
</view>
|
|
|
<view class="teacher-price">
|
|
|
<view class="teacher">
|
|
|
- <!-- <view class="photo">
|
|
|
- <u-avatar class="avatar"
|
|
|
- :src="item.headPhoto != null ? item.headPhoto : '../../assets/img/head.png'" size="64">
|
|
|
- </u-avatar>
|
|
|
- </view> -->
|
|
|
<view class="name-teacher">
|
|
|
咨询电话:
|
|
|
</view>
|
|
|
- <!-- <view class="img">
|
|
|
- <img src="../../../assets/img/riLine-smartphone-line@1x.png" alt="">
|
|
|
- </view> -->
|
|
|
<view class="phone-teacher">
|
|
|
{{item.consultPhone != null ? item.consultPhone : '暂无'}}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <!-- <view class="price">
|
|
|
-
|
|
|
- </view> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <u-divider v-if="reCoursesList.length == recordsTotal && recordsTotal != 0" style="margin-top: 10px">没有更多了</u-divider>
|
|
|
-
|
|
|
-
|
|
|
+ <u-divider v-if="reCoursesList.length == recordsTotal && recordsTotal != 0"
|
|
|
+ style="margin-top: 10px">没有更多了</u-divider>
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
@@ -119,10 +106,13 @@
|
|
|
pageNum: 1,
|
|
|
pageSize: 5,
|
|
|
recordsTotal: 0,
|
|
|
- current:0,
|
|
|
+ current: 0,
|
|
|
list: [{
|
|
|
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
|
|
|
}, ],
|
|
|
+ courseBaseList: [],
|
|
|
+ teacherList: [],
|
|
|
+ categorize: 1
|
|
|
}
|
|
|
},
|
|
|
onReady() {
|
|
@@ -134,6 +124,79 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ toSearchResultById(item) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/parents/search/searchResult?id=' + item.id
|
|
|
+ })
|
|
|
+ },
|
|
|
+ toTeacherHomepage(item) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/parents/teacherHomepage/teacherHomepage?id=' + item.employeeId
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getCourseBaseListBySortId(courseSortId) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ courseApi.getCourseBaseListBySortId({
|
|
|
+ courseSortId: courseSortId
|
|
|
+ }).then((response) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.courseBaseList = response.data;
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getTeacherListBySortId(courseSortId) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ courseApi.getTeacherListBySortId({
|
|
|
+ courseSortId: courseSortId
|
|
|
+ }).then((response) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ this.teacherList = response.data;
|
|
|
+ for (var i = 0; i < this.teacherList.length; i++) {
|
|
|
+ this.getTeacherCourseList(this.teacherList[i].employeeId,i);
|
|
|
+ }
|
|
|
+ console.log(this.teacherList)
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getTeacherCourseList(teacherId,index) {
|
|
|
+ uni.showLoading({
|
|
|
+ title: "加载中",
|
|
|
+ mask: true,
|
|
|
+ })
|
|
|
+ courseApi.getTeacherCourseList({
|
|
|
+ teacherId: teacherId
|
|
|
+ }).then((response) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ var teacherCourseList = response.data;
|
|
|
+ var courseNameList = [];
|
|
|
+ var courseName = '';
|
|
|
+ courseNameList = teacherCourseList.map(record => {
|
|
|
+ return record.course_name;
|
|
|
+ });
|
|
|
+ courseName = courseNameList.join(',');
|
|
|
+
|
|
|
+ this.teacherList[index]['courseName'] = courseName;
|
|
|
+ }).catch(error => {
|
|
|
+ uni.showToast({
|
|
|
+ title: error,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
toSearchResult() {
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/parents/search/searchResult'
|
|
@@ -170,10 +233,13 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- courseChose(m,index) {
|
|
|
+ courseChose(m, index) {
|
|
|
this.active = index;
|
|
|
this.courseSort = m.id;
|
|
|
- this.getReCoursesList(true);
|
|
|
+ this.categorize = 1;
|
|
|
+ // this.getReCoursesList(true);
|
|
|
+ this.getCourseBaseListBySortId(m.id)
|
|
|
+ this.getTeacherListBySortId(m.id)
|
|
|
},
|
|
|
getLoadTopCourseSorts() {
|
|
|
uni.showLoading({
|
|
@@ -184,7 +250,9 @@
|
|
|
uni.hideLoading();
|
|
|
this.courseMenu = response.data;
|
|
|
this.courseSort = response.data[0].id;
|
|
|
- this.getReCoursesList();
|
|
|
+ // this.getReCoursesList();
|
|
|
+ this.getCourseBaseListBySortId(this.courseSort)
|
|
|
+ this.getTeacherListBySortId(this.courseSort)
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
title: error,
|
|
@@ -217,8 +285,9 @@
|
|
|
border-radius: 12px;
|
|
|
width: 28%;
|
|
|
text-align: center;
|
|
|
- height:1200rpx;
|
|
|
- overflow-y: scroll;
|
|
|
+ height: 1200rpx;
|
|
|
+ overflow-y: scroll;
|
|
|
+
|
|
|
.item {
|
|
|
line-height: 32px;
|
|
|
margin-top: 14px;
|
|
@@ -226,7 +295,7 @@
|
|
|
}
|
|
|
|
|
|
.chosen {
|
|
|
- width: 66.7%;
|
|
|
+ width: 80.7%;
|
|
|
margin: 14px auto 0;
|
|
|
border-radius: 50px;
|
|
|
background-color: rgba(13, 186, 199, 1);
|
|
@@ -239,39 +308,40 @@
|
|
|
margin-left: 12px;
|
|
|
width: 68.3%;
|
|
|
height: 1200rpx;
|
|
|
- overflow-y: scroll;
|
|
|
+ overflow-y: scroll;
|
|
|
+
|
|
|
.infos-box {
|
|
|
border-radius: 12px;
|
|
|
background-color: rgba(255, 255, 255, 1);
|
|
|
padding: 12px;
|
|
|
margin-bottom: 12px;
|
|
|
display: flex;
|
|
|
-
|
|
|
+
|
|
|
.picture {
|
|
|
width: 200rpx;
|
|
|
height: 200rpx;
|
|
|
border-radius: 4px;
|
|
|
overflow: hidden;
|
|
|
-
|
|
|
+
|
|
|
img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.infos {
|
|
|
flex: 1;
|
|
|
margin-left: 12px;
|
|
|
-
|
|
|
+
|
|
|
.name {
|
|
|
color: rgba(51, 51, 51, 1);
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.tips {
|
|
|
display: flex;
|
|
|
margin-top: 8px;
|
|
|
-
|
|
|
+
|
|
|
.item {
|
|
|
padding: 0 8px;
|
|
|
line-height: 20px;
|
|
@@ -282,13 +352,13 @@
|
|
|
margin-right: 8px;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.teacher-price {
|
|
|
margin-top: 44rpx;
|
|
|
// display: flex;
|
|
|
// justify-content: space-between;
|
|
|
// align-items: center;
|
|
|
-
|
|
|
+
|
|
|
.teacher {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -298,44 +368,44 @@
|
|
|
font-size: 16px;
|
|
|
width: 60%;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.phone-teacher {
|
|
|
margin-right: 8px;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.photo {
|
|
|
// width: 32px;
|
|
|
// height: 32px;
|
|
|
// border-radius: 50px;
|
|
|
// overflow: hidden;
|
|
|
margin-right: 8px;
|
|
|
-
|
|
|
+
|
|
|
img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.img {
|
|
|
width: 32rpx;
|
|
|
height: 32rpx;
|
|
|
margin-left: 16rpx;
|
|
|
-
|
|
|
+
|
|
|
img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.price {
|
|
|
color: rgba(119, 119, 119, 1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.title {
|
|
|
color: rgba(51, 51, 51, 1);
|
|
|
font-size: 16px;
|
|
@@ -367,74 +437,83 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.classes{
|
|
|
- height: 88rpx;
|
|
|
- line-height: 88rpx;
|
|
|
- display: flex;
|
|
|
- background-color: #ffffff;
|
|
|
- margin-bottom: 24rpx;
|
|
|
- border-radius: 12px;
|
|
|
- border: 2px solid rgba(13, 186, 199, 1);
|
|
|
- color: rgba(13, 186, 199, 1);
|
|
|
- .checked{
|
|
|
- background-color: #0DBAC7;
|
|
|
- color:#fff
|
|
|
- }
|
|
|
- .item{
|
|
|
- width: 50%;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-.teacher-item{
|
|
|
- width: 100%;
|
|
|
- border-radius: 12px;
|
|
|
- background-color: rgba(255, 255, 255, 1);
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- margin-bottom: 24rpx;
|
|
|
-
|
|
|
- padding: 24rpx;
|
|
|
- .photo{
|
|
|
- width: 96rpx;
|
|
|
- height: 96rpx;
|
|
|
- border-radius: 8px;
|
|
|
- overflow: hidden;
|
|
|
- img{
|
|
|
- width: 100%;
|
|
|
+ .classes {
|
|
|
+ height: 88rpx;
|
|
|
+ line-height: 88rpx;
|
|
|
+ display: flex;
|
|
|
+ background-color: #ffffff;
|
|
|
+ margin-bottom: 24rpx;
|
|
|
+ border-radius: 12px;
|
|
|
+ border: 2px solid rgba(13, 186, 199, 1);
|
|
|
+ color: rgba(13, 186, 199, 1);
|
|
|
+
|
|
|
+ .checked {
|
|
|
+ background-color: #0DBAC7;
|
|
|
+ color: #fff
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- .infos{
|
|
|
- margin-left: 16rpx;
|
|
|
- .name{
|
|
|
- color: rgba(51, 51, 51, 1);
|
|
|
- font-size: 32rpx;
|
|
|
- margin-bottom: 16rpx;
|
|
|
+
|
|
|
+ .item {
|
|
|
+ width: 50%;
|
|
|
+ text-align: center;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
- .course1{
|
|
|
- color: rgba(119, 119, 119, 1);
|
|
|
- font-size: 28rpx;
|
|
|
- width: 200rpx;
|
|
|
- white-space: nowrap;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ .teacher-item {
|
|
|
+ width: 100%;
|
|
|
+ border-radius: 12px;
|
|
|
+ background-color: rgba(255, 255, 255, 1);
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 24rpx;
|
|
|
+
|
|
|
+ padding: 24rpx;
|
|
|
+
|
|
|
+ .photo {
|
|
|
+ width: 96rpx;
|
|
|
+ height: 96rpx;
|
|
|
+ border-radius: 8px;
|
|
|
+ overflow: hidden;
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .infos {
|
|
|
+ margin-left: 16rpx;
|
|
|
+
|
|
|
+ .name {
|
|
|
+ color: rgba(51, 51, 51, 1);
|
|
|
+ font-size: 32rpx;
|
|
|
+ margin-bottom: 16rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .course1 {
|
|
|
+ color: rgba(119, 119, 119, 1);
|
|
|
+ font-size: 28rpx;
|
|
|
+ width: 200rpx;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .more {
|
|
|
+ margin-left: auto;
|
|
|
+ }
|
|
|
}
|
|
|
- .more{
|
|
|
- margin-left: auto;
|
|
|
+
|
|
|
+ .teacher-box {
|
|
|
+ border-radius: 12px;
|
|
|
+ background-color: rgba(255, 255, 255, 1);
|
|
|
+ padding: 12px;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ display: flex;
|
|
|
}
|
|
|
-}
|
|
|
-.teacher-box {
|
|
|
- border-radius: 12px;
|
|
|
- background-color: rgba(255, 255, 255, 1);
|
|
|
- padding: 12px;
|
|
|
- margin-bottom: 12px;
|
|
|
- display: flex;
|
|
|
- }
|
|
|
-</style>
|
|
|
+</style>
|