فهرست منبع

'完善找教员和找学员选项功能'

machinecat520 2 سال پیش
والد
کامیت
d15f4cf969

BIN
images/cancel.png


+ 219 - 26
pages/stuList/stuList.js

@@ -1,4 +1,6 @@
 // pages/stuList/stuList.js
+let searchLists = [] //搜索条件列表
+searchLists.length = 7
 Page({
 
     /**
@@ -23,6 +25,8 @@ Page({
         showTeachSex: false, //老师性别选项区是否显示
         teachImgChosed: '', //老师照片的筛选条件
         showTeachImg: false, //老师照片选项区是否显示
+        list: [], //筛选后的列表
+        isSearch: false, //是否点击搜索
         // 筛选条件
         // 1、课程类别
         courseList: ['小学', '初中', '高中', '大学', '音乐', '舞蹈', '语言', '体育', '美术', '书法', '少儿编程', '计算机', '其他'],
@@ -73,7 +77,7 @@ Page({
                     courseDetail: '小学1-5语文'
                 },
                 {
-                    teachPosition: '老师上门'
+                    teachPosition: '不限'
                 },
                 {
                     stuSex: '男'
@@ -146,7 +150,7 @@ Page({
                     teachSex: '男'
                 },
                 {
-                    teachImg: '不限'
+                    teachImg: '有照片'
                 },
                 {
                     otherNeed: '无'
@@ -171,7 +175,7 @@ Page({
                     courseDetail: '高一高二物理'
                 },
                 {
-                    teachPosition: '老师上门'
+                    teachPosition: '学员上门'
                 },
                 {
                     stuSex: '女'
@@ -220,7 +224,7 @@ Page({
                     courseDetail: '小学1-5语文'
                 },
                 {
-                    teachPosition: '老师上门'
+                    teachPosition: '学员住家'
                 },
                 {
                     stuSex: '男'
@@ -232,7 +236,7 @@ Page({
                     schoolTime: '周六晚上'
                 },
                 {
-                    except: '全力以赴备战小升初'
+                    except: '考个第一'
                 },
                 {
                     teachId: '在校大学生'
@@ -244,7 +248,7 @@ Page({
                     teachSex: '女'
                 },
                 {
-                    teachImg: '不限'
+                    teachImg: '有照片'
                 },
                 {
                     otherNeed: '无'
@@ -269,7 +273,7 @@ Page({
                     courseDetail: '初一初二语文'
                 },
                 {
-                    teachPosition: '老师上门'
+                    teachPosition: '老师住家'
                 },
                 {
                     stuSex: '男'
@@ -318,7 +322,7 @@ Page({
                     courseDetail: '高一高二物理'
                 },
                 {
-                    teachPosition: '老师上门'
+                    teachPosition: '线上辅导'
                 },
                 {
                     stuSex: '女'
@@ -379,7 +383,7 @@ Page({
                     schoolTime: '周六晚上'
                 },
                 {
-                    except: '全力以赴备战小升初'
+                    except: '考个好初中'
                 },
                 {
                     teachId: '在校大学生'
@@ -465,7 +469,7 @@ Page({
                     courseDetail: '高一高二物理'
                 },
                 {
-                    teachPosition: '老师上门'
+                    teachPosition: '不限'
                 },
                 {
                     stuSex: '女'
@@ -519,14 +523,15 @@ Page({
             toSearch: !toSearch
         })
         // 判断打开找学员的筛选区的条件是否为false,如果是,则关闭所有选项的筛选区
-        if(!this.data.toSearch){
+        if (!this.data.toSearch) {
             this.setData({
-                showTeachId: false,
                 showCourse: false,
                 showCourseDetail: false,
+                showTeachPosition: false,
+                showSexList: false,
+                showTeachType: false,
                 showTeachEdu: false,
                 showTeachSex: false,
-                showSchool: false,
                 showTeachImg: false
             })
         }
@@ -537,12 +542,13 @@ Page({
     chooseCourse() {
         let showCourse = this.data.showCourse
         this.setData({
-            showTeachId: false,
             showCourse: !showCourse,
             showCourseDetail: false,
+            showTeachPosition: false,
+            showSexList: false,
+            showTeachType: false,
             showTeachEdu: false,
             showTeachSex: false,
-            showSchool: false,
             showTeachImg: false
         })
     },
@@ -562,24 +568,38 @@ Page({
         let index = e.currentTarget.dataset.index
         let courseDetail = this.data.courseDetail
         let courseChosedIndex = this.data.courseChosedIndex
-        // let courseDetailIndex = this.data.courseDetailIndex
-        // let courseDetailChosed = this.data.courseDetailChosed
         this.setData({
             courseDetailChosed: courseDetail[courseChosedIndex][index],
             showCourseDetail: false,
             showCourse: false,
-            courseDetailIndex:e.currentTarget.dataset.index
+            courseDetailIndex: e.currentTarget.dataset.index,
         })
+        searchLists[0] = this.data.courseDetailChosed
         // console.log(this.data.courseDetailChosed);
         // console.log(this.data.courseDetailIndex);
     },
+    // 需求课程取消图标的功能
+    cancelChooseCourse() {
+        searchLists[0] = []
+        this.setData({
+            courseDetailChosed: '',
+            searchLists
+        })
+    },
 
     // 辅导方式
     // 打开辅导方式筛选区,关闭其他选项筛选区
     chooseTeachPosition() {
         let showTeachPosition = this.data.showTeachPosition
         this.setData({
-            showTeachPosition: !showTeachPosition
+            showCourse: false,
+            showCourseDetail: false,
+            showTeachPosition: !showTeachPosition,
+            showSexList: false,
+            showTeachType: false,
+            showTeachEdu: false,
+            showTeachSex: false,
+            showTeachImg: false
         })
     },
     // 选择辅导方式
@@ -597,14 +617,31 @@ Page({
             teachPositionChosed,
             showTeachPosition: false
         })
+        searchLists[1] = this.data.teachPositionChosed
+    },
+    // 辅导方式取消图标的功能
+    cancelChooseTeachPosition() {
+        searchLists[1] = []
+        this.setData({
+            teachPositionChosed: '',
+            searchLists
+        })
     },
 
     // 选择学生性别筛选项
     // 打开学生性别选项区,关闭其他选项区
     chooseStuSex() {
+        console.log(searchLists);
         let showSexList = this.data.showSexList
         this.setData({
-            showSexList: !showSexList
+            showCourse: false,
+            showCourseDetail: false,
+            showTeachPosition: false,
+            showSexList: !showSexList,
+            showTeachType: false,
+            showTeachEdu: false,
+            showTeachSex: false,
+            showTeachImg: false
         })
     },
     // 选择学生性别
@@ -621,6 +658,15 @@ Page({
             stuSexChosed,
             showSexList: false
         })
+        searchLists[2] = this.data.stuSexChosed
+    },
+    // 学生性别取消图标的功能
+    cancleChooseStuSex() {
+        searchLists[2] = []
+        this.setData({
+            stuSexChosed: '',
+            searchLists
+        })
     },
 
     // 教员类型筛选项
@@ -628,7 +674,14 @@ Page({
     chooseTeachType() {
         let showTeachType = this.data.showTeachType
         this.setData({
-            showTeachType: !showTeachType
+            showCourse: false,
+            showCourseDetail: false,
+            showTeachPosition: false,
+            showSexList: false,
+            showTeachType: !showTeachType,
+            showTeachEdu: false,
+            showTeachSex: false,
+            showTeachImg: false
         })
     },
 
@@ -647,6 +700,15 @@ Page({
             teachTypeChosed,
             showTeachType: false
         })
+        searchLists[3] = this.data.teachTypeChosed
+    },
+    // 教员类型取消图标的功能
+    cancelChooseTeachType(){
+        searchLists[3] = []
+        this.setData({
+            teachTypeChosed: '',
+            searchLists
+        })
     },
 
     // 老师学历筛选项
@@ -654,12 +716,13 @@ Page({
     chooseTeachEdu() {
         let showTeachEdu = this.data.showTeachEdu
         this.setData({
-            showTeachId: false,
             showCourse: false,
             showCourseDetail: false,
+            showTeachPosition: false,
+            showSexList: false,
+            showTeachType: false,
             showTeachEdu: !showTeachEdu,
             showTeachSex: false,
-            showSchool: false,
             showTeachImg: false
         })
     },
@@ -677,6 +740,15 @@ Page({
             teachEduChosed,
             showTeachEdu: false
         })
+        searchLists[4] = this.data.teachEduChosed
+    },
+    // 教员学历取消图标的功能
+    cancelChooseTeachEdu(){
+        searchLists[4] = []
+        this.setData({
+            teachEduChosed: '',
+            searchLists
+        })
     },
 
     // 选择老师性别筛选项
@@ -684,7 +756,14 @@ Page({
     chooseTeachSex() {
         let showTeachSex = this.data.showTeachSex
         this.setData({
-            showTeachSex: !showTeachSex
+            showCourse: false,
+            showCourseDetail: false,
+            showTeachPosition: false,
+            showSexList: false,
+            showTeachType: false,
+            showTeachEdu: false,
+            showTeachSex: !showTeachSex,
+            showTeachImg: false
         })
     },
     // 选择老师性别
@@ -701,6 +780,14 @@ Page({
             teachSexChosed,
             showTeachSex: false
         })
+        searchLists[5] = this.data.teachSexChosed
+    },
+    cancelChooseTeachSex(){
+        searchLists[5] = []
+        this.setData({
+            teachSexChosed: '',
+            searchLists
+        })
     },
 
     // 老师照片筛选项
@@ -708,6 +795,13 @@ Page({
     chooseTeachImg() {
         let showTeachImg = this.data.showTeachImg
         this.setData({
+            showCourse: false,
+            showCourseDetail: false,
+            showTeachPosition: false,
+            showSexList: false,
+            showTeachType: false,
+            showTeachEdu: false,
+            showTeachSex: false,
             showTeachImg: !showTeachImg
         })
     },
@@ -726,20 +820,119 @@ Page({
             teachImgChosed,
             showTeachImg: false
         })
+        searchLists[6] = this.data.teachImgChosed
+    },
+    cancelChooseTeachImg(){
+        searchLists[6] = []
+        this.setData({
+            teachImgChosed: '',
+            searchLists
+        })
     },
 
+    // 搜索按钮功能
+    onSearch() {
+        // console.log(searchLists[0]);
+        // list = []
+        // 判断搜索条件的数组是否为空(即是否选择了搜索条件)
+        if (!searchLists[0] && !searchLists[1] && !searchLists[2] && !searchLists[3] && !searchLists[4] && !searchLists[5] && !searchLists[6]) {
+            this.setData({
+                isSearch: false
+            })
+            wx.showToast({
+                title: '您还没选择搜索条件',
+                icon: 'none'
+            })
+            return
+        }
+        // 当搜索条件数组不为空时,点击搜索按钮后,重新将筛选后的数组设置为空数组,并将是否点击搜索的条件置为true
+        this.setData({
+            list: [],
+            isSearch: true
+        })
+        let stuLists = this.data.stuLists
+        let list = this.data.list
+        // 判断第一个筛选项值是否符合要求
+        if (searchLists[0]) {
+            for (let i = 0; i < stuLists.length; i++) {
+                for (let j = 0; j < stuLists[i].length; j++) {
+                    // console.log(stuLists[i][j].courseDetail);
+                    // 判断学生列表中是否有符合第一项筛选条件的信息
+                    if (searchLists[0] == stuLists[i][j].courseDetail) {
+                        // console.log('ok');
+                        // 将满足条件的学生信息添加进新数组
+                        list.push(stuLists[i])
+                        this.setData({
+                            list
+                        })
+                    }
+                }
+            }
+            console.log(list);
+        }
+        // 判断第二个筛选值是否符合要求
+        if (searchLists[1]) {
+            if (searchLists[0]) {
+                for (let i = 0; i < list.length; i++) {
+                    for (let j = 0; j < list[i].length; j++) {
+                        // console.log(stuLists[i][j].courseDetail);
+                        // 判断学生列表中是否有符合第一项筛选条件的信息
+                        if (searchLists[1] == list[i][j].teachPosition) {
+                            // console.log('ok');
+                            // 将满足条件的学生信息添加进新数组
+                            let newList = []
+                            newList.push(list[i])
+                            this.setData({
+                                list: newList
+                            })
+                        }
+                    }
+                }
+                console.log(this.data.list);
+            } else {
+                for (let i = 0; i < stuLists.length; i++) {
+                    for (let j = 0; j < stuLists[i].length; j++) {
+                        // console.log(stuLists[i][j].courseDetail);
+                        // 判断学生列表中是否有符合第一项筛选条件的信息
+                        if (searchLists[1] == stuLists[i][j].teachPosition) {
+                            // console.log('ok');
+                            // 将满足条件的学生信息添加进新数组
+                            list.push(stuLists[i])
+                            this.setData({
+                                list
+                            })
+                        }
+                    }
+                }
+                console.log(this.data.list);
+            }
+        }
 
+    },
 
-    // 清楚选择按钮
+    // 清选择按钮
     clearOptions() {
+        searchLists = []
         this.setData({
+            isSearch: false,
             courseDetailChosed: '',
             teachPositionChosed: '',
             stuSexChosed: '',
             teachTypeChosed: '',
             teachEduChosed: '',
             teachSexChosed: '',
-            teachImgChosed: ''
+            teachImgChosed: '',
+            list: [],
+
+            // 将筛选选项区全部置为false
+            showCourse: false,
+            showCourseDetail: false,
+            showTeachPosition: false,
+            showSexList: false,
+            showTeachType: false,
+            showTeachEdu: false,
+            showTeachSex: false,
+            showTeachImg: false
         })
     },
 

+ 50 - 23
pages/stuList/stuList.wxml

@@ -5,42 +5,69 @@
     <image wx:else class="iconImg" src="../../images/down.png"></image>
 </view>
 <view class="searchContainer" wx:if="{{toSearch}}">
-    <view class="searchList" bindtap="chooseCourse">
-        {{courseDetailChosed || '需求课程'}}
-        <image class="iconImg" src="../../images/down.png"></image>
+    <view class="searchList">
+        <view  bindtap="chooseCourse">{{courseDetailChosed || '需求课程'}}</view>
+        <image wx:if="{{courseDetailChosed}}" class="iconCancelImg" src="../../images/cancel.png" bindtap="cancelChooseCourse"></image>
+        <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseCourse"></image>
     </view>
-    <view class="searchList" bindtap="chooseTeachPosition">
-        {{teachPositionChosed || '辅导方式'}}
-        <image class="iconImg" src="../../images/down.png"></image>
+    <view class="searchList">
+        <view bindtap="chooseTeachPosition">{{teachPositionChosed || '辅导方式'}}</view>
+        <image wx:if="{{teachPositionChosed}}" class="iconCancelImg" src="../../images/cancel.png" bindtap="cancelChooseTeachPosition"></image>
+        <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseTeachPosition"></image>
     </view>
-    <view class="searchList" bindtap="chooseStuSex">
-        {{stuSexChosed || '学生性别'}}
-        <image class="iconImg" src="../../images/down.png"></image>
+    <view class="searchList">
+        <view bindtap="chooseStuSex">{{stuSexChosed || '学生性别'}}</view>
+        <image wx:if="{{stuSexChosed}}" class="iconCancelImg" src="../../images/cancel.png" bindtap="cancleChooseStuSex"></image>
+        <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseStuSex"></image>
     </view>
-    <view class="searchList" bindtap="chooseTeachType">
-        {{teachTypeChosed || '教员类型'}}
-        <image class="iconImg" src="../../images/down.png"></image>
+    <view class="searchList">
+        <view bindtap="chooseTeachType">{{teachTypeChosed || '教员类型'}}</view>
+        <image wx:if="{{teachTypeChosed}}" class="iconCancelImg" src="../../images/cancel.png" bindtap="cancelChooseTeachType"></image>
+        <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseTeachType"></image>
     </view>
-    <view class="searchList" bindtap="chooseTeachEdu">
-        {{teachEduChosed || '教员学历'}}
-        <image class="iconImg" src="../../images/down.png"></image>
+    <view class="searchList">
+        <view bindtap="chooseTeachEdu">{{teachEduChosed || '教员学历'}}</view>
+        <image wx:if="{{teachEduChosed}}" class="iconCancelImg" src="../../images/cancel.png" bindtap="cancelChooseTeachEdu"></image>
+        <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseTeachEdu"></image>
     </view>
-    <view class="searchList" bindtap="chooseTeachSex">
-        {{teachSexChosed || '教员性别'}}
-        <image class="iconImg" src="../../images/down.png"></image>
+    <view class="searchList">
+        <view bindtap="chooseTeachSex">{{teachSexChosed || '教员性别'}}</view>
+        <image wx:if="{{teachSexChosed}}" class="iconCancelImg" src="../../images/down.png" bindtap="cancelChooseTeachSex"></image>
+        <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseTeachSex"></image>
     </view>
-    <view class="searchList" bindtap="chooseTeachImg">
-        {{teachImgChosed || '教员照片'}}
-        <image class="iconImg" src="../../images/down.png"></image>
+    <view class="searchList">
+        <view bindtap="chooseTeachImg">{{teachImgChosed || '教员照片'}}</view>
+        <image wx:if="{{teachImgChosed}}" class="iconCancelImg" src="../../images/cancel.png" bindtap="cancelChooseTeachImg"></image>
+        <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseTeachImg"></image>
     </view>
 </view>
 <view class="searchBtn-container" wx:if="{{toSearch}}">
-    <view class="searchBtn">搜索</view>
+    <view class="searchBtn" bindtap="onSearch">搜索</view>
     <view class="clearBtn" bindtap="clearOptions">清除选择</view>
 </view>
 
 <!-- 学生列表区 -->
-<view class="stuListContainer">
+<view wx:if="{{isSearch && !list.length}}">没有找到符合条件的信息</view>
+<view wx:if="{{isSearch}}" class="stuListContainer">
+    <view wx:for="{{list}}" wx:key="index" wx:for-index="index">
+        <!-- 间隔区域 -->
+        <view class="stuListInterval"></view>
+        <!-- 学生列表区域 -->
+        <view class="stuListDetail" bindtap="toStuDetail">
+            <view class="stuLeft">
+                <text class="stuTitle">科目:{{list[index][5].courseDetail}}</text>
+                <text class="stuDesc">{{list[index][10].except}}</text>
+            </view>
+            <view class="stuRight">
+                <text class="stuId">{{list[index][0].id}}</text>
+                <text class="stuSex">学员:{{list[index][7].stuSex}}</text>
+                <text class="salary">{{list[index][8].salary}}/小时</text>
+            </view>
+        </view>
+    </view>
+</view>
+
+<view wx:else class="stuListContainer">
     <view wx:for="{{stuLists}}" wx:key="index" wx:for-index="index">
         <!-- 间隔区域 -->
         <view class="stuListInterval"></view>

+ 15 - 0
pages/stuList/stuList.wxss

@@ -29,9 +29,11 @@
 }
 /* 筛选区列表的样式 */
 .searchList{
+    display: flex;
     width: 28%;
     height: 50rpx;
     text-align: center;
+    justify-content: center;
     margin-top: 10rpx;
     margin-left: 20rpx;
     border: 1rpx solid gray;
@@ -43,6 +45,19 @@
     width: 26rpx;
     height: 26rpx;
 }
+.searchList .iconImg{
+    width: 26rpx;
+    height: 26rpx;
+    padding-top: 11rpx;
+    padding-left: 10rpx;
+}
+/* 取消图标的样式 */
+.iconCancelImg{
+    width: 36rpx;
+    height: 36rpx;
+    padding-top: 7rpx;
+    padding-left: 10rpx;
+}
 /* 搜索按钮 */
 /* 搜索按钮外层容器 */
 .searchBtn-container{

+ 1 - 5
pages/stuNeed/stuNeed.js

@@ -815,11 +815,7 @@ Page({
                 choesd: true
             },
             {
-                imgUpload: '是',
-                choesd: false
-            },
-            {
-                imgUpload: '否',
+                imgUpload: '有照片',
                 choesd: false
             }
         ],

+ 2 - 2
pages/stuNeed/stuNeed.wxml

@@ -132,7 +132,7 @@
         </view>
         <!-- 是否要求老师上传头像 -->
         <view class="stuInfo">
-            <view>是否要求头像上传:</view>
+            <view>对老师的照片要求:</view>
             <view class="stuNeedOptions" bindtap="toTeacherImgUpload">
                 <view class="stuCourse">{{teacherImg}}</view>
                 <view class="iconfont icon-xiangxia"></view>
@@ -293,7 +293,7 @@
     </view>
 </view>
 
-<!-- 老师头像是否上传 -->
+<!-- 对老师的照片要求 -->
 <view wx:if="{{showTeachImg}}">
     <!-- 空白区(背景) -->
     <view class="mask" bindtap="hiddenTeacherImgUpload"></view>

+ 50 - 14
pages/teacherList/teacherList.js

@@ -5,11 +5,11 @@ Page({
      * 页面的初始数据
      */
     data: {
-        toSearch: false,    //是否打开找老师的筛选区
+        toSearch: false, //是否打开找老师的筛选区
         courseChosedIndex: '', //选中科目的索引
         showCourse: false, //科目选项区是否显示
         courseDetailChosed: '', //课程详情筛选条件
-        courseDetailIndex:'',   //选中课程详情的索引
+        courseDetailIndex: '', //选中课程详情的索引
         showCourseDetail: false, //课程详情选项区是否显示
         teachIdChosed: '', //老师身份的筛选条件
         showTeachId: false, //老师身份选项区是否显示
@@ -33,10 +33,10 @@ Page({
             ['托福', '雅思', '高等数学', '微观经济学', 'MBA', '成人高考', '国学', '自学考试', '专升本', '考博面试辅导', '考博专业课', '考博英语', '英语四级', '英语六级', '论文指导', '考研专业课', '考研政治', '考研数学', '考研英语', '英语专业四级', '英语专业八级', '课程辅导'],
             ['小提琴', '钢琴', '电子琴', '长笛', '琵琶', '手风琴', '古筝', '练耳歌唱', '大号', '声乐', '萨克斯', '单簧管', '吉他', '小号', '古琴', '二胡', '大提琴', '打击乐', '圆号', '中提琴', '竹笛', '架子鼓', '扬琴', '巴松'],
             ['民族舞', '爵士舞', '拉丁舞', '芭蕾舞', '街舞', '现代舞', '踢踏舞'],
-            ['本地方言', '日语', '英语口语', '新概念英语', '牛津英语', '西班牙语', '德语', '商务英语', '法语', '韩语', '意大利语', '汉语', '阿拉伯语', 'SBS英语', '俄语', '葡萄牙语'], 
+            ['本地方言', '日语', '英语口语', '新概念英语', '牛津英语', '西班牙语', '德语', '商务英语', '法语', '韩语', '意大利语', '汉语', '阿拉伯语', 'SBS英语', '俄语', '葡萄牙语'],
             ['羽毛球', '跆拳道', '游泳', '乒乓球', '网球', '中国象棋', '国际象棋', '围棋', '篮球', '空手道'],
             ['卡通画', '中国画', '素描', '油画', '水彩', '漫画'],
-             ['硬笔', '毛笔', '篆刻'],
+            ['硬笔', '毛笔', '篆刻'],
             ['Scratch', 'Python', 'C++', 'microbit'],
             ['应用能力初级', '应用能力中级', '基本操作'],
             ['学习习惯', '口才', '心理辅导', '记忆力', '注意力']
@@ -468,13 +468,13 @@ Page({
     },
 
     // 打开找老师的筛选区
-    toOpenSearch(){
+    toOpenSearch() {
         let toSearch = this.data.toSearch
         this.setData({
-            toSearch : !toSearch
+            toSearch: !toSearch
         })
         // 判断打开找老师的筛选区的条件是否为false,如果是,则关闭所有选项的筛选区
-        if(!this.data.toSearch){
+        if (!this.data.toSearch) {
             this.setData({
                 showTeachId: false,
                 showCourse: false,
@@ -502,30 +502,36 @@ Page({
         })
     },
     // 选择科目大类
-    chosedCourse(e){
+    chosedCourse(e) {
         // console.log(e.currentTarget.dataset.index);
         let courseChosedIndex = e.currentTarget.dataset.index
         this.setData({
             courseChosedIndex,
-            showCourseDetail:true
+            showCourseDetail: true
         })
         // console.log(this.data.courseChosedIndex);
     },
     // 选择课程详情
-    chosedCourseDetail(e){
+    chosedCourseDetail(e) {
         // console.log(e.currentTarget.dataset.index);
         let index = e.currentTarget.dataset.index
         let courseDetail = this.data.courseDetail
         let courseChosedIndex = this.data.courseChosedIndex
         // let courseDetailChosed = this.data.courseDetailChosed
         this.setData({
-            courseDetailChosed : courseDetail[courseChosedIndex][index],
+            courseDetailChosed: courseDetail[courseChosedIndex][index],
             showCourseDetail: false,
             showCourse: false,
-            courseDetailIndex:index
+            courseDetailIndex: index
         })
         console.log(this.data.courseDetailChosed);
     },
+    // 课程详情取消图标的功能
+    cancelChooseCourse() {
+        this.setData({
+            courseDetailChosed: ''
+        })
+    },
 
     // 老师身份筛选项
     // 打开老师身份选项区,关闭其他选项区
@@ -558,6 +564,12 @@ Page({
             showTeachId: false
         })
     },
+    // 老师身份取消图标的功能
+    cancelChooseTeachId() {
+        this.setData({
+            teachIdChosed: ''
+        })
+    },
 
     // 老师学历筛选项
     // 打开老师学历选项区,关闭其他选项区
@@ -588,6 +600,12 @@ Page({
             showTeachEdu: false
         })
     },
+    // 老师学历取消图标的功能
+    cancelChooseTeachEdu() {
+        this.setData({
+            teachEduChosed: ''
+        })
+    },
 
     // 选择老师性别筛选项
     // 打开老师性别选项区,关闭其他选项区
@@ -618,6 +636,12 @@ Page({
             showTeachSex: false
         })
     },
+    // 老师性别取消图标的功能
+    cancelChooseTeachSex() {
+        this.setData({
+            teachSexChosed: ''
+        })
+    },
 
     // 大学筛选项
     // 打开大学筛选选项区,关闭其他选项区
@@ -648,6 +672,12 @@ Page({
             showSchool: false
         })
     },
+    // 大学取消图标的功能
+    cancelChooseSchool() {
+        this.setData({
+            schoolChosed: ''
+        })
+    },
 
     // 老师照片筛选项
     // 打开老师照片选项区,关闭其他选项区
@@ -679,13 +709,19 @@ Page({
             showTeachImg: false
         })
     },
+    // 老师照片取消图标的功能
+    cancelChooseTeachImg() {
+        this.setData({
+            teachImgChosed: ''
+        })
+    },
 
     // 清除选择按钮
     clearOptions() {
         this.setData({
             courseChosedIndex: '',
-            courseDetailIndex:'',
-            courseDetailChosed:'',
+            courseDetailIndex: '',
+            courseDetailChosed: '',
             teachIdChosed: '',
             teachEduChosed: '',
             teachSexChosed: '',

+ 24 - 18
pages/teacherList/teacherList.wxml

@@ -6,29 +6,35 @@
         <image wx:else class="iconImg" src="../../images/down.png"></image>
     </view>
     <view class="searchContainer" wx:if="{{toSearch}}">
-        <view class="searchList" bindtap="chooseCourse">
-            {{courseDetailChosed || '课程详情'}}
-            <image class="iconImg" src="../../images/down.png"></image>
+        <view class="searchList">
+            <view bindtap="chooseCourse">{{courseDetailChosed || '课程详情'}}</view>
+            <image wx:if="{{courseDetailChosed}}" class="iconCancelImg" src="../../images/cancel.png" bindtap="cancelChooseCourse"></image>
+            <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseCourse"></image>
         </view>
-        <view class="searchList" bindtap="chooseTeachId">
-            {{teachIdChosed || '老师身份'}}
-            <image class="iconImg" src="../../images/down.png"></image>
+        <view class="searchList">
+            <view bindtap="chooseTeachId">{{teachIdChosed || '老师身份'}}</view>
+            <image wx:if="{{teachIdChosed}}" class="iconCancelImg" src="../../images/cancel.png" bindtap="cancelChooseTeachId"></image>
+            <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseTeachId"></image>
         </view>
-        <view class="searchList" bindtap="chooseTeachEdu">
-            {{teachEduChosed || '学历'}}
-            <image class="iconImg" src="../../images/down.png"></image>
+        <view class="searchList">
+            <view bindtap="chooseTeachEdu">{{teachEduChosed || '学历'}}</view>
+            <image wx:if="{{teachEduChosed}}" class="iconCancelImg" src="../../images/cancel.png" bindtap="cancelChooseTeachEdu"></image>
+            <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseTeachEdu"></image>
         </view>
-        <view class="searchList" bindtap="chooseTeachSex">
-            {{teachSexChosed || '性别'}}
-            <image class="iconImg" src="../../images/down.png"></image>
+        <view class="searchList">
+            <view bindtap="chooseTeachSex">{{teachSexChosed || '性别'}}</view>
+            <image wx:if="{{teachSexChosed}}" class="iconCancelImg" src="../../images/cancel.png" bindtap="cancelChooseTeachSex"></image>
+            <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseTeachSex"></image>
         </view>
-        <view class="searchList" bindtap="chooseSchool">
-            {{schoolChosed || '大学'}}
-            <image class="iconImg" src="../../images/down.png"></image>
+        <view class="searchList">
+            <view bindtap="chooseSchool">{{schoolChosed || '大学'}}</view>
+            <image wx:if="{{schoolChosed}}" class="iconCancelImg" src="../../images/cancel.png" bindtap="cancelChooseSchool"></image>
+            <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseSchool"></image>
         </view>
-        <view class="searchList" bindtap="chooseTeachImg">
-            {{teachImgChosed || '老师照片'}}
-            <image class="iconImg" src="../../images/down.png"></image>
+        <view class="searchList">
+            <view bindtap="chooseTeachImg">{{teachImgChosed || '老师照片'}}</view>
+            <image wx:if="{{teachImgChosed}}" class="iconCancelImg" src="../../images/cancel.png" bindtap="cancelChooseTeachImg"></image>
+            <image wx:else class="iconImg" src="../../images/down.png" bindtap="chooseTeachImg"></image>
         </view>
     </view>
     <view class="searchBtn-container" wx:if="{{searchList.length && toSearch}}">

+ 15 - 0
pages/teacherList/teacherList.wxss

@@ -28,9 +28,11 @@
 }
 /* 筛选区列表的样式 */
 .searchList{
+    display: flex;
     width: 28%;
     height: 50rpx;
     text-align: center;
+    justify-content: center;
     margin-top: 10rpx;
     margin-left: 20rpx;
     border: 1rpx solid gray;
@@ -42,6 +44,19 @@
     width: 26rpx;
     height: 26rpx;
 }
+.searchList .iconImg{
+    width: 26rpx;
+    height: 26rpx;
+    padding-top: 11rpx;
+    padding-left: 10rpx;
+}
+/* 取消选择的图标样式 */
+.iconCancelImg{
+    width: 36rpx;
+    height: 36rpx;
+    padding-top: 7rpx;
+    padding-left: 10rpx;
+}
 /* 搜索按钮 */
 /* 搜索按钮外层容器 */
 .searchBtn-container{