From 83dd2d381c88e847a6da8e34d56a1fd50376f7a5 Mon Sep 17 00:00:00 2001 From: zsk <710162063@qq.com> Date: Thu, 29 Feb 2024 15:13:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.js | 329 +++++++++++++++++++++++-------------------------- pages/index/index.wxml | 130 ++++++++----------- pages/index/index.wxss | 13 ++ 3 files changed, 218 insertions(+), 254 deletions(-) diff --git a/pages/index/index.js b/pages/index/index.js index b78a507..599c0f9 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -33,6 +33,7 @@ Page({ recordList: [], jobSpecialLabelNames: [], storeJobListSearchForm: { + recruitment:1, pageNum: 1, pageSize: 20, classify: 1, @@ -117,181 +118,9 @@ Page({ halfHide: true, // 智能匹配显示一半控制 topNum: 0, scrollTo: "", // 列表滚动的控制 - navList: [ - { - img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/ztrt.png", - url: "/pages/hotList/index", - title: "主推/热推", - }, - // { img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/dtld.png",url:'/pages/hotList/index', title: "职位云亮点" }, - // { img: "http://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/zjzp.png",url:'/pages/hotList/index', title: "职教职培" }, - { - img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/cwdl.png", - url: "/pages/tobeAgency/index", - title: "成为代理", - }, - // { img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/dzkf.png",url:'/pages/hotList/index', title: "定制开发" }, - { - img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/xmhz.png", - url: "/pages/xiangmuhezuo/index", - title: "项目合作", - }, - { - img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/xtxx.png", - url: "/pages/message/index", - title: "消息中心", - }, - { - img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/lxwm.png", - url: "/pages/connectUs/index", - title: "联系我们", - }, - // { img: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/jqqd.png",url:'/pages/hotList/index', title: "敬请期待" }, - ], + bannerList: [], - /** - * 筛选的相关变量 - * - * - */ - filterData: { - yanba: [ - { - name: "无", - id: 1, - active: 0, - }, - { - name: "小面积", - id: 2, - active: 0, - }, - { - name: "大面积", - id: 3, - active: 0, - }, - ], - area: [ - { - name: "江浙沪", - id: 1, - active: 0, - }, - { - name: "鄂豫皖", - id: 2, - active: 0, - }, - { - name: "京津冀", - id: 3, - active: 0, - }, - { - name: "晋西北", - id: 4, - active: 0, - }, - { - name: "粤桂闽", - id: 5, - active: 0, - }, - { - name: "鲁东南", - id: 6, - active: 0, - }, - { - name: "黑吉辽", - id: 7, - active: 0, - }, - { - name: "疆藏青", - id: 8, - active: 0, - }, - { - name: "渝湘赣", - id: 9, - active: 0, - }, - { - name: "陕甘宁", - id: 10, - active: 0, - }, - { - name: "云贵川", - id: 11, - active: 0, - }, - { - name: "港澳台", - id: 12, - active: 0, - }, - ], - price: [ - { - name: "3000-4000", - id: 1, - active: 0, - }, - { - name: "4000-5000", - id: 2, - active: 0, - }, - { - name: "5000-6000", - id: 3, - active: 0, - }, - { - name: "6000-7000", - id: 4, - active: 0, - }, - { - name: "7000-8000", - id: 5, - active: 0, - }, - { - name: "8000以上", - id: 6, - active: 0, - }, - ], - sex: [ - { - name: "男", - id: 1, - active: 0, - }, - { - name: "女", - id: 2, - active: 0, - }, - { - name: "男女不限", - id: -1, - active: -1, - }, - ], - jobFilter: { - tagArray0: [], - tagArray1: [], - tagArray2: [], - tagArray3: [], - tagArray4: [], - }, - classifyList: [], - }, + copyList: {}, innerFilter: false, // 年龄筛选参数 @@ -636,7 +465,58 @@ Page({ console.log("清除成功"); }, inputBlur () { }, - getListByTypeAndIndustry: function () {}, + getListByTypeAndIndustry: function () { + var that = this; + wx.request({ + url: app.globalData.ip + "/labels/getListByTypeAndIndustry", + data: { + type: 90, + industry: 2, + }, + header: app.globalData.header, + method: "GET", + success: function (res) { + console.log(res.data.data); + wx.setStorageSync("FILTER_LIST", res.data.data); + res.data.data.forEach((item) => { + if (item.typeClassify == "0") { + that.data.tagArray0.push(item); + } else if (item.typeClassify == "1") { + that.data.tagArray1.push(item); + } else if (item.typeClassify == "2") { + that.data.tagArray2.push(item); + } else if (item.typeClassify == "3") { + that.data.tagArray3.push(item); + } else if (item.typeClassify == "4") { + that.data.tagArray4.push(item); + } + }); + that.setData({ + tagArray0: that.data.tagArray0, + tagArray1: that.data.tagArray1, + tagArray2: that.data.tagArray2, + tagArray3: that.data.tagArray3, + tagArray4: that.data.tagArray4, + }); + + var jobSpecialLabelIdArray = + that.data.storeJobListSearchForm.jobSpecialLabelIds.split(","); + + res.data.data.forEach((item) => { + item["checked"] = false; + jobSpecialLabelIdArray.forEach((item1) => { + if (item.id == item1) { + item["checked"] = true; + } + }); + }); + + that.setData({ + jobSpecialLabelList: res.data.data, + }); + }, + }); + }, golistSharePage () { if (this.data.isLogin) { if (app.globalData.loginUserInfo.agencyStatus == 1) { @@ -956,7 +836,7 @@ Page({ } app.getLoginUserTokenInfo(); - this.getJobList(); + // this.getJobList(); if (wx.getStorageSync("FILTER_LIST")) { let list = wx.getStorageSync("FILTER_LIST"); list.forEach((item) => { @@ -1185,7 +1065,7 @@ Page({ leftShow: false, recordList: [], whichOneShow: "", - // scrollTo: "sticky", + scrollTo: "sticky", }); if (this.data.choiceCollect == 0) { this.data.storeJobListSearchForm.ucj = 0; @@ -2893,7 +2773,102 @@ Page({ ) .exec(); }, + deleteMark (e) { + // console.log(e); + console.log(e); + let data = e.currentTarget.dataset.item; + let filter = this.data.filterData; + // if(e.currentTarget.dataset.item){ + // 判断是否是标签筛选项 + this.data.storeJobListSearchForm.pageNum = 1; + if (data.hasOwnProperty("typeClassify")) { + console.log(e); + this.data.selectJobList.forEach((item, index) => { + if (item.id == data.id) { + this.data.selectJobList.splice(index, 1); + let ind = + filter.jobFilter["tagArray" + data.typeClassify].indexOf(item); + console.log(filter.jobFilter["tagArray" + data.typeClassify][ind]); + filter.jobFilter["tagArray" + data.typeClassify][ind].active = 0; + // let ind = filter.classifyList.indexOf(item); + // console.log(filter.classifyList[ind]); + // filter.classifyList[ind].active = false; + this.toList(); + } + }); + this.setData({ + selectJobList: this.data.selectJobList, + filterData: this.data.filterData, + }); + } else { + this.data.selectBrandList.forEach((item, index) => { + if (item.id == data.id) { + this.data.selectBrandList.splice(index, 1); + // let ind = filter.jobFilter["tagArray" + data.typeClassify].indexOf(item); + // console.log(filter.jobFilter["tagArray" + data.typeClassify][ind]); + // filter.jobFilter["tagArray" + data.typeClassify][ind].active = 0; + let ind = filter.classifyList.indexOf(item); + console.log(filter.classifyList[ind]); + filter.classifyList[ind].active = 0; + this.toList(); + } + }); + this.setData({ + selectBrandList: this.data.selectBrandList, + filterData: this.data.filterData, + }); + } + + // } + }, + + deleteAge (e) { + console.log(e); + let that = this; + that.data.storeJobListSearchForm.ageRangeStr = "16-60"; + that.data.storeJobListSearchForm.pageNum = 1; + this.setData({ + minAge: 16, + maxAge: 60, + rangeValues: [16, 60], + }); + this.toList(); + }, + + deletePaixu (e) { + console.log(e); + let that = this; + // let data = e.currentTarget.dataset.item; + this.data.storeJobListSearchForm.sortTag = 0; + that.data.storeJobListSearchForm.pageNum = 1; + this.setData({ + firstMenu: "工价", + activez: "zuigao", + }); + this.toList(); + }, + deleteSex () { + let filter = this.data.filterData; + this.data.storeJobListSearchForm.pageNum = 1; + this.data.filterData.sex.forEach((item, index) => { + item.active = 0; + if (index == 2) { + item.active = -1; + } + }); + this.data.smartObj.sex.forEach((item, index) => { + item.active = 0; + if (index == 2) { + item.active = -1; + } + }); + this.setData({ + filterData: this.data.filterData, + smartObj: this.data.smartObj, + }); + this.toList(); + }, // tabbar点击监听 onTabItemTap (e) { console.log(e); diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 3cc1d5b..0b2b290 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -19,7 +19,7 @@ - + @@ -113,7 +113,7 @@ --> - 年龄(岁) + 1.年龄(岁) {{minAge + '-'}} @@ -123,43 +123,43 @@ - 1.性别(单选) + 2.性别(单选) {{item.name}} - 2.分类 + 3.分类 {{item.name}} - 3.薪资福利 + 4.薪资福利 {{item.name}} - 4.宿舍保障 + 5.宿舍保障 {{item.name}} - 5.班制休息 + 6.班制休息 {{item.name}} - 6.面试特色 + 7.面试特色 {{item.name}} - 7.其他特色 + 8.其他特色 {{item.name}} @@ -219,81 +219,57 @@ --> - - - - - - - - - - - + + + + + + + diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 11ad95f..3e8e3eb 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -66,6 +66,19 @@ page { position: absolute; right: 58px; } +.clear_icon { + position: absolute; + display: inline-block; + width: 12px; + height: 12px; + line-height: 10px; + border-radius: 50%; + background-color: #fff; + right: -2px; + top: -2px; + color: #aaa; + /* font-size: 12px; */ +} .weui-search-bar__form .icon-sousuo { left: 8px; }