diff --git a/pages/index/index.js b/pages/index/index.js index 9c6e267..71fc7e6 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1095,17 +1095,17 @@ Page({ }, onReady() { let that = this; - var query = wx.createSelectorQuery(); - query.select(".navigatorBar").boundingClientRect(); - query.exec(function (res) { - //res就是 所有标签为v1的元素的信息 的数组 - console.log(res); - //取高度 - console.log(res[0].height); - that.setData({ - navigatorBarHeight: res[0].height, - }); - }); + // var query = wx.createSelectorQuery(); + // query.select(".navigatorBar").boundingClientRect(); + // query.exec(function (res) { + // //res就是 所有标签为v1的元素的信息 的数组 + // console.log(res); + // //取高度 + // console.log(res[0].height); + // that.setData({ + // navigatorBarHeight: res[0].height, + // }); + // }); }, /** * 智能匹配结束 @@ -1476,17 +1476,17 @@ Page({ that.data.storeJobListSearchForm.pageNum = 1; wx.setStorageSync("BILLFROM", "firstBill"); - var query = wx.createSelectorQuery(); - query.select(".toppic").boundingClientRect(); - query.exec(function (res) { - //res就是 所有标签为v1的元素的信息 的数组 - console.log(res); - //取高度 - console.log(res[0].height); - that.setData({ - swiperHeight: res[0].height, - }); - }); + // var query = wx.createSelectorQuery(); + // query.select(".toppic").boundingClientRect(); + // query.exec(function (res) { + // //res就是 所有标签为v1的元素的信息 的数组 + // console.log(res); + // //取高度 + // console.log(res[0].height); + // that.setData({ + // swiperHeight: res[0].height, + // }); + // }); // wx.showTabBar({ // success(e) {}, diff --git a/pages/type/type/index.js b/pages/type/type/index.js index 1c0c0ca..c9cce5f 100644 --- a/pages/type/type/index.js +++ b/pages/type/type/index.js @@ -3,7 +3,6 @@ const app = getApp(); const commonUtil = require("../../../utils/commonUtil.js"); Page({ data: { - swiperHeight:0, toped: "1", chaShowed: false, isTrigger: false, @@ -103,8 +102,6 @@ Page({ iosDialog: false, // 成为代理弹窗 isLoading: true, // 成为代理图片加载loading效果 isScrollTop: false, // 控制职位列表的滚动 - swiperTextList: ["日结工", "18岁", "电子厂", "短期工", "47岁", "保底", "小时工"], // 关键词轮播的关键词列表 - placeholderText: "", // 当前关键词 leftShow: false, // 左侧智能匹配抽屉显示 /** * 滑动相关变量 @@ -154,144 +151,7 @@ Page({ * * */ - 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, @@ -919,86 +779,9 @@ Page({ }, onLoad(options) { var that = this; - console.log(options); - console.log(wx.getSystemInfoSync()); - // Array.prototype.logResult = function(){ - // console.log('Array'); - // } - this.setData({ - placeholderText: this.data.swiperTextList[0], - }); let arr = []; arr.logResult(); - - this.getListByTypeAndIndustry(); - this.getBrandNameAllList(); - - // 查看是否授权 - wx.getSetting({ - success(res) { - if (res.authSetting["scope.userInfo"]) { - // 已经授权,可以直接调用 getUserInfo 获取头像昵称 - wx.getUserInfo({ - success: function (res) { - console.log(res.userInfo); - }, - }); - } - }, - }); - - // if (app.isNotEmptyCheck(options.fromSearchPage) && options.fromSearchPage == 1) { - // try { - // var searchCityParamStorage = wx.getStorageSync("searchCityParamStorage"); - // if (searchCityParamStorage) { - // console.log("searchCityParamStorage======", searchCityParamStorage); - // that.data.storeJobListSearchForm.cityName = searchCityParamStorage.name; - // if (app.isEmptyCheck(searchCityParamStorage.name)) { - // that.data.storeJobListSearchForm.cityName = "全国"; - // } - // that.setData({ - // searchCityParamStorage: searchCityParamStorage, - // }); - // } - // } catch (e) { - // console.log("获取缓存设置的查询职位列表参数错误:", e); - // } - // } else { - // try { - // wx.removeStorageSync("searchJobListParamStorage"); - // } catch (e) { - // console.log("删除缓存设置的查询职位列表参数错误:", e); - // } - // try { - // wx.removeStorageSync("searchCityParamStorage"); - // } catch (e) { - // console.log("删除缓存设置的查询职位列表参数错误:", e); - // } - // } - - try { - if (app.globalData.isScanQRCodes - 1 == 0) { - wx.showToast({ - title: "欢迎查看好工作", - icon: "success", - duration: 2000, - }); - if (!getApp().globalData.isLogin) { - setTimeout(function () { - if (!getApp().globalData.isLogin) { - that.openIOS2(); - } - }, 5000); - } - } - } catch (e) { - console.log("获取缓存设置的查询职位列表参数错误:", e); - } - - console.log("options==============================1"); - console.log(options); - console.log("options==============================2"); - + if (app.isNotEmptyCheck(options.scene)) { //扫小程序码携带参数 var sceneStr = decodeURIComponent(options.scene); @@ -1095,7 +878,6 @@ Page({ } //登录=================================end - this.getHopeJobLabels(); var reset = true; let agencyUserId = options.agencyUserId; if (agencyUserId) { @@ -1106,44 +888,7 @@ Page({ app.getLoginUserTokenInfo(); this.getJobList(); - if (wx.getStorageSync("FILTER_LIST")) { - let list = wx.getStorageSync("FILTER_LIST"); - list.forEach((item) => { - item.active = 0; - if (item.typeClassify == "0") { - this.data.filterData.jobFilter["tagArray0"].push(item); - } else if (item.typeClassify == "1") { - this.data.filterData.jobFilter["tagArray1"].push(item); - } else if (item.typeClassify == "2") { - this.data.filterData.jobFilter["tagArray2"].push(item); - } else if (item.typeClassify == "3") { - this.data.filterData.jobFilter["tagArray3"].push(item); - } else if (item.typeClassify == "4") { - this.data.filterData.jobFilter["tagArray4"].push(item); - } - }); - let jobFilter = "filterData.jobFilter"; - this.setData({ - [jobFilter]: this.data.filterData.jobFilter, - }); - } - - if (wx.getStorageSync("CLASSIFY_LIST")) { - this.data.filterData.classifyList = wx.getStorageSync("CLASSIFY_LIST"); - this.data.filterData.classifyList.forEach((item) => { - item.active = 0; - }); - let classifyList = "filterData.classifyList"; - this.setData({ - [classifyList]: this.data.filterData.classifyList, - }); - } - this.setData({ - copyList: JSON.parse(JSON.stringify(this.data.filterData)), - }); - // that.getJobList(); - that.getBannerList(); - that.getchannelList(); + }, onReady() { }, @@ -1335,102 +1080,7 @@ Page({ // this.getJobList(); }, - /** - * 点击确认按钮 - * - * - */ - toList() { - let that = this; - let innerFilter = false; - console.log(this.data.filterData); - let formSearch = { - pageNum: 1, - pageSize: 20, - }; - let filter = this.data.filterData; - for (var k in filter) { - if (k != "jobFilter") { - let jobCategoryArr = []; - filter[k].forEach((item) => { - if (item.active != 0) { - if (k == "price") { - if (item.name == "8000以上") { - formSearch.monthlyPayStr = "8001-20000"; - } else { - formSearch.monthlyPayStr = item.name; - } - } else if (k == "sex") { - formSearch.sex = item.id; - if (item.id == -1) { - this.data.secondMenu = "不限"; - } else if (item.id == 1) { - this.data.secondMenu = "男生"; - innerFilter = true; - } else if (item.id == 2) { - this.data.secondMenu = "女生"; - innerFilter = true; - } - this.setData({ - sexid: item.id, - secondMenu: this.data.secondMenu, - }); - } else if (k == "classifyList") { - jobCategoryArr.push(item.id); - if (jobCategoryArr.length > 0) { - innerFilter = true; - } - } - } - }); - formSearch.jobCategoryLabelIds = jobCategoryArr.join(); - } else { - let totalArr = [...filter["jobFilter"].tagArray0, ...filter["jobFilter"].tagArray1, ...filter["jobFilter"].tagArray2, ...filter["jobFilter"].tagArray3, ...filter["jobFilter"].tagArray4]; - let jobSpecialArr = []; - console.log(totalArr); - totalArr.forEach((item) => { - if (item.active != 0) { - jobSpecialArr.push(item.id); - } - }); - console.log(jobSpecialArr); - if (jobSpecialArr.length > 0) { - innerFilter = true; - } - console.log(jobSpecialArr.join(",")); - formSearch.jobSpecialLabelIds = jobSpecialArr.join(","); - } - } - console.log(formSearch); - that.data.storeJobListSearchForm = { ...that.data.storeJobListSearchForm, ...formSearch }; - if (this.data.choiceCollect == 0) { - that.data.storeJobListSearchForm.ucj = 0; - } else { - that.data.storeJobListSearchForm.ucj = 1; - } - console.log(that.data.storeJobListSearchForm); - that.setData({ - recordList: [], - leftShow: false, - innerFilter, - whichOneShow: "", - storeJobListSearchForm: that.data.storeJobListSearchForm, - }); - that.loginOut(); - that.getJobList(); - }, - /** - * 智能匹配结束 - * - * - */ - onTabClick(e) { - const index = e.detail.index; - this.setData({ - activeTab: index, - }); - }, onChange(e) { const index = e.detail.index; @@ -1439,44 +1089,12 @@ Page({ }); }, - findLocation() { - var that = this; - wx.getLocation({ - type: "gcj02", - success(res1) { - console.log("获取位置2"); - console.log(res1); - app.globalData.lng = res1.longitude; - app.globalData.lat = res1.latitude; - }, - fail() {}, - }); - }, + emptyMethod(e) { console.log(e); }, - chooseIdCard() { - var that = this; - if (that.data.agencyStatus != 1) { - this.setData({ - iosDialog: true, - }); - return; - } - wx.chooseImage({ - count: 1, - sizeType: ["original", "compressed"], - sourceType: ["album", "camera"], - success(res) { - console.log(res); - wx.navigateTo({ - url: `../newEnroll/enroll/index?applyType=1&imgUrl=${res.tempFilePaths[0]}`, - }); - // that.uploadIdcardImg(res); - }, - }); - }, + navigatorToRecord() { if (this.data.agencyStatus != 1) { this.setData({ @@ -1515,35 +1133,7 @@ Page({ let that = this; that.data.storeJobListSearchForm.pageNum = 1; wx.setStorageSync("BILLFROM", "firstBill"); - if (wx.getStorageSync("FROMCITY")) { - try { - var searchCityParamStorage = wx.getStorageSync("searchCityParamStorage"); - if (searchCityParamStorage) { - console.log("searchCityParamStorage======", searchCityParamStorage); - that.data.storeJobListSearchForm.cityName = searchCityParamStorage.name; - if (app.isEmptyCheck(searchCityParamStorage.name)) { - that.data.storeJobListSearchForm.cityName = "全国"; - } - - that.setData({ - searchCityParamStorage: searchCityParamStorage, - storeJobListSearchForm: that.data.storeJobListSearchForm, - }); - that.setData({ - recordList: [], - }); - this.getJobList(); - } - } catch (e) { - console.log("获取缓存设置的查询职位列表参数错误:", e); - } - wx.removeStorageSync("FROMCITY"); - }else{ - that.setData({ - recordList: [], - }); - that.getJobList(); - } + if (typeof this.getTabBar === "function" && this.getTabBar()) { this.getTabBar().setData({ selected: 0, @@ -1614,187 +1204,6 @@ Page({ that.searchAnimate(); }, - collectedStoreJobList() { - var that = this; - - wx.request({ - url: app.globalData.ip + "/store/job/collected/list?ucj=1", - method: "GET", - data: {}, - header: app.globalData.headers, - success: function (res) { - console.log(res); - let collectList = res.data.data.recordList; - let jobs = that.data.recordList; - if (collectList != null && collectList != "" && collectList != undefined && collectList.length != 0 && jobs != null && jobs != "" && jobs != undefined && jobs.length != 0) { - for (var j = 0; j != jobs.length; ++j) { - jobs[j].collected = 2; - } - for (var i = 0; i != collectList.length; ++i) { - for (var j = 0; j != jobs.length; ++j) { - if (collectList[i].storeJobId - jobs[j].id == 0) { - jobs[j].collected = 1; - break; - } - } - } - that.setData({ - recordList: jobs, - }); - } - }, - fail: function (res) {}, - }); - }, - getHopeJobLabels() { - var that = this; - wx.request({ - url: app.globalData.ip + "/labels/findAllHopeJobLabels", - // ?category=4 - method: "GET", - data: {}, - success: function (res0) { - console.log("感兴趣职位 ↓↓↓"); - console.log(res0); - if (res0.data.data != null) { - res0.data.data.forEach((item, index) => { - item["title"] = item.name; - item["checked"] = false; - - if (index == 0 || index == 1) { - item["checked"] = true; - } - }); - } - - that.setData({ - labelItems: res0.data.data == null ? [] : res0.data.data, - }); - that.initData(); - console.log("感兴趣职位 赋值title↓↓↓"); - console.log(res0); - }, - fail: function (res) { - console.log(res); - wx.showToast({ - title: "获取失败", - icon: "none", - duration: 2000, - }); - }, - }); - }, - makePhoneCall() { - var that = this; - wx.makePhoneCall({ - phoneNumber: "13937184434", - }); - }, - goScreen() { - wx.navigateTo({ - url: "../screen/index", - }); - }, - goCity() { - let that = this; - - wx.navigateTo({ - url: "../city/index", - }); - }, - initData() { - var that = this; - try { - // 获取手机基础信息(头状态栏和标题栏高度) - let systemInfo = wx.getSystemInfoSync(); - let getMenuButtonBoundingClientRect = wx.getMenuButtonBoundingClientRect(); - console.log(wx.getMenuButtonBoundingClientRect()); - this.setData({ - systemInfo, - getMenuButtonBoundingClientRect, - }); - } catch (e) { - console.log(e); - - wx.alert({ - title: "温馨提示", - content: "onLoad 执行异常", - }); - } - let res0 = wx.getStorageSync("checkedlabelItems"); - - console.log(app.isNotEmptyCheck(res0.data)); - that.data.tabs2 = [ - { - name: "打勾推荐", - category: -1, - id: 406, - checked: true, - title: "打勾推荐", - }, - ]; - - if (app.isNotEmptyCheck(res0.data)) { - for (var i = 0; i < res0.data.length; i++) { - res0.data[i]["title"] = res0.data[i].name; - // that.data.tabs2.push(res0.data[i]); - } - - console.log("获取缓存"); // res0.data.unshift(); - // console.log(res.data.unshift({name: "打勾推荐", category: 3, id: 406, checked: true, title: "打勾推荐"})); - } else { - console.log("无感兴趣职位 push两个职位 ↓↓↓"); - console.log(that.data.labelItems); - that.data.labelItems.forEach((item) => { - if (item.name == "理货员" || item.name == "餐饮服务员") { - // that.data.tabs2.push(item); - } - }); // that.data.tabs2.push(that.data.labelItems[0], that.data.labelItems[1]) - } - - that.setData({ - tabs2: that.data.tabs2, - }); - - let res = wx.getStorageSync("sex"); //性别 - if (app.isNotEmptyCheck(res.data)) { - that.data.storeJobListSearchForm.sex = res.data; - that.data.storeJobListSearchForm.pageNum = 1; - } else { - // res.data = []; - } - let res2 = wx.getStorageSync("checkedJobItems"); //筛选职位 - let workTypeStrCurr = ""; - if (app.isNotEmptyCheck(res2.data)) { - res2.data.forEach((item, index) => { - workTypeStrCurr += item.value + ","; - }); - - if (workTypeStrCurr.length > 0) { - workTypeStrCurr = workTypeStrCurr.substr(0, workTypeStrCurr.length - 1); - } - - that.data.storeJobListSearchForm.workTypeStr = workTypeStrCurr; - that.data.storeJobListSearchForm.pageNum = 1; - } else { - that.data.storeJobListSearchForm.workTypeStr = ""; - that.data.storeJobListSearchForm.pageNum = 1; - } - - console.log(res.data + "===" + res2.data); - - if (res.data == -1 && (res2.data == null || res2.data == "")) { - that.setData({ - chooseActive: false, - }); - } else { - that.setData({ - chooseActive: true, - }); - } - - // this.getJobList(); - }, getJobList() { var that = this; @@ -1810,10 +1219,7 @@ Page({ } console.log(that.data.inputVal); - that.data.storeJobListSearchForm.cityName = that.data.searchCityParamStorage.name; - if (app.isEmptyCheck(that.data.searchCityParamStorage.name)) { - that.data.storeJobListSearchForm.cityName = "全国"; - } + that.data.storeJobListSearchForm.keys = that.data.inputVal == "搜索工作" ? "" : that.data.inputVal; // debugger; wx.showLoading({ @@ -1868,7 +1274,7 @@ Page({ storeJobListSearchForm: that.data.storeJobListSearchForm, }); resolve(); - that.getTag(); + // that.getTag(); that.data.recordList.forEach((item, index) => { // console.log(item); @@ -1913,30 +1319,6 @@ Page({ this.getJobList(); }, - getTag() { - let that = this; - let query = that.createSelectorQuery(); - query - .selectAll(".tttg") - .boundingClientRect() - .exec(function (res) { - res.forEach((item) => { - item.forEach((element, index) => { - if (element.width > 200) { - // that.data.recordList[index].isTagShow = true; - var age = "recordList[" + index + "].isTagShow"; - that.setData({ - [age]: true, - }); - } - }); - }); - // if(){ - - // } - // console.log(res); - }); - }, // 下拉加载更多 onScrollToLower() { @@ -2116,18 +1498,6 @@ Page({ }, }); }, - changeRecordBillType(e) { - let that = this; - console.log(e); - that.setData({ - recordBillType: e.currentTarget.dataset.type, - }); - }, - toSmart() { - wx.navigateTo({ - url: "/pages/IDCardWithNFC/index", - }); - }, getPhoneNumber(e) { var that = this; console.log(e); @@ -2265,102 +1635,7 @@ Page({ } return false; }, - getPhoneNumber1(e) { - var that = this; - console.log(e); - console.log(e.detail.errMsg); - - that.close(); - // console.log(e); - // console.log(e.detail.errMsg) - // console.log(e.detail.iv) - // console.log(e.detail.encryptedData) - - if ("getPhoneNumber:ok" == e.detail.errMsg) { - //同意 - var iv = e.detail.iv; - var encryptedData = e.detail.encryptedData; - wx.checkSession({ - success() { - //session_key 未过期,并且在本生命周期一直有效 - wx.request({ - url: app.globalData.ip + "/getWechatTel", - data: { - code: that.data.wxCode, - iv: iv, - encryptedData: encryptedData, - type: "yishoudan", - appId:app.globalData.appId - }, - success: function (res) { - console.log(res); - let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); - promise.then((res) => { - that.setData({ - isLogin: app.globalData.isLogin, - }); - that.onScrollToLower(); - }); - }, - fail: function (res) { - console.log("获取用户手机号错误"); - }, - }); - }, - fail() { - // session_key 已经失效,需要重新执行登录流程 - wx.login({ - success(res) { - if (res.code) { - console.log(res.code); - //发起网络请求 - wx.request({ - url: app.globalData.ip + "/getWechatTel", - data: { - code: res.code, - iv: iv, - encryptedData: encryptedData, - type: "yishoudan", - appId:app.globalData.appId - }, - success: function (res) { - console.log(res); - let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); - promise.then((res) => { - that.setData({ - isLogin: app.globalData.isLogin, - }); - }); - }, - fail: function (res) { - console.log("获取用户手机号错误"); - }, - }); - } else { - console.log("获取手机号失败!" + res.errMsg); - } - }, - }); - }, - }); - } else { - //拒绝 - if (e.currentTarget.dataset.type != "close") { - try { - wx.setStorageSync("comeFromPage", "index"); - } catch (e) { - console.log("index-页面跳转,设置参数错误:", e); - } - wx.navigateTo({ - url: "/pages/login/index", - }); - } else { - that.close(); - } - } - return false; - }, getAgencyUserId(id) { var that = this; wx.request({ @@ -2390,402 +1665,8 @@ Page({ }, }); }, - collectPaste(e) { - var txt; - var that = this; - if (!this.data.isLogin) { - wx.navigateTo({ - url: "/pages/login/index", - }); - return; - } - var collected = e.currentTarget.dataset.collected; - var storeJobId = e.currentTarget.dataset.jobid; - that.doCollected(collected, storeJobId); - // console.log(collected); - // if(!this.data.isCollect){ - // that.setData({ - // isCollect: true, - // collectTxt:'已收藏' - // }) - // txt = '收藏成功' - // }else{ - // that.setData({ - // isCollect: false, - // collectTxt:'收藏' - // }) - // } - }, - doCollected(collected, storeJobId) { - var that = this; - var url = "/user/collect/job/add"; - if (collected - 1 == 0) { - url = "/user/collect/job/remove"; - } - console.log(app.globalData.headers); - //发起网络请求 - wx.request({ - url: app.globalData.ip + url, - data: { - storeJobId: storeJobId, - }, - header: app.globalData.headers, - method: "GET", - success: function (res) { - var txt; - if (collected - 1 == 0) { - //取消收藏 - for (var i = 0; i != that.data.recordList.length; ++i) { - if (that.data.recordList[i].id - storeJobId == 0) { - that.data.recordList[i].collected = 2; - break; - } - } - txt = "取消收藏"; - that.data.currentJobDrawer.collected = 2; - if (that.data.choiceCollect == 1) { - if (that.data.drawerShow) { - that.data.drawerShow = false; - } - that.data.storeJobListSearchForm.pageNum = 1; - that.setData({ - recordList: [], - drawerShow: that.data.drawerShow, - storeJobListSearchForm: that.data.storeJobListSearchForm, - }); - that.getJobList(); - } - } else { - //收藏 - for (var i = 0; i != that.data.recordList.length; ++i) { - if (that.data.recordList[i].id - storeJobId == 0) { - that.data.recordList[i].collected = 1; - break; - } - } - that.data.currentJobDrawer.collected = 1; - txt = "收藏成功"; - } - - console.log(that.data.currentJobDrawer); - - that.setData({ - recordList: that.data.recordList, - currentJobDrawer: that.data.currentJobDrawer, - isLogin: app.globalData.isLogin, - }); - wx.showToast({ - icon: "none", - title: txt, - }); - }, - fail: function (res) { - console.log("操作失败"); - }, - }); - }, - getUserInfoBtn: function (e) { - console.log(e); - let that = this; - let type = e.currentTarget.dataset.type; - var collected = e.currentTarget.dataset.collected; - var storeJobId = e.currentTarget.dataset.jobid; - let idx = e.currentTarget.dataset.idx; - console.log(type); - wx.getUserProfile({ - desc: "用于完善会员资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 - success: (res) => { - console.log(res); - //发起网络请求 - wx.request({ - url: app.globalData.ip + "/updateUserWechatInfo", - data: { - nickName: res.userInfo.nickName, - avatarUrl: res.userInfo.avatarUrl, - gender: res.userInfo.gender, - country: res.userInfo.country, - province: res.userInfo.province, - city: res.userInfo.city, - }, - method: "POST", - header: app.globalData.headers, - success: function (res) { - console.log(res); - app.globalData.hasUserInfo = 1; - that.setData({ - hasUserInfo: 1, - }); - that.doMenuClick(type, collected, storeJobId, idx); - }, - fail: function (res) { - that.doMenuClick(type, collected, storeJobId, idx); - }, - }); - }, - fail: (res) => { - console.log(res); - that.doMenuClick(type, collected, storeJobId, idx); - }, - }); - }, - doMenuClick: function (_type, _collected, _storeJobId, _idx) { - let that = this; - if (_type - 1 == 0) { - //点击全国 - that.goCity(); - } else if (_type - 2 == 0) { - //搜索 - } else if (_type - 3 == 0) { - //筛选 - that.goScreen(); - } else if (_type - 4 == 0) { - //收藏 - that.doCollected(_collected, _storeJobId); - } else if (_type - 5 == 0) { - //报名 - wx.setStorageSync("jobDetailStorage", that.data.recordList[_idx]); - wx.navigateTo({ - url: "../enroll/index?applyType=1&tel=" + app.globalData.loginUserInfo.tel, - }); - } - }, - changSign(e) { - let that = this; - console.log(e); - that.data.storeJobListSearchForm.pageNum = 1; - if (e.target.dataset.type == 0 && that.data.signType != 0) { - that.data.storeJobListSearchForm.signType = ""; - that.setData({ - signType: e.target.dataset.type, - recordList: [], - storeJobListSearchForm: that.data.storeJobListSearchForm, - }); - that.getJobList(); - } else if (e.target.dataset.type == 1 && that.data.signType != 1) { - that.data.storeJobListSearchForm.signType = 1; - that.setData({ - signType: e.target.dataset.type, - recordList: [], - storeJobListSearchForm: that.data.storeJobListSearchForm, - }); - that.getJobList(); - } else if (e.target.dataset.type == 2 && that.data.signType != 2) { - that.data.storeJobListSearchForm.signType = 2; - that.setData({ - signType: e.target.dataset.type, - recordList: [], - storeJobListSearchForm: that.data.storeJobListSearchForm, - }); - that.getJobList(); - } - }, - /** - * 收藏的切换 - * - * - */ - collectChange(e) { - let that = this; - if (that.data.isLogin || (!that.data.isLogin && e.currentTarget.dataset.id == 0)) { - if (e.currentTarget.dataset.id) { - that.data.choiceCollect = e.currentTarget.dataset.id; - that.data.storeJobListSearchForm.ucj = e.currentTarget.dataset.id; - that.data.storeJobListSearchForm.pageNum = 1; - that.setData({ - choiceCollect: that.data.choiceCollect, - storeJobListSearchForm: that.data.storeJobListSearchForm, - recordList: [], - hasMoreData: false, - }); - that.getJobList(); - } - } else { - that.setData({ - recordList: [], - hasMoreData:false, - choiceCollect: 1, - }); - // } - } - }, - choiceFilter(e) { - var that = this; - // let str = that.data.activez - let str = e.currentTarget.dataset.id; - if (str == "all") { - that.data.storeJobListSearchForm.sortTag = 0; - that.setData({ - firstMenu: "排序", - // storeJobListSearchForm: that.data.storeJobListSearchForm, - recordList: [], - }); - that.getJobList().then(() => { - that.setData({ - siv: "menu", - }); - }); - } else if (str == "zuijin") { - //距离最近 - if (that.data.storeJobListSearchForm.lng && that.data.storeJobListSearchForm.lat) { - that.data.storeJobListSearchForm.sortTag = 2; - that.setData({ - firstMenu: "距离", - // storeJobListSearchForm: tha t.data.storeJobListSearchForm, - recordList: [], - }); - that.getJobList().then(() => { - that.setData({ - siv: "menu", - }); - }); - } else { - wx.getLocation({ - type: "gcj02", - success(res1) { - console.log("获取位置1"); - app.globalData.lng = res1.longitude; - app.globalData.lat = res1.latitude; - that.data.storeJobListSearchForm.lng = res1.longitude; - that.data.storeJobListSearchForm.lat = res1.latitude; - that.data.storeJobListSearchForm.sortTag = 2; - that.data.storeJobListSearchForm.pageNum = 1; - that.setData({ - firstMenu: "距离", - storeJobListSearchForm: that.data.storeJobListSearchForm, - recordList: [], - }); - that.getJobList().then(() => { - that.setData({ - siv: "menu", - }); - }); - // var promise = new Promise(function(resolve,reject){ - // that.getJobList(); - // }); - }, - fail() { - console.log("获取位置失败,打开位置设置界面"); - // wx.openSetting({ - // success(res) { - // console.log(res.authSetting); - // if (res.authSetting["scope.userLocation"]) { - // wx.getLocation({ - // type: "gcj02", - // success(res1) { - // console.log("获取位置2"); - // console.log(res1); - // app.globalData.lng = res1.longitude; - // app.globalData.lat = res1.latitude; - - // that.data.storeJobListSearchForm.sortTag = 2; - // that.data.storeJobListSearchForm.lng = res1.longitude; - // that.data.storeJobListSearchForm.lat = res1.latitude; - // that.data.storeJobListSearchForm.pageNum = 1; - // that.setData({ - // storeJobListSearchForm: that.data.storeJobListSearchForm, - // recordList: [], - // }); - // that.getJobList().then(() => { - // that.setData({ - // siv: "menu", - // }); - // }); - // }, - // fail() {}, - // }); - // } - // }, - // }); - }, - }); - } - } else if (str == "zuigao") { - //工价最高 - that.data.storeJobListSearchForm.sortTag = 1; - that.data.storeJobListSearchForm.pageNum = 1; - that.setData({ - storeJobListSearchForm: that.data.storeJobListSearchForm, - firstMenu: "排序", - recordList: [], - }); - that.getJobList().then(() => { - that.setData({ - siv: "menu", - }); - }); - } - that.setData({ - activez: str, - }); - that.setData({ - whichOneShow: "", - siv: "", - }); - // setTimeout(() => { - // that.setData({ - // whichOneShow: "", - // }); - // console.log(this.data.whichOneShow); - // console.log("112233"); - // }, 1); - }, - /** - * 清除所有的筛选项 - * - * - */ - clearFilter() { - let that = this; - that.data.jobSpecialLabelList.forEach((item) => { - // console.log(item); - if (item.checked) { - item.checked = false; - } - }); - that.data.brandList.forEach((item) => { - if (item.checked) { - item.checked = false; - } - }); - that.data.storeJobListSearchForm.jobSpecialLabelIds = ""; - // that.data.storeJobListSearchForm.ucj = - // that.data.storeJobListSearchForm.brandIds = ""; - that.data.storeJobListSearchForm.jobCategoryLabelIds = ""; - that.data.storeJobListSearchForm.pageNum = 1; - that.setData({ - jobSpecialLabelList: that.data.jobSpecialLabelList, - tagArray0: that.data.tagArray0, - tagArray1: that.data.tagArray1, - tagArray2: that.data.tagArray2, - tagArray3: that.data.tagArray3, - brandList: that.data.brandList, - selectJobList: [], - selectBrandList: [], - recordList: [], - whichOneShow: "", - firstMenu: "排序", - secondMenu: "不限", - sexid: -1, - activez: "zuigao", - }); - // that.choiceFilter({ - // currentTarget: { - // dataset: { - // id: "all", - // }, - // }, - // }); - // that.choiceSex({ - // currentTarget: { - // dataset: { - // id: "-1", - // }, - // }, - // }); - that.getJobList(); - }, scroll(e) { return false; }, @@ -2798,36 +1679,7 @@ Page({ url: `/pages/configAnnunciate/index`, }); }, - /** - * 简版报名 - * - * - */ - recordBill(e) { - if (!this.data.isLogin) { - wx.navigateTo({ - url: "/pages/login/index", - }); - return; - } - console.log(e.currentTarget.dataset.job); - console.log(123); - let middleInfo = e.currentTarget.dataset.job; - let info = JSON.stringify({ - id: middleInfo.id, - jobName: middleInfo.jobName, - storeName: middleInfo.storeName, - aliasName: middleInfo.aliasName, - storeId: middleInfo.storeId, - }); - console.log(info); - wx.navigateTo({ - url: `../newEnroll/enroll/index?applyType=1&info=${info}`, - }); - // wx.navigateTo({ - // url: `../newEnroll/enroll/index?applyType=1&info=${info}`, - // }); - }, + imageLoad() { this.setData({ isLoading: false, @@ -2868,107 +1720,9 @@ Page({ * * */ - getSwiperIndex(e) { - // console.dir(e); - if (e.detail.current) { - this.setData({ - placeholderText: this.data.swiperTextList[e.detail.current], - }); - // console.log(this.data.swiperTextList[e.detail.current]); - // console.log(this.data.placeholderText); - } - }, + onPageScroll(e) {}, - drawerTouchStart(event) { - this.handletouchtart(event); - }, - drawerTouchMove(event) { - let tx = this.handletouchmove(event); - console.log(tx); - if (tx.ty > 100) { - this.hideDrawer(); - } - }, - filterTouchMove(event) { - let tx = this.handletouchmove(event); - if (tx.tx < -100) { - this.setData({ - leftShow: false, - }); - } - }, - filterTouchStart(event) { - this.handletouchtart(event); - }, - listTouchMove(event) { - if (event.detail.scrollTop - this.data.listPosition > 15 && this.data.halfHide == false) { - this.setData({ - halfHide: true, - }); - } else if (event.detail.scrollTop - this.data.listPosition < -15 && this.data.halfHide == true) { - this.setData({ - halfHide: false, - }); - } - if (event.detail.scrollTop > 200) { - // wx.setTabBarItem({ - // index: 0, - // text: "回顶部", - // iconPath: "/assets/images/ysd.png", - // selectedIconPath: "/assets/images/top.png", - // success: (e) => {}, - // fail(e) { - // console.log(e); - // }, - // }); - } else if (event.detail.scrollTop <= 200) { - // wx.setTabBarItem({ - // index: 0, - // text: "首页", - // iconPath: "/assets/images/ysd.png", - // selectedIconPath: "/assets/images/ysd1.png", - // success: (e) => {}, - // fail(e) { - // console.log(e); - // }, - // }); - } - // console.log(event); - }, - listTouchStart(event) { - this.data.listPosition = event.detail.scrollTop; - }, - /** - * 页面滑动事件监听 - * - * - */ - handletouchmove: function (event) { - let that = this; - var currentX = event.touches[0].pageX; - var currentY = event.touches[0].pageY; - var tx = currentX - this.data.lastX; - var ty = currentY - this.data.lastY; - var text = ""; - //左右方向滑动 - if (Math.abs(tx) > Math.abs(ty)) { - return { - tx, - }; - } - //上下方向滑动 - else { - return { - ty, - }; - } - }, - // 触摸开始事件 - handletouchtart: function (event) { - this.data.lastX = event.touches[0].pageX; - this.data.lastY = event.touches[0].pageY; - }, searchAnimate() { let that = this; wx.createSelectorQuery() @@ -3025,22 +1779,6 @@ Page({ url: "/pages/filterPage/index", }); }, - goMap(){ - wx.getLocation({ - type: 'gcj02', //返回可以用于wx.openLocation的经纬度 - success (res) { - const latitude = 34.757034; - const longitude = 113.772587; - wx.openLocation({ - latitude, - longitude, - name:'郑州一才企业管理有限公司', - address:'河南省郑州市管城回族区心怡路与东站南街交叉口郑东升龙广场2号楼5楼', - scale: 18 - }) - } - }) - }, makePhone(e){ var that = this; var tel = e.currentTarget.dataset.tel;