stuList.js 85 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305
  1. // pages/stuList/stuList.js
  2. let searchLists = [] //搜索条件列表
  3. searchLists.length = 7
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. toSearch: false, //打开/关闭筛选区
  10. courseChosedIndex: '', //选中科目的索引
  11. showCourse: false, //科目选项区是否显示
  12. courseDetailChosed: '', //课程详情筛选条件
  13. courseDetailIndex: null, //选中课程详情的索引
  14. showCourseDetail: false, //课程详情选项区是否显示
  15. teachPositionChosed: '', //需求辅导方式
  16. showTeachPosition: false, //需求辅导方式选项区是否显示
  17. stuSexChosed: '', //学生性别
  18. showSexList: false, //学生性别选项区是否显示
  19. teachTypeChosed: '', //教员类型
  20. showTeachType: false, //教员类型选项区是否显示
  21. teachEduChosed: '', //老师学历的筛选条件
  22. showTeachEdu: false, //老师学历选项区是否显示
  23. teachSexChosed: '', //老师性别的筛选条件
  24. showTeachSex: false, //老师性别选项区是否显示
  25. teachImgChosed: '', //老师照片的筛选条件
  26. showTeachImg: false, //老师照片选项区是否显示
  27. list: [], //筛选后的列表
  28. isSearch: false, //是否点击搜索
  29. // 筛选条件
  30. // 1、课程类别
  31. courseList: ['小学', '初中', '高中', '大学', '音乐', '舞蹈', '语言', '体育', '美术', '书法', '少儿编程', '计算机', '其他'],
  32. // 课程详情
  33. courseDetail: [
  34. ['小学1-5数学', '小学1-5英语', '小学1-5语文', '小学6数学', '小学6英语', '小学6语文', '小学奥数'],
  35. ['初一初二语文', '初一初二数学', '初一初二英语', '初一初二物理', '初一初二化学', '初三语文', '初三数学', '初三英语', '初三物理', '初三化学', '初中历史', '初中地理', '初中奥数', '初中生物', '初中预备班', '初中科学', '初中政治'],
  36. ['高一高二语文', '高一高二数学', '高一高二英语', '高一高二物理', '高一高二化学', '高三语文', '高三数学', '高三英语', '高三物理', '高三化学', '高中历史', '高中地理', '高中政治', '高中生物', '信息科技', 'SAT'],
  37. ['托福', '雅思', '高等数学', '微观经济学', 'MBA', '成人高考', '国学', '自学考试', '专升本', '考博面试辅导', '考博专业课', '考博英语', '英语四级', '英语六级', '论文指导', '考研专业课', '考研政治', '考研数学', '考研英语', '英语专业四级', '英语专业八级', '课程辅导'],
  38. ['小提琴', '钢琴', '电子琴', '长笛', '琵琶', '手风琴', '古筝', '练耳歌唱', '大号', '声乐', '萨克斯', '单簧管', '吉他', '小号', '古琴', '二胡', '大提琴', '打击乐', '圆号', '中提琴', '竹笛', '架子鼓', '扬琴', '巴松'],
  39. ['民族舞', '爵士舞', '拉丁舞', '芭蕾舞', '街舞', '现代舞', '踢踏舞'],
  40. ['本地方言', '日语', '英语口语', '新概念英语', '牛津英语', '西班牙语', '德语', '商务英语', '法语', '韩语', '意大利语', '汉语', '阿拉伯语', 'SBS英语', '俄语', '葡萄牙语'],
  41. ['羽毛球', '跆拳道', '游泳', '乒乓球', '网球', '中国象棋', '国际象棋', '围棋', '篮球', '空手道'],
  42. ['卡通画', '中国画', '素描', '油画', '水彩', '漫画'],
  43. ['硬笔', '毛笔', '篆刻'],
  44. ['Scratch', 'Python', 'C++', 'microbit'],
  45. ['应用能力初级', '应用能力中级', '基本操作'],
  46. ['学习习惯', '口才', '心理辅导', '记忆力', '注意力']
  47. ],
  48. // 2、辅导方式
  49. teachPositions: ['不限', '老师上门', '学员上门', '线上辅导', '老师住家', '学员住家'],
  50. // 3、性别列表
  51. sexList: ['不限', '男', '女'],
  52. // 4、教员类型
  53. teachType: ['不限', '专职老师', '在校大学生'],
  54. // 5、教员学历
  55. educationList: ['不限', '博士毕业', '博士在读', '硕士毕业', '硕士在读', '本科毕业', '本科在读', '专科毕业', '专科在读'],
  56. // 6、老师照片选项
  57. teachImgOptions: ['不限', '有照片'],
  58. // 模拟后台读取的学生列表信息
  59. stuLists: [
  60. [{
  61. id: '20220811'
  62. },
  63. {
  64. name: '孙悟空'
  65. },
  66. {
  67. phone: '13400000000'
  68. },
  69. {
  70. weChatNum: '13400000000'
  71. },
  72. {
  73. courseNeed: '小学'
  74. },
  75. {
  76. courseDetail: '小学1-5语文'
  77. },
  78. {
  79. teachPosition: '不限'
  80. },
  81. {
  82. stuSex: '男'
  83. },
  84. {
  85. salary: '200'
  86. },
  87. {
  88. schoolTime: '周六晚上'
  89. },
  90. {
  91. except: '全力以赴备战小升初'
  92. },
  93. {
  94. teachId: '在校大学生'
  95. },
  96. {
  97. teachEdu: '本科在读'
  98. },
  99. {
  100. teachSex: '女'
  101. },
  102. {
  103. teachImg: '不限'
  104. },
  105. {
  106. otherNeed: '无'
  107. }
  108. ],
  109. [{
  110. id: '20220821'
  111. },
  112. {
  113. name: '孙悟空'
  114. },
  115. {
  116. phone: '13400000000'
  117. },
  118. {
  119. weChatNum: '13400000000'
  120. },
  121. {
  122. courseNeed: '初中'
  123. },
  124. {
  125. courseDetail: '初一初二语文'
  126. },
  127. {
  128. teachPosition: '老师上门'
  129. },
  130. {
  131. stuSex: '男'
  132. },
  133. {
  134. salary: '200'
  135. },
  136. {
  137. schoolTime: '周六晚上'
  138. },
  139. {
  140. except: '考上重点初中'
  141. },
  142. {
  143. teachId: '在校大学生'
  144. },
  145. {
  146. teachEdu: '本科在读'
  147. },
  148. {
  149. teachSex: '男'
  150. },
  151. {
  152. teachImg: '有照片'
  153. },
  154. {
  155. otherNeed: '无'
  156. }
  157. ],
  158. [{
  159. id: '20220811'
  160. },
  161. {
  162. name: '孙悟空'
  163. },
  164. {
  165. phone: '13400000000'
  166. },
  167. {
  168. weChatNum: '13400000000'
  169. },
  170. {
  171. courseNeed: '高中'
  172. },
  173. {
  174. courseDetail: '高一高二物理'
  175. },
  176. {
  177. teachPosition: '学员住家'
  178. },
  179. {
  180. stuSex: '女'
  181. },
  182. {
  183. salary: '200'
  184. },
  185. {
  186. schoolTime: '周日晚上'
  187. },
  188. {
  189. except: '好好学习,天天向上,考个重点大学'
  190. },
  191. {
  192. teachId: '专职老师'
  193. },
  194. {
  195. teachEdu: '本科毕业'
  196. },
  197. {
  198. teachSex: '不限'
  199. },
  200. {
  201. teachImg: '不限'
  202. },
  203. {
  204. otherNeed: '无'
  205. }
  206. ],
  207. [{
  208. id: '20220811'
  209. },
  210. {
  211. name: '孙悟空'
  212. },
  213. {
  214. phone: '13400000000'
  215. },
  216. {
  217. weChatNum: '13400000000'
  218. },
  219. {
  220. courseNeed: '小学'
  221. },
  222. {
  223. courseDetail: '小学1-5语文'
  224. },
  225. {
  226. teachPosition: '学员住家'
  227. },
  228. {
  229. stuSex: '女'
  230. },
  231. {
  232. salary: '200'
  233. },
  234. {
  235. schoolTime: '周六晚上'
  236. },
  237. {
  238. except: '考个第一'
  239. },
  240. {
  241. teachId: '在校大学生'
  242. },
  243. {
  244. teachEdu: '本科在读'
  245. },
  246. {
  247. teachSex: '女'
  248. },
  249. {
  250. teachImg: '有照片'
  251. },
  252. {
  253. otherNeed: '无'
  254. }
  255. ],
  256. [{
  257. id: '20220821'
  258. },
  259. {
  260. name: '孙悟空'
  261. },
  262. {
  263. phone: '13400000000'
  264. },
  265. {
  266. weChatNum: '13400000000'
  267. },
  268. {
  269. courseNeed: '初中'
  270. },
  271. {
  272. courseDetail: '初一初二语文'
  273. },
  274. {
  275. teachPosition: '老师住家'
  276. },
  277. {
  278. stuSex: '男'
  279. },
  280. {
  281. salary: '200'
  282. },
  283. {
  284. schoolTime: '周六晚上'
  285. },
  286. {
  287. except: '考个好学校'
  288. },
  289. {
  290. teachId: '在校大学生'
  291. },
  292. {
  293. teachEdu: '硕士在读'
  294. },
  295. {
  296. teachSex: '男'
  297. },
  298. {
  299. teachImg: '不限'
  300. },
  301. {
  302. otherNeed: '无'
  303. }
  304. ],
  305. [{
  306. id: '20220811'
  307. },
  308. {
  309. name: '孙悟空'
  310. },
  311. {
  312. phone: '13400000000'
  313. },
  314. {
  315. weChatNum: '13400000000'
  316. },
  317. {
  318. courseNeed: '高中'
  319. },
  320. {
  321. courseDetail: '高一高二物理'
  322. },
  323. {
  324. teachPosition: '线上辅导'
  325. },
  326. {
  327. stuSex: '女'
  328. },
  329. {
  330. salary: '200'
  331. },
  332. {
  333. schoolTime: '周日晚上'
  334. },
  335. {
  336. except: '好好学习'
  337. },
  338. {
  339. teachId: '专职老师'
  340. },
  341. {
  342. teachEdu: '硕士毕业'
  343. },
  344. {
  345. teachSex: '不限'
  346. },
  347. {
  348. teachImg: '不限'
  349. },
  350. {
  351. otherNeed: '无'
  352. }
  353. ],
  354. [{
  355. id: '20220811'
  356. },
  357. {
  358. name: '孙悟空'
  359. },
  360. {
  361. phone: '13400000000'
  362. },
  363. {
  364. weChatNum: '13400000000'
  365. },
  366. {
  367. courseNeed: '小学'
  368. },
  369. {
  370. courseDetail: '小学1-5语文'
  371. },
  372. {
  373. teachPosition: '老师上门'
  374. },
  375. {
  376. stuSex: '男'
  377. },
  378. {
  379. salary: '200'
  380. },
  381. {
  382. schoolTime: '周六晚上'
  383. },
  384. {
  385. except: '考个好初中'
  386. },
  387. {
  388. teachId: '专职老师'
  389. },
  390. {
  391. teachEdu: '专科毕业'
  392. },
  393. {
  394. teachSex: '女'
  395. },
  396. {
  397. teachImg: '不限'
  398. },
  399. {
  400. otherNeed: '无'
  401. }
  402. ],
  403. [{
  404. id: '20220821'
  405. },
  406. {
  407. name: '白骨精'
  408. },
  409. {
  410. phone: '13400000000'
  411. },
  412. {
  413. weChatNum: '13400000000'
  414. },
  415. {
  416. courseNeed: '初中'
  417. },
  418. {
  419. courseDetail: '初一初二语文'
  420. },
  421. {
  422. teachPosition: '老师上门'
  423. },
  424. {
  425. stuSex: '女'
  426. },
  427. {
  428. salary: '200'
  429. },
  430. {
  431. schoolTime: '周六晚上'
  432. },
  433. {
  434. except: '顺利升学'
  435. },
  436. {
  437. teachId: '专职老师'
  438. },
  439. {
  440. teachEdu: '本科毕业'
  441. },
  442. {
  443. teachSex: '男'
  444. },
  445. {
  446. teachImg: '不限'
  447. },
  448. {
  449. otherNeed: '无'
  450. }
  451. ],
  452. [{
  453. id: '20220811'
  454. },
  455. {
  456. name: '孙悟空'
  457. },
  458. {
  459. phone: '13400000000'
  460. },
  461. {
  462. weChatNum: '13400000000'
  463. },
  464. {
  465. courseNeed: '高中'
  466. },
  467. {
  468. courseDetail: '高一高二物理'
  469. },
  470. {
  471. teachPosition: '不限'
  472. },
  473. {
  474. stuSex: '男'
  475. },
  476. {
  477. salary: '200'
  478. },
  479. {
  480. schoolTime: '周日晚上'
  481. },
  482. {
  483. except: '补课'
  484. },
  485. {
  486. teachId: '在校大学生'
  487. },
  488. {
  489. teachEdu: '硕士在读'
  490. },
  491. {
  492. teachSex: '不限'
  493. },
  494. {
  495. teachImg: '不限'
  496. },
  497. {
  498. otherNeed: '无'
  499. }
  500. ],
  501. ]
  502. },
  503. /**
  504. * 生命周期函数--监听页面加载
  505. */
  506. onLoad(options) {
  507. },
  508. //跳转到学生详情页
  509. toStuDetail() {
  510. wx.navigateTo({
  511. url: '/pages/stuDetail/stuDetail',
  512. })
  513. },
  514. // 找学员按钮的点击事件
  515. toOpenSearch() {
  516. let toSearch = this.data.toSearch
  517. this.setData({
  518. toSearch: !toSearch
  519. })
  520. // 判断打开找学员的筛选区的条件是否为false,如果是,则关闭所有选项的筛选区
  521. if (!this.data.toSearch) {
  522. this.setData({
  523. showCourse: false,
  524. showCourseDetail: false,
  525. showTeachPosition: false,
  526. showSexList: false,
  527. showTeachType: false,
  528. showTeachEdu: false,
  529. showTeachSex: false,
  530. showTeachImg: false
  531. })
  532. }
  533. },
  534. // 科目筛选项
  535. // 打开科目选项区,关闭其他选项区
  536. chooseCourse() {
  537. let showCourse = this.data.showCourse
  538. this.setData({
  539. showCourse: !showCourse,
  540. showCourseDetail: false,
  541. showTeachPosition: false,
  542. showSexList: false,
  543. showTeachType: false,
  544. showTeachEdu: false,
  545. showTeachSex: false,
  546. showTeachImg: false
  547. })
  548. },
  549. // 选择科目大类
  550. chosedCourse(e) {
  551. // console.log(e.currentTarget.dataset.index);
  552. let courseChosedIndex = e.currentTarget.dataset.index
  553. this.setData({
  554. courseChosedIndex,
  555. showCourseDetail: true
  556. })
  557. // console.log(this.data.courseChosedIndex);
  558. },
  559. // 选择课程详情
  560. chosedCourseDetail(e) {
  561. // console.log(e.currentTarget.dataset.index);
  562. let index = e.currentTarget.dataset.index
  563. let courseDetail = this.data.courseDetail
  564. let courseChosedIndex = this.data.courseChosedIndex
  565. this.setData({
  566. courseDetailChosed: courseDetail[courseChosedIndex][index],
  567. showCourseDetail: false,
  568. showCourse: false,
  569. courseDetailIndex: e.currentTarget.dataset.index,
  570. })
  571. searchLists[0] = this.data.courseDetailChosed
  572. // console.log(this.data.courseDetailChosed);
  573. // console.log(this.data.courseDetailIndex);
  574. },
  575. // 需求课程取消图标的功能
  576. cancelChooseCourse() {
  577. searchLists[0] = ''
  578. this.setData({
  579. courseDetailChosed: '',
  580. showCourse: false,
  581. showCourseDetail: false
  582. })
  583. },
  584. // 辅导方式
  585. // 打开辅导方式筛选区,关闭其他选项筛选区
  586. chooseTeachPosition() {
  587. let showTeachPosition = this.data.showTeachPosition
  588. this.setData({
  589. showCourse: false,
  590. showCourseDetail: false,
  591. showTeachPosition: !showTeachPosition,
  592. showSexList: false,
  593. showTeachType: false,
  594. showTeachEdu: false,
  595. showTeachSex: false,
  596. showTeachImg: false
  597. })
  598. },
  599. // 选择辅导方式
  600. toChosedTeachPosition(e) {
  601. // console.log(e);
  602. let index = e.currentTarget.dataset.index
  603. let teachPositionChosed = this.data.teachPositionChosed
  604. let teachPositions = this.data.teachPositions
  605. for (let i = 0; i < teachPositions.length; i++) {
  606. if (i == index) {
  607. teachPositionChosed = teachPositions[i]
  608. }
  609. }
  610. this.setData({
  611. teachPositionChosed,
  612. showTeachPosition: false
  613. })
  614. searchLists[1] = this.data.teachPositionChosed
  615. },
  616. // 辅导方式取消图标的功能
  617. cancelChooseTeachPosition() {
  618. searchLists[1] = ''
  619. this.setData({
  620. teachPositionChosed: '',
  621. showTeachPosition: false
  622. })
  623. },
  624. // 选择学生性别筛选项
  625. // 打开学生性别选项区,关闭其他选项区
  626. chooseStuSex() {
  627. // console.log(searchLists);
  628. let showSexList = this.data.showSexList
  629. this.setData({
  630. showCourse: false,
  631. showCourseDetail: false,
  632. showTeachPosition: false,
  633. showSexList: !showSexList,
  634. showTeachType: false,
  635. showTeachEdu: false,
  636. showTeachSex: false,
  637. showTeachImg: false
  638. })
  639. },
  640. // 选择学生性别
  641. toChosedStuSex(e) {
  642. let index = e.currentTarget.dataset.index
  643. let stuSexChosed = this.data.stuSexChosed
  644. let sexList = this.data.sexList
  645. for (let i = 0; i < sexList.length; i++) {
  646. if (i == index) {
  647. stuSexChosed = sexList[i]
  648. }
  649. }
  650. this.setData({
  651. stuSexChosed,
  652. showSexList: false
  653. })
  654. searchLists[2] = this.data.stuSexChosed
  655. },
  656. // 学生性别取消图标的功能
  657. cancleChooseStuSex() {
  658. searchLists[2] = ''
  659. this.setData({
  660. stuSexChosed: '',
  661. showSexList: false
  662. })
  663. },
  664. // 教员类型筛选项
  665. // 打开老师身份选项区,关闭其他选项区
  666. chooseTeachType() {
  667. let showTeachType = this.data.showTeachType
  668. this.setData({
  669. showCourse: false,
  670. showCourseDetail: false,
  671. showTeachPosition: false,
  672. showSexList: false,
  673. showTeachType: !showTeachType,
  674. showTeachEdu: false,
  675. showTeachSex: false,
  676. showTeachImg: false
  677. })
  678. },
  679. // 选择教员类型
  680. toChosedTeachType(e) {
  681. // console.log(e);
  682. let index = e.currentTarget.dataset.index
  683. let teachTypeChosed = this.data.teachTypeChosed
  684. let teachType = this.data.teachType
  685. for (let i = 0; i < teachType.length; i++) {
  686. if (i == index) {
  687. teachTypeChosed = teachType[i]
  688. }
  689. }
  690. this.setData({
  691. teachTypeChosed,
  692. showTeachType: false
  693. })
  694. searchLists[3] = this.data.teachTypeChosed
  695. },
  696. // 教员类型取消图标的功能
  697. cancelChooseTeachType() {
  698. searchLists[3] = ''
  699. this.setData({
  700. teachTypeChosed: '',
  701. showTeachType: false
  702. })
  703. },
  704. // 老师学历筛选项
  705. // 打开老师学历选项区,关闭其他选项区
  706. chooseTeachEdu() {
  707. let showTeachEdu = this.data.showTeachEdu
  708. this.setData({
  709. showCourse: false,
  710. showCourseDetail: false,
  711. showTeachPosition: false,
  712. showSexList: false,
  713. showTeachType: false,
  714. showTeachEdu: !showTeachEdu,
  715. showTeachSex: false,
  716. showTeachImg: false
  717. })
  718. },
  719. // 选择老师学历
  720. toChosedTeachEdu(e) {
  721. let index = e.currentTarget.dataset.index
  722. let teachEduChosed = this.data.teachEduChosed
  723. let educationList = this.data.educationList
  724. for (let i = 0; i < educationList.length; i++) {
  725. if (i == index) {
  726. teachEduChosed = educationList[i]
  727. }
  728. }
  729. this.setData({
  730. teachEduChosed,
  731. showTeachEdu: false
  732. })
  733. searchLists[4] = this.data.teachEduChosed
  734. },
  735. // 教员学历取消图标的功能
  736. cancelChooseTeachEdu() {
  737. searchLists[4] = ''
  738. this.setData({
  739. teachEduChosed: '',
  740. showTeachEdu: false
  741. })
  742. },
  743. // 选择老师性别筛选项
  744. // 打开老师性别选项区,关闭其他选项区
  745. chooseTeachSex() {
  746. let showTeachSex = this.data.showTeachSex
  747. this.setData({
  748. showCourse: false,
  749. showCourseDetail: false,
  750. showTeachPosition: false,
  751. showSexList: false,
  752. showTeachType: false,
  753. showTeachEdu: false,
  754. showTeachSex: !showTeachSex,
  755. showTeachImg: false
  756. })
  757. },
  758. // 选择老师性别
  759. toChosedTeachSex(e) {
  760. let index = e.currentTarget.dataset.index
  761. let teachSexChosed = this.data.teachSexChosed
  762. let sexList = this.data.sexList
  763. for (let i = 0; i < sexList.length; i++) {
  764. if (i == index) {
  765. teachSexChosed = sexList[i]
  766. }
  767. }
  768. this.setData({
  769. teachSexChosed,
  770. showTeachSex: false
  771. })
  772. searchLists[5] = this.data.teachSexChosed
  773. },
  774. // 老师性别取消图标的功能
  775. cancelChooseTeachSex() {
  776. searchLists[5] = ''
  777. this.setData({
  778. teachSexChosed: '',
  779. showTeachSex: false
  780. })
  781. },
  782. // 老师照片筛选项
  783. // 打开老师照片选项区,关闭其他选项区
  784. chooseTeachImg() {
  785. let showTeachImg = this.data.showTeachImg
  786. this.setData({
  787. showCourse: false,
  788. showCourseDetail: false,
  789. showTeachPosition: false,
  790. showSexList: false,
  791. showTeachType: false,
  792. showTeachEdu: false,
  793. showTeachSex: false,
  794. showTeachImg: !showTeachImg
  795. })
  796. },
  797. // 选择老师照片筛选条件
  798. toChosedTeachImg(e) {
  799. let index = e.currentTarget.dataset.index
  800. let teachImgChosed = this.data.teachImgChosed
  801. let teachImgOptions = this.data.teachImgOptions
  802. for (let i = 0; i < teachImgOptions.length; i++) {
  803. if (i == index) {
  804. teachImgChosed = teachImgOptions[i]
  805. }
  806. }
  807. this.setData({
  808. teachImgChosed,
  809. showTeachImg: false
  810. })
  811. searchLists[6] = this.data.teachImgChosed
  812. },
  813. // 老师照片取消图标的功能
  814. cancelChooseTeachImg() {
  815. searchLists[6] = ''
  816. this.setData({
  817. teachImgChosed: '',
  818. showTeachImg: false
  819. })
  820. },
  821. // 搜索按钮功能
  822. onSearch() {
  823. // 点击搜索按钮后,将筛选选项区全部置为false(关闭筛选选项区)
  824. this.setData({
  825. showCourse: false,
  826. showCourseDetail: false,
  827. showTeachPosition: false,
  828. showSexList: false,
  829. showTeachType: false,
  830. showTeachEdu: false,
  831. showTeachSex: false,
  832. showTeachImg: false
  833. })
  834. // console.log(searchLists[0]);
  835. // 判断搜索条件的数组是否为空(即是否选择了搜索条件)
  836. if (!searchLists[0] && !searchLists[1] && !searchLists[2] && !searchLists[3] && !searchLists[4] && !searchLists[5] && !searchLists[6]) {
  837. this.setData({
  838. isSearch: false
  839. })
  840. wx.showToast({
  841. title: '您还没选择搜索条件',
  842. icon: 'none'
  843. })
  844. return
  845. }
  846. // 当搜索条件数组不为空时,点击搜索按钮后,重新将筛选后的数组设置为空数组,并将是否点击搜索的条件置为true
  847. this.setData({
  848. list: [],
  849. isSearch: true
  850. })
  851. let stuLists = this.data.stuLists
  852. let list = this.data.list
  853. // 当第一个筛选值存在时,判断第一个筛选值是否符合要求
  854. if (searchLists[0]) {
  855. for (let i = 0; i < stuLists.length; i++) {
  856. for (let j = 0; j < stuLists[i].length; j++) {
  857. // console.log(stuLists[i][j].courseDetail);
  858. // 判断学生列表中是否有符合第一项筛选条件的信息
  859. if (searchLists[0] == stuLists[i][j].courseDetail) {
  860. // console.log('ok');
  861. // 将满足条件的学生信息添加进新数组
  862. list.push(stuLists[i])
  863. this.setData({
  864. list
  865. })
  866. }
  867. }
  868. }
  869. // console.log('list第一个:',list);
  870. if (!list.length) {
  871. return
  872. }
  873. }
  874. // console.log('list:',list);
  875. // 当第二个筛选值不为空时,判断第二个筛选值是否符合要求
  876. if (searchLists[1]) {
  877. let flag = false
  878. let newList = []
  879. let list = this.data.list
  880. // console.log(list);
  881. // 当第一个筛选值存在时
  882. if (searchLists[0]) {
  883. /*
  884. 当第一个筛选项存在时,设置局部变量flag初始值为false,用来判断第二个筛选项在筛选后
  885. 的数组中是否能找到符合条件的信息,如果能找到,则将flag的值改为true
  886. */
  887. // console.log(list);
  888. for (let i = 0; i < list.length; i++) {
  889. for (let j = 0; j < list[i].length; j++) {
  890. // 判断满足第一个筛选条件的新数组中是否有符合第二个筛选条件的信息
  891. if (searchLists[1] == list[i][j].teachPosition) {
  892. // 将满足条件的学生信息添加进新数组
  893. // console.log('ok');
  894. newList.push(list[i])
  895. this.setData({
  896. list: newList
  897. })
  898. // 如果有满足第二个筛选条件的信息,则将flag的值改为true
  899. flag = true
  900. }
  901. }
  902. }
  903. // console.log('flag:',flag);
  904. // 如果在满足第一个筛选条件的数组中,没有满足第二个筛选条件的信息,则将筛选后的数组置为空数组
  905. if (!flag) {
  906. this.setData({
  907. list: []
  908. })
  909. return
  910. }
  911. // console.log(this.data.list);
  912. // console.log(list);
  913. }
  914. // 当其他筛选值都为空时,则在学员数组中查找是否有符合条件的信息
  915. else if (!searchLists[0]) {
  916. for (let i = 0; i < stuLists.length; i++) {
  917. for (let j = 0; j < stuLists[i].length; j++) {
  918. // 判断学生数组中是否有符合第二个筛选条件的信息
  919. if (searchLists[1] == stuLists[i][j].teachPosition) {
  920. // 将满足条件的学生信息添加进新数组
  921. list.push(stuLists[i])
  922. this.setData({
  923. list
  924. })
  925. }
  926. }
  927. }
  928. // console.log(this.data.list);
  929. // console.log(list);
  930. if (!list.length) {
  931. return
  932. }
  933. }
  934. }
  935. // 当第三个筛选项不为空时,判断第三个筛选值是否符合要求
  936. if (searchLists[2]) {
  937. // 当第三个筛选项不为空时,判断第一个或者第二个筛选条件是否存在
  938. let flag = false
  939. let newList = []
  940. let list = this.data.list
  941. // 当第一个和第二个筛选值同时存在时,在筛选后的数组里查找是否有符合第三个筛选条件的信息
  942. if (searchLists[0] && searchLists[1]) {
  943. for (let i = 0; i < list.length; i++) {
  944. for (let j = 0; j < list[i].length; j++) {
  945. if (searchLists[2] == list[i][j].stuSex) {
  946. newList.push(list[i])
  947. this.setData({
  948. list: newList
  949. })
  950. flag = true
  951. }
  952. }
  953. }
  954. if (!flag) {
  955. this.setData({
  956. list: []
  957. })
  958. return
  959. }
  960. }
  961. // 当第一个筛选值存在,第二个筛选值不存在时
  962. else if (searchLists[0] && !searchLists[1]) {
  963. let list = this.data.list
  964. for (let i = 0; i < list.length; i++) {
  965. for (let j = 0; j < list[i].length; j++) {
  966. if (searchLists[2] == list[i][j].stuSex) {
  967. newList.push(list[i])
  968. this.setData({
  969. list: newList
  970. })
  971. flag = true
  972. }
  973. }
  974. }
  975. if (!flag) {
  976. this.setData({
  977. list: []
  978. })
  979. return
  980. }
  981. }
  982. // 当第一个筛选值不存在,第二个筛选值存在时
  983. else if (!searchLists[0] && searchLists[1]) {
  984. let list = this.data.list
  985. for (let i = 0; i < list.length; i++) {
  986. for (let j = 0; j < list[i].length; j++) {
  987. if (searchLists[2] == list[i][j].stuSex) {
  988. newList.push(list[i])
  989. this.setData({
  990. list: newList
  991. })
  992. flag = true
  993. }
  994. }
  995. }
  996. if (!flag) {
  997. this.setData({
  998. list: []
  999. })
  1000. return
  1001. }
  1002. }
  1003. // 当第一个、第二个筛选值都为空时,则在学员数组中查找是否有符合条件的信息
  1004. else if (!searchLists[0] && !searchLists[1]) {
  1005. let list = this.data.list
  1006. for (let i = 0; i < stuLists.length; i++) {
  1007. for (let j = 0; j < stuLists[i].length; j++) {
  1008. // 判断学生数组中是否有符合第二个筛选条件的信息
  1009. if (searchLists[2] == stuLists[i][j].stuSex) {
  1010. // 将满足条件的学生信息添加进新数组
  1011. list.push(stuLists[i])
  1012. this.setData({
  1013. list
  1014. })
  1015. }
  1016. }
  1017. }
  1018. if (!list.length) {
  1019. return
  1020. }
  1021. }
  1022. }
  1023. // 当第四个筛选项不为空时,判断第四个筛选值是否符合要求
  1024. if (searchLists[3]) {
  1025. let flag = false
  1026. let newList = []
  1027. let list = this.data.list
  1028. // 当第一个、第二个、第三个筛选值同时存在时
  1029. if (searchLists[0] && searchLists[1] && searchLists[2]) {
  1030. for (let i = 0; i < list.length; i++) {
  1031. for (let j = 0; j < list[i].length; j++) {
  1032. if (searchLists[3] == list[i][j].teachId) {
  1033. newList.push(list[i])
  1034. this.setData({
  1035. list: newList
  1036. })
  1037. flag = true
  1038. }
  1039. }
  1040. }
  1041. if (!flag) {
  1042. this.setData({
  1043. list: []
  1044. })
  1045. return
  1046. }
  1047. }
  1048. // 当第一个、第二个筛选值存在,第三个筛选值不存在时
  1049. else if (searchLists[0] && searchLists[1] && !searchLists[2]) {
  1050. let list = this.data.list
  1051. for (let i = 0; i < list.length; i++) {
  1052. for (let j = 0; j < list[i].length; j++) {
  1053. if (searchLists[3] == list[i][j].teachId) {
  1054. newList.push(list[i])
  1055. this.setData({
  1056. list: newList
  1057. })
  1058. flag = true
  1059. }
  1060. }
  1061. }
  1062. if (!flag) {
  1063. this.setData({
  1064. list: []
  1065. })
  1066. return
  1067. }
  1068. }
  1069. // 当第一个、第三个筛选值存在,第二个筛选值不存在时
  1070. else if (searchLists[0] && !searchLists[1] && searchLists[2]) {
  1071. let list = this.data.list
  1072. for (let i = 0; i < list.length; i++) {
  1073. for (let j = 0; j < list[i].length; j++) {
  1074. if (searchLists[3] == list[i][j].teachId) {
  1075. newList.push(list[i])
  1076. this.setData({
  1077. list: newList
  1078. })
  1079. flag = true
  1080. }
  1081. }
  1082. }
  1083. if (!flag) {
  1084. this.setData({
  1085. list: []
  1086. })
  1087. return
  1088. }
  1089. }
  1090. // 当第二个、第三个筛选值存在,第一个筛选值不存在时
  1091. else if (!searchLists[0] && searchLists[1] && searchLists[2]) {
  1092. let list = this.data.list
  1093. for (let i = 0; i < list.length; i++) {
  1094. for (let j = 0; j < list[i].length; j++) {
  1095. if (searchLists[3] == list[i][j].teachId) {
  1096. newList.push(list[i])
  1097. this.setData({
  1098. list: newList
  1099. })
  1100. flag = true
  1101. }
  1102. }
  1103. }
  1104. if (!flag) {
  1105. this.setData({
  1106. list: []
  1107. })
  1108. return
  1109. }
  1110. }
  1111. // 当第一个筛选值存在,第二个、第三个筛选值不存在时
  1112. else if (searchLists[0] && !searchLists[1] && !searchLists[2]) {
  1113. let list = this.data.list
  1114. for (let i = 0; i < list.length; i++) {
  1115. for (let j = 0; j < list[i].length; j++) {
  1116. if (searchLists[3] == list[i][j].teachId) {
  1117. newList.push(list[i])
  1118. this.setData({
  1119. list: newList
  1120. })
  1121. flag = true
  1122. }
  1123. }
  1124. }
  1125. if (!flag) {
  1126. this.setData({
  1127. list: []
  1128. })
  1129. return
  1130. }
  1131. }
  1132. // 当第二个筛选值存在,第一个、第三个筛选值不存在时
  1133. else if (!searchLists[0] && searchLists[1] && !searchLists[2]) {
  1134. let list = this.data.list
  1135. for (let i = 0; i < list.length; i++) {
  1136. for (let j = 0; j < list[i].length; j++) {
  1137. if (searchLists[3] == list[i][j].teachId) {
  1138. newList.push(list[i])
  1139. this.setData({
  1140. list: newList
  1141. })
  1142. flag = true
  1143. }
  1144. }
  1145. }
  1146. if (!flag) {
  1147. this.setData({
  1148. list: []
  1149. })
  1150. return
  1151. }
  1152. }
  1153. // 当第三个筛选值存在,第一个、第二个筛选值不存在时
  1154. else if (!searchLists[0] && !searchLists[1] && searchLists[2]) {
  1155. let list = this.data.list
  1156. for (let i = 0; i < list.length; i++) {
  1157. for (let j = 0; j < list[i].length; j++) {
  1158. if (searchLists[3] == list[i][j].teachId) {
  1159. newList.push(list[i])
  1160. this.setData({
  1161. list: newList
  1162. })
  1163. flag = true
  1164. }
  1165. }
  1166. }
  1167. if (!flag) {
  1168. this.setData({
  1169. list: []
  1170. })
  1171. return
  1172. }
  1173. }
  1174. // 当第一个、第二个、第三个筛选值都为空时,则在学员数组中查找是否有符合条件的信息
  1175. else if (!searchLists[0] && !searchLists[1] && !searchLists[2]) {
  1176. let list = this.data.list
  1177. for (let i = 0; i < stuLists.length; i++) {
  1178. for (let j = 0; j < stuLists[i].length; j++) {
  1179. // 判断学生数组中是否有符合第二个筛选条件的信息
  1180. if (searchLists[3] == stuLists[i][j].teachId) {
  1181. // 将满足条件的学生信息添加进新数组
  1182. list.push(stuLists[i])
  1183. this.setData({
  1184. list
  1185. })
  1186. }
  1187. }
  1188. }
  1189. if (!list.length) {
  1190. return
  1191. }
  1192. }
  1193. }
  1194. // 当第五个筛选值不为空时,判断第五个筛选值是否符合要求
  1195. if (searchLists[4]) {
  1196. let flag = false
  1197. let newList = []
  1198. let list = this.data.list
  1199. // 当第一个、第二个、第三个、第四个筛选值同时存在时
  1200. if (searchLists[0] && searchLists[1] && searchLists[2] && searchLists[3]) {
  1201. for (let i = 0; i < list.length; i++) {
  1202. for (let j = 0; j < list[i].length; j++) {
  1203. if (searchLists[4] == list[i][j].teachEdu) {
  1204. newList.push(list[i])
  1205. this.setData({
  1206. list: newList
  1207. })
  1208. flag = true
  1209. }
  1210. }
  1211. }
  1212. if (!flag) {
  1213. this.setData({
  1214. list: []
  1215. })
  1216. return
  1217. }
  1218. }
  1219. // 当第一个、第二个、第三个筛选值存在,第四个筛选值不存在时
  1220. else if (searchLists[0] && searchLists[1] && searchLists[2] && !searchLists[3]) {
  1221. let list = this.data.list
  1222. for (let i = 0; i < list.length; i++) {
  1223. for (let j = 0; j < list[i].length; j++) {
  1224. if (searchLists[4] == list[i][j].teachEdu) {
  1225. newList.push(list[i])
  1226. this.setData({
  1227. list: newList
  1228. })
  1229. flag = true
  1230. }
  1231. }
  1232. }
  1233. if (!flag) {
  1234. this.setData({
  1235. list: []
  1236. })
  1237. return
  1238. }
  1239. }
  1240. // 当第一个、第二个、第四个筛选值存在,第三个筛选值不存在时
  1241. else if (searchLists[0] && searchLists[1] && !searchLists[2] && searchLists[3]) {
  1242. let list = this.data.list
  1243. for (let i = 0; i < list.length; i++) {
  1244. for (let j = 0; j < list[i].length; j++) {
  1245. if (searchLists[4] == list[i][j].teachEdu) {
  1246. newList.push(list[i])
  1247. this.setData({
  1248. list: newList
  1249. })
  1250. flag = true
  1251. }
  1252. }
  1253. }
  1254. if (!flag) {
  1255. this.setData({
  1256. list: []
  1257. })
  1258. return
  1259. }
  1260. }
  1261. // 当第一个、第三个、第四个筛选值存在,第二个筛选值不存在时
  1262. else if (searchLists[0] && !searchLists[1] && searchLists[2] && searchLists[3]) {
  1263. let list = this.data.list
  1264. for (let i = 0; i < list.length; i++) {
  1265. for (let j = 0; j < list[i].length; j++) {
  1266. if (searchLists[4] == list[i][j].teachEdu) {
  1267. newList.push(list[i])
  1268. this.setData({
  1269. list: newList
  1270. })
  1271. flag = true
  1272. }
  1273. }
  1274. }
  1275. if (!flag) {
  1276. this.setData({
  1277. list: []
  1278. })
  1279. return
  1280. }
  1281. }
  1282. // 当第二个、第三个、第四个筛选值存在,第一个筛选值不存在时
  1283. else if (!searchLists[0] && searchLists[1] && searchLists[2] && searchLists[3]) {
  1284. let list = this.data.list
  1285. for (let i = 0; i < list.length; i++) {
  1286. for (let j = 0; j < list[i].length; j++) {
  1287. if (searchLists[4] == list[i][j].teachEdu) {
  1288. newList.push(list[i])
  1289. this.setData({
  1290. list: newList
  1291. })
  1292. flag = true
  1293. }
  1294. }
  1295. }
  1296. if (!flag) {
  1297. this.setData({
  1298. list: []
  1299. })
  1300. return
  1301. }
  1302. }
  1303. // 当第一个、第二个筛选值存在,第三个、第四个筛选值不存在时
  1304. else if (searchLists[0] && searchLists[1] && !searchLists[2] && !searchLists[3]) {
  1305. let list = this.data.list
  1306. for (let i = 0; i < list.length; i++) {
  1307. for (let j = 0; j < list[i].length; j++) {
  1308. if (searchLists[4] == list[i][j].teachEdu) {
  1309. newList.push(list[i])
  1310. this.setData({
  1311. list: newList
  1312. })
  1313. flag = true
  1314. }
  1315. }
  1316. }
  1317. if (!flag) {
  1318. this.setData({
  1319. list: []
  1320. })
  1321. return
  1322. }
  1323. }
  1324. // 当第一个、第三个筛选值存在,第二个、第四个筛选值不存在时
  1325. else if (searchLists[0] && !searchLists[1] && searchLists[2] && !searchLists[3]) {
  1326. let list = this.data.list
  1327. for (let i = 0; i < list.length; i++) {
  1328. for (let j = 0; j < list[i].length; j++) {
  1329. if (searchLists[4] == list[i][j].teachEdu) {
  1330. newList.push(list[i])
  1331. this.setData({
  1332. list: newList
  1333. })
  1334. flag = true
  1335. }
  1336. }
  1337. }
  1338. if (!flag) {
  1339. this.setData({
  1340. list: []
  1341. })
  1342. return
  1343. }
  1344. }
  1345. // 当第一个、第四个筛选值存在,第二个、第三个筛选值不存在时
  1346. else if (searchLists[0] && !searchLists[1] && !searchLists[2] && searchLists[3]) {
  1347. let list = this.data.list
  1348. for (let i = 0; i < list.length; i++) {
  1349. for (let j = 0; j < list[i].length; j++) {
  1350. if (searchLists[4] == list[i][j].teachEdu) {
  1351. newList.push(list[i])
  1352. this.setData({
  1353. list: newList
  1354. })
  1355. flag = true
  1356. }
  1357. }
  1358. }
  1359. if (!flag) {
  1360. this.setData({
  1361. list: []
  1362. })
  1363. return
  1364. }
  1365. }
  1366. // 当第二个、第三个筛选值存在,第一个、第四个筛选值不存在时
  1367. else if (!searchLists[0] && searchLists[1] && searchLists[2] && !searchLists[3]) {
  1368. let list = this.data.list
  1369. for (let i = 0; i < list.length; i++) {
  1370. for (let j = 0; j < list[i].length; j++) {
  1371. if (searchLists[4] == list[i][j].teachEdu) {
  1372. newList.push(list[i])
  1373. this.setData({
  1374. list: newList
  1375. })
  1376. flag = true
  1377. }
  1378. }
  1379. }
  1380. if (!flag) {
  1381. this.setData({
  1382. list: []
  1383. })
  1384. return
  1385. }
  1386. }
  1387. // 当第二个、第四个筛选值存在,第一个、第三个筛选值不存在时
  1388. else if (!searchLists[0] && searchLists[1] && !searchLists[2] && searchLists[3]) {
  1389. let list = this.data.list
  1390. for (let i = 0; i < list.length; i++) {
  1391. for (let j = 0; j < list[i].length; j++) {
  1392. if (searchLists[4] == list[i][j].teachEdu) {
  1393. newList.push(list[i])
  1394. this.setData({
  1395. list: newList
  1396. })
  1397. flag = true
  1398. }
  1399. }
  1400. }
  1401. if (!flag) {
  1402. this.setData({
  1403. list: []
  1404. })
  1405. return
  1406. }
  1407. }
  1408. // 当第三个、第四个筛选值存在,第一个、第二个筛选值不存在时
  1409. else if (!searchLists[0] && !searchLists[1] && searchLists[2] && searchLists[3]) {
  1410. let list = this.data.list
  1411. for (let i = 0; i < list.length; i++) {
  1412. for (let j = 0; j < list[i].length; j++) {
  1413. if (searchLists[4] == list[i][j].teachEdu) {
  1414. newList.push(list[i])
  1415. this.setData({
  1416. list: newList
  1417. })
  1418. flag = true
  1419. }
  1420. }
  1421. }
  1422. if (!flag) {
  1423. this.setData({
  1424. list: []
  1425. })
  1426. return
  1427. }
  1428. }
  1429. // 当第一个筛选值存在,第二个、第三个、第四个筛选值不存在时
  1430. else if (searchLists[0] && !searchLists[1] && !searchLists[2] && !searchLists[3]) {
  1431. let list = this.data.list
  1432. for (let i = 0; i < list.length; i++) {
  1433. for (let j = 0; j < list[i].length; j++) {
  1434. if (searchLists[4] == list[i][j].teachEdu) {
  1435. newList.push(list[i])
  1436. this.setData({
  1437. list: newList
  1438. })
  1439. flag = true
  1440. }
  1441. }
  1442. }
  1443. if (!flag) {
  1444. this.setData({
  1445. list: []
  1446. })
  1447. return
  1448. }
  1449. }
  1450. // 当第二个筛选值存在,第一个、第三个、第四个筛选值不存在时
  1451. else if (!searchLists[0] && searchLists[1] && !searchLists[2] && !searchLists[3]) {
  1452. let list = this.data.list
  1453. for (let i = 0; i < list.length; i++) {
  1454. for (let j = 0; j < list[i].length; j++) {
  1455. if (searchLists[4] == list[i][j].teachEdu) {
  1456. newList.push(list[i])
  1457. this.setData({
  1458. list: newList
  1459. })
  1460. flag = true
  1461. }
  1462. }
  1463. }
  1464. if (!flag) {
  1465. this.setData({
  1466. list: []
  1467. })
  1468. return
  1469. }
  1470. }
  1471. // 当第三个筛选值存在,第一个、第二个、第四个筛选值不存在时
  1472. else if (!searchLists[0] && !searchLists[1] && searchLists[2] && !searchLists[3]) {
  1473. let list = this.data.list
  1474. for (let i = 0; i < list.length; i++) {
  1475. for (let j = 0; j < list[i].length; j++) {
  1476. if (searchLists[4] == list[i][j].teachEdu) {
  1477. newList.push(list[i])
  1478. this.setData({
  1479. list: newList
  1480. })
  1481. flag = true
  1482. }
  1483. }
  1484. }
  1485. if (!flag) {
  1486. this.setData({
  1487. list: []
  1488. })
  1489. return
  1490. }
  1491. }
  1492. // 当第四个筛选值存在,第一个、第二个、第三个筛选值不存在时
  1493. else if (!searchLists[0] && !searchLists[1] && !searchLists[2] && searchLists[3]) {
  1494. let list = this.data.list
  1495. for (let i = 0; i < list.length; i++) {
  1496. for (let j = 0; j < list[i].length; j++) {
  1497. if (searchLists[4] == list[i][j].teachEdu) {
  1498. newList.push(list[i])
  1499. this.setData({
  1500. list: newList
  1501. })
  1502. flag = true
  1503. }
  1504. }
  1505. }
  1506. if (!flag) {
  1507. this.setData({
  1508. list: []
  1509. })
  1510. return
  1511. }
  1512. }
  1513. // 当第一个、第二个、第三个、第四个筛选值都为空时,则在学员数组中查找是否有符合条件的信息
  1514. else if (!searchLists[0] && !searchLists[1] && !searchLists[2] && !searchLists[3]) {
  1515. let list = this.data.list
  1516. for (let i = 0; i < stuLists.length; i++) {
  1517. for (let j = 0; j < stuLists[i].length; j++) {
  1518. // 判断学生数组中是否有符合第二个筛选条件的信息
  1519. if (searchLists[4] == stuLists[i][j].teachEdu) {
  1520. // 将满足条件的学生信息添加进新数组
  1521. list.push(stuLists[i])
  1522. this.setData({
  1523. list
  1524. })
  1525. }
  1526. }
  1527. }
  1528. if (!list.length) {
  1529. return
  1530. }
  1531. }
  1532. }
  1533. // 当第六个筛选值不为空时,判断第六个筛选值是否符合要求
  1534. if (searchLists[5]) {
  1535. let flag = false
  1536. let newList = []
  1537. let list = this.data.list
  1538. // 当第一个、第二个、第三个、第四个、第五个筛选值同时存在时
  1539. if (searchLists[0] && searchLists[1] && searchLists[2] && searchLists[3] && searchLists[4]) {
  1540. for (let i = 0; i < list.length; i++) {
  1541. for (let j = 0; j < list[i].length; j++) {
  1542. if (searchLists[5] == list[i][j].teachSex) {
  1543. newList.push(list[i])
  1544. this.setData({
  1545. list: newList
  1546. })
  1547. flag = true
  1548. }
  1549. }
  1550. }
  1551. if (!flag) {
  1552. this.setData({
  1553. list: []
  1554. })
  1555. return
  1556. }
  1557. }
  1558. // 当第一个、第二个、第三个、第四个筛选值存在,第五个筛选值不存在时
  1559. else if (searchLists[0] && searchLists[1] && searchLists[2] && searchLists[3] && !searchLists[4]) {
  1560. let list = this.data.list
  1561. for (let i = 0; i < list.length; i++) {
  1562. for (let j = 0; j < list[i].length; j++) {
  1563. if (searchLists[5] == list[i][j].teachSex) {
  1564. newList.push(list[i])
  1565. this.setData({
  1566. list: newList
  1567. })
  1568. flag = true
  1569. }
  1570. }
  1571. }
  1572. if (!flag) {
  1573. this.setData({
  1574. list: []
  1575. })
  1576. return
  1577. }
  1578. }
  1579. // 当第一个、第二个、第三个、第五个筛选值存在,第四个筛选值不存在时
  1580. else if (searchLists[0] && searchLists[1] && searchLists[2] && !searchLists[3] && searchLists[4]) {
  1581. let list = this.data.list
  1582. for (let i = 0; i < list.length; i++) {
  1583. for (let j = 0; j < list[i].length; j++) {
  1584. if (searchLists[5] == list[i][j].teachSex) {
  1585. newList.push(list[i])
  1586. this.setData({
  1587. list: newList
  1588. })
  1589. flag = true
  1590. }
  1591. }
  1592. }
  1593. if (!flag) {
  1594. this.setData({
  1595. list: []
  1596. })
  1597. return
  1598. }
  1599. }
  1600. // 当第一个、第二个、第四个、第五个筛选值存在,第三个筛选值不存在时
  1601. else if (searchLists[0] && searchLists[1] && !searchLists[2] && searchLists[3] && searchLists[4]) {
  1602. let list = this.data.list
  1603. for (let i = 0; i < list.length; i++) {
  1604. for (let j = 0; j < list[i].length; j++) {
  1605. if (searchLists[5] == list[i][j].teachSex) {
  1606. newList.push(list[i])
  1607. this.setData({
  1608. list: newList
  1609. })
  1610. flag = true
  1611. }
  1612. }
  1613. }
  1614. if (!flag) {
  1615. this.setData({
  1616. list: []
  1617. })
  1618. return
  1619. }
  1620. }
  1621. // 当第一个、第三个、第四个、第五个筛选值存在,第二个筛选值不存在时
  1622. else if (searchLists[0] && !searchLists[1] && searchLists[2] && searchLists[3] && searchLists[4]) {
  1623. let list = this.data.list
  1624. for (let i = 0; i < list.length; i++) {
  1625. for (let j = 0; j < list[i].length; j++) {
  1626. if (searchLists[5] == list[i][j].teachSex) {
  1627. newList.push(list[i])
  1628. this.setData({
  1629. list: newList
  1630. })
  1631. flag = true
  1632. }
  1633. }
  1634. }
  1635. if (!flag) {
  1636. this.setData({
  1637. list: []
  1638. })
  1639. return
  1640. }
  1641. }
  1642. // 当第二个、第三个、第四个、第五个筛选值存在,第一个筛选值不存在时
  1643. else if (!searchLists[0] && searchLists[1] && searchLists[2] && searchLists[3] && searchLists[4]) {
  1644. let list = this.data.list
  1645. for (let i = 0; i < list.length; i++) {
  1646. for (let j = 0; j < list[i].length; j++) {
  1647. if (searchLists[5] == list[i][j].teachSex) {
  1648. newList.push(list[i])
  1649. this.setData({
  1650. list: newList
  1651. })
  1652. flag = true
  1653. }
  1654. }
  1655. }
  1656. if (!flag) {
  1657. this.setData({
  1658. list: []
  1659. })
  1660. return
  1661. }
  1662. }
  1663. // 当第一个、第二个、第三个筛选值存在,第四个、第五个筛选值不存在时
  1664. else if (searchLists[0] && searchLists[1] && searchLists[2] && !searchLists[3] && !searchLists[4]) {
  1665. let list = this.data.list
  1666. for (let i = 0; i < list.length; i++) {
  1667. for (let j = 0; j < list[i].length; j++) {
  1668. if (searchLists[5] == list[i][j].teachSex) {
  1669. newList.push(list[i])
  1670. this.setData({
  1671. list: newList
  1672. })
  1673. flag = true
  1674. }
  1675. }
  1676. }
  1677. if (!flag) {
  1678. this.setData({
  1679. list: []
  1680. })
  1681. return
  1682. }
  1683. }
  1684. // 当第一个、第二个、第四个筛选值存在,第三个、第五个筛选值不存在时
  1685. else if (searchLists[0] && searchLists[1] && !searchLists[2] && searchLists[3] && !searchLists[4]) {
  1686. let list = this.data.list
  1687. for (let i = 0; i < list.length; i++) {
  1688. for (let j = 0; j < list[i].length; j++) {
  1689. if (searchLists[5] == list[i][j].teachSex) {
  1690. newList.push(list[i])
  1691. this.setData({
  1692. list: newList
  1693. })
  1694. flag = true
  1695. }
  1696. }
  1697. }
  1698. if (!flag) {
  1699. this.setData({
  1700. list: []
  1701. })
  1702. return
  1703. }
  1704. }
  1705. // 当第一个、第三个、第四个筛选值存在,第二个、第五个筛选值不存在时
  1706. else if (searchLists[0] && !searchLists[1] && searchLists[2] && searchLists[3] && !searchLists[4]) {
  1707. let list = this.data.list
  1708. for (let i = 0; i < list.length; i++) {
  1709. for (let j = 0; j < list[i].length; j++) {
  1710. if (searchLists[5] == list[i][j].teachSex) {
  1711. newList.push(list[i])
  1712. this.setData({
  1713. list: newList
  1714. })
  1715. flag = true
  1716. }
  1717. }
  1718. }
  1719. if (!flag) {
  1720. this.setData({
  1721. list: []
  1722. })
  1723. return
  1724. }
  1725. }
  1726. // 当第二个、第三个、第四个筛选值存在,第一个、第五个筛选值不存在时
  1727. else if (!searchLists[0] && searchLists[1] && searchLists[2] && searchLists[3] && !searchLists[4]) {
  1728. let list = this.data.list
  1729. for (let i = 0; i < list.length; i++) {
  1730. for (let j = 0; j < list[i].length; j++) {
  1731. if (searchLists[5] == list[i][j].teachSex) {
  1732. newList.push(list[i])
  1733. this.setData({
  1734. list: newList
  1735. })
  1736. flag = true
  1737. }
  1738. }
  1739. }
  1740. if (!flag) {
  1741. this.setData({
  1742. list: []
  1743. })
  1744. return
  1745. }
  1746. }
  1747. // 当第一个、第二个、第五个筛选值存在,第三个、第四个筛选值不存在时
  1748. else if (searchLists[0] && searchLists[1] && !searchLists[2] && !searchLists[3] && searchLists[4]) {
  1749. let list = this.data.list
  1750. for (let i = 0; i < list.length; i++) {
  1751. for (let j = 0; j < list[i].length; j++) {
  1752. if (searchLists[5] == list[i][j].teachSex) {
  1753. newList.push(list[i])
  1754. this.setData({
  1755. list: newList
  1756. })
  1757. flag = true
  1758. }
  1759. }
  1760. }
  1761. if (!flag) {
  1762. this.setData({
  1763. list: []
  1764. })
  1765. return
  1766. }
  1767. }
  1768. // 当第一个、第三个、第五个筛选值存在,第二个、第四个筛选值不存在时
  1769. else if (searchLists[0] && !searchLists[1] && searchLists[2] && !searchLists[3] && searchLists[4]) {
  1770. let list = this.data.list
  1771. for (let i = 0; i < list.length; i++) {
  1772. for (let j = 0; j < list[i].length; j++) {
  1773. if (searchLists[5] == list[i][j].teachSex) {
  1774. newList.push(list[i])
  1775. this.setData({
  1776. list: newList
  1777. })
  1778. flag = true
  1779. }
  1780. }
  1781. }
  1782. if (!flag) {
  1783. this.setData({
  1784. list: []
  1785. })
  1786. return
  1787. }
  1788. }
  1789. // 当第二个、第三个、第五个筛选值存在,第一个、第四个筛选值不存在时
  1790. else if (!searchLists[0] && searchLists[1] && searchLists[2] && !searchLists[3] && searchLists[4]) {
  1791. let list = this.data.list
  1792. for (let i = 0; i < list.length; i++) {
  1793. for (let j = 0; j < list[i].length; j++) {
  1794. if (searchLists[5] == list[i][j].teachSex) {
  1795. newList.push(list[i])
  1796. this.setData({
  1797. list: newList
  1798. })
  1799. flag = true
  1800. }
  1801. }
  1802. }
  1803. if (!flag) {
  1804. this.setData({
  1805. list: []
  1806. })
  1807. return
  1808. }
  1809. }
  1810. // 当第一个、第四个、第五个筛选值存在,第二个、第三个筛选值不存在时
  1811. else if (searchLists[0] && !searchLists[1] && !searchLists[2] && searchLists[3] && searchLists[4]) {
  1812. let list = this.data.list
  1813. for (let i = 0; i < list.length; i++) {
  1814. for (let j = 0; j < list[i].length; j++) {
  1815. if (searchLists[5] == list[i][j].teachSex) {
  1816. newList.push(list[i])
  1817. this.setData({
  1818. list: newList
  1819. })
  1820. flag = true
  1821. }
  1822. }
  1823. }
  1824. if (!flag) {
  1825. this.setData({
  1826. list: []
  1827. })
  1828. return
  1829. }
  1830. }
  1831. // 当第二个、第四个、第五个筛选值存在,第一个、第三个筛选值不存在时
  1832. else if (!searchLists[0] && searchLists[1] && !searchLists[2] && searchLists[3] && searchLists[4]) {
  1833. let list = this.data.list
  1834. for (let i = 0; i < list.length; i++) {
  1835. for (let j = 0; j < list[i].length; j++) {
  1836. if (searchLists[5] == list[i][j].teachSex) {
  1837. newList.push(list[i])
  1838. this.setData({
  1839. list: newList
  1840. })
  1841. flag = true
  1842. }
  1843. }
  1844. }
  1845. if (!flag) {
  1846. this.setData({
  1847. list: []
  1848. })
  1849. return
  1850. }
  1851. }
  1852. // 当第三个、第四个、第五个筛选值存在,第一个、第二个筛选值不存在时
  1853. else if (!searchLists[0] && !searchLists[1] && searchLists[2] && searchLists[3] && searchLists[4]) {
  1854. let list = this.data.list
  1855. for (let i = 0; i < list.length; i++) {
  1856. for (let j = 0; j < list[i].length; j++) {
  1857. if (searchLists[5] == list[i][j].teachSex) {
  1858. newList.push(list[i])
  1859. this.setData({
  1860. list: newList
  1861. })
  1862. flag = true
  1863. }
  1864. }
  1865. }
  1866. if (!flag) {
  1867. this.setData({
  1868. list: []
  1869. })
  1870. return
  1871. }
  1872. }
  1873. // 当第一个、第二个筛选值存在,第三个、第四个、第五个筛选值不存在时
  1874. else if (searchLists[0] && searchLists[1] && !searchLists[2] && !searchLists[3] && !searchLists[4]) {
  1875. let list = this.data.list
  1876. for (let i = 0; i < list.length; i++) {
  1877. for (let j = 0; j < list[i].length; j++) {
  1878. if (searchLists[5] == list[i][j].teachSex) {
  1879. newList.push(list[i])
  1880. this.setData({
  1881. list: newList
  1882. })
  1883. flag = true
  1884. }
  1885. }
  1886. }
  1887. if (!flag) {
  1888. this.setData({
  1889. list: []
  1890. })
  1891. return
  1892. }
  1893. }
  1894. // 当第一个、第三个筛选值存在,第二个、第四个、第五个筛选值不存在时
  1895. else if (searchLists[0] && !searchLists[1] && searchLists[2] && !searchLists[3] && !searchLists[4]) {
  1896. let list = this.data.list
  1897. for (let i = 0; i < list.length; i++) {
  1898. for (let j = 0; j < list[i].length; j++) {
  1899. if (searchLists[5] == list[i][j].teachSex) {
  1900. newList.push(list[i])
  1901. this.setData({
  1902. list: newList
  1903. })
  1904. flag = true
  1905. }
  1906. }
  1907. }
  1908. if (!flag) {
  1909. this.setData({
  1910. list: []
  1911. })
  1912. return
  1913. }
  1914. }
  1915. // 当第二个、第三个筛选值存在,第一个、第四个、第五个筛选值不存在时
  1916. else if (!searchLists[0] && searchLists[1] && searchLists[2] && !searchLists[3] && !searchLists[4]) {
  1917. let list = this.data.list
  1918. for (let i = 0; i < list.length; i++) {
  1919. for (let j = 0; j < list[i].length; j++) {
  1920. if (searchLists[5] == list[i][j].teachSex) {
  1921. newList.push(list[i])
  1922. this.setData({
  1923. list: newList
  1924. })
  1925. flag = true
  1926. }
  1927. }
  1928. }
  1929. if (!flag) {
  1930. this.setData({
  1931. list: []
  1932. })
  1933. return
  1934. }
  1935. }
  1936. // 当第一个、第四个筛选值存在,第二个、第三个、第五个筛选值不存在时
  1937. else if (searchLists[0] && !searchLists[1] && !searchLists[2] && searchLists[3] && !searchLists[4]) {
  1938. let list = this.data.list
  1939. for (let i = 0; i < list.length; i++) {
  1940. for (let j = 0; j < list[i].length; j++) {
  1941. if (searchLists[5] == list[i][j].teachSex) {
  1942. newList.push(list[i])
  1943. this.setData({
  1944. list: newList
  1945. })
  1946. flag = true
  1947. }
  1948. }
  1949. }
  1950. if (!flag) {
  1951. this.setData({
  1952. list: []
  1953. })
  1954. return
  1955. }
  1956. }
  1957. // 当第二个、第四个筛选值存在,第一个、第三个、第五个筛选值不存在时
  1958. else if (!searchLists[0] && searchLists[1] && !searchLists[2] && searchLists[3] && !searchLists[4]) {
  1959. let list = this.data.list
  1960. for (let i = 0; i < list.length; i++) {
  1961. for (let j = 0; j < list[i].length; j++) {
  1962. if (searchLists[5] == list[i][j].teachSex) {
  1963. newList.push(list[i])
  1964. this.setData({
  1965. list: newList
  1966. })
  1967. flag = true
  1968. }
  1969. }
  1970. }
  1971. if (!flag) {
  1972. this.setData({
  1973. list: []
  1974. })
  1975. return
  1976. }
  1977. }
  1978. // 当第三个、第四个筛选值存在,第一个、第二个、第五个筛选值不存在时
  1979. else if (!searchLists[0] && !searchLists[1] && searchLists[2] && searchLists[3] && !searchLists[4]) {
  1980. let list = this.data.list
  1981. for (let i = 0; i < list.length; i++) {
  1982. for (let j = 0; j < list[i].length; j++) {
  1983. if (searchLists[5] == list[i][j].teachSex) {
  1984. newList.push(list[i])
  1985. this.setData({
  1986. list: newList
  1987. })
  1988. flag = true
  1989. }
  1990. }
  1991. }
  1992. if (!flag) {
  1993. this.setData({
  1994. list: []
  1995. })
  1996. return
  1997. }
  1998. }
  1999. // 当第一个、第五个筛选值存在,第二个、第三个、第四个筛选值不存在时
  2000. else if (searchLists[0] && !searchLists[1] && !searchLists[2] && !searchLists[3] && searchLists[4]) {
  2001. let list = this.data.list
  2002. for (let i = 0; i < list.length; i++) {
  2003. for (let j = 0; j < list[i].length; j++) {
  2004. if (searchLists[5] == list[i][j].teachSex) {
  2005. newList.push(list[i])
  2006. this.setData({
  2007. list: newList
  2008. })
  2009. flag = true
  2010. }
  2011. }
  2012. }
  2013. if (!flag) {
  2014. this.setData({
  2015. list: []
  2016. })
  2017. return
  2018. }
  2019. }
  2020. // 当第二个、第五个筛选值存在,第一个、第三个、第四个筛选值不存在时
  2021. else if (!searchLists[0] && searchLists[1] && !searchLists[2] && !searchLists[3] && searchLists[4]) {
  2022. let list = this.data.list
  2023. for (let i = 0; i < list.length; i++) {
  2024. for (let j = 0; j < list[i].length; j++) {
  2025. if (searchLists[5] == list[i][j].teachSex) {
  2026. newList.push(list[i])
  2027. this.setData({
  2028. list: newList
  2029. })
  2030. flag = true
  2031. }
  2032. }
  2033. }
  2034. if (!flag) {
  2035. this.setData({
  2036. list: []
  2037. })
  2038. return
  2039. }
  2040. }
  2041. // 当第三个、第五个筛选值存在,第一个、第二个、第四个筛选值不存在时
  2042. else if (!searchLists[0] && !searchLists[1] && searchLists[2] && !searchLists[3] && searchLists[4]) {
  2043. let list = this.data.list
  2044. for (let i = 0; i < list.length; i++) {
  2045. for (let j = 0; j < list[i].length; j++) {
  2046. if (searchLists[5] == list[i][j].teachSex) {
  2047. newList.push(list[i])
  2048. this.setData({
  2049. list: newList
  2050. })
  2051. flag = true
  2052. }
  2053. }
  2054. }
  2055. if (!flag) {
  2056. this.setData({
  2057. list: []
  2058. })
  2059. return
  2060. }
  2061. }
  2062. // 当第四个、第五个筛选值存在,第一个、第二个、第三个筛选值不存在时
  2063. else if (!searchLists[0] && !searchLists[1] && !searchLists[2] && searchLists[3] && searchLists[4]) {
  2064. let list = this.data.list
  2065. for (let i = 0; i < list.length; i++) {
  2066. for (let j = 0; j < list[i].length; j++) {
  2067. if (searchLists[5] == list[i][j].teachSex) {
  2068. newList.push(list[i])
  2069. this.setData({
  2070. list: newList
  2071. })
  2072. flag = true
  2073. }
  2074. }
  2075. }
  2076. if (!flag) {
  2077. this.setData({
  2078. list: []
  2079. })
  2080. return
  2081. }
  2082. }
  2083. // 当第一个筛选值存在,第二个、第三个、第四个、第五个筛选值不存在时
  2084. else if (searchLists[0] && !searchLists[1] && !searchLists[2] && !searchLists[3] && !searchLists[4]) {
  2085. let list = this.data.list
  2086. for (let i = 0; i < list.length; i++) {
  2087. for (let j = 0; j < list[i].length; j++) {
  2088. if (searchLists[5] == list[i][j].teachSex) {
  2089. newList.push(list[i])
  2090. this.setData({
  2091. list: newList
  2092. })
  2093. flag = true
  2094. }
  2095. }
  2096. }
  2097. if (!flag) {
  2098. this.setData({
  2099. list: []
  2100. })
  2101. return
  2102. }
  2103. }
  2104. // 当第二个筛选值存在,第一个、第三个、第四个、第五个筛选值不存在时
  2105. else if (!searchLists[0] && searchLists[1] && !searchLists[2] && !searchLists[3] && !searchLists[4]) {
  2106. let list = this.data.list
  2107. for (let i = 0; i < list.length; i++) {
  2108. for (let j = 0; j < list[i].length; j++) {
  2109. if (searchLists[5] == list[i][j].teachSex) {
  2110. newList.push(list[i])
  2111. this.setData({
  2112. list: newList
  2113. })
  2114. flag = true
  2115. }
  2116. }
  2117. }
  2118. if (!flag) {
  2119. this.setData({
  2120. list: []
  2121. })
  2122. return
  2123. }
  2124. }
  2125. // 当第三个筛选值存在,第一个、第二个、第四个、第五个筛选值不存在时
  2126. else if (!searchLists[0] && !searchLists[1] && searchLists[2] && !searchLists[3] && !searchLists[4]) {
  2127. let list = this.data.list
  2128. for (let i = 0; i < list.length; i++) {
  2129. for (let j = 0; j < list[i].length; j++) {
  2130. if (searchLists[5] == list[i][j].teachSex) {
  2131. newList.push(list[i])
  2132. this.setData({
  2133. list: newList
  2134. })
  2135. flag = true
  2136. }
  2137. }
  2138. }
  2139. if (!flag) {
  2140. this.setData({
  2141. list: []
  2142. })
  2143. return
  2144. }
  2145. }
  2146. // 当第四个筛选值存在,第一个、第二个、第三个、第五个筛选值不存在时
  2147. else if (!searchLists[0] && !searchLists[1] && !searchLists[2] && searchLists[3] && !searchLists[4]) {
  2148. let list = this.data.list
  2149. for (let i = 0; i < list.length; i++) {
  2150. for (let j = 0; j < list[i].length; j++) {
  2151. if (searchLists[5] == list[i][j].teachSex) {
  2152. newList.push(list[i])
  2153. this.setData({
  2154. list: newList
  2155. })
  2156. flag = true
  2157. }
  2158. }
  2159. }
  2160. if (!flag) {
  2161. this.setData({
  2162. list: []
  2163. })
  2164. return
  2165. }
  2166. }
  2167. // 当第五个筛选值存在,第一个、第二个、第三个、第四个筛选值不存在时
  2168. else if (!searchLists[0] && !searchLists[1] && !searchLists[2] && !searchLists[3] && searchLists[4]) {
  2169. let list = this.data.list
  2170. for (let i = 0; i < list.length; i++) {
  2171. for (let j = 0; j < list[i].length; j++) {
  2172. if (searchLists[5] == list[i][j].teachSex) {
  2173. newList.push(list[i])
  2174. this.setData({
  2175. list: newList
  2176. })
  2177. flag = true
  2178. }
  2179. }
  2180. }
  2181. if (!flag) {
  2182. this.setData({
  2183. list: []
  2184. })
  2185. return
  2186. }
  2187. }
  2188. // 当前五个筛选值都不存在时
  2189. else if (!searchLists[0] && !searchLists[1] && !searchLists[2] && !searchLists[3] && !searchLists[4]) {
  2190. let list = this.data.list
  2191. for (let i = 0; i < stuLists.length; i++) {
  2192. for (let j = 0; j < stuLists[i].length; j++) {
  2193. // 判断学生数组中是否有符合第二个筛选条件的信息
  2194. if (searchLists[5] == stuLists[i][j].teachSex) {
  2195. // 将满足条件的学生信息添加进新数组
  2196. list.push(stuLists[i])
  2197. this.setData({
  2198. list
  2199. })
  2200. }
  2201. }
  2202. }
  2203. if (!list.length) {
  2204. return
  2205. }
  2206. }
  2207. }
  2208. },
  2209. // 清除选择按钮
  2210. clearOptions() {
  2211. searchLists = []
  2212. this.setData({
  2213. // 点击清除选择按钮后,将所有选项置为空
  2214. isSearch: false,
  2215. courseDetailChosed: '',
  2216. teachPositionChosed: '',
  2217. stuSexChosed: '',
  2218. teachTypeChosed: '',
  2219. teachEduChosed: '',
  2220. teachSexChosed: '',
  2221. teachImgChosed: '',
  2222. list: [],
  2223. // 将筛选选项区全部置为false(关闭筛选选项区)
  2224. showCourse: false,
  2225. showCourseDetail: false,
  2226. showTeachPosition: false,
  2227. showSexList: false,
  2228. showTeachType: false,
  2229. showTeachEdu: false,
  2230. showTeachSex: false,
  2231. showTeachImg: false
  2232. })
  2233. },
  2234. /**
  2235. * 生命周期函数--监听页面初次渲染完成
  2236. */
  2237. onReady() {
  2238. },
  2239. /**
  2240. * 生命周期函数--监听页面显示
  2241. */
  2242. onShow() {
  2243. },
  2244. /**
  2245. * 生命周期函数--监听页面隐藏
  2246. */
  2247. onHide() {
  2248. },
  2249. /**
  2250. * 生命周期函数--监听页面卸载
  2251. */
  2252. onUnload() {
  2253. },
  2254. /**
  2255. * 页面相关事件处理函数--监听用户下拉动作
  2256. */
  2257. onPullDownRefresh() {
  2258. wx.startPullDownRefresh()
  2259. },
  2260. /**
  2261. * 页面上拉触底事件的处理函数
  2262. */
  2263. onReachBottom() {
  2264. wx.showToast({
  2265. title: '没有更多了',
  2266. icon: 'none'
  2267. })
  2268. },
  2269. /**
  2270. * 用户点击右上角分享
  2271. */
  2272. onShareAppMessage() {
  2273. }
  2274. })