diff --git a/app.json b/app.json index 6fdcf0e..cde81a0 100644 --- a/app.json +++ b/app.json @@ -70,19 +70,27 @@ "pages/justShowName/index", "pages/justShowID/index", "pages/specialArea/index", + "pages/special/index", "pages/bannerDetail/index", "pages/zhijiaoIndex/index" ], "window": { - "backgroundTextStyle": "light", - "navigationBarBackgroundColor": "#027AFF", - "navigationBarTextStyle": "white", - "navigationBarTitleText": "伯才" + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTextStyle": "black", + "navigationBarTitleText": "一才", + "backgroundColor": "#eeeeee", + "backgroundTextStyle": "light" + }, + "plugins": { + "job-plugin": { + "version": "1.0.2", + "provider": "wxaf516c59d925481f" + } }, "tabBar": { "color": "#666", "borderStyle": "black", - "selectedColor": "#027AFF", + "selectedColor": "#0dcc91", "list": [ { "iconPath": "/images/job.png", diff --git a/images/job.png b/images/job.png index 8cfc81d..6ac9003 100644 Binary files a/images/job.png and b/images/job.png differ diff --git a/images/job1.png b/images/job1.png index 72ac533..30a4d33 100644 Binary files a/images/job1.png and b/images/job1.png differ diff --git a/images/me.png b/images/me.png index e8e5b96..d612e55 100644 Binary files a/images/me.png and b/images/me.png differ diff --git a/images/me1.png b/images/me1.png index f2244ee..5552658 100644 Binary files a/images/me1.png and b/images/me1.png differ diff --git a/images/msg.png b/images/msg.png new file mode 100644 index 0000000..3069404 Binary files /dev/null and b/images/msg.png differ diff --git a/images/msg1.png b/images/msg1.png new file mode 100644 index 0000000..748900a Binary files /dev/null and b/images/msg1.png differ diff --git a/images/消息.png b/images/消息.png new file mode 100644 index 0000000..1a605b6 Binary files /dev/null and b/images/消息.png differ diff --git a/images/消息1.png b/images/消息1.png new file mode 100644 index 0000000..4155b87 Binary files /dev/null and b/images/消息1.png differ diff --git a/pages/detail/index.js b/pages/detail/index.js index 7b80c4c..c4c2a71 100644 --- a/pages/detail/index.js +++ b/pages/detail/index.js @@ -1,918 +1,80 @@ - -const app = getApp(); -const commonUtil = require("../../utils/commonUtil.js"); -const { wxml, style } = require('./demo.js') -var QQMapWX = require('../../utils/qqmap-wx-jssdk.min.js'); -var qqmapsdk; - - +// pages/detail/index.js Page({ - data: { - citys: "", - storeJobId: "", - currIndex: '1', - //职位ID - searchForm: { - storeJobId: "", - lng: "", - lat: "" - }, - fullScreen:false, - labelColor: ["#c41d7f", "#096dd9", "#531dab", "#d46b08", "#389e0d", "#08979c", "#cf1322"], - bgColor: ["#fff0f6", "#e6f7ff", "#f9f0ff", "#fff7e6", "#f6ffed", "#e6fffb", "#fff1f0"], - jobDetail: {}, //详情 - wxCode: '', - pbtm:0, - shareTitle:'', - isCollect:false, - src: '', - word:'woca', - phoneDialog:false, - isImg: true, - wxml: { - text: "啊啊按", - }, - - }, - onShow() { - var that = this; - this.setData({ - isLogin: app.globalData.isLogin - }); - if (!app.globalData.isLogin) { - this.wxLogin(); - } - }, - showphone:function(){ - this.setData({ - phoneDialog: true - }); - }, - close: function () { - this.setData({ - phoneDialog:false, - }) - }, - wxLogin() { - var that = this; - wx.login({ - success(res) { - if (res.code) { - that.setData({ - wxCode: res.code - }); - - } else { - console.log('获取code失败!' + res.errMsg) - } - } - }) - }, - showImage(e){ - let resImg = e.currentTarget.dataset.src; - console.log(this.data.jobDetail.storeImage); - var imgArr = []; - - this.data.jobDetail.storeImage.forEach((item) => { - // let regs = /\.(jpg|jpeg|png)(\?.*)?$/; - // item.isImg = regs.test(item.url.toLowerCase()); - if (item.isImg) { - imgArr.push(item.url); - } - }); - wx.previewImage({ - current: e.currentTarget.dataset.src, // 当前显示图片的http链接 - urls: imgArr, - }); - }, - renderToCanvas() { - const p1 = this.widget.renderToCanvas({ wxml:wxml(that.data.wxml), style }) - p1.then((res) => { - console.log('container', res.layoutBox) - this.container = res - console.log(res); - }) - }, - extraImage() { - var that = this; - // return new Promise(function (resolve, reject) { - that.widget.renderToCanvas({ wxml:wxml(that.data.wxml), style }).then(res1 => { - const p2 = that.widget.canvasToTempFilePath() - p2.then(res => { - console.log(res); - that.setData({ - src: res.tempFilePath, - }) - }) - }); - // }); - }, - onLoad(query) { - var that = this; - that.widget = that.selectComponent('.widget') - wx.getSystemInfo({ - success: res => { - console.log('手机信息res' + res.model) - let modelmes = res.model; - console.log(modelmes.search('iPhone X')); - if (modelmes.search('iPhone 12 Pro') != -1 || modelmes.search('iPhone X') != -1 || modelmes.search('iPhone XR') != -1 || modelmes.search('iPhone XS max') != -1 || modelmes.search('iPhone 11') != -1) { - that.setData({ - pbtm: 40 - }) - } else { - - } - } - }) - - qqmapsdk = new QQMapWX({ - key: '5PTBZ-YI7C6-MZGS3-ES7QN-4T5O2-EJFVR' - }); - - - - console.log('HHHHHHHHHHHHH' + query.storeJobId); - this.data.searchForm.storeJobId = query.storeJobId; - // this.data.wxCode = query.wxCode; - // this.getLocation(); - this.getStoreJobDetailById(); - // that.setData({ - // wxCode: that.data.wxCode - // }) - wx.setStorageSync({ - key: "storeJobId", - data: query.storeJobId - }); - - let agencyUserId = query.agencyUserId; - if(agencyUserId) { - wx.setStorageSync('storageSyncAgencyUserId', agencyUserId); - console.log('agencyUserId', agencyUserId) - app.globalData.isCommission = 1; - } - - }, - openMap(e){ - wx.showLoading({ - title: '加载中', - }) - console.log(e); - let address = e.currentTarget.dataset.address; - let lat = e.currentTarget.dataset.lat; - var formatted_addresses = "" - qqmapsdk.reverseGeocoder({ - location:`${e.currentTarget.dataset.lat},${e.currentTarget.dataset.lng}`, - success: function(res) { - console.log(res); - formatted_addresses = res.result.formatted_addresses.recommend; - } - }) - - - - - console.log(address); - console.log(formatted_addresses); - wx.getLocation({ - type: 'gcj02', //返回可以用于wx.openLocation的经纬度 - success (res) { - wx.openLocation({ - latitude: e.currentTarget.dataset.lat - 0, - longitude :e.currentTarget.dataset.lng - 0, - name:formatted_addresses, - address:address, - scale: 8 - }) - }, - complete(res){ - wx.hideLoading(); - console.log(1123213); - } - }) - }, - changeMenu(e) { - let currentIndex = parseInt(e.currentTarget.dataset.id); - this.setData({ - currIndex: e.currentTarget.dataset.id - }) - }, - getLocation() { - var that = this; - - wx.getSetting({ - success: res => { - console.log(res); // res.authSetting.location - - if (res.authSetting.location) { - wx.getLocation({ - success(res1) { - console.log("获取位置"); - console.log(res1); - - if ( - app.isNotEmptyCheck(res1.latitude) && - app.isNotEmptyCheck(res1.longitude) - ) { - that.data.searchForm.lat = res1.latitude; - that.data.searchForm.lng = res1.longitude; - } - - that.getStoreJobDetailById(); - }, - - fail() { - that.getStoreJobDetailById(); - } - }); - } else { - that.getStoreJobDetailById(); - } - } - }); // my.getLocation({ - // success(res) { - // my.hideLoading(); - // console.log(res) - // that.data.searchForm.lng = res.longitude; - // that.data.searchForm.lat = res.latitude; - // that.getStoreJobDetailById(); - // }, - // fail() { - // my.hideLoading(); - // that.getStoreJobDetailById(); - // }, - // }) - }, - onShareAppMessage: function () { - var path = commonUtil.getCurrentPageUrlWithArgs(); - if(app.globalData.isLogin && app.globalData.agencyStatus - 0 != 0) {//当前用户是代理人 - path += '&agencyUserId=' + app.globalData.loginUserInfo.id; - } - var that = this; - // const promise = new Promise(resolve => { - // that.widget.renderToCanvas({ wxml:wxml(that.data.jobDetail), style }).then(res1 => { - // const p2 = that.widget.canvasToTempFilePath() - // p2.then(res => { - // console.log(res); - // resolve({ - // title:that.data.shareTitle, - // imageUrl: res.tempFilePath, - // }) - - // }) - - // }); - // }); - return { - "title":that.data.shareTitle, - 'imageUrl':that.data.src , - 'path': path, - // promise - } - }, - showVideo(e) { - console.log(e); - console.log(wx.getSystemInfo()); - var that = this; - this.videoContext = wx.createVideoContext(`${e.target.dataset.id}`, this); - this.videoContext.requestFullScreen(); - this.videoContext.hideStatusBar(); - this.videoContext.play(); - setTimeout(() => { - that.setData({ - isShareShow: true, + /** + * 页面的初始数据 + */ + data: { + id:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + id:options.id + }) + }, + sub_enroll: function (e) { + console.log("↓↓↓↓↓↓↓↓↓↓↓↓") + console.log(e.detail) + wx.navigateTo({ + url: '../enroll/index?jd='+e.detail, + }) + }, + sendTitle(e){ + wx.setNavigationBarTitle({ + title:e.detail }); - }, 500); - }, - fullScreen(e) { - console.log(e); - if (!e.detail.fullScreen) { - this.setData({ - isShareShow: false, - }); - this.videoContext.stop(); - } - }, - - // play(e) { - // //执行全屏方法 - // var id = e.currentTarget.id; - // var videoContext = wx.createVideoContext("a"+id , this); - // videoContext.requestFullScreen(); - // setTimeout(()=>{ - // videoContext.play(); - // },100) - // this.setData({ - // fullScreen:true - // }) - - // }, - // screenChange(e){ - // console.log(e.currentTarget.id); - // var id = e.currentTarget.id; - // var videoContext = wx.createVideoContext(id , this); - // let fullScreen = e.detail.fullScreen //值true为进入全屏,false为退出全屏 - // if (!fullScreen ){ //退出全屏 - // videoContext.pause() - // this.setData({ - // controls: false - // }) - // }else{ //进入全屏 - // this.setData({ - // controls: true - // }) - // } - // }, - - // closeVideo(e) { - // var id = e.currentTarget.id; - // //执行退出全屏方法 - // var videoContext = wx.createVideoContext('a'+id, this); - // videoContext.exitFullScreen(); - // }, - // /**视屏进入、退出全屏 */ - // fullScreen(e){ - // var isFull = e.detail.fullScreen; - // //视屏全屏时显示加载video,非全屏时,不显示加载video - // this.setData({ - // fullScreen:isFull - // }) - // }, - - - onShareTimeline:function(){ - return { - title:this.data.shareTitle, - query:"?storeJobId="+ this.data.storeJobId - } - }, - - getStoreJobDetailById() { - var that = this; - wx.request({ - // url: app.globalData.ip + "/store/job/getStoreJobDetailById?storeJobId=" + that.data.searchForm.storeJobId, - url: app.globalData.ip + "/overall/store/job/getStoreJobDetailById?storeJobId=" + that.data.searchForm.storeJobId, - method: "POST", - header: app.globalData.headers, - data: that.data.searchForm, - success: function (res) { - console.log(res); - var result = res.data.data; - var title = result.storeJob.jobName; - // var title1 = result.store.aliasName; - // that.data.logo2 - - console.log(title); - that.setData({ - shareTitle: title, - }) - - let regs = /\.(jpg|jpeg|png)(\?.*)?$/ - res.data.data.storeImage.forEach((item)=>{ - item.isImg = regs.test(item.url.toLowerCase()) - }) - console.log(res); - - console.log(that.data.jobDetail); - if (app.isNotEmptyCheck(title)) { - title = result.storeJob.jobName; - } else { - title = result.store.aliasName; - } - - wx.setNavigationBarTitle({ - title - }); - - result.storeJob.workType = commonUtil.getWorkTypeById( - result.storeJob.workTypeMulti - ); - - if ( - app.isNotEmptyCheck(result.storeJob.calculationSalaryType) - ) { - result.storeJob.calculationSalaryType = result.storeJob.calculationSalaryType.split( - "#" - )[0]; - } - - if (app.isNotEmptyCheck(result.storeJob.paymentSalaryType)) { - result.storeJob.paymentSalaryType = result.storeJob.paymentSalaryType.split( - "," - ); - } - - if (app.isNotEmptyCheck(result.storeJob.salaryDesp)) { - result.storeJob.salaryDesp = result.storeJob.salaryDesp.split( - ";" - ); - } - - if (app.isNotEmptyCheck(result.storeJob.workDurationDesp)) { - result.storeJob.workDurationDesp = result.storeJob.workDurationDesp.split( - ";" - ); - } - - if (app.isNotEmptyCheck(result.storeJob.probationDesp)) { - result.storeJob.probationDesp = result.storeJob.probationDesp.split( - ";" - ); - } - - if (app.isNotEmptyCheck(result.storeJob.workingLunchDesp)) { - result.storeJob.workingLunchDesp = result.storeJob.workingLunchDesp.split( - ";" - ); - } - - if (app.isNotEmptyCheck(result.storeJob.dormitoryDesp)) { - result.storeJob.dormitoryDesp = result.storeJob.dormitoryDesp.split( - ";" - ); - } - - if (app.isNotEmptyCheck(result.storeJob.foregift)) { - result.storeJob.foregift = result.storeJob.foregift.split( - ";" - ); - var arrTemp = []; - result.storeJob.foregift.forEach(item => { - var arr = item.split(","); - - if (app.length > 0) { - arrTemp.push({ - item0: arr[0].split("#")[0], - item1: arr[1].split("#")[0] - }); - } - }); - result.storeJob.foregift = arrTemp; - } else { - result.storeJob.foregift = "无押金"; - } - - result.store.distance = commonUtil.getDistanceName( - result.store.distance - ); - if (app.isNotEmptyCheck(result.store.distance)) { - result.store.distance = '丨' + result.store.distance; - } - - /*if (app.isNotEmptyCheck(result.store.district)) { - var tempArr = result.store.district.split(","); - - if (tempArr.length == 1) { - result.store.district = tempArr[0]; - } else if (tempArr.length == 2) { - result.store.district = tempArr[0] + "" + tempArr[1]; - } else if (tempArr.length > 2) { - result.store.district = tempArr[1] + "" + tempArr[2]; - } - }*/ - // getStoreAddress - - - that.disposeJobListData(result); - if (app.isNotEmptyCheck(result.store.logo)) { - result['logo2'] = result.store.logo.replace("http:","http:"); - } else { - result['logo2'] = ''; - } - let citys = commonUtil.setJobInfoPosition(result.store.district) - result.storeJob.genderRestrict = commonUtil.getGenderByMinAge(result.storeJob) - that.setData({ - jobDetail: result, - citys: citys || "-", - }); - console.log(that.data.jobDetail); - } - }); - }, - - /** - * 处理后台返回的职位列表 - */ - disposeJobListData(jobDetail) { - var that = this; - - // item["workType"] = commonUtil.getWorkTypeById( - // item.workTypeMulti - // ); - - // if (app.isNotEmptyCheck(item.distance)) { - // item["distanceKm"] = commonUtil.getDistanceName( - // item.distance - // ); - // } - //年龄 - var ageStr = ''; - if (app.isNotEmptyCheck(jobDetail.storeJob.minAge) && app.isNotEmptyCheck(jobDetail.storeJob.maxAge)) { - ageStr = jobDetail.storeJob.minAge + '-' + jobDetail.storeJob.maxAge + '岁'; - } else if (app.isNotEmptyCheck(jobDetail.storeJob.minAge)) { - ageStr = jobDetail.storeJob.minAge + '岁以上'; - } else if (app.isNotEmptyCheck(jobDetail.storeJob.maxAge)) { - ageStr = jobDetail.storeJob.maxAge + '岁以下'; - } - jobDetail.storeJob["age"] = ageStr; - // //时薪 - // var hourlyPayStr = ''; - // var hasHourlyPay = false; - // if (app.isNotEmptyCheck(jobDetail.storeJob.hourlyPay)) { - // hourlyPayStr = jobDetail.storeJob.hourlyPay + '元/小时'; - // hasHourlyPay = true; - // } else if (app.isNotEmptyCheck(jobDetail.storeJob.dayPay)) { - // hourlyPayStr = jobDetail.storeJob.dayPay + '元/日'; - // hasHourlyPay = true; - // } else { - // if (app.isNotEmptyCheck(jobDetail.storeJob.minMonthlyPay) && app.isNotEmptyCheck(jobDetail.storeJob.maxMonthlyPay)) { - // if (jobDetail.storeJob.minMonthlyPay == jobDetail.storeJob.maxMonthlyPay) { - // hourlyPayStr = jobDetail.storeJob.minMonthlyPay; - // } else { - // hourlyPayStr = jobDetail.storeJob.minMonthlyPay + '-' + jobDetail.storeJob.maxMonthlyPay; - // } - // } else if (app.isNotEmptyCheck(jobDetail.storeJob.minMonthlyPay)) { - // hourlyPayStr = jobDetail.storeJob.minMonthlyPay; - // } else if (app.isNotEmptyCheck(jobDetail.storeJob.maxMonthlyPay)) { - // hourlyPayStr = jobDetail.storeJob.maxMonthlyPay; - // } - // } - // jobDetail.storeJob["hourlyPay"] = hourlyPayStr; - jobDetail.storeJob["salaryClassifyValue"] = commonUtil.getSalaryClassifyValue(jobDetail.storeJob.salaryClassify, jobDetail.storeJob.salaryClassifyValue); - //月薪 - var monthlyPayStr = ''; - // if (hasHourlyPay) { - if (app.isNotEmptyCheck(jobDetail.storeJob.minMonthlyPay) && app.isNotEmptyCheck(jobDetail.storeJob.maxMonthlyPay)) { - if (jobDetail.storeJob.minMonthlyPay == jobDetail.storeJob.maxMonthlyPay) { - monthlyPayStr = jobDetail.storeJob.minMonthlyPay; - } else { - monthlyPayStr = jobDetail.storeJob.minMonthlyPay + '-' + jobDetail.storeJob.maxMonthlyPay; - } - } else if (app.isNotEmptyCheck(jobDetail.storeJob.minMonthlyPay)) { - monthlyPayStr = jobDetail.storeJob.minMonthlyPay; - } else if (app.isNotEmptyCheck(jobDetail.storeJob.maxMonthlyPay)) { - monthlyPayStr = jobDetail.storeJob.maxMonthlyPay; - } - // } - jobDetail.storeJob["monthlyPay"] = monthlyPayStr; - //地址深圳丨龙岗区丨 - var districtStr = ''; - if (app.isNotEmptyCheck(jobDetail.storeJob.district)) { - var districtArr = jobDetail.storeJob.district.split(','); - if(districtArr.length < 3) { - districtStr = districtArr[districtArr.length - 1]; - } else { - districtStr = districtArr[1] + '丨' + districtArr[2]; - } - //districtStr = districtArr[1] + '丨' + districtArr[2]; - } - jobDetail.storeJob["districtStr"] = districtStr; - jobDetail.storeJob["districtDetail"] = commonUtil.getStoreAddress(jobDetail.storeJob.district, jobDetail.storeJob.detailPosition); - - //职位特色 - if (app.isNotEmptyCheck(jobDetail.storeJob.jobSpecialLabelNames)) { - jobDetail.storeJob['jobSpecialLabelNames'] = that.getJobSpecialLabelNamesArray(jobDetail.storeJob.jobSpecialLabelNames); - } + }, - }, - getJobSpecialLabelNamesArray(jobSpecialLabelNames) { - if (app.isNotEmptyCheck(jobSpecialLabelNames)) { - return jobSpecialLabelNames.split(', '); - } - return []; - }, - goSimilar() { - var that = this; + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { - console.log(that.data.jobDetail) - console.log(that.data.jobDetail.storeJob.jobLabelId) + }, - wx.navigateTo({ - url: "../similar/index?brandId=" + - that.data.jobDetail.store.brandId + - "&jobLabelId=" + - that.data.jobDetail.storeJob.jobLabelId + - "&classify=99" - }); - }, + /** + * 生命周期函数--监听页面显示 + */ + onShow() { - makePhoneCall() { - console.log(1); - var that = this; - wx.makePhoneCall({ - // number: that.data.jobDetail.assistantUserTel + "" - phoneNumber:'18039237825' - }); - // var that = this; + }, - // let res = wx.getStorageSync({ - // key: "assistantUserTel" - // }); + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { - // console.log(res); - // console.log("缓存获取电话号:" + res.data); + }, - // if (app.isNotEmptyCheck(res.data)) { - // wx.makePhoneCall({ - // number: res.data - // }); - // } else { - // wx.request({ - // url: app.globalData.ip + "/store/job/getOneAssistantUser", - // method: "POST", - // header: app.globalData.headers, - // data: {}, - // success: function (res) { - // console.log(res.data.data.tel); + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { - // wx.setStorageSync({ - // key: "assistantUserTel", - // data: res.data.data.tel - // }); + }, - // wx.makePhoneCall({ - // number: res.data.data.tel + "" - // }); - // } - // }); - // } - }, - textPaste() { - var that = this; - wx.setClipboardData({ - // data: that.data.jobDetail.assistantUserWechat, - data:'18039237825', - success: function (res) { - wx.getClipboardData({ - success: function (res) { - wx.showToast({ - icon: "none", - title: '已复制微信号,快去添加好友吧', - duration:0, - }) - wx.showModal({ - title: '已复制微信号', - content: '快去搜索添加经纪人好友吧', - showCancel:false, - success (res) { - if (res.confirm) { - console.log('用户点击确定') - } else if (res.cancel) { - console.log('用户点击取消') - } - } - }) - - console.log(res.data) // data - } - }) - } - }) - }, - /*collectPaste() { - var txt; - var that = this; - if(!this.data.isCollect){ - that.setData({ - isCollect: true - }) - txt = '收藏成功' - }else{ - that.setData({ - isCollect: false - }) - txt = '取消收藏' - } - wx.showToast({ - icon: "none", - title: txt, - }) - - },*/ - goEnroll() { - var that = this; + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { - // wx.setStorageSync({ - // key: "jobDetailStorage", - // data: that.data.jobDetail - // }); - wx.setStorageSync('jobDetailStorage', that.data.jobDetail.storeJob); - // wx.navigateTo({ - // url: "../enroll/index?applyType=1" - // }); + }, - wx.navigateTo({ - url: "../enroll/index?applyType=1&tel=" + app.globalData.loginUserInfo.tel - }); - }, - emptyMethod() { + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { - }, - wxLogin() { - var that = this; - wx.login({ - success(res) { - if (res.code) { - that.setData({ - wxCode: res.code - }); - - } else { - console.log('获取code失败!' + res.errMsg) - } - } - }) - }, - getPhoneNumber(e) { - var that = this; - console.log(e) - console.log(e.detail.errMsg) - console.log(that.data.jobDetail.storeJob); - /*wx.setStorageSync({ - key: "jobDetailStorage", - data: that.data.jobDetail.storeJob, - });*/ - wx.setStorageSync('jobDetailStorage', that.data.jobDetail.storeJob); - // 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, - }, - success: function (res) { - console.log(res); - app.globalData.openId = res.data.data.openId; - let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); - var collected = e.currentTarget.dataset.collected; - if(collected) { - promise.then(res => { - that.setData({ - isLogin: app.globalData.isLogin - }); - that.doCollected(collected, e.currentTarget.dataset.jobid); - }) - } else { - /*wx.navigateTo({ - url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber - });*/ - promise.then(res => { - wx.navigateTo({ - //url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber - url: "../enroll/index?applyType=1" - }); - }) - } - // wx.navigateTo({ - // url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber - // }); - }, - 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, - }, - success: function (res) { - console.log(res); + }, - let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); - - var collected = e.currentTarget.dataset.collected; - if(collected) { - promise.then(res => { - that.setData({ - isLogin: app.globalData.isLogin - }); - that.doCollected(collected, e.currentTarget.dataset.jobid); - }); - - } else { - promise.then(res => { - wx.navigateTo({ - //url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber - url: "../enroll/index?applyType=1" - }); - }) - - } - }, - fail: function (res) { - console.log("获取用户手机号错误"); - } - }) - } else { - console.log('获取手机号失败!' + res.errMsg) - } - } - }) - } - }) - - } else {//拒绝 - var collected = e.currentTarget.dataset.collected; - if (collected) { - try { - wx.setStorageSync('comeFromPage', 'detail'); - wx.setStorageSync('comeFromPageParam', {storeJobId: that.data.searchForm.storeJobId}); - } catch (e) { - console.log("detail-页面跳转,设置参数错误:", e); - } - wx.navigateTo({ - url: '/pages/login/index', - }) - } else { - wx.navigateTo({ - //url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber - url: "../enroll/index?applyType=1" - }); - } - } - return false; - }, + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { - collectPaste(e) { - var txt; - var that = this; - 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) {//取消收藏 - that.data.jobDetail.storeJob.collected = 2; - txt = '取消收藏'; - } else {//收藏 - that.data.jobDetail.storeJob.collected = 1; - txt = '收藏成功'; - } - that.setData({ - jobDetail: that.data.jobDetail, - isLogin: app.globalData.isLogin - }); - console.log(that.data.jobDetail) - wx.showToast({ - icon: "none", - title: txt, - }) - }, - fail: function (res) { - console.log("操作失败"); - } - }) - }, -}); + } +}) \ No newline at end of file diff --git a/pages/detail/index.json b/pages/detail/index.json index 71119b2..aa61bd4 100644 --- a/pages/detail/index.json +++ b/pages/detail/index.json @@ -1,6 +1,6 @@ { - "usingComponents": { - "wxml-to-canvas": "wxml-to-canvas" - }, - "navigationBarTitleText": " " -} + "usingComponents": { + "di": "plugin://job-plugin/detail" + } + +} \ No newline at end of file diff --git a/pages/detail/index.wxml b/pages/detail/index.wxml index e684eb7..8e32a14 100644 --- a/pages/detail/index.wxml +++ b/pages/detail/index.wxml @@ -1,317 +1,2 @@ - - - - - - - - - {{jobDetail.storeJob.jobName}} - - - - - - - - - - - - - - - {{citys}}{{jobDetail.store.distance}} - - - - - {{jobDetail.storeJob.genderRestrict}} - 丨{{jobDetail.storeJob.age}} - - - - - - - - - {{jobDetail.storeJob.salaryClassifyValue}} - - - - {{jobDetail.storeJob.monthlyPay}} - - - - - - - - {{item1}} - - - {{item1}} - - - - - - - - - {{jobDetail.poses.store.posContent ? jobDetail.poses.store.posContent :'暂无地址信息'}} - - - - - - - - - - - - - - - - - - - - - - 薪资待遇 - - - 薪资明细 - {{jobDetail.storeJob.salaryDetail}} - - - 薪资发放 - {{jobDetail.storeJob.payDay}} - - - 银行卡 - {{jobDetail.storeJob.bankInfo}} - - - 工期 - {{jobDetail.storeJob.workCycle}} - - - 培训 - {{jobDetail.storeJob.training}} - - - 试用期 - {{jobDetail.storeJob.probation}} - - - 福利待遇 - {{jobDetail.storeJob.boon}} - - - 薪资说明 - {{jobDetail.storeJob.salaryDesp}} - - - 招聘要求 - - - 性别年龄 - {{showSexAgeText}} - - - 文化学历 - {{jobDetail.storeJob.education}} - - - - - - - 证件 - {{jobDetail.storeJob.idCard}} - - - - 疑难杂症 - {{jobDetail.storeJob.otherRequire}} - - - - - 体检 - {{jobDetail.storeJob.healthRequire}} - - - - 岗位说明 - - - 工作内容 - {{jobDetail.storeJob.workContent}} - - - 工作方式 - {{jobDetail.storeJob.workMode}} - - - 班次工时 - {{jobDetail.storeJob.workClasses}} - - - 工作衣 - {{jobDetail.storeJob.workClothes}} - - - 车间 - {{jobDetail.storeJob.securityCheck}} - - - 保险 - {{jobDetail.storeJob.employeeInsurance}} - - - 换岗调班 - {{jobDetail.storeJob.otherDesp}} - - - 吃饭住宿 - - - 吃饭 - - - 吃饭 - {{jobDetail.storeJob.workingLunch}} - - - - - - 住宿 - - - 住宿费用 - {{jobDetail.storeJob.dormitory}} - - - 宿舍设施 - {{jobDetail.storeJob.dormitoryFacilities}} - - - 宿舍距离 - {{jobDetail.storeJob.dormDistance}} - - - 厂车 - {{jobDetail.storeJob.bus}} - - - - 住宿要求 - {{jobDetail.storeJob.dormitoryDesp}} - - - - - - 其它信息 - {{jobDetail.storeJob.OtherInfo}} - - - - - - - - - - - 电话 - - - - - - - 微信 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 孔老师 - 人才经纪人 - - 18039237825 - - - - 取消 - - - - - - - \ No newline at end of file + + diff --git a/pages/detail/index.wxss b/pages/detail/index.wxss index 6368e91..a17762a 100644 --- a/pages/detail/index.wxss +++ b/pages/detail/index.wxss @@ -1,372 +1,4 @@ -page, -.pb180 { - padding-bottom: 120px; -} - -.bottomBtn { - position: fixed; - width: 100%; - left: 0; - bottom: 0; - background-color: #fff; - border-top: 1px solid rgba(0, 0, 0, 0.08); -} -.mt3{ - margin-top: 3px; -} -.sharebtn{ - padding-right: 0; - margin: 0; - display: inline; - background-color: transparent; - line-height: 1; - float:right; - margin-top: 5px; -} -.ml2{ - margin-left: 2px; -} -.am-button { - margin-top: 0; - margin-bottom: 0; -} - -.activeList { - display: flex; - text-align: center; -} -button::after{ - border: 0; -} - -.menu { - flex: 1; - line-height: 1.5; - font-size: 16px; - color: rgba(0, 0, 0, 0.65); - border-bottom: 4px solid transparent; -} - -.menu.active { - font-weight: 601; - color: rgba(0, 0, 0, 0.85); - border-bottom: 4px solid #FE633F; -} -.icon-wode-shoucang{ - color: #787878 !important; -} -.icon-shoucang-red{ - color: #DA0106 !important; -} -.scrollImg { - /* width: 67px; - height: 67px; - margin-right: 12px; - margin-top: 20px; */ - /* margin-top: 16px; */ -} - -.show{ - display:show; - } - .hide{ - display:none; - } - -.scroll-header { - display: flex; - white-space: nowrap; -} - -.scroll-header view { - - display: inline-block; -} - -.scroll-header image:first-child { - margin-left: 0px; -} -button.detailBtn{ - margin-bottom: 0; - padding: 7px 0; - font-size: 18px; - font-weight: 601; - color: #ffffff; - line-height: 26px; - margin-top: 8px; - background: #027AFF; -border-radius: 21px; -margin-bottom: 16px; -} -.flex-1.f14.c085{ -/* white-space: pre-wrap; */ -white-space: pre-line; -font-size: 17px; -line-height: 28px; -} -button.collectBtn{ - margin: 0; - padding: 0; - line-height: 1.4; - padding: 0; - background-color: #fff; - /* text-align: left; */ - /* background-color: #fff; */ -} -.tagsLi{ - height: 20px; - font-size: 14px; - font-weight: 400; - margin-right: 8px; - margin-bottom: 8px; - color: #888; - line-height: 18px; - padding: 0px 4px; -} -.pb4{ - padding-bottom: 4px; -} -.mg020 { - margin: 0 20px; -} -.dName{ - font-size: 16px; - font-weight: 601; - color: #262626; - line-height: 22px; -} -.dsName{ - font-size: 12px; - font-weight: 400; - color: #8c8c8c; - line-height: 17px; -} -.ava{ - width: 48px; - height: 48px; - border-radius: 50%; - margin-right: 14px; -} -.f25{ - font-size: 25px; -} -.p20-0{ - padding: 20px 0; - margin-bottom: 20px; -} -.p020{ - padding: 0 20px; -} -.dianhua{ - color: #787878; -} -.achover .dianhua{ - color:#999; -} -.scrollImgBox { - position: relative; - border-radius: 4px; - width: 60px; - height: 60px; - margin: 12px 5px; - overflow: hidden; -} -image { - max-width: 100%; - max-height: 100%; -} -.show { - display: show; -} -.hide { - display: none; -} -.p020 { - padding: 0 20px; -} -.scroll-header { - display: flex; - white-space: nowrap; -} - -.scroll-header view { - display: inline-block; -} -.scroll-header video { - width: 100%; - height: 100%; - border-radius: 8px; -} -.scroll-header image:first-child { - margin-left: 0px; -} -.storeTitle{ - font-size: 18px; - font-weight: 601; - color: #262626; - line-height: 25px; - /* margin-bottom: 10px; */ -} -.storeInfo{ - font-size: 15px; - font-weight: 400; - color: #939393; - line-height: 21px; - white-space: pre-line; -} -.address{ - font-size: 15px; -font-weight: 400; -color: #333; -line-height: 21px; -flex: 1; -} -.btext{ - font-size: 11px; - font-weight: 400; - color: #444444; - line-height: 16px; - margin-top: 2px; -} -.flex-3{ - flex: 3; -} -.noShow{ - position: absolute; - top: -9999px; -} -.detailH3 { - font-size: 16px; - font-weight: 400; - color: #000; - line-height: 22px; - margin-top: 16px; - margin-bottom: 8px; -} -.pri { - white-space: pre-line; -} -.pri:empty:before, -.textb1:empty:before { - content: "-" !important; - color: #333; -} -.outSp { - border: 1px solid #f3f3f3; - border-radius: 4px; - /* line-height: 56rpx; */ -} -.outSp .display-flex:last-child .rb1, -.outSp .display-flex:last-child .textb1 { - border-bottom: 0; -} -.sbb1 { - border-bottom: 1rpx solid #eee !important; -} -.tabBox .display-flex { - flex-wrap: wrap; -} -.tabBox .display-flex > view { - margin-bottom: 8px; -} -.rb1 { - font-size: 14px; - color: #666; - text-align: center; - width: 80px; - border-right: 1px solid #f3f3f3; - border-bottom: 1px solid #f3f3f3; - display: flex; - align-items: center; - justify-content: center; -} -.textb1 { - white-space: pre-line; - color: #333; - border-bottom: 1px solid #f3f3f3; - padding: 0 8px; - flex: 1; - line-height: 1.8; - padding-top: 3px; -} -.jobMoney { - color: var(--color-ysd); -} -.c633 { - color: var(--color-027); -} -.videoContainer::after { - content: ""; - width: 0; - height: 0; - border: 10px solid #ffffffbb; - border-right-color: transparent; - border-top-color: transparent; - border-left-width: 16px; - border-right-width: 0px; - border-bottom-color: transparent; - left: 50%; - top: 50%; - border-radius: 3px; - transform: translate(-50%, -50%); - /* background-color: #ffffff; */ - position: absolute; - z-index: 10; -} -.theVideo { - position: relative; -} -.theVideo .t-icon { - position: absolute; - bottom: 80px; - right: 30px; - width: 20px; - height: 24px; - background-repeat: no-repeat; - background-size: 100%; - z-index: 1111; -} -.theVideo .t-icon::after { - position: absolute; - content: ""; - width: 44px; - height: 44px; - left: 50%; - top: 50%; - transform: translate(-50%, -55%); - background-color: #ffffff66; - border-radius: 50%; -} -.t-icon-ziying1 { - background-repeat: no-repeat; - display: inline-block; - width: 32px; - height: 20px; - margin-right: 6px; -} -.ml18{ - margin-left: 18px; -} -.mask { - position: fixed; - width: 100vw; - height: 100vh; - background-color: rgba(0, 0, 0, 0.3); - top: 0; - left: 0; - z-index: 99; - pointer-events: none; - /* display: none; */ -} -.norecruit { - position: absolute; - width: 100%; - height: 38px; - line-height: 38px; - top: -38px; - font-size: 14px; - text-align: center; - background-color: #666; - color: #fff; - /* display: none; */ -} +/* pages/detail/index.wxss */ +page{ + padding-bottom: 120px; +} \ No newline at end of file diff --git a/pages/detail/demo.js b/pages/detail的副本/demo.js similarity index 100% rename from pages/detail/demo.js rename to pages/detail的副本/demo.js diff --git a/pages/detail的副本/index.js b/pages/detail的副本/index.js new file mode 100644 index 0000000..7b80c4c --- /dev/null +++ b/pages/detail的副本/index.js @@ -0,0 +1,918 @@ + +const app = getApp(); +const commonUtil = require("../../utils/commonUtil.js"); +const { wxml, style } = require('./demo.js') +var QQMapWX = require('../../utils/qqmap-wx-jssdk.min.js'); +var qqmapsdk; + + +Page({ + data: { + citys: "", + storeJobId: "", + currIndex: '1', + //职位ID + searchForm: { + storeJobId: "", + lng: "", + lat: "" + }, + fullScreen:false, + labelColor: ["#c41d7f", "#096dd9", "#531dab", "#d46b08", "#389e0d", "#08979c", "#cf1322"], + bgColor: ["#fff0f6", "#e6f7ff", "#f9f0ff", "#fff7e6", "#f6ffed", "#e6fffb", "#fff1f0"], + jobDetail: {}, //详情 + wxCode: '', + pbtm:0, + shareTitle:'', + isCollect:false, + src: '', + word:'woca', + phoneDialog:false, + isImg: true, + wxml: { + text: "啊啊按", + }, + + }, + onShow() { + var that = this; + this.setData({ + isLogin: app.globalData.isLogin + }); + if (!app.globalData.isLogin) { + this.wxLogin(); + } + }, + showphone:function(){ + this.setData({ + phoneDialog: true + }); + }, + close: function () { + this.setData({ + phoneDialog:false, + }) + }, + wxLogin() { + var that = this; + wx.login({ + success(res) { + if (res.code) { + that.setData({ + wxCode: res.code + }); + + } else { + console.log('获取code失败!' + res.errMsg) + } + } + }) + }, + showImage(e){ + let resImg = e.currentTarget.dataset.src; + console.log(this.data.jobDetail.storeImage); + var imgArr = []; + + this.data.jobDetail.storeImage.forEach((item) => { + // let regs = /\.(jpg|jpeg|png)(\?.*)?$/; + // item.isImg = regs.test(item.url.toLowerCase()); + if (item.isImg) { + imgArr.push(item.url); + } + }); + wx.previewImage({ + current: e.currentTarget.dataset.src, // 当前显示图片的http链接 + urls: imgArr, + }); + }, + renderToCanvas() { + const p1 = this.widget.renderToCanvas({ wxml:wxml(that.data.wxml), style }) + p1.then((res) => { + console.log('container', res.layoutBox) + this.container = res + console.log(res); + }) + }, + extraImage() { + var that = this; + // return new Promise(function (resolve, reject) { + that.widget.renderToCanvas({ wxml:wxml(that.data.wxml), style }).then(res1 => { + const p2 = that.widget.canvasToTempFilePath() + p2.then(res => { + console.log(res); + that.setData({ + src: res.tempFilePath, + }) + }) + }); + // }); + }, + onLoad(query) { + var that = this; + that.widget = that.selectComponent('.widget') + wx.getSystemInfo({ + success: res => { + console.log('手机信息res' + res.model) + let modelmes = res.model; + console.log(modelmes.search('iPhone X')); + if (modelmes.search('iPhone 12 Pro') != -1 || modelmes.search('iPhone X') != -1 || modelmes.search('iPhone XR') != -1 || modelmes.search('iPhone XS max') != -1 || modelmes.search('iPhone 11') != -1) { + that.setData({ + pbtm: 40 + }) + } else { + + } + } + }) + + qqmapsdk = new QQMapWX({ + key: '5PTBZ-YI7C6-MZGS3-ES7QN-4T5O2-EJFVR' + }); + + + + console.log('HHHHHHHHHHHHH' + query.storeJobId); + this.data.searchForm.storeJobId = query.storeJobId; + // this.data.wxCode = query.wxCode; + // this.getLocation(); + this.getStoreJobDetailById(); + // that.setData({ + // wxCode: that.data.wxCode + // }) + wx.setStorageSync({ + key: "storeJobId", + data: query.storeJobId + }); + + let agencyUserId = query.agencyUserId; + if(agencyUserId) { + wx.setStorageSync('storageSyncAgencyUserId', agencyUserId); + console.log('agencyUserId', agencyUserId) + app.globalData.isCommission = 1; + } + + }, + openMap(e){ + wx.showLoading({ + title: '加载中', + }) + console.log(e); + let address = e.currentTarget.dataset.address; + let lat = e.currentTarget.dataset.lat; + var formatted_addresses = "" + + qqmapsdk.reverseGeocoder({ + location:`${e.currentTarget.dataset.lat},${e.currentTarget.dataset.lng}`, + success: function(res) { + console.log(res); + formatted_addresses = res.result.formatted_addresses.recommend; + } + }) + + + + + console.log(address); + console.log(formatted_addresses); + wx.getLocation({ + type: 'gcj02', //返回可以用于wx.openLocation的经纬度 + success (res) { + wx.openLocation({ + latitude: e.currentTarget.dataset.lat - 0, + longitude :e.currentTarget.dataset.lng - 0, + name:formatted_addresses, + address:address, + scale: 8 + }) + }, + complete(res){ + wx.hideLoading(); + console.log(1123213); + } + }) + }, + changeMenu(e) { + let currentIndex = parseInt(e.currentTarget.dataset.id); + this.setData({ + currIndex: e.currentTarget.dataset.id + }) + }, + getLocation() { + var that = this; + + wx.getSetting({ + success: res => { + console.log(res); // res.authSetting.location + + if (res.authSetting.location) { + wx.getLocation({ + success(res1) { + console.log("获取位置"); + console.log(res1); + + if ( + app.isNotEmptyCheck(res1.latitude) && + app.isNotEmptyCheck(res1.longitude) + ) { + that.data.searchForm.lat = res1.latitude; + that.data.searchForm.lng = res1.longitude; + } + + that.getStoreJobDetailById(); + }, + + fail() { + that.getStoreJobDetailById(); + } + }); + } else { + that.getStoreJobDetailById(); + } + } + }); // my.getLocation({ + // success(res) { + // my.hideLoading(); + // console.log(res) + // that.data.searchForm.lng = res.longitude; + // that.data.searchForm.lat = res.latitude; + // that.getStoreJobDetailById(); + // }, + // fail() { + // my.hideLoading(); + // that.getStoreJobDetailById(); + // }, + // }) + }, + onShareAppMessage: function () { + var path = commonUtil.getCurrentPageUrlWithArgs(); + if(app.globalData.isLogin && app.globalData.agencyStatus - 0 != 0) {//当前用户是代理人 + path += '&agencyUserId=' + app.globalData.loginUserInfo.id; + } + var that = this; + // const promise = new Promise(resolve => { + // that.widget.renderToCanvas({ wxml:wxml(that.data.jobDetail), style }).then(res1 => { + // const p2 = that.widget.canvasToTempFilePath() + // p2.then(res => { + // console.log(res); + // resolve({ + // title:that.data.shareTitle, + // imageUrl: res.tempFilePath, + // }) + + // }) + + // }); + // }); + return { + "title":that.data.shareTitle, + 'imageUrl':that.data.src , + 'path': path, + // promise + } + }, + showVideo(e) { + console.log(e); + console.log(wx.getSystemInfo()); + var that = this; + this.videoContext = wx.createVideoContext(`${e.target.dataset.id}`, this); + this.videoContext.requestFullScreen(); + this.videoContext.hideStatusBar(); + this.videoContext.play(); + setTimeout(() => { + that.setData({ + isShareShow: true, + }); + }, 500); + }, + fullScreen(e) { + console.log(e); + if (!e.detail.fullScreen) { + this.setData({ + isShareShow: false, + }); + this.videoContext.stop(); + } + }, + + // play(e) { + // //执行全屏方法 + // var id = e.currentTarget.id; + // var videoContext = wx.createVideoContext("a"+id , this); + // videoContext.requestFullScreen(); + // setTimeout(()=>{ + // videoContext.play(); + // },100) + // this.setData({ + // fullScreen:true + // }) + + // }, + // screenChange(e){ + // console.log(e.currentTarget.id); + // var id = e.currentTarget.id; + // var videoContext = wx.createVideoContext(id , this); + // let fullScreen = e.detail.fullScreen //值true为进入全屏,false为退出全屏 + // if (!fullScreen ){ //退出全屏 + // videoContext.pause() + // this.setData({ + // controls: false + // }) + // }else{ //进入全屏 + // this.setData({ + // controls: true + // }) + // } + // }, + + // closeVideo(e) { + // var id = e.currentTarget.id; + // //执行退出全屏方法 + // var videoContext = wx.createVideoContext('a'+id, this); + // videoContext.exitFullScreen(); + // }, + // /**视屏进入、退出全屏 */ + // fullScreen(e){ + // var isFull = e.detail.fullScreen; + // //视屏全屏时显示加载video,非全屏时,不显示加载video + // this.setData({ + // fullScreen:isFull + // }) + // }, + + + onShareTimeline:function(){ + return { + title:this.data.shareTitle, + query:"?storeJobId="+ this.data.storeJobId + } + }, + + getStoreJobDetailById() { + var that = this; + wx.request({ + // url: app.globalData.ip + "/store/job/getStoreJobDetailById?storeJobId=" + that.data.searchForm.storeJobId, + url: app.globalData.ip + "/overall/store/job/getStoreJobDetailById?storeJobId=" + that.data.searchForm.storeJobId, + method: "POST", + header: app.globalData.headers, + data: that.data.searchForm, + success: function (res) { + console.log(res); + var result = res.data.data; + var title = result.storeJob.jobName; + // var title1 = result.store.aliasName; + // that.data.logo2 + + console.log(title); + that.setData({ + shareTitle: title, + }) + + let regs = /\.(jpg|jpeg|png)(\?.*)?$/ + res.data.data.storeImage.forEach((item)=>{ + item.isImg = regs.test(item.url.toLowerCase()) + }) + console.log(res); + + console.log(that.data.jobDetail); + if (app.isNotEmptyCheck(title)) { + title = result.storeJob.jobName; + } else { + title = result.store.aliasName; + } + + wx.setNavigationBarTitle({ + title + }); + + result.storeJob.workType = commonUtil.getWorkTypeById( + result.storeJob.workTypeMulti + ); + + if ( + app.isNotEmptyCheck(result.storeJob.calculationSalaryType) + ) { + result.storeJob.calculationSalaryType = result.storeJob.calculationSalaryType.split( + "#" + )[0]; + } + + if (app.isNotEmptyCheck(result.storeJob.paymentSalaryType)) { + result.storeJob.paymentSalaryType = result.storeJob.paymentSalaryType.split( + "," + ); + } + + if (app.isNotEmptyCheck(result.storeJob.salaryDesp)) { + result.storeJob.salaryDesp = result.storeJob.salaryDesp.split( + ";" + ); + } + + if (app.isNotEmptyCheck(result.storeJob.workDurationDesp)) { + result.storeJob.workDurationDesp = result.storeJob.workDurationDesp.split( + ";" + ); + } + + if (app.isNotEmptyCheck(result.storeJob.probationDesp)) { + result.storeJob.probationDesp = result.storeJob.probationDesp.split( + ";" + ); + } + + if (app.isNotEmptyCheck(result.storeJob.workingLunchDesp)) { + result.storeJob.workingLunchDesp = result.storeJob.workingLunchDesp.split( + ";" + ); + } + + if (app.isNotEmptyCheck(result.storeJob.dormitoryDesp)) { + result.storeJob.dormitoryDesp = result.storeJob.dormitoryDesp.split( + ";" + ); + } + + if (app.isNotEmptyCheck(result.storeJob.foregift)) { + result.storeJob.foregift = result.storeJob.foregift.split( + ";" + ); + var arrTemp = []; + result.storeJob.foregift.forEach(item => { + var arr = item.split(","); + + if (app.length > 0) { + arrTemp.push({ + item0: arr[0].split("#")[0], + item1: arr[1].split("#")[0] + }); + } + }); + result.storeJob.foregift = arrTemp; + } else { + result.storeJob.foregift = "无押金"; + } + + result.store.distance = commonUtil.getDistanceName( + result.store.distance + ); + if (app.isNotEmptyCheck(result.store.distance)) { + result.store.distance = '丨' + result.store.distance; + } + + /*if (app.isNotEmptyCheck(result.store.district)) { + var tempArr = result.store.district.split(","); + + if (tempArr.length == 1) { + result.store.district = tempArr[0]; + } else if (tempArr.length == 2) { + result.store.district = tempArr[0] + "" + tempArr[1]; + } else if (tempArr.length > 2) { + result.store.district = tempArr[1] + "" + tempArr[2]; + } + }*/ + // getStoreAddress + + + that.disposeJobListData(result); + if (app.isNotEmptyCheck(result.store.logo)) { + result['logo2'] = result.store.logo.replace("http:","http:"); + } else { + result['logo2'] = ''; + } + let citys = commonUtil.setJobInfoPosition(result.store.district) + result.storeJob.genderRestrict = commonUtil.getGenderByMinAge(result.storeJob) + that.setData({ + jobDetail: result, + citys: citys || "-", + }); + console.log(that.data.jobDetail); + } + }); + }, + + /** + * 处理后台返回的职位列表 + */ + disposeJobListData(jobDetail) { + var that = this; + + // item["workType"] = commonUtil.getWorkTypeById( + // item.workTypeMulti + // ); + + // if (app.isNotEmptyCheck(item.distance)) { + // item["distanceKm"] = commonUtil.getDistanceName( + // item.distance + // ); + // } + //年龄 + var ageStr = ''; + if (app.isNotEmptyCheck(jobDetail.storeJob.minAge) && app.isNotEmptyCheck(jobDetail.storeJob.maxAge)) { + ageStr = jobDetail.storeJob.minAge + '-' + jobDetail.storeJob.maxAge + '岁'; + } else if (app.isNotEmptyCheck(jobDetail.storeJob.minAge)) { + ageStr = jobDetail.storeJob.minAge + '岁以上'; + } else if (app.isNotEmptyCheck(jobDetail.storeJob.maxAge)) { + ageStr = jobDetail.storeJob.maxAge + '岁以下'; + } + jobDetail.storeJob["age"] = ageStr; + // //时薪 + // var hourlyPayStr = ''; + // var hasHourlyPay = false; + // if (app.isNotEmptyCheck(jobDetail.storeJob.hourlyPay)) { + // hourlyPayStr = jobDetail.storeJob.hourlyPay + '元/小时'; + // hasHourlyPay = true; + // } else if (app.isNotEmptyCheck(jobDetail.storeJob.dayPay)) { + // hourlyPayStr = jobDetail.storeJob.dayPay + '元/日'; + // hasHourlyPay = true; + // } else { + // if (app.isNotEmptyCheck(jobDetail.storeJob.minMonthlyPay) && app.isNotEmptyCheck(jobDetail.storeJob.maxMonthlyPay)) { + // if (jobDetail.storeJob.minMonthlyPay == jobDetail.storeJob.maxMonthlyPay) { + // hourlyPayStr = jobDetail.storeJob.minMonthlyPay; + // } else { + // hourlyPayStr = jobDetail.storeJob.minMonthlyPay + '-' + jobDetail.storeJob.maxMonthlyPay; + // } + // } else if (app.isNotEmptyCheck(jobDetail.storeJob.minMonthlyPay)) { + // hourlyPayStr = jobDetail.storeJob.minMonthlyPay; + // } else if (app.isNotEmptyCheck(jobDetail.storeJob.maxMonthlyPay)) { + // hourlyPayStr = jobDetail.storeJob.maxMonthlyPay; + // } + // } + // jobDetail.storeJob["hourlyPay"] = hourlyPayStr; + jobDetail.storeJob["salaryClassifyValue"] = commonUtil.getSalaryClassifyValue(jobDetail.storeJob.salaryClassify, jobDetail.storeJob.salaryClassifyValue); + //月薪 + var monthlyPayStr = ''; + // if (hasHourlyPay) { + if (app.isNotEmptyCheck(jobDetail.storeJob.minMonthlyPay) && app.isNotEmptyCheck(jobDetail.storeJob.maxMonthlyPay)) { + if (jobDetail.storeJob.minMonthlyPay == jobDetail.storeJob.maxMonthlyPay) { + monthlyPayStr = jobDetail.storeJob.minMonthlyPay; + } else { + monthlyPayStr = jobDetail.storeJob.minMonthlyPay + '-' + jobDetail.storeJob.maxMonthlyPay; + } + } else if (app.isNotEmptyCheck(jobDetail.storeJob.minMonthlyPay)) { + monthlyPayStr = jobDetail.storeJob.minMonthlyPay; + } else if (app.isNotEmptyCheck(jobDetail.storeJob.maxMonthlyPay)) { + monthlyPayStr = jobDetail.storeJob.maxMonthlyPay; + } + // } + jobDetail.storeJob["monthlyPay"] = monthlyPayStr; + //地址深圳丨龙岗区丨 + var districtStr = ''; + if (app.isNotEmptyCheck(jobDetail.storeJob.district)) { + var districtArr = jobDetail.storeJob.district.split(','); + if(districtArr.length < 3) { + districtStr = districtArr[districtArr.length - 1]; + } else { + districtStr = districtArr[1] + '丨' + districtArr[2]; + } + //districtStr = districtArr[1] + '丨' + districtArr[2]; + } + jobDetail.storeJob["districtStr"] = districtStr; + jobDetail.storeJob["districtDetail"] = commonUtil.getStoreAddress(jobDetail.storeJob.district, jobDetail.storeJob.detailPosition); + + //职位特色 + if (app.isNotEmptyCheck(jobDetail.storeJob.jobSpecialLabelNames)) { + jobDetail.storeJob['jobSpecialLabelNames'] = that.getJobSpecialLabelNamesArray(jobDetail.storeJob.jobSpecialLabelNames); + } + + }, + getJobSpecialLabelNamesArray(jobSpecialLabelNames) { + if (app.isNotEmptyCheck(jobSpecialLabelNames)) { + return jobSpecialLabelNames.split(', '); + } + return []; + }, + goSimilar() { + var that = this; + + console.log(that.data.jobDetail) + console.log(that.data.jobDetail.storeJob.jobLabelId) + + wx.navigateTo({ + url: "../similar/index?brandId=" + + that.data.jobDetail.store.brandId + + "&jobLabelId=" + + that.data.jobDetail.storeJob.jobLabelId + + "&classify=99" + }); + }, + + makePhoneCall() { + console.log(1); + var that = this; + wx.makePhoneCall({ + // number: that.data.jobDetail.assistantUserTel + "" + phoneNumber:'18039237825' + }); + // var that = this; + + // let res = wx.getStorageSync({ + // key: "assistantUserTel" + // }); + + // console.log(res); + // console.log("缓存获取电话号:" + res.data); + + // if (app.isNotEmptyCheck(res.data)) { + // wx.makePhoneCall({ + // number: res.data + // }); + // } else { + // wx.request({ + // url: app.globalData.ip + "/store/job/getOneAssistantUser", + // method: "POST", + // header: app.globalData.headers, + // data: {}, + // success: function (res) { + // console.log(res.data.data.tel); + + // wx.setStorageSync({ + // key: "assistantUserTel", + // data: res.data.data.tel + // }); + + // wx.makePhoneCall({ + // number: res.data.data.tel + "" + // }); + // } + // }); + // } + }, + textPaste() { + var that = this; + wx.setClipboardData({ + // data: that.data.jobDetail.assistantUserWechat, + data:'18039237825', + success: function (res) { + wx.getClipboardData({ + success: function (res) { + wx.showToast({ + icon: "none", + title: '已复制微信号,快去添加好友吧', + duration:0, + }) + wx.showModal({ + title: '已复制微信号', + content: '快去搜索添加经纪人好友吧', + showCancel:false, + success (res) { + if (res.confirm) { + console.log('用户点击确定') + } else if (res.cancel) { + console.log('用户点击取消') + } + } + }) + + console.log(res.data) // data + } + }) + } + }) + }, + /*collectPaste() { + var txt; + var that = this; + if(!this.data.isCollect){ + that.setData({ + isCollect: true + }) + txt = '收藏成功' + }else{ + that.setData({ + isCollect: false + }) + txt = '取消收藏' + } + wx.showToast({ + icon: "none", + title: txt, + }) + + },*/ + goEnroll() { + var that = this; + + // wx.setStorageSync({ + // key: "jobDetailStorage", + // data: that.data.jobDetail + // }); + wx.setStorageSync('jobDetailStorage', that.data.jobDetail.storeJob); + // wx.navigateTo({ + // url: "../enroll/index?applyType=1" + // }); + + wx.navigateTo({ + url: "../enroll/index?applyType=1&tel=" + app.globalData.loginUserInfo.tel + }); + }, + emptyMethod() { + + }, + wxLogin() { + var that = this; + wx.login({ + success(res) { + if (res.code) { + that.setData({ + wxCode: res.code + }); + + } else { + console.log('获取code失败!' + res.errMsg) + } + } + }) + }, + getPhoneNumber(e) { + var that = this; + console.log(e) + console.log(e.detail.errMsg) + console.log(that.data.jobDetail.storeJob); + /*wx.setStorageSync({ + key: "jobDetailStorage", + data: that.data.jobDetail.storeJob, + });*/ + wx.setStorageSync('jobDetailStorage', that.data.jobDetail.storeJob); + // 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, + }, + success: function (res) { + console.log(res); + app.globalData.openId = res.data.data.openId; + let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); + var collected = e.currentTarget.dataset.collected; + if(collected) { + promise.then(res => { + that.setData({ + isLogin: app.globalData.isLogin + }); + that.doCollected(collected, e.currentTarget.dataset.jobid); + }) + } else { + /*wx.navigateTo({ + url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber + });*/ + promise.then(res => { + wx.navigateTo({ + //url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber + url: "../enroll/index?applyType=1" + }); + }) + } + // wx.navigateTo({ + // url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber + // }); + }, + 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, + }, + success: function (res) { + console.log(res); + + let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); + + var collected = e.currentTarget.dataset.collected; + if(collected) { + promise.then(res => { + that.setData({ + isLogin: app.globalData.isLogin + }); + that.doCollected(collected, e.currentTarget.dataset.jobid); + }); + + } else { + promise.then(res => { + wx.navigateTo({ + //url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber + url: "../enroll/index?applyType=1" + }); + }) + + } + }, + fail: function (res) { + console.log("获取用户手机号错误"); + } + }) + } else { + console.log('获取手机号失败!' + res.errMsg) + } + } + }) + } + }) + + } else {//拒绝 + var collected = e.currentTarget.dataset.collected; + if (collected) { + try { + wx.setStorageSync('comeFromPage', 'detail'); + wx.setStorageSync('comeFromPageParam', {storeJobId: that.data.searchForm.storeJobId}); + } catch (e) { + console.log("detail-页面跳转,设置参数错误:", e); + } + wx.navigateTo({ + url: '/pages/login/index', + }) + } else { + wx.navigateTo({ + //url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber + url: "../enroll/index?applyType=1" + }); + } + } + return false; + }, + + collectPaste(e) { + var txt; + var that = this; + 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) {//取消收藏 + that.data.jobDetail.storeJob.collected = 2; + txt = '取消收藏'; + } else {//收藏 + that.data.jobDetail.storeJob.collected = 1; + txt = '收藏成功'; + } + that.setData({ + jobDetail: that.data.jobDetail, + isLogin: app.globalData.isLogin + }); + console.log(that.data.jobDetail) + wx.showToast({ + icon: "none", + title: txt, + }) + }, + fail: function (res) { + console.log("操作失败"); + } + }) + }, +}); diff --git a/pages/detail的副本/index.json b/pages/detail的副本/index.json new file mode 100644 index 0000000..71119b2 --- /dev/null +++ b/pages/detail的副本/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "wxml-to-canvas": "wxml-to-canvas" + }, + "navigationBarTitleText": " " +} diff --git a/pages/detail的副本/index.wxml b/pages/detail的副本/index.wxml new file mode 100644 index 0000000..e684eb7 --- /dev/null +++ b/pages/detail的副本/index.wxml @@ -0,0 +1,317 @@ + + + + + + + + + {{jobDetail.storeJob.jobName}} + + + + + + + + + + + + + + + {{citys}}{{jobDetail.store.distance}} + + + + + {{jobDetail.storeJob.genderRestrict}} + 丨{{jobDetail.storeJob.age}} + + + + + + + + + {{jobDetail.storeJob.salaryClassifyValue}} + + + + {{jobDetail.storeJob.monthlyPay}} + + + + + + + + {{item1}} + + + {{item1}} + + + + + + + + + {{jobDetail.poses.store.posContent ? jobDetail.poses.store.posContent :'暂无地址信息'}} + + + + + + + + + + + + + + + + + + + + + + 薪资待遇 + + + 薪资明细 + {{jobDetail.storeJob.salaryDetail}} + + + 薪资发放 + {{jobDetail.storeJob.payDay}} + + + 银行卡 + {{jobDetail.storeJob.bankInfo}} + + + 工期 + {{jobDetail.storeJob.workCycle}} + + + 培训 + {{jobDetail.storeJob.training}} + + + 试用期 + {{jobDetail.storeJob.probation}} + + + 福利待遇 + {{jobDetail.storeJob.boon}} + + + 薪资说明 + {{jobDetail.storeJob.salaryDesp}} + + + 招聘要求 + + + 性别年龄 + {{showSexAgeText}} + + + 文化学历 + {{jobDetail.storeJob.education}} + + + + + + + 证件 + {{jobDetail.storeJob.idCard}} + + + + 疑难杂症 + {{jobDetail.storeJob.otherRequire}} + + + + + 体检 + {{jobDetail.storeJob.healthRequire}} + + + + 岗位说明 + + + 工作内容 + {{jobDetail.storeJob.workContent}} + + + 工作方式 + {{jobDetail.storeJob.workMode}} + + + 班次工时 + {{jobDetail.storeJob.workClasses}} + + + 工作衣 + {{jobDetail.storeJob.workClothes}} + + + 车间 + {{jobDetail.storeJob.securityCheck}} + + + 保险 + {{jobDetail.storeJob.employeeInsurance}} + + + 换岗调班 + {{jobDetail.storeJob.otherDesp}} + + + 吃饭住宿 + + + 吃饭 + + + 吃饭 + {{jobDetail.storeJob.workingLunch}} + + + + + + 住宿 + + + 住宿费用 + {{jobDetail.storeJob.dormitory}} + + + 宿舍设施 + {{jobDetail.storeJob.dormitoryFacilities}} + + + 宿舍距离 + {{jobDetail.storeJob.dormDistance}} + + + 厂车 + {{jobDetail.storeJob.bus}} + + + + 住宿要求 + {{jobDetail.storeJob.dormitoryDesp}} + + + + + + 其它信息 + {{jobDetail.storeJob.OtherInfo}} + + + + + + + + + + + 电话 + + + + + + + 微信 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 孔老师 + 人才经纪人 + + 18039237825 + + + + 取消 + + + + + + + \ No newline at end of file diff --git a/pages/detail的副本/index.wxss b/pages/detail的副本/index.wxss new file mode 100644 index 0000000..6368e91 --- /dev/null +++ b/pages/detail的副本/index.wxss @@ -0,0 +1,372 @@ +page, +.pb180 { + padding-bottom: 120px; +} + +.bottomBtn { + position: fixed; + width: 100%; + left: 0; + bottom: 0; + background-color: #fff; + border-top: 1px solid rgba(0, 0, 0, 0.08); +} +.mt3{ + margin-top: 3px; +} +.sharebtn{ + padding-right: 0; + margin: 0; + display: inline; + background-color: transparent; + line-height: 1; + float:right; + margin-top: 5px; +} +.ml2{ + margin-left: 2px; +} +.am-button { + margin-top: 0; + margin-bottom: 0; +} + +.activeList { + display: flex; + text-align: center; +} +button::after{ + border: 0; +} + +.menu { + flex: 1; + line-height: 1.5; + font-size: 16px; + color: rgba(0, 0, 0, 0.65); + border-bottom: 4px solid transparent; +} + +.menu.active { + font-weight: 601; + color: rgba(0, 0, 0, 0.85); + border-bottom: 4px solid #FE633F; +} +.icon-wode-shoucang{ + color: #787878 !important; +} +.icon-shoucang-red{ + color: #DA0106 !important; +} +.scrollImg { + /* width: 67px; + height: 67px; + margin-right: 12px; + margin-top: 20px; */ + /* margin-top: 16px; */ +} + +.show{ + display:show; + } + .hide{ + display:none; + } + +.scroll-header { + display: flex; + white-space: nowrap; +} + +.scroll-header view { + + display: inline-block; +} + +.scroll-header image:first-child { + margin-left: 0px; +} +button.detailBtn{ + margin-bottom: 0; + padding: 7px 0; + font-size: 18px; + font-weight: 601; + color: #ffffff; + line-height: 26px; + margin-top: 8px; + background: #027AFF; +border-radius: 21px; +margin-bottom: 16px; +} +.flex-1.f14.c085{ +/* white-space: pre-wrap; */ +white-space: pre-line; +font-size: 17px; +line-height: 28px; +} +button.collectBtn{ + margin: 0; + padding: 0; + line-height: 1.4; + padding: 0; + background-color: #fff; + /* text-align: left; */ + /* background-color: #fff; */ +} +.tagsLi{ + height: 20px; + font-size: 14px; + font-weight: 400; + margin-right: 8px; + margin-bottom: 8px; + color: #888; + line-height: 18px; + padding: 0px 4px; +} +.pb4{ + padding-bottom: 4px; +} +.mg020 { + margin: 0 20px; +} +.dName{ + font-size: 16px; + font-weight: 601; + color: #262626; + line-height: 22px; +} +.dsName{ + font-size: 12px; + font-weight: 400; + color: #8c8c8c; + line-height: 17px; +} +.ava{ + width: 48px; + height: 48px; + border-radius: 50%; + margin-right: 14px; +} +.f25{ + font-size: 25px; +} +.p20-0{ + padding: 20px 0; + margin-bottom: 20px; +} +.p020{ + padding: 0 20px; +} +.dianhua{ + color: #787878; +} +.achover .dianhua{ + color:#999; +} +.scrollImgBox { + position: relative; + border-radius: 4px; + width: 60px; + height: 60px; + margin: 12px 5px; + overflow: hidden; +} +image { + max-width: 100%; + max-height: 100%; +} +.show { + display: show; +} +.hide { + display: none; +} +.p020 { + padding: 0 20px; +} +.scroll-header { + display: flex; + white-space: nowrap; +} + +.scroll-header view { + display: inline-block; +} +.scroll-header video { + width: 100%; + height: 100%; + border-radius: 8px; +} +.scroll-header image:first-child { + margin-left: 0px; +} +.storeTitle{ + font-size: 18px; + font-weight: 601; + color: #262626; + line-height: 25px; + /* margin-bottom: 10px; */ +} +.storeInfo{ + font-size: 15px; + font-weight: 400; + color: #939393; + line-height: 21px; + white-space: pre-line; +} +.address{ + font-size: 15px; +font-weight: 400; +color: #333; +line-height: 21px; +flex: 1; +} +.btext{ + font-size: 11px; + font-weight: 400; + color: #444444; + line-height: 16px; + margin-top: 2px; +} +.flex-3{ + flex: 3; +} +.noShow{ + position: absolute; + top: -9999px; +} +.detailH3 { + font-size: 16px; + font-weight: 400; + color: #000; + line-height: 22px; + margin-top: 16px; + margin-bottom: 8px; +} +.pri { + white-space: pre-line; +} +.pri:empty:before, +.textb1:empty:before { + content: "-" !important; + color: #333; +} +.outSp { + border: 1px solid #f3f3f3; + border-radius: 4px; + /* line-height: 56rpx; */ +} +.outSp .display-flex:last-child .rb1, +.outSp .display-flex:last-child .textb1 { + border-bottom: 0; +} +.sbb1 { + border-bottom: 1rpx solid #eee !important; +} +.tabBox .display-flex { + flex-wrap: wrap; +} +.tabBox .display-flex > view { + margin-bottom: 8px; +} +.rb1 { + font-size: 14px; + color: #666; + text-align: center; + width: 80px; + border-right: 1px solid #f3f3f3; + border-bottom: 1px solid #f3f3f3; + display: flex; + align-items: center; + justify-content: center; +} +.textb1 { + white-space: pre-line; + color: #333; + border-bottom: 1px solid #f3f3f3; + padding: 0 8px; + flex: 1; + line-height: 1.8; + padding-top: 3px; +} +.jobMoney { + color: var(--color-ysd); +} +.c633 { + color: var(--color-027); +} +.videoContainer::after { + content: ""; + width: 0; + height: 0; + border: 10px solid #ffffffbb; + border-right-color: transparent; + border-top-color: transparent; + border-left-width: 16px; + border-right-width: 0px; + border-bottom-color: transparent; + left: 50%; + top: 50%; + border-radius: 3px; + transform: translate(-50%, -50%); + /* background-color: #ffffff; */ + position: absolute; + z-index: 10; +} +.theVideo { + position: relative; +} +.theVideo .t-icon { + position: absolute; + bottom: 80px; + right: 30px; + width: 20px; + height: 24px; + background-repeat: no-repeat; + background-size: 100%; + z-index: 1111; +} +.theVideo .t-icon::after { + position: absolute; + content: ""; + width: 44px; + height: 44px; + left: 50%; + top: 50%; + transform: translate(-50%, -55%); + background-color: #ffffff66; + border-radius: 50%; +} +.t-icon-ziying1 { + background-repeat: no-repeat; + display: inline-block; + width: 32px; + height: 20px; + margin-right: 6px; +} +.ml18{ + margin-left: 18px; +} +.mask { + position: fixed; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.3); + top: 0; + left: 0; + z-index: 99; + pointer-events: none; + /* display: none; */ +} +.norecruit { + position: absolute; + width: 100%; + height: 38px; + line-height: 38px; + top: -38px; + font-size: 14px; + text-align: center; + background-color: #666; + color: #fff; + /* display: none; */ +} diff --git a/pages/enroll/index.js b/pages/enroll/index.js index 4063fae..2f60eed 100644 --- a/pages/enroll/index.js +++ b/pages/enroll/index.js @@ -1,797 +1,156 @@ - -const app = getApp(); -const commonUtil = require("../../utils/commonUtil.js"); - -var inter; - -Page({ - data: { - // array: ['服务员1', '服务员2', '服务员3', '服务员4'], - hopeJobList: [], - //期望职位列表 - hopeJobListIndex: -1, - applyType: 0, - //申请标识,0预约,1报名 - jobDetail: {}, - phoneNumber: '', - //职位详情 - btnLoading: false, - sendTime: '获取验证码', - sendColor: '#fe633f', - snsMsgWait:60, - showMsgCode: true, - msgCode: '', - disabled: 0, //0不可点 - _num: 0, - sex:-1, - tapFlag:true, //点击手机号倒计时变红 - iosDialog1: false, - iosDialog2: false, - canInputTel: false, - inputShowed: true, - inputTel: '', - wxCode: '', - canCommit: false, - inputUserName: '', - }, - onShow:function(){ - // this.openIOS2(); - - if (app.globalData.isLogin) { - this.data.canInputTel = true; - this.data.inputTel = app.globalData.loginUserInfo.tel; - this.data.canCommit = true; - if (app.isNotEmptyCheck(app.globalData.user.userName)) { - this.data.inputUserName = app.globalData.user.userName; - } - } else { - this.wxLogin(); - } - this.setData({ - isLogin: app.globalData.isLogin, - hasUserInfo: app.globalData.hasUserInfo, - canInputTel: this.data.canInputTel, - canCommit: this.data.canCommit, - inputUserName: this.data.inputUserName, - }); - - }, - wxLogin() { - var that = this; - wx.login({ - success(res) { - if (res.code) { - that.setData({ - wxCode: res.code - }); - - } else { - console.log('获取code失败!' + res.errMsg) - } - } - }) - }, - getPhoneNumber(e) { - var that = this; - console.log(e) - console.log(e.detail.errMsg) - - // 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, - }, - success: function(res) { - console.log(res); - let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); - promise.then(res => { - that.setData({ - isLogin: app.globalData.isLogin, - phoneNumber: app.globalData.loginUserInfo.tel, - canInputTel: true, - }); - }) - - }, - 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, - }, - success: function(res) { - console.log(res); - app.globalData.openId = res.data.data.openId; - let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); - var collected = e.currentTarget.dataset.collected; - if (collected) { - promise.then(res => { - that.setData({ - isLogin: app.globalData.isLogin - }); - that.doCollected(collected, e.currentTarget.dataset.jobid); - }) - } else { - wx.navigateTo({ - url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber - }); - } - }, - fail: function(res) { - console.log("获取用户手机号错误"); - } - }) - } else { - console.log('获取手机号失败!' + res.errMsg) - } - } - }) - } - }) - - } else { //拒绝 - console.log("拒绝获取手机号===="); - that.setData({ - canInputTel: true, - inputShowed: true, - }); - } - return false; - }, - close: function () { - this.setData({ - iosDialog1: false, - iosDialog2: false, - }) - }, - closeInputCode: function () { - var telNum = ''; - if (app.isNotEmptyCheck(app.globalData.loginUserInfo.tel)) { - telNum = app.globalData.loginUserInfo.tel; - } - - this.setData({ - iosDialog1: false, - iosDialog2: false, - phoneNumber: telNum, - }) - }, - openIOS1: function() { - this.setData({ - iosDialog1: true - }); - }, - openIOS2: function() { - var that = this; - - clearInterval(inter); - - this.setData({ - iosDialog2: true, - - msgCode: '', - - sendColor: '#ccc', - sendTime: '60秒', - snsMsgWait:60, - smsFlag: false - }); - - this.sendCode(); - }, - showCha: function (e) { - this.setData({ - msgCode: e.detail.value - }) - }, - bindinputUserName: function (e) { - this.setData({ - inputUserName: e.detail.value - }) - }, - checkCodeAndLogin: function () { - - app.load("校验中..."); - - var that = this; - - console.log(this.data.inputTel) - - if (this.data.msgCode == '') { - app.hideLoad(); - wx.showToast({ - icon: "none", - title: '验证码不能为空', - duration: 2000 - }) - return; - } - - var channelContactId = ''; - try { - var value = wx.getStorageSync('fromQrCodeChannelContactId') - if (value) { - console.log("fromQrCodeChannelContactId:======", value); - channelContactId = value; - } - } catch (e) { - console.log("获取缓存设置的参数错误:", e); - } - var agencyUserId = ''; - try { - var value = wx.getStorageSync('storageSyncAgencyUserId') - if (value) { - console.log("storageSyncAgencyUserId======", value); - agencyUserId = value; - } - } catch (e) { - console.log("获取缓存设置的参数错误:", e); - } - - wx.request({ - url: app.globalData.ip + '/registerOrLoginByTel', - data: { - tel: that.data.inputTel, - code: that.data.msgCode, - channelContactId: channelContactId, - agencyUserId: agencyUserId, - autoLoginTag: -1, - }, - header: { - 'content-type': 'application/json' - }, - success: function (res) { - app.hideLoad(); - - console.log(res.data); - - if (res.data.status == 200) { - app.globalData.sessionId = res.data.data.sessionId; - app.globalData.headers.Cookie = 'JSESSIONID=' + res.data.data.sessionId; - app.globalData.headers2.Cookie = 'JSESSIONID=' + res.data.data.sessionId; - app.globalData.isLogin = true; - app.globalData.agencyStatus = res.data.data.agencyStatus; - app.globalData.hasUserInfo = res.data.data.imgSrc != '' && res.data.data.imgSrc != null && res.data.data.imgSrc != undefined && res.data.data.nickName != '' && res.data.data.nickName != null && res.data.data.nickName != undefined ? 1 : 0, - app.globalData.loginUserInfo = res.data.data; - //登录设置缓存 - app.globalData.userLoginTokenInfo.tel = res.data.data.tel; - app.globalData.userLoginTokenInfo.token = null; - - wx.setStorageSync('loginUserTokenInfo', app.globalData.userLoginTokenInfo); - - console.log(111); - - that.close(); - - that.setData({ - isLogin: true, - canInputTel: true, - canCommit: true, - }); - - } else { - wx.showToast({ - icon: "none", - title: res.data.msg, - duration: 2000 - }) - } - - } - }) - //console.log('form发生了submit事件,携带数据为:', e.detail.value) - }, - inputBlur:function(e){ - var that = this; - var myreg = /^[1][3456789][0-9]{9}$/; - console.log(e.detail.value); - that.data.inputTel = e.detail.value; - - if(myreg.test(e.detail.value)){ - - if (app.globalData.isLogin) { - if (app.globalData.loginUserInfo.tel != that.data.inputTel) { - that.addUserResourceAfterInputTel(); - this.openIOS2(); - } - } else { - that.addUserResourceAfterInputTel(); - this.openIOS2(); - } - - - }else{ - wx.showToast({ - duration: 2000, - title: '手机号格式不正确', - icon: 'none', - mask: true - }) - } - }, - showCha: function (e) { - - var myreg = /^[1][3456789][0-9]{9}$/; - if (e.target.dataset.tel == 1) { - if (myreg.test(e.detail.value) && this.data.tapFlag) { - this.setData({ - disabled: 1, - phoneNumber: e.detail.value - }) - } else { - this.setData({ - disabled: 0 - }) - } - - } else { - this.setData({ - msgCode: e.detail.value - }) - } - - if (e.detail.value.length > 0) { - this.setData({ - _num: e.target.dataset.num, - }) - } else { - this.setData({ - _num: 0, - }) - } - }, - sendCode: function () { - var that = this; - // 60秒后重新获取验证码 - wx.request({ - url: app.globalData.ip + '/commons/sendMsgCode', - data: { - // tel: that.data.phoneNumber - tel: that.data.inputTel - }, - header: app.globalData.headers, - method: "GET", - success: function (res) { - console.log("发送短信验证码"); - console.log(res); - if (res.data.status == 200) { - // app.globalData.headers.Cookie = 'JSESSIONID=' + res.data.data.sessionId; - // app.globalData.headers2.Cookie = 'JSESSIONID=' + res.data.data.sessionId; - that.setData({ - smsFlag: true, - sendColor: '#cccccc', - sendTime: that.data.snsMsgWait + '秒', - snsMsgWait: that.data.snsMsgWait - 1, - disabled: 0, - }); - inter = setInterval(function () { - that.setData({ - smsFlag: true, - sendColor: '#cccccc', - sendTime: that.data.snsMsgWait + '秒', - snsMsgWait: that.data.snsMsgWait - 1 - }); - if (that.data.snsMsgWait < 0) { - clearInterval(inter) - that.setData({ - sendColor: '#ff0000', - sendTime: '重新获取', - snsMsgWait: 60, - smsFlag: false, - disabled: 1, - }); - } - }.bind(that), 1000); - } else { - wx.showToast({ - icon: "none", - title: res.data.msg, - duration: 2000 - }); - } - } - }) - - }, - - checkMsgCode: function (formData) { - - var that = this; - - // if (this.data.phoneNumber == '') { - if (this.data.inputTel == '') { - that.showTips('手机号码不能为空'); - return; - } - /*if(this.data.showMsgCode) {//需要填写验证码时,才验证 - if (this.data.msgCode == '') { - that.showTips('验证码不能为空'); - return; - } - - wx.request({ - url: app.globalData.ip + '/commons/validateMsgCode', - data: { - tel: that.data.phoneNumber, - code: that.data.msgCode, - }, - header: app.globalData.headers, - method: "GET", - success: function (res) { - console.log(res); - if (res.data.status == 200) { - that.doSubmit(formData); - }else { - that.showTips(res.data.msg); - } - } - }) - } else { - that.doSubmit(formData); - }*/ - that.doSubmit(formData); - - }, - showTips(_title) { - wx.showToast({ - duration: 2000, - title: _title, - icon: 'none', - mask: true - }) - }, - onLoad(query) { - var that = this; - - wx.setStorageSync({ - key: "storeJobId", - data: -1 - }); - - this.data.applyType = query.applyType; - console.log(this.data.applyType); - // this.data.phoneNumber = query.tel != undefined ? query.tel : ''; - this.data.phoneNumber = app.globalData.loginUserInfo.tel; - console.log(this.data.jobDetail); - - if (this.data.applyType == 1) { - that.data.jobDetail = wx.getStorageSync("jobDetailStorage"); - console.log(that.data.jobDetail); - if(app.isEmptyCheck(that.data.jobDetail.districtStr)){ - that.data.jobDetail.districtStr = that.data.jobDetail.district; - } - // that.data.jobDetail["salaryClassifyValue"] = commonUtil.getSalaryClassifyValue(that.data.jobDetail.salaryClassify, that.data.jobDetail.salaryClassify); - // that.data.jobDetail.districtStr = that.data.jobDetail.district; - that.setData({ - jobDetail:that.data.jobDetail - }) - wx.setNavigationBarTitle({ - title: "我想报名" - }); - } else { - wx.setNavigationBarTitle({ - title: "预约推荐" - }); - } - - this.setData({ - applyType: that.data.applyType, - jobDetail: that.data.jobDetail, - phoneNumber: that.data.phoneNumber, - showMsgCode: that.data.phoneNumber != '' ? false : true, - }); - //this.getHopeJobLabels(); - }, - getHopeJobLabels() { - var that = this; - - wx.request({ - url: app.globalData.ip + "/labels/findAllHopeJobLabels?category=4", - method: "GET", - header: app.globalData.headers, - data: {}, - success: function (res) { - console.log(res); - that.setData({ - hopeJobList: res.data.data - }); - }, - fail: function (res) { - console.log("获取期望职位错误"); - } - }); - }, - - bindPickerChange(e) { - console.log("picker发送选择改变,携带值为", e.detail.value); - this.setData({ - hopeJobListIndex: e.detail.value - }); - }, - changeSex(e){ - var sex = e.currentTarget.dataset.sex; - this.setData({ - sex: sex - }); - - }, - onSubmit(e) { - console.log(e); - - var that = this; - - that.setData({ - btnLoading: true - }); - - if (e.detail.value.tel == '') { - that.showTips('你尚未验证手机号,不能报名'); - that.setData({ - btnLoading: false - }); - return; - } - - var myreg = /^[1][3456789][0-9]{9}$/; - if (!myreg.test(e.detail.value.tel) || e.detail.value.tel == "") { - wx.showToast({ - icon: "none", - title: "请输入正确手机号", - duration: 3000 - }); - - that.setData({ - btnLoading: false - }); - return; - } - - var formData = e.detail.value; - formData["applyType"] = that.data.applyType; - // formData["sex"] = that.data.sex; - - - if (that.data.applyType == 1) { - formData["storeJobId"] = that.data.jobDetail.id; - } - - console.log(formData); - that.checkMsgCode(formData); - - }, - onSubmitAfterGetUserInfo() { - - var that = this; - - that.setData({ - btnLoading: true - }); - - if (that.data.inputTel == '') { - that.showTips('你尚未验证手机号,不能报名'); - that.setData({ - btnLoading: false - }); - return; - } - - var myreg = /^[1][3456789][0-9]{9}$/; - if (!myreg.test(that.data.inputTel) || that.data.inputTel == "") { - wx.showToast({ - icon: "none", - title: "请输入正确手机号", - duration: 3000 - }); - - that.setData({ - btnLoading: false - }); - return; - } - - var formData = { - userName: that.data.inputUserName, - tel: that.data.inputTel, - }; - formData["applyType"] = that.data.applyType; - // formData["sex"] = that.data.sex; - - - if (that.data.applyType == 1) { - formData["storeJobId"] = that.data.jobDetail.id; - } - - console.log(formData); - that.checkMsgCode(formData); - - }, - - doSubmit(formData) { - var that = this; - - try { - var value = wx.getStorageSync('fromQrCodeChannelContactId') - if (value) { - console.log("fromQrCodeChannelContactId:======", value); - formData['channelContactId'] = value; - } - } catch (e) { - console.log("获取缓存设置的参数错误:", e); - } - try { - var value = wx.getStorageSync('storageSyncAgencyUserId') - if (value) { - console.log("storageSyncAgencyUserId======", value); - formData['agencyUserId'] = value; - } - } catch (e) { - console.log("获取缓存设置的参数错误:", e); - } - - formData['isCommission'] = app.globalData.isCommission; - - wx.request({ - url: app.globalData.ip + "/user/resource/applyJobWX", - method: "POST", - header: app.globalData.headers, - data: formData, - success: function (res) { - console.log(res); - - if (res.data.status == 200) { - if (res.data.data.doLogin == 0) { - app.setLoginUserTokenInfo(formData.tel, null); - } - if (app.isNotEmptyCheck(formData.userName)) {//报名之后把用户名修改了,设置一下前端缓存的用户名 - app.globalData.user.userName = formData.userName; - } - - wx.redirectTo({ - url: "../success/index?applyType=" + that.data.applyType - }); - } else { - wx.showToast({ - icon: "none", - title: res.data.msg, - duration: 2000 - }); - - that.setData({ - btnLoading: false - }); - } - } - }); - }, - addUserResourceAfterInputTel() { - var that = this; - var formData = { - applyType: 1, - sourceFrom: 19, - tel: that.data.inputTel, - }; - that.addOneRecord(formData); - }, - addUserResourceAfterGetWXUserInfoRefuse() { - var that = this; - - var formData = { - applyType: 1, - sourceFrom: 20, - tel: that.data.inputTel, - }; - that.addOneRecord(formData); - - that.openIOS1(); - }, - addOneRecord(formData) { - var that = this; - - if (that.data.applyType == 1) { - formData["storeJobId"] = that.data.jobDetail.id; - } - try { - var value = wx.getStorageSync('fromQrCodeChannelContactId') - if (value) { - console.log("fromQrCodeChannelContactId:======", value); - formData['channelContactId'] = value; - } - } catch (e) { - console.log("获取缓存设置的参数错误:", e); - } - try { - var value = wx.getStorageSync('storageSyncAgencyUserId') - if (value) { - console.log("storageSyncAgencyUserId======", value); - formData['agencyUserId'] = value; - } - } catch (e) { - console.log("获取缓存设置的参数错误:", e); - } - wx.request({ - url: app.globalData.ip + "/user/resource/applyJobWX", - method: "POST", - header: app.globalData.headers, - data: formData, - success: function (res) { - console.log(res); - if (res.data.status == 200) { - } else { - } - } - }); - }, - emptyMethod() { - }, - - 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.onSubmitAfterGetUserInfo(); - }, - fail: function(res) { - that.addUserResourceAfterGetWXUserInfoRefuse(); - } - }) - - }, - fail: (res) => { - console.log(res) - that.addUserResourceAfterGetWXUserInfoRefuse(); - } - }) - }, -}); \ No newline at end of file +// pages/enroll/index.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + inputUserName: '', + phoneNumber:'', + btnLoading: false, + jobDetail:{} + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + // console.log(wx.getStorageSync("jobDetailStorageChajian")) + }, + bindinputUserName(e) { + console.log(e) + }, + getJob(e){ + console.log(e.detail) + this.setData({ + jobDetail:e.detail + }) + }, + onSubmit(e) { + console.log(e); + var that = this; + that.setData({ + btnLoading: true + }); + if (e.detail.value.userName == '') { + wx.showToast({ + icon: "none", + title: "请输入姓名", + duration: 3000 + }); + that.setData({ + btnLoading: false + }); + return; + } + var myreg = /^[1][3456789][0-9]{9}$/; + if (!myreg.test(e.detail.value.tel) || e.detail.value.tel == "") { + wx.showToast({ + icon: "none", + title: "请输入正确手机号", + duration: 3000 + }); + + that.setData({ + btnLoading: false + }); + return; + } + var formData = { + userName: e.detail.value.userName, + tel: e.detail.value.tel, + applyType:1, + isCommission:0, + storeJobId:that.data.jobDetail.storeJob.id + }; + + wx.request({ + url: app.globalData.ip + "/user/resource/applyJobWX", + method: "POST", + header: app.globalData.headers, + data: formData, + success: function (res) { + wx.showToast({ + icon: "success", + title: "报名成功", + duration: 3000, + success(){ + that.setData({ + inputUserName:'', + phoneNumber:'', + btnLoading: false + }) + } + }); + } + }) + + + + + + }, + getPhoneNumber(e) { + var that = this; + console.log(e.detail.code) // 动态令牌 + console.log(e.detail.errMsg) // 回调信息(成功失败都会返回) + console.log(e.detail.errno) // 错误码(失败时返回) + if ("getPhoneNumber:ok" == e.detail.errMsg) { //同意 + + + } else { //拒绝 + console.log("拒绝获取手机号===="); + + } + return false; + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/enroll/index.json b/pages/enroll/index.json index ebe54a3..10b7ad3 100644 --- a/pages/enroll/index.json +++ b/pages/enroll/index.json @@ -1,4 +1,6 @@ { - - "navigationBarTitleText": "我想报名" -} + "navigationBarTitleText": "我想报名", + "usingComponents": { + "enroll": "plugin://job-plugin/enroll" + } +} \ No newline at end of file diff --git a/pages/enroll/index.wxml b/pages/enroll/index.wxml index a5e0fb9..6ef8820 100644 --- a/pages/enroll/index.wxml +++ b/pages/enroll/index.wxml @@ -1,208 +1,25 @@ - - - - 请提供你的联系方式和基本信息,稍后会有职业顾问联系你,免费帮你推荐合适的工作 - - - - - - - - {{jobDetail.jobName}} - - - - - - - - - - - - - - {{jobDetail.districtStr}}{{jobDetail.distance}} - - - - 限男生 - 限女生 - 男女不限 - 丨{{jobDetail.age}} - - - - - - - - {{jobDetail.salaryClassifyValue}} - - - - {{jobDetail.monthlyPay}} - - - - - - 返费{{jobDetail.rebate}} - - - {{item1}} - - - - - - -
- - - - 姓名 - - - - - - - - - - - - - - 手机号 - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - 提交失败 - - 你需要授权你的微信昵称才可以提交报名 - - - - 知道了 - - - - - - - - 请输入发送到你手机上的验证码 - - - - - - {{sendTime}} - - - - - - 取消 - - - - - - - \ No newline at end of file + +
+ + + + 姓名 + + + + + + + + + 手机号 + + + + + + + + + +
\ No newline at end of file diff --git a/pages/enroll/index.wxss b/pages/enroll/index.wxss index 871df87..055917b 100644 --- a/pages/enroll/index.wxss +++ b/pages/enroll/index.wxss @@ -1,176 +1,48 @@ -.date-radio { - padding: 26rpx; -} - -.date-radio label + label { - margin-left: 20rpx; -} - -.row { - display: flex; - align-items: center; - padding: 0 30rpx; -} - -.row-title { - flex: 1; - padding-top: 28rpx; - padding-bottom: 28rpx; - font-size: 34rpx; - color: #000; -} -.row-extra { - flex-basis: initial; - font-size: 14px; - color: #111; -} - -.row-arrow { - width: 32rpx; - height: 32rpx; - margin-left: 16rpx; -} - -input { - font-size: 16px; - color: #262626 !important; -} -.zbtn{ - width: 100%; - position: absolute; - top: -23px; - left: 0; - z-index: 999; - opacity: 0; -} -.pr{ - position: relative; -} -.f14s{ - font-size: 14px; -} -.weui-cell:before { - -webkit-transform: scaleY(1); - transform: scaleY(1); - border-top: 1px solid rgba(0,0,0,0.08); -} -.weui-vcode-btn { - display: inline-block; - padding: 0 0.6em 0 0.7em; - line-height: 44px; - font-size: 16px; - height: auto; -} -.weui-cell{ - padding-left: 20px; -} -.weui-label{ - width:95px; +.form-row { + display: flex; + align-items: center; + padding: 0 20px; + height: 44px; + align-items: center; + margin-bottom: 20px; } -.form-row{ - margin-bottom: 20px; +.form-row-label { + width: 50px; + font-size: 16px; + font-weight: 400; + color: #666666; + line-height: 22px; + margin-right: 10px; } -.form-row-label,input { - font-size: 16px; +.form-row-content { + flex: 1; + font-size: 16px; + background: #f4f4f4; + border-radius: 6px; + line-height: 50px; } input { - height: 50px; - line-height: 50px; - padding-left: 20px; -} -.tagsLi{ - font-size: 16px; - font-weight: 400; - color: #555555; - line-height: 22px; - padding:1px 8px; + height: 50px; + line-height: 50px; + padding-left: 20px; } -.mt50{ - margin-top: 90px; +.mt20{ + margin-top: 20px; } .fullBtn{ - width: 260px; + width: 260px; height: 50px; opacity: 1; -background-color: #027AFF; +background-color: #ff4400; border-radius: 25px; font-size: 18px; font-weight: 601; color: #ffffff; line-height: 50px; } -.ml16{ - margin-left: 16px; +.fullBtn:active,.fullBtn:focus{ + background-color:#ff6933; +} +.mt80{ + margin-top: 80px; } -.weui-dialog__title{ - font-size: 18px; - font-weight: 400; - color: #333333; - line-height: 25px; - } - .weui-dialog__bd{ - font-size: 16px; - font-weight: 400; - text-align: center; - color: #787878; - line-height: 22px; - margin-bottom: 20px; - /* border-bottom: 1rpx solid #e2e2e2; */ - } - .weui-dialog__bd.bd1{ - padding:0 40px 20px 40px; - border-bottom: 1rpx solid #e2e2e2; - } - .weui-dialog__bd .display-flex{ - padding:0; - padding-bottom:20px; - border-bottom: 1rpx solid #e2e2e2; - } - .weui-dialog__hd { - padding: 32px 24px 20px; - } - .weui-dialog__bd input{ - height: 40px; - text-align: left; - opacity: 1; - background: #f4f4f4; - border-radius: 6px; - } - .rightTime{ - width: 120px; - text-align: center; - line-height: 40px; - } - - - .lflex{ - font-size: 18px; - font-weight: 601; - text-align: center; - color: #027AFF; - line-height: 28px; - /* margin-top: 7px; */ - padding:0 10px 0 30px; - } - .rflex{ - flex:1; - padding:0 30px 0 10px; - } - .rflex button{ - margin-top: 0; - margin-bottom: 0; - height: 40px; - opacity: 1; - background: #027AFF; - border-radius: 25px; - font-size: 18px; - font-weight: 601; - color: #ffffff; - line-height: 40px; - } - .pb16{ - padding-bottom: 16px; - } - .pb20{ - padding-bottom: 20px; - } \ No newline at end of file diff --git a/pages/enroll的副本/index.js b/pages/enroll的副本/index.js new file mode 100644 index 0000000..4063fae --- /dev/null +++ b/pages/enroll的副本/index.js @@ -0,0 +1,797 @@ + +const app = getApp(); +const commonUtil = require("../../utils/commonUtil.js"); + +var inter; + +Page({ + data: { + // array: ['服务员1', '服务员2', '服务员3', '服务员4'], + hopeJobList: [], + //期望职位列表 + hopeJobListIndex: -1, + applyType: 0, + //申请标识,0预约,1报名 + jobDetail: {}, + phoneNumber: '', + //职位详情 + btnLoading: false, + sendTime: '获取验证码', + sendColor: '#fe633f', + snsMsgWait:60, + showMsgCode: true, + msgCode: '', + disabled: 0, //0不可点 + _num: 0, + sex:-1, + tapFlag:true, //点击手机号倒计时变红 + iosDialog1: false, + iosDialog2: false, + canInputTel: false, + inputShowed: true, + inputTel: '', + wxCode: '', + canCommit: false, + inputUserName: '', + }, + onShow:function(){ + // this.openIOS2(); + + if (app.globalData.isLogin) { + this.data.canInputTel = true; + this.data.inputTel = app.globalData.loginUserInfo.tel; + this.data.canCommit = true; + if (app.isNotEmptyCheck(app.globalData.user.userName)) { + this.data.inputUserName = app.globalData.user.userName; + } + } else { + this.wxLogin(); + } + this.setData({ + isLogin: app.globalData.isLogin, + hasUserInfo: app.globalData.hasUserInfo, + canInputTel: this.data.canInputTel, + canCommit: this.data.canCommit, + inputUserName: this.data.inputUserName, + }); + + }, + wxLogin() { + var that = this; + wx.login({ + success(res) { + if (res.code) { + that.setData({ + wxCode: res.code + }); + + } else { + console.log('获取code失败!' + res.errMsg) + } + } + }) + }, + getPhoneNumber(e) { + var that = this; + console.log(e) + console.log(e.detail.errMsg) + + // 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, + }, + success: function(res) { + console.log(res); + let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); + promise.then(res => { + that.setData({ + isLogin: app.globalData.isLogin, + phoneNumber: app.globalData.loginUserInfo.tel, + canInputTel: true, + }); + }) + + }, + 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, + }, + success: function(res) { + console.log(res); + app.globalData.openId = res.data.data.openId; + let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); + var collected = e.currentTarget.dataset.collected; + if (collected) { + promise.then(res => { + that.setData({ + isLogin: app.globalData.isLogin + }); + that.doCollected(collected, e.currentTarget.dataset.jobid); + }) + } else { + wx.navigateTo({ + url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber + }); + } + }, + fail: function(res) { + console.log("获取用户手机号错误"); + } + }) + } else { + console.log('获取手机号失败!' + res.errMsg) + } + } + }) + } + }) + + } else { //拒绝 + console.log("拒绝获取手机号===="); + that.setData({ + canInputTel: true, + inputShowed: true, + }); + } + return false; + }, + close: function () { + this.setData({ + iosDialog1: false, + iosDialog2: false, + }) + }, + closeInputCode: function () { + var telNum = ''; + if (app.isNotEmptyCheck(app.globalData.loginUserInfo.tel)) { + telNum = app.globalData.loginUserInfo.tel; + } + + this.setData({ + iosDialog1: false, + iosDialog2: false, + phoneNumber: telNum, + }) + }, + openIOS1: function() { + this.setData({ + iosDialog1: true + }); + }, + openIOS2: function() { + var that = this; + + clearInterval(inter); + + this.setData({ + iosDialog2: true, + + msgCode: '', + + sendColor: '#ccc', + sendTime: '60秒', + snsMsgWait:60, + smsFlag: false + }); + + this.sendCode(); + }, + showCha: function (e) { + this.setData({ + msgCode: e.detail.value + }) + }, + bindinputUserName: function (e) { + this.setData({ + inputUserName: e.detail.value + }) + }, + checkCodeAndLogin: function () { + + app.load("校验中..."); + + var that = this; + + console.log(this.data.inputTel) + + if (this.data.msgCode == '') { + app.hideLoad(); + wx.showToast({ + icon: "none", + title: '验证码不能为空', + duration: 2000 + }) + return; + } + + var channelContactId = ''; + try { + var value = wx.getStorageSync('fromQrCodeChannelContactId') + if (value) { + console.log("fromQrCodeChannelContactId:======", value); + channelContactId = value; + } + } catch (e) { + console.log("获取缓存设置的参数错误:", e); + } + var agencyUserId = ''; + try { + var value = wx.getStorageSync('storageSyncAgencyUserId') + if (value) { + console.log("storageSyncAgencyUserId======", value); + agencyUserId = value; + } + } catch (e) { + console.log("获取缓存设置的参数错误:", e); + } + + wx.request({ + url: app.globalData.ip + '/registerOrLoginByTel', + data: { + tel: that.data.inputTel, + code: that.data.msgCode, + channelContactId: channelContactId, + agencyUserId: agencyUserId, + autoLoginTag: -1, + }, + header: { + 'content-type': 'application/json' + }, + success: function (res) { + app.hideLoad(); + + console.log(res.data); + + if (res.data.status == 200) { + app.globalData.sessionId = res.data.data.sessionId; + app.globalData.headers.Cookie = 'JSESSIONID=' + res.data.data.sessionId; + app.globalData.headers2.Cookie = 'JSESSIONID=' + res.data.data.sessionId; + app.globalData.isLogin = true; + app.globalData.agencyStatus = res.data.data.agencyStatus; + app.globalData.hasUserInfo = res.data.data.imgSrc != '' && res.data.data.imgSrc != null && res.data.data.imgSrc != undefined && res.data.data.nickName != '' && res.data.data.nickName != null && res.data.data.nickName != undefined ? 1 : 0, + app.globalData.loginUserInfo = res.data.data; + //登录设置缓存 + app.globalData.userLoginTokenInfo.tel = res.data.data.tel; + app.globalData.userLoginTokenInfo.token = null; + + wx.setStorageSync('loginUserTokenInfo', app.globalData.userLoginTokenInfo); + + console.log(111); + + that.close(); + + that.setData({ + isLogin: true, + canInputTel: true, + canCommit: true, + }); + + } else { + wx.showToast({ + icon: "none", + title: res.data.msg, + duration: 2000 + }) + } + + } + }) + //console.log('form发生了submit事件,携带数据为:', e.detail.value) + }, + inputBlur:function(e){ + var that = this; + var myreg = /^[1][3456789][0-9]{9}$/; + console.log(e.detail.value); + that.data.inputTel = e.detail.value; + + if(myreg.test(e.detail.value)){ + + if (app.globalData.isLogin) { + if (app.globalData.loginUserInfo.tel != that.data.inputTel) { + that.addUserResourceAfterInputTel(); + this.openIOS2(); + } + } else { + that.addUserResourceAfterInputTel(); + this.openIOS2(); + } + + + }else{ + wx.showToast({ + duration: 2000, + title: '手机号格式不正确', + icon: 'none', + mask: true + }) + } + }, + showCha: function (e) { + + var myreg = /^[1][3456789][0-9]{9}$/; + if (e.target.dataset.tel == 1) { + if (myreg.test(e.detail.value) && this.data.tapFlag) { + this.setData({ + disabled: 1, + phoneNumber: e.detail.value + }) + } else { + this.setData({ + disabled: 0 + }) + } + + } else { + this.setData({ + msgCode: e.detail.value + }) + } + + if (e.detail.value.length > 0) { + this.setData({ + _num: e.target.dataset.num, + }) + } else { + this.setData({ + _num: 0, + }) + } + }, + sendCode: function () { + var that = this; + // 60秒后重新获取验证码 + wx.request({ + url: app.globalData.ip + '/commons/sendMsgCode', + data: { + // tel: that.data.phoneNumber + tel: that.data.inputTel + }, + header: app.globalData.headers, + method: "GET", + success: function (res) { + console.log("发送短信验证码"); + console.log(res); + if (res.data.status == 200) { + // app.globalData.headers.Cookie = 'JSESSIONID=' + res.data.data.sessionId; + // app.globalData.headers2.Cookie = 'JSESSIONID=' + res.data.data.sessionId; + that.setData({ + smsFlag: true, + sendColor: '#cccccc', + sendTime: that.data.snsMsgWait + '秒', + snsMsgWait: that.data.snsMsgWait - 1, + disabled: 0, + }); + inter = setInterval(function () { + that.setData({ + smsFlag: true, + sendColor: '#cccccc', + sendTime: that.data.snsMsgWait + '秒', + snsMsgWait: that.data.snsMsgWait - 1 + }); + if (that.data.snsMsgWait < 0) { + clearInterval(inter) + that.setData({ + sendColor: '#ff0000', + sendTime: '重新获取', + snsMsgWait: 60, + smsFlag: false, + disabled: 1, + }); + } + }.bind(that), 1000); + } else { + wx.showToast({ + icon: "none", + title: res.data.msg, + duration: 2000 + }); + } + } + }) + + }, + + checkMsgCode: function (formData) { + + var that = this; + + // if (this.data.phoneNumber == '') { + if (this.data.inputTel == '') { + that.showTips('手机号码不能为空'); + return; + } + /*if(this.data.showMsgCode) {//需要填写验证码时,才验证 + if (this.data.msgCode == '') { + that.showTips('验证码不能为空'); + return; + } + + wx.request({ + url: app.globalData.ip + '/commons/validateMsgCode', + data: { + tel: that.data.phoneNumber, + code: that.data.msgCode, + }, + header: app.globalData.headers, + method: "GET", + success: function (res) { + console.log(res); + if (res.data.status == 200) { + that.doSubmit(formData); + }else { + that.showTips(res.data.msg); + } + } + }) + } else { + that.doSubmit(formData); + }*/ + that.doSubmit(formData); + + }, + showTips(_title) { + wx.showToast({ + duration: 2000, + title: _title, + icon: 'none', + mask: true + }) + }, + onLoad(query) { + var that = this; + + wx.setStorageSync({ + key: "storeJobId", + data: -1 + }); + + this.data.applyType = query.applyType; + console.log(this.data.applyType); + // this.data.phoneNumber = query.tel != undefined ? query.tel : ''; + this.data.phoneNumber = app.globalData.loginUserInfo.tel; + console.log(this.data.jobDetail); + + if (this.data.applyType == 1) { + that.data.jobDetail = wx.getStorageSync("jobDetailStorage"); + console.log(that.data.jobDetail); + if(app.isEmptyCheck(that.data.jobDetail.districtStr)){ + that.data.jobDetail.districtStr = that.data.jobDetail.district; + } + // that.data.jobDetail["salaryClassifyValue"] = commonUtil.getSalaryClassifyValue(that.data.jobDetail.salaryClassify, that.data.jobDetail.salaryClassify); + // that.data.jobDetail.districtStr = that.data.jobDetail.district; + that.setData({ + jobDetail:that.data.jobDetail + }) + wx.setNavigationBarTitle({ + title: "我想报名" + }); + } else { + wx.setNavigationBarTitle({ + title: "预约推荐" + }); + } + + this.setData({ + applyType: that.data.applyType, + jobDetail: that.data.jobDetail, + phoneNumber: that.data.phoneNumber, + showMsgCode: that.data.phoneNumber != '' ? false : true, + }); + //this.getHopeJobLabels(); + }, + getHopeJobLabels() { + var that = this; + + wx.request({ + url: app.globalData.ip + "/labels/findAllHopeJobLabels?category=4", + method: "GET", + header: app.globalData.headers, + data: {}, + success: function (res) { + console.log(res); + that.setData({ + hopeJobList: res.data.data + }); + }, + fail: function (res) { + console.log("获取期望职位错误"); + } + }); + }, + + bindPickerChange(e) { + console.log("picker发送选择改变,携带值为", e.detail.value); + this.setData({ + hopeJobListIndex: e.detail.value + }); + }, + changeSex(e){ + var sex = e.currentTarget.dataset.sex; + this.setData({ + sex: sex + }); + + }, + onSubmit(e) { + console.log(e); + + var that = this; + + that.setData({ + btnLoading: true + }); + + if (e.detail.value.tel == '') { + that.showTips('你尚未验证手机号,不能报名'); + that.setData({ + btnLoading: false + }); + return; + } + + var myreg = /^[1][3456789][0-9]{9}$/; + if (!myreg.test(e.detail.value.tel) || e.detail.value.tel == "") { + wx.showToast({ + icon: "none", + title: "请输入正确手机号", + duration: 3000 + }); + + that.setData({ + btnLoading: false + }); + return; + } + + var formData = e.detail.value; + formData["applyType"] = that.data.applyType; + // formData["sex"] = that.data.sex; + + + if (that.data.applyType == 1) { + formData["storeJobId"] = that.data.jobDetail.id; + } + + console.log(formData); + that.checkMsgCode(formData); + + }, + onSubmitAfterGetUserInfo() { + + var that = this; + + that.setData({ + btnLoading: true + }); + + if (that.data.inputTel == '') { + that.showTips('你尚未验证手机号,不能报名'); + that.setData({ + btnLoading: false + }); + return; + } + + var myreg = /^[1][3456789][0-9]{9}$/; + if (!myreg.test(that.data.inputTel) || that.data.inputTel == "") { + wx.showToast({ + icon: "none", + title: "请输入正确手机号", + duration: 3000 + }); + + that.setData({ + btnLoading: false + }); + return; + } + + var formData = { + userName: that.data.inputUserName, + tel: that.data.inputTel, + }; + formData["applyType"] = that.data.applyType; + // formData["sex"] = that.data.sex; + + + if (that.data.applyType == 1) { + formData["storeJobId"] = that.data.jobDetail.id; + } + + console.log(formData); + that.checkMsgCode(formData); + + }, + + doSubmit(formData) { + var that = this; + + try { + var value = wx.getStorageSync('fromQrCodeChannelContactId') + if (value) { + console.log("fromQrCodeChannelContactId:======", value); + formData['channelContactId'] = value; + } + } catch (e) { + console.log("获取缓存设置的参数错误:", e); + } + try { + var value = wx.getStorageSync('storageSyncAgencyUserId') + if (value) { + console.log("storageSyncAgencyUserId======", value); + formData['agencyUserId'] = value; + } + } catch (e) { + console.log("获取缓存设置的参数错误:", e); + } + + formData['isCommission'] = app.globalData.isCommission; + + wx.request({ + url: app.globalData.ip + "/user/resource/applyJobWX", + method: "POST", + header: app.globalData.headers, + data: formData, + success: function (res) { + console.log(res); + + if (res.data.status == 200) { + if (res.data.data.doLogin == 0) { + app.setLoginUserTokenInfo(formData.tel, null); + } + if (app.isNotEmptyCheck(formData.userName)) {//报名之后把用户名修改了,设置一下前端缓存的用户名 + app.globalData.user.userName = formData.userName; + } + + wx.redirectTo({ + url: "../success/index?applyType=" + that.data.applyType + }); + } else { + wx.showToast({ + icon: "none", + title: res.data.msg, + duration: 2000 + }); + + that.setData({ + btnLoading: false + }); + } + } + }); + }, + addUserResourceAfterInputTel() { + var that = this; + var formData = { + applyType: 1, + sourceFrom: 19, + tel: that.data.inputTel, + }; + that.addOneRecord(formData); + }, + addUserResourceAfterGetWXUserInfoRefuse() { + var that = this; + + var formData = { + applyType: 1, + sourceFrom: 20, + tel: that.data.inputTel, + }; + that.addOneRecord(formData); + + that.openIOS1(); + }, + addOneRecord(formData) { + var that = this; + + if (that.data.applyType == 1) { + formData["storeJobId"] = that.data.jobDetail.id; + } + try { + var value = wx.getStorageSync('fromQrCodeChannelContactId') + if (value) { + console.log("fromQrCodeChannelContactId:======", value); + formData['channelContactId'] = value; + } + } catch (e) { + console.log("获取缓存设置的参数错误:", e); + } + try { + var value = wx.getStorageSync('storageSyncAgencyUserId') + if (value) { + console.log("storageSyncAgencyUserId======", value); + formData['agencyUserId'] = value; + } + } catch (e) { + console.log("获取缓存设置的参数错误:", e); + } + wx.request({ + url: app.globalData.ip + "/user/resource/applyJobWX", + method: "POST", + header: app.globalData.headers, + data: formData, + success: function (res) { + console.log(res); + if (res.data.status == 200) { + } else { + } + } + }); + }, + emptyMethod() { + }, + + 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.onSubmitAfterGetUserInfo(); + }, + fail: function(res) { + that.addUserResourceAfterGetWXUserInfoRefuse(); + } + }) + + }, + fail: (res) => { + console.log(res) + that.addUserResourceAfterGetWXUserInfoRefuse(); + } + }) + }, +}); \ No newline at end of file diff --git a/pages/enroll的副本/index.json b/pages/enroll的副本/index.json new file mode 100644 index 0000000..ebe54a3 --- /dev/null +++ b/pages/enroll的副本/index.json @@ -0,0 +1,4 @@ +{ + + "navigationBarTitleText": "我想报名" +} diff --git a/pages/enroll的副本/index.wxml b/pages/enroll的副本/index.wxml new file mode 100644 index 0000000..a5e0fb9 --- /dev/null +++ b/pages/enroll的副本/index.wxml @@ -0,0 +1,208 @@ + + + + 请提供你的联系方式和基本信息,稍后会有职业顾问联系你,免费帮你推荐合适的工作 + + + + + + + + {{jobDetail.jobName}} + + + + + + + + + + + + + + {{jobDetail.districtStr}}{{jobDetail.distance}} + + + + 限男生 + 限女生 + 男女不限 + 丨{{jobDetail.age}} + + + + + + + + {{jobDetail.salaryClassifyValue}} + + + + {{jobDetail.monthlyPay}} + + + + + + 返费{{jobDetail.rebate}} + + + {{item1}} + + + + + + +
+ + + + 姓名 + + + + + + + + + + + + + + 手机号 + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + 提交失败 + + 你需要授权你的微信昵称才可以提交报名 + + + + 知道了 + + + + + + + + 请输入发送到你手机上的验证码 + + + + + + {{sendTime}} + + + + + + 取消 + + + + + + + \ No newline at end of file diff --git a/pages/enroll的副本/index.wxss b/pages/enroll的副本/index.wxss new file mode 100644 index 0000000..871df87 --- /dev/null +++ b/pages/enroll的副本/index.wxss @@ -0,0 +1,176 @@ +.date-radio { + padding: 26rpx; +} + +.date-radio label + label { + margin-left: 20rpx; +} + +.row { + display: flex; + align-items: center; + padding: 0 30rpx; +} + +.row-title { + flex: 1; + padding-top: 28rpx; + padding-bottom: 28rpx; + font-size: 34rpx; + color: #000; +} +.row-extra { + flex-basis: initial; + font-size: 14px; + color: #111; +} + +.row-arrow { + width: 32rpx; + height: 32rpx; + margin-left: 16rpx; +} + +input { + font-size: 16px; + color: #262626 !important; +} +.zbtn{ + width: 100%; + position: absolute; + top: -23px; + left: 0; + z-index: 999; + opacity: 0; +} +.pr{ + position: relative; +} +.f14s{ + font-size: 14px; +} +.weui-cell:before { + -webkit-transform: scaleY(1); + transform: scaleY(1); + border-top: 1px solid rgba(0,0,0,0.08); +} +.weui-vcode-btn { + display: inline-block; + padding: 0 0.6em 0 0.7em; + line-height: 44px; + font-size: 16px; + height: auto; +} +.weui-cell{ + padding-left: 20px; +} +.weui-label{ + width:95px; +} +.form-row{ + margin-bottom: 20px; +} +.form-row-label,input { + font-size: 16px; +} +input { + height: 50px; + line-height: 50px; + padding-left: 20px; +} +.tagsLi{ + font-size: 16px; + font-weight: 400; + color: #555555; + line-height: 22px; + padding:1px 8px; +} +.mt50{ + margin-top: 90px; +} +.fullBtn{ + width: 260px; +height: 50px; +opacity: 1; +background-color: #027AFF; +border-radius: 25px; +font-size: 18px; +font-weight: 601; +color: #ffffff; +line-height: 50px; +} +.ml16{ + margin-left: 16px; +} +.weui-dialog__title{ + font-size: 18px; + font-weight: 400; + color: #333333; + line-height: 25px; + } + .weui-dialog__bd{ + font-size: 16px; + font-weight: 400; + text-align: center; + color: #787878; + line-height: 22px; + margin-bottom: 20px; + /* border-bottom: 1rpx solid #e2e2e2; */ + } + .weui-dialog__bd.bd1{ + padding:0 40px 20px 40px; + border-bottom: 1rpx solid #e2e2e2; + } + .weui-dialog__bd .display-flex{ + padding:0; + padding-bottom:20px; + border-bottom: 1rpx solid #e2e2e2; + } + .weui-dialog__hd { + padding: 32px 24px 20px; + } + .weui-dialog__bd input{ + height: 40px; + text-align: left; + opacity: 1; + background: #f4f4f4; + border-radius: 6px; + } + .rightTime{ + width: 120px; + text-align: center; + line-height: 40px; + } + + + .lflex{ + font-size: 18px; + font-weight: 601; + text-align: center; + color: #027AFF; + line-height: 28px; + /* margin-top: 7px; */ + padding:0 10px 0 30px; + } + .rflex{ + flex:1; + padding:0 30px 0 10px; + } + .rflex button{ + margin-top: 0; + margin-bottom: 0; + height: 40px; + opacity: 1; + background: #027AFF; + border-radius: 25px; + font-size: 18px; + font-weight: 601; + color: #ffffff; + line-height: 40px; + } + .pb16{ + padding-bottom: 16px; + } + .pb20{ + padding-bottom: 20px; + } \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index ff8189b..f643458 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1,1684 +1,34 @@ -const app = getApp(); - -const commonUtil = require("../../utils/commonUtil.js"); - -Page({ - data: { - isScrollTop:false, - background: ['http://matripe.oss-cn-beijing.aliyuncs.com/banner/banner1.jpg'], - pullNum: 0,//下拉次数 - tabs: [], - activeTab: 0, - innerAudioContext:{}, - systemInfo: {}, - getMenuButtonBoundingClientRect: {}, - // 手机基础信息 - tabs2: [], - loadMore: "", - loadContent: [ - "马不停蹄加载更多数据中...", - "-- 已经到底了,加不了咯 --" - ], - activeTab2: 0, - contentIndex: 0, - latestClass: 0, - zoneClass: 0, - jobList: [], - jobSpecialLabelNames: [], - storeJobListSearchForm: { - pageNum: 1, - pageSize: 20, - classify: 1, - sex: -1, - workTypeStr: "", - lat: "", - lng: "", - jobClassify: '', - sortTag: 0, - jobSpecialLabelIds: '', - cityName: '', - brandIds: '', - }, - loading: true, - topJobList: [], - hasLocation: false, - chooseActive: false, - //筛选是否高亮 - labelItems: [], - checkedlabelItems: [], - hasMoreData: true, //下拉是否还有更多数据 - inputShowed: false, - inputVal: "", - wxCode: '', - isCollect: false, - collectTxt: '收藏', - isLogin: false, - hasUserInfo: 0, - searchCityParamStorage: {name: '', shortName: ''}, - iosDialog1: false, - iosDialog2: false, - phoneDialog:false, - triggered: false, - pageShow:false, - getTop:false, - getTopn:false, - siv:'', - activez:'', - activen:'', - dialog1: false, - dialog2: false, - jobSpecialLabelList: [], - brandList: [], - firstMenu:'工价', - tagArray0:[], - tagArray1:[], - tagArray2:[], - tagArray3:[], - }, - PageScroll(e) { - let that = this; - const query = wx.createSelectorQuery().in(this); - query - .select(".xgxg") - .boundingClientRect(function (res) { - // console.log(res.top); - if (res.top > 24) { - that.setData({ - isScrollTop: false, - }); - } else{ - that.setData({ - isScrollTop: true, - }); - - } - }) - .exec(); - }, - // onPullDownRefresh:function(){ - // this.getJobList(); - // console.log(123); - - // wx.stopPullDownRefresh({ - // success() { - // app.refreshSuccess(); - // } - // }); - // }, - closeFix:function(){ - var that = this; - setTimeout(() => { - that.setData({ - getTop:false, - getTopn:false, - }) - }, 1); - - }, - chooseGj:function(){ - var that = this; - that.setData({ - - }) - // setTimeout(() => { - that.setData({ - getTop:true, - getTopn:false, - // siv:'menu', - }) - // }, 301); - - // wx.pageScrollTo({ - // scrollTop: 290, - // duration: 300, - // complete: function(res) { - // console.log(res) - // } - // }) - }, - toSpecialArea: function(e) { - var id = e.currentTarget.dataset.id; - wx.navigateTo({ - url: "../specialArea/index?id=" + id - }) - }, - chooseM:function(e){ - var str = e.currentTarget.dataset.id; - console.log(str); - var that = this; - that.setData({ - activez:str - }) - if(str == 'zuijin') {//距离最近 - wx.getLocation({ - type: 'gcj02', - success(res1) { - console.log("获取位置1"); - 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.setData({ - firstMenu:'最近', - storeJobListSearchForm: that.data.storeJobListSearchForm - }); - that.data.storeJobListSearchForm.pageNum = 1; - that.setData({ - storeJobListSearchForm: that.data.storeJobListSearchForm, - jobList: [], - }); - - // var promise = new Promise(function(resolve,reject){ - // that.getJobList(); - // }); - that.getJobList().then(()=>{ - that.setData({ - siv:'menu', - }) - }) - - }, - 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, - jobList: [], - }); - that.getJobList().then(()=>{ - that.setData({ - siv:'menu', - }) - }) - }, - fail() { - } - }); - } - } - }) - } - }); - } else if(str == 'zuigao') {//工价最高 - that.data.storeJobListSearchForm.sortTag = 0; - that.data.storeJobListSearchForm.pageNum = 1; - that.setData({ - storeJobListSearchForm: that.data.storeJobListSearchForm, - firstMenu:'工价', - jobList: [], - }); - that.getJobList().then(()=>{ - that.setData({ - siv:'menu', - }) - }) - } - - }, - - chooseNl:function(){ - var that = this; - that.setData({ - - }) - // setTimeout(() => { - that.setData({ - getTopn:true, - getTop:false - // siv:'menu' - }) - // }, 301); - // wx.pageScrollTo({ - // scrollTop: 290, - // duration: 300, - // complete: function(res) { - // console.log(res) - // } - // }) - }, - choosen:function(e){ - var str = e.currentTarget.dataset.id; - var ageStr = e.currentTarget.dataset.str; - console.log(str); - var that = this; - if(that.data.activen == str) { - str = ''; - ageStr = ''; - } - that.setData({ - activen:str - }) - that.data.storeJobListSearchForm.pageNum = 1; - that.data.storeJobListSearchForm.ageStr = ageStr; - that.setData({ - storeJobListSearchForm: that.data.storeJobListSearchForm, - jobList: [], - }); - that.getJobList(); - // that.getJobList().then(()=>{ - // that.setData({ - // siv:'menu', - // }) - // }) - }, - onScrollRefresh: function () { - var that=this; - that.data.storeJobListSearchForm.pageNum = 1; - that.setData({ - jobList: [], - }) - that.getJobList(); - - // setTimeout(function(){ - // that.setData({ - // jobList: [],: false, - // }) - // },2000); - }, - open1() { - // wx.pageScrollTo({ - // scrollTop: 290, - // duration: 300, - // complete: function(res) { - // console.log(res) - // } - // }) - this.setData({ - dialog1: true, - getTopn:false, - getTop:false - }); - }, - open2() { - // wx.pageScrollTo({ - // scrollTop: 290, - // duration: 300, - // complete: function(res) { - // console.log(res) - // } - // }) - this.setData({ - dialog2: true, - getTopn:false, - getTop:false - }); - }, - cc:function(){}, - close: function () { - this.setData({ - dialog1: false, - dialog2: false, - iosDialog1: false, - iosDialog2: false, - phoneDialog:false, - }) - }, - openIOS1: function() { - this.setData({ - iosDialog1: true - }); - }, - - openIOS2: function() { - this.setData({ - iosDialog2: true - }); - }, - showphone:function(){ - this.setData({ - phoneDialog: true - }); - }, - searchKey: function(e) { - console.log(e); - this.data.jobList = []; - this.data.storeJobListSearchForm.pageNum = 1; - this.data.storeJobListSearchForm.keys = e.detail.value; - this.getJobList(); - }, - showInput: function() { - this.setData({ - inputShowed: true - }); - }, - hideInput: function() { - this.setData({ - inputVal: "", - inputShowed: false - }); - }, - onShareAppMessage: function () { - var path = commonUtil.getCurrentPageUrlWithArgs(); - if(app.globalData.isLogin && app.globalData.agencyStatus - 0 != 0) {//当前用户是代理人 - path += (path.indexOf('?') >= 0 ? '&' : '?') + 'agencyUserId=' + app.globalData.loginUserInfo.id; - } - console.log(path) - return { - "title":'伯才', - 'path': path, - } - }, - clearInput: function() { - this.setData({ - inputVal: "", - inputShowed: false, - hasMoreData: true, - }); - this.data.jobList = []; - this.data.storeJobListSearchForm.pageNum = 1; - this.data.storeJobListSearchForm.keys = ''; - this.getJobList(); - }, - inputTyping: function(e) { - this.setData({ - inputVal: e.detail.value - }); - }, - clear() { - wx.clearStorage(); - - console.log("清除成功"); - }, - 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); - 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); - } - }) - that.setData({ - tagArray0:that.data.tagArray0, - tagArray1:that.data.tagArray1, - tagArray2:that.data.tagArray2, - tagArray3:that.data.tagArray3, - }) - - 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 - }) - - } - }) - }, - getBrandNameAllList: function () { - var that = this; - wx.request({ - url: app.globalData.ip + '/brand/getBrandNameAllList', - data: { - }, - header: app.globalData.header, - method: "GET", - success: function (res) { - console.log(res); - - var brandIdArray = that.data.storeJobListSearchForm.brandIds.split(','); - - res.data.data.forEach(item => { - item['checked'] = false; - brandIdArray.forEach(item1 => { - if (item.id == item1) { - item['checked'] = true; - } - }); - }); - that.setData({ - brandList:res.data.data - }) - - } - }) - }, - selectJobSpecialLabel: function(e) { - var that = this; - var index = e.currentTarget.dataset.index; - var indexTag = e.currentTarget.dataset.indextag; -// debugger; - if(indexTag=='0'){ - if(that.data.tagArray0[index].checked) { - that.data.tagArray0[index].checked = false; - } else { - that.data.tagArray0[index].checked = true; - } - this.setData({ - tagArray0: that.data.tagArray0 - }); - }else if(indexTag=='1'){ - if(that.data.tagArray1[index].checked) { - that.data.tagArray1[index].checked = false; - } else { - that.data.tagArray1[index].checked = true; - } - this.setData({ - tagArray1: that.data.tagArray1 - }); - }else if(indexTag=='2'){ - if(that.data.tagArray2[index].checked) { - that.data.tagArray2[index].checked = false; - } else { - that.data.tagArray2[index].checked = true; - } - this.setData({ - tagArray2: that.data.tagArray2 - }); - }else if(indexTag=='3'){ - if(that.data.tagArray3[index].checked) { - that.data.tagArray3[index].checked = false; - } else { - that.data.tagArray3[index].checked = true; - } - this.setData({ - tagArray3: that.data.tagArray3 - }); - } - // jobSpecialLabelList - - // if(that.data.jobSpecialLabelList[index].checked) { - // that.data.jobSpecialLabelList[index].checked = false; - // } else { - // that.data.jobSpecialLabelList[index].checked = true; - // } - // this.setData({ - // jobSpecialLabelList: that.data.jobSpecialLabelList - // }); - }, - selectBrand: function(e) { - var that = this; - var index = e.currentTarget.dataset.index; - if(that.data.brandList[index].checked) { - that.data.brandList[index].checked = false; - } else { - that.data.brandList[index].checked = true; - } - this.setData({ - brandList: that.data.brandList - }); - }, - reset:function(e){ - var that = this; - if(e.target.dataset.type == 1) {//特色 - that.data.jobSpecialLabelList.forEach(item => { - if (item.checked) { - item.checked = false; - } - }) - that.setData({ - jobSpecialLabelList: that.data.jobSpecialLabelList, - }); - } else if(e.target.dataset.type == 2) {//品牌 - that.data.brandList.forEach(item => { - if (item.checked) { - item.checked = false; - } - }) - that.setData({ - brandList:that.data.brandList - }); - } - }, - loginOut: function () { - var that = this; - var jobSpecialLabelIdArray = []; - that.data.jobSpecialLabelList.forEach(item => { - if (item.checked) { - jobSpecialLabelIdArray.push(item.id); - } - }); - - if (jobSpecialLabelIdArray.length > 0) { - that.data.storeJobListSearchForm.jobSpecialLabelIds = jobSpecialLabelIdArray.join(','); - } else { - that.data.storeJobListSearchForm.jobSpecialLabelIds = ''; - } - - var brandIdArray = []; - that.data.brandList.forEach(item => { - if (item.checked) { - brandIdArray.push(item.id); - } - }); - - if (brandIdArray.length > 0) { - that.data.storeJobListSearchForm.brandIds = brandIdArray.join(','); - } else { - that.data.storeJobListSearchForm.brandIds = ''; - } - that.data.storeJobListSearchForm.pageNum = 1; - that.setData({ - jobList: [], - dialog2: false, - dialog1: false, - }) - that.getJobList(); - }, - onLoad(options) { - var that = this; - wx.showLoading({ - title: '加载中...', - }) - 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 searchJobListParamStorage = wx.getStorageSync('searchJobListParamStorage') - if (searchJobListParamStorage) { - console.log("searchJobListParamStorage:======", searchJobListParamStorage); - that.data.storeJobListSearchForm.jobSpecialLabelIds = searchJobListParamStorage.jobSpecialLabelIds; - that.data.storeJobListSearchForm.brandIds = searchJobListParamStorage.brandIds; - that.data.storeJobListSearchForm.sortTag = searchJobListParamStorage.sortTag; - if (searchJobListParamStorage.sortTag == 2) { - that.findLocation(); - } - that.setData({ - storeJobListSearchForm: that.data.storeJobListSearchForm - }); - } - } catch (e) { - console.log("获取缓存设置的查询职位列表参数错误:", e); - } - 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); - var sceneJson = commonUtil.sceneToJson(sceneStr); - console.log("sceneJson===", sceneJson); - if (sceneJson.fromType == 1) { - app.globalData.isCommission = 1; - wx.setStorageSync('storageSyncAgencyUserId', sceneJson.userId); - } - - //先设置代理人缓存人再登录 - app.getLoginUserTokenInfo(); - - } else if (app.isNotEmptyCheck(options.fromType)) {//扫小程序普通二维码携带参数-来源ID - console.log("options.fromType========" + options.fromType); - if (options.fromType == 0) { - console.log("options.id========" + options.id); - console.log("options.userId========" + options.userId); - try { - app.globalData.isCommission = 1; - wx.setStorageSync('fromQrCodeChannelContactId', options.id); - that.getAgencyUserId(options.id); - - } catch (e) { - console.log("0-扫描微信二维码,设置参数错误:", e); - } - } else if (options.fromType.indexOf('0&id=') >= 0) {//兼容2021-9-9之前的二维码 - var paramsTempId = options.fromType.replace('0&id=', ''); - console.log("¶msTempId========" + paramsTempId); - try { - app.globalData.isCommission = 1; - wx.setStorageSync('fromQrCodeChannelContactId', paramsTempId); - that.getAgencyUserId(paramsTempId); - } catch (e) { - console.log("0-扫描微信二维码,设置参数错误:", e); - } - } else {//兼容2021-9-9之前的二维码 - var paramsTempId = options.fromType.replace('0,id=', ''); - console.log("=paramsTempId========" + paramsTempId); - try { - app.globalData.isCommission = 1; - wx.setStorageSync('fromQrCodeChannelContactId', paramsTempId); - that.getAgencyUserId(paramsTempId); - } catch (e) { - console.log("0-扫描微信二维码,设置参数错误:", e); - } - } - } else { - console.log("options.fromType===else=====" + options); - } - - - //this.wxLogin(); - let res = wx.getStorageSync('storeJobId'); //详情页返回 - console.log(res); - if (app.isEmptyCheck(res.data)) { - this.setData({ - jobList: [] - }); - } else { - wx.removeStorageSync({ - key: "storeJobId" - }); - } - - console.log("on show"); - - //登录=================================start - if (app.globalData.isLogin) { - this.setData({ - isLogin: app.globalData.isLogin, - hasUserInfo: app.globalData.hasUserInfo, - }); - } else { - // 由于 userLogin 是网络请求,可能会在 Page.onLoad 之后才返回 - // 所以此处加入 callback 以防止这种情况 - app.userLoginCallback = res => { - this.setData({ - isLogin: app.globalData.isLogin, - hasUserInfo: app.globalData.hasUserInfo, - }); - } - } - //登录=================================end - - this.getHopeJobLabels(); - var reset = true; - let agencyUserId = options.agencyUserId; - if(agencyUserId) { - wx.setStorageSync('storageSyncAgencyUserId', agencyUserId); - console.log('agencyUserId', agencyUserId) - app.globalData.isCommission = 1; - } - }, - onTabClick(e) { - const index = e.detail.index - this.setData({ - activeTab: index - }) - }, - - onChange(e) { - const index = e.detail.index - this.setData({ - activeTab: index - }) - }, - - 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() { - }, - play(){ - this.data.innerAudioContext.play() - }, - - onShow() { - let that = this; - this.setData({ - isLogin: app.globalData.isLogin, - iosDialog2: app.globalData.isLogin ? false : that.data.iosDialog2, - }); - if(app.globalData.isLogin) { - this.collectedStoreJobList(); - } else { - this.wxLogin(); - } - console.log(app.globalData.headers) - - - that.data.innerAudioContext = wx.createInnerAudioContext({ - useWebAudioImplement: false // 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项 - }) - that.data.innerAudioContext.src = 'http://bocaiyishoudan.oss-cn-beijing.aliyuncs.com/success.wav' - that.play(); - - // innerAudioContext.play() // 播放 - - // innerAudioContext.pause() // 暂停 - - // innerAudioContext.stop() // 停止 - /*this.wxLogin(); - let res = wx.getStorageSync({ - key: "storeJobId" - }); //详情页返回 - - if (app.isEmptyCheck(res.data)) { - this.setData({ - jobList: [] - }); - } else { - wx.removeStorageSync({ - key: "storeJobId" - }); - } - - console.log("on show"); - this.getHopeJobLabels(); - var reset = true;*/ - - - }, - 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.jobList; - let jobs = that.data.jobList; - 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({ - jobList: 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) { - wx.showToast({ - title: '获取失败', - icon: 'none', - duration: 2000 - }) - } - }); - }, - makePhoneCall() { - var that = this; - wx.makePhoneCall({ - phoneNumber: '18039237825' - }); - }, - goScreen(){ - wx.navigateTo({ - url: '../screen/index', - }) - }, - goCity(){ - 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; - return new Promise(function(resolve,reject){ - if (that.data.storeJobListSearchForm.sortTag == 2) {//如果按照距离排序,拼接上坐标 - that.data.storeJobListSearchForm.lng = app.globalData.lng; - that.data.storeJobListSearchForm.lat = app.globalData.lat; - } - - wx.request({ - url: app.globalData.ip + "/store/job/list", - method: "POST", - header: app.globalData.headers, - data: that.data.storeJobListSearchForm, - success: function(res) { - console.log("职位列表↓↓↓↓"); - console.log(res); - - // that.setData({ - // hasMoreData: false - // }); - - that.setData({ - loading: true, - hasMoreData: true - }); - setTimeout(function(){ - that.setData({ - triggered: false, - }) - },1000); - if (app.isEmptyCheck(res.data.data)) { - that.setData({ - hasMoreData: false - }); - } else if ( - res.data.data.jobList == null || - res.data.data.jobList.length == 0 || - res.data.data.jobList.length < that.data.storeJobListSearchForm.pageSize - ) { - var jobListTemp = that.disposeJobListData(res.data.data.jobList); - that.data.jobList = that.data.jobList.concat(jobListTemp); - - that.setData({ - jobList: that.data.jobList, - hasMoreData: false - }); - } else { - - var jobListTemp = that.disposeJobListData(res.data.data.jobList); - that.data.jobList = that.data.jobList.concat(jobListTemp); - - that.setData({ - jobList: that.data.jobList, - }); - } - wx.hideLoading({ - success: (res) => {}, - }) - that.setData({ - loading: false, - pageShow:true, - storeJobListSearchForm: that.data.storeJobListSearchForm - }); - resolve(); - } - - }); - }) - - - }, - /** - * 处理后台返回的职位列表 - */ - disposeJobListData(jobList) { - var that = this; - jobList.forEach(item => { - item["workType"] = commonUtil.getWorkTypeById( - item.workTypeMulti - ); - - if (app.isNotEmptyCheck(item.distance)) { - item["distanceKm"] = commonUtil.getDistanceName( - item.distance - ); - } - //年龄 - var ageStr = ''; - if (app.isNotEmptyCheck(item.minAge) && app.isNotEmptyCheck(item.maxAge)) { - ageStr = item.minAge + '-' + item.maxAge + '岁'; - } else if (app.isNotEmptyCheck(item.minAge)) { - ageStr = item.minAge + '岁以上'; - } else if (app.isNotEmptyCheck(item.maxAge)) { - ageStr = item.maxAge + '岁以下'; - } - item["age"] = ageStr; - item["salaryClassifyValue"] = commonUtil.getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue); - // //时薪 - // var hourlyPayStr = ''; - // var hasHourlyPay = false; - // if (app.isNotEmptyCheck(item.hourlyPay)) { - // hourlyPayStr = item.hourlyPay + '元/小时'; - // hasHourlyPay = true; - // } else if (app.isNotEmptyCheck(item.dayPay)) { - // hourlyPayStr = item.dayPay + '元/日'; - // hasHourlyPay = true; - // } else { - // if (app.isNotEmptyCheck(item.minMonthlyPay) && app.isNotEmptyCheck(item.maxMonthlyPay)) { - // if (item.minMonthlyPay == item.maxMonthlyPay) { - // hourlyPayStr = item.minMonthlyPay; - // } else { - // hourlyPayStr = item.minMonthlyPay + '-' + item.maxMonthlyPay; - // } - // } else if (app.isNotEmptyCheck(item.minMonthlyPay)) { - // hourlyPayStr = item.minMonthlyPay; - // } else if (app.isNotEmptyCheck(item.maxMonthlyPay)) { - // hourlyPayStr = item.maxMonthlyPay; - // } - // } - // item["hourlyPay"] = hourlyPayStr; - //月薪 - var monthlyPayStr = ''; - // if (hasHourlyPay) { - if (app.isNotEmptyCheck(item.minMonthlyPay) && app.isNotEmptyCheck(item.maxMonthlyPay)) { - if (item.minMonthlyPay == item.maxMonthlyPay) { - monthlyPayStr = item.minMonthlyPay; - } else { - monthlyPayStr = item.minMonthlyPay + '-' + item.maxMonthlyPay; - } - } else if (app.isNotEmptyCheck(item.minMonthlyPay)) { - monthlyPayStr = item.minMonthlyPay; - } else if (app.isNotEmptyCheck(item.maxMonthlyPay)) { - monthlyPayStr = item.maxMonthlyPay; - } - // } - item["monthlyPay"] = monthlyPayStr; - //地址深圳丨龙岗区丨 - var districtStr = ''; - if (app.isNotEmptyCheck(item.district)) { - var districtArr = item.district.split(','); - if(districtArr.length < 3) { - districtStr = districtArr[districtArr.length - 1]; - } else { - districtStr = districtArr[1] + '丨' + districtArr[2]; - } - //districtStr = districtArr[1] + '丨' + districtArr[2]; - } - item["district"] = districtStr; - //职位特色 - item['jobSpecialLabelNames'] = that.getJobSpecialLabelNamesArray(item.jobSpecialLabelNames); - - }); - - return jobList; - }, - - // 下拉加载更多 - onScrollToLower() { - var that = this; - if (app.globalData.isLogin) { - that.data.storeJobListSearchForm.pageNum = - that.data.storeJobListSearchForm.pageNum + 1; - that.getJobList(); - // 根据实际数据加载情况设定 loadMore 的值即可,分别为 load 和 over - - this.setData({ - loadMore: "load", - // loading:true - }); - } else { - if (that.data.pullNum == 0) { - - // 通过审核后打开 - - // that.openIOS1(); - } - } - - that.data.pullNum = that.data.pullNum + 1; - - }, - - getJobSpecialLabelNamesArray(jobSpecialLabelNames) { - if (app.isNotEmptyCheck(jobSpecialLabelNames)) { - return jobSpecialLabelNames.split(', '); - } - return []; - }, - handleTabClick(e) { - var that = this; - var index = e.detail.index; - console.log( - e.detail.index - ); - let categoryCurr = that.data.tabs2[index].category; // that.data.tabs2.forEach((item,index2) => { - // if (index == index2) { - // categoryCurr = item.category - // } - // if( index == 0){ - // categoryCurr = -1 - // } - // }) - - this.setData({ - // [tabsName]: index, - contentIndex: index - }); - console.log(categoryCurr); - that.data.storeJobListSearchForm.jobClassify = categoryCurr; - that.data.storeJobListSearchForm.pageNum = 1; - that.setData({ - jobList: [] - }); - that.getJobList(); - }, - - - - - goDetail(e) { - console.log(e); - var that = this; - wx.navigateTo({ - url: "../detail/index?storeJobId=" + e.currentTarget.dataset.id + "&wxCode=" + that.data.wxCode - }); - }, - - - - goEnroll(e) { - // wx.navigateTo({ - // url: "../enroll/index?applyType=0" - // }); - var that = this; - console.log(that.data.jobList[e.currentTarget.dataset.idx]); - wx.setStorageSync('jobDetailStorage', that.data.jobList[e.currentTarget.dataset.idx]); - - wx.navigateTo({ - url: "../enroll/index?applyType=1&tel=" + app.globalData.loginUserInfo.tel - }); - }, - emptyMethod() { - - }, - wxLogin() { - var that = this; - wx.login({ - success(res) { - if (res.code) { - that.setData({ - wxCode: res.code - }); - - } else { - console.log('获取code失败!' + res.errMsg) - } - } - }) - }, - getPhoneNumber(e) { - var that = this; - console.log(e) - console.log(e.detail.errMsg) - /*wx.setStorageSync({ - key: "jobDetailStorage", - data: that.data.jobList[e.currentTarget.dataset.idx] - });*/ - - wx.setStorageSync('jobDetailStorage', that.data.jobList[e.currentTarget.dataset.idx]); - - // 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, - }, - success: function(res) { - console.log(res); - app.globalData.openId = res.data.data.openId; - let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); - var collected = e.currentTarget.dataset.collected; - if (collected) { - promise.then(res => { - that.setData({ - isLogin: app.globalData.isLogin - }); - that.doCollected(collected, e.currentTarget.dataset.jobid); - that.collectedStoreJobList(); - }) - } else { - promise.then(res => { - wx.navigateTo({ - url: "../enroll/index?applyType=1" - //url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber - }); - }) - - } - - }, - 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, - }, - success: function(res) { - console.log(res); - let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); - var collected = e.currentTarget.dataset.collected; - if (collected) { - promise.then(res => { - that.setData({ - isLogin: app.globalData.isLogin - }); - that.doCollected(collected, e.currentTarget.dataset.jobid); - }) - } else { - promise.then(res => { - wx.navigateTo({ - url: "../enroll/index?applyType=1" - //url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber - }); - }) - } - }, - fail: function(res) { - console.log("获取用户手机号错误"); - } - }) - } else { - console.log('获取手机号失败!' + res.errMsg) - } - } - }) - } - }) - - } else { //拒绝 - var collected = e.currentTarget.dataset.collected; - if (collected) { - try { - wx.setStorageSync('comeFromPage', 'index'); - } catch (e) { - console.log("index-页面跳转,设置参数错误:", e); - } - wx.navigateTo({ - url: '/pages/login/index', - }) - } else { - wx.navigateTo({ - url: "../enroll/index?applyType=1" - }); - } - } - 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, - }, - 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, - }, - 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({ - url: app.globalData.ip + "/channel/contact/getAgencyUserId", - method: "GET", - header: app.globalData.header, - data: { - channelContactId: id - }, - success: function(res) { - console.log("获取来源对应的代理人,来源ID:", id); - console.log(res); - try { - if (app.isNotEmptyCheck(res.data.data)) { - wx.setStorageSync('storageSyncAgencyUserId', res.data.data); - } - //先设置代理人缓存人再登录 - app.getLoginUserTokenInfo(); - } catch (e) { - console.log("0-扫描微信二维码,设置参数错误:", e); - //先设置代理人缓存人再登录 - app.getLoginUserTokenInfo(); - } - }, - fail: function(res0) { - console.log("获取来源对应的代理人错误", id); - } - }); - }, - collectPaste(e) { - var txt; - var that = this; - 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.jobList.length; ++i) { - if (that.data.jobList[i].id - storeJobId == 0) { - that.data.jobList[i].collected = 2; - break; - } - } - txt = '取消收藏'; - } else { //收藏 - for (var i = 0; i != that.data.jobList.length; ++i) { - if (that.data.jobList[i].id - storeJobId == 0) { - that.data.jobList[i].collected = 1; - break; - } - } - txt = '收藏成功'; - } - that.setData({ - jobList: that.data.jobList, - 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) {//搜索 - that.showInput(); - } 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.jobList[_idx]); - wx.navigateTo({ - url: "../enroll/index?applyType=1&tel=" + app.globalData.loginUserInfo.tel - }); - } - } -}); \ No newline at end of file +const plugin = requirePlugin('job-plugin') +Page({ + data: { + items: [], + currentItem: 0, + tabSelectID:{ num1: 0, num2: 0, num0: 0 } + }, + onLoad() { + plugin.sayHello() + const world = plugin.answer + }, + sub_fun: function (e) { + console.log(e.detail) + wx.navigateTo({ + url: '../detail/index?id='+e.detail, + }) + }, + special_btn: function (e) { + console.log(e.detail) + wx.navigateTo({ + url: '../special/index?id='+e.detail, + }) + }, + sendMsg(e){ + console.log(e.detail); + }, + addItem() { + this.data.items.push(this.data.currentItem++) + this.setData({ + items: this.data.items, + currentItem: this.data.currentItem + }) + }, +}) diff --git a/pages/index/index.json b/pages/index/index.json index 3c0a769..a9c7419 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -1,3 +1,8 @@ { - "navigationBarTitleText": "好工作" -} + + "navigationStyle":"custom", + + "usingComponents": { + "job-list": "plugin://job-plugin/job-component" + } +} \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 0ee60fa..095cdb4 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,384 +1 @@ - - - - - - - - - - - - - - - - - - {{searchCityParamStorage.name == '' ? '全国' : - searchCityParamStorage.shortName}} - - -
- - - - - - -
- - - - - 客服 - -
- - - - - - - - - 今日热推 - - - - 短期工 - - - - 寒假工 - - - - 大龄工 - - - - - - - - - - - - - - - - - {{firstMenu}} - - - 离我最近 - 工价最高 - - - - - 年龄 - - - - 16-18岁 - 18-45岁 - 45-58岁 - 58岁以上 - - - - 特色 - 更多 - - - - - - - - - - - - - - - - - - - - - - - - - {{item.jobName}} - - - {{item.aliasName}} - - - {{item.salaryClassifyValue}} - - - - - - - {{item.district}} - - | - {{item.distanceKm}} - {{item.age}} - {{item.monthlyPay}} - - - - - - - - {{item1}} - - - - - - - - - - - - - - 没有符合条件的职位 - - - - - - - - - 加载中... - - - 暂无更多数据 - - - - - - - - -
- - - - 暂无记录 - - - - - - - 登录后才能查看全部职位 - - 现在登录吗? - - - - 知道了 - - - - - - - - - - - - 请提供你的手机号 - - 方便客服联系你,帮你推荐工作 - - - - - - - - - - - - - - - - - - - - 孔老师 - 专属客服 - - 18039237825 - - - 取消 - - - - - - -
- - - - - - - - 薪资福利 - - - {{item.name}} - - - 食宿保障 - - - {{item.name}} - - - 班制特色 - - - {{item.name}} - - - - 其它特色 - - - {{item.name}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - 品牌 - - - {{item.name}} - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss index fc9d5b8..3cc20cf 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -1,529 +1,12 @@ -/* required by usingComponents */ - -page { - overflow-x: hidden; - /* line-height: 1; */ - background: #f5f5f5; -} - -.demo-steps-class { - margin: 20px 0; - border-bottom: 1px solid #e5e5e5; -} - -.demo-btn-container { - display: flex; - justify-content: space-between; - margin: 20px; -} - -.demo-btn { - width: 47%; -} - -.atd-config-transparent-header { - background-color: #fff; -} - -/*.atd-config-transparent-header .content-top { -background-image: url('https://gw.alipayobjects.com/mdn/rms_7a3c08/afts/img/A*13jpTYrECqYAAAAAAAAAAABjARQnAQ'); -background-repeat: no-repeat; -background-size: 100% 100%; --moz-background-size: 100% 100%; -width: 100vw; -height: 746rpx; -color: #fff; -}*/ - -/* .atd-config-transparent-header .content-top{ -color: #000; -} */ - -.atd-config-transparent-header .content-top .statusBar { - background-color: transparent; - display: flex; - align-items: center; - justify-content: center; -} - -.atd-config-transparent-header .content-top .titleBar { - /* background-color: #108ee9; */ - display: flex; - align-items: center; - justify-content: left; - padding-left: 32rpx; -} - -.tab-content { - display: flex; - justify-content: center; - align-items: center; - padding: 40rpx; - box-sizing: border-box; - /* 如果 swipeable="{{true}}",需要增加 height */ - /* height: 350px; */ - /* 为了体现 stickyBar 的作用而增加的 tab-content 的高度 */ - height: 100vh; -} - -/*.atd-config-transparent-header .content-bottom { -margin-top: 1000rpx; -background-image: url('https://gw.alipayobjects.com/mdn/rms_7a3c08/afts/img/A*rFctR6myHjcAAAAAAAAAAABjARQnAQ'); -background-repeat: no-repeat; -background-size: 100% 100%; --moz-background-size: 100% 100%; -width: 100vw; -height: 746rpx; -} -*/ - -.atd-config-transparent-header .content-top .titleBar { - background-color: #fff; -} - -.am-tabs-content-wrap { - height: auto !important; -} - -.atd-config-transparent-header .content-top .titleBar { - padding-left: 0; -} - -.am-tabs-tab-bar-wrap { - width: calc(100vw - 120px); -} - -.latest { - color: rgba(0, 0, 0, 0.65); -} - -.latest .active { - color: rgba(0, 0, 0, 0.85); - font-weight: 601; -} - -.secondSelect { - padding: 8px 20px; -} - -.zoneSelect .dib { - font-size: 14px; - margin-left: 8px; - background-color: rgba(0, 0, 0, 0.06); - color: rgba(0, 0, 0, 0.65); - padding: 4px; -} - -.zoneSelect .dib.active { - background-color: rgba(254, 99, 63, 0.15); - color: #fe633f; -} - -.am-tabs-bar { - padding-left: 20px; -} - -.weui-tabs-swiper { - display: none; -} - -.weui-tabs-bar__item { - margin: 12px 8px; -} - -.weui-tabs-bar__title { - color: rgba(0, 0, 0, 0.65); -} - -.weui-tabs-bar__title.tab-bar-title__selected { - font-weight: bolder; - color: rgba(0, 0, 0, 0.85); - border-bottom-color: #fe633f !important; -} - -.dian { - float: left; - position: relative; - line-height: 36px; - left: 20px; - box-shadow: -30px 0 30px #fff; -} - -.weui-cell_access .weui-cell__ft { - padding-right: 16px; -} - - -.weui-tabs { - padding-left: 12px; -} -.tagsLi { - font-size: 12px; -} -.mt6{ - margin-top: 6px; -} -.mb6{ - margin-bottom: 5px; -} -.logoClass { - width: 48px; - height: 48px; - max-width: 100%; - /* border: 1rpx solid #ddd; */ - margin-bottom: 16px; - border-radius: 4px; -} -.f20.c633.lh1{ - font-weight: 601; -} -.storeName{ - font-size: 18px; - color:rgba(0,0,0,0.85); - /* flex:1; */ - width: 360rpx; - font-weight: 601; - line-height:1; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.hourPay{ - /* f18 c633 lh1 flex-1 tr */ - font-size: 18px; - line-height: 1; - flex: 1; - text-align: right; - white-space: nowrap; - color: #ea433a; - font-weight: 601; -} -.weui-btn_primary{ - border-radius: 3px; - font-size: 12px; - margin-top: 2px; - font-weight: 400; - width:48px; - height:18px; - border-radius: 9px; - /* line-height: 18px; */ - background-color: #027AFF; - margin-bottom: 0; -} -.searchbar-result{margin-top:0;font-size:14px}.searchbar-result .weui-cell__bd{padding:2px 0 2px 20px;color:var(--weui-FG-1)}.searchbar-result:before{display:none} -.weui-search-bar { - position: relative; - padding: 8px 16px; - padding-bottom: 10px; -} - .tttg{ - max-width:calc(100vw - 150px);float: left; - } - .tttg .tagsLi{ - display: none; - } - .tttg .tagsLi:nth-child(-n+3){ - display: inline-block; - } - .f12.c045.flex-1.mb4{ - margin-bottom: 7px; - } - .prImg{ - position: relative; - width: 48px; - height: 48px; - margin-right: 10px; - } -button.collect{ - position: absolute; - left: 0; - top: 65px; - bottom: 0; - padding: 0; - width: 48px; - border: 1rpx solid #ddd; - border-radius: 2px; - height: 18px; - text-align: center; - margin: 0; - padding: 0px; - background-color: #fff; - /* opacity: 0.7; */ - line-height: 18px; - /* border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; */ - display: flex; - align-items: center; - justify-content: center; - } - .cf{ - color: #fff; - } - .icon-sousuo{ - position: absolute; - top: 50%; - left: 14px; - margin-top: -7px; - width: 16px; - height: 16px; - color: #cccccc; - } - .weui-search-bar__form{ - border-radius: 20px; - } - .icon-qingchu{ - position: absolute; - top: 50%; - right: 4px; - margin-top: -15px; - padding: 8px; - width: 18px; - height: 18px; - -webkit-mask-size: 16px; - mask-size: 16px; - color: rgba(0, 0, 0, 0.25); - } - .f15{ - font-size: 15px !important; - } - .weui-search-bar__box { - padding-left: 36px; - } - .weui-search-bar{ - background-color: #027AFF; - } - .p1020 { - padding:10px; -} -/* .p1020 .display-flex{ - padding: 16px 10px; - -} */ -#searchBar .cf,#searchBar .cf085{ - color: #FFF; -} -.banner{ - /* background-color: #027AFF; */ - margin-top: 10px; - padding:0 10px; -} -.innerSwiper{ - border-radius: 8px; - overflow: hidden; -} - -.jobCenter{ - height:calc(100vh); - padding: 0px; - margin-top:10px; - border-radius: 8px; - position: relative; - z-index: 999; - background-color: #fff; - box-sizing: border-box; -} -.jobCenterActive{ - height:calc(100vh); - /* padding: 0 10px; - margin-top:10px; */ - /* border-radius: 8px; */ - position: relative; - z-index: 999; - background-color: #f8f8f7; - box-sizing: border-box; -} -.jobOne{ - /* margin-top: 10px; */ - padding: 0 10px; - line-height: 1; - margin-top:-1rpx; -} -.jobIn{ - border-top:1rpx solid #f5f5f5; - padding: 20px 0px; - background-color: #fff; - /* border-radius: 4px; */ -} -.jobOne:nth-of-type(1) .jobIn{ - border-top:0; -} -.jobOne:nth-child(1) .jobIn{ - border-top:0; -} -.icon-weixuanzhong2{ - color:#999; - font-size:6px; - margin-left:2px; - line-height: 36px; - position: relative; - top:-2px; -} -.xgxg .icon-zhankai{ - font-size: 14px; -} -.csbf{ - /* position: relative; */ - /* width:60px; */ - text-align: center; - font-size: 14px; - font-weight: 400; - color: #333333; - line-height: 36px; -} -/* .csbf .icon-baise1{ - font-size:7px; - position: relative; - top: -2px; -} */ -.csbf.active{ - color: #027AFF; -} -/* .csbf.active .icon-baise1{ - color: #027AFF; -} */ -.weui-search-bar__box .weui-search-bar__input { - padding: 6px 0; -} -.topHover,.ahover{ - opacity: 0.8; -} -.c8,.icon-wode-shoucang{ - color: #888; -} -.cred,.icon-shoucang-red{ - color: rgba(234,67,58,1); -} -.collect.collectred{ - /* opacity: 0.5; */ - border: 1rpx solid #ea433a; -} -.opacityBtn{ - position: absolute; - width: calc(100vw - 100px); - z-index: 999; - opacity: 0; -} -.opacityBtn button{ - padding:0 10px; -} -.clickMore{ - width: 120px; -height: 28px; -margin: 16px auto; -opacity: 1; -border: 1px solid #979797; -border-radius: 20px; -color: #8c8c8c; -line-height: 28px; -font-size: 14px; -background-color: #fff; -} -.stm{ - font-size: 13px; - font-weight: 400; - text-align: center; - color: #262626; - line-height: 18px; -} -.gjFixed{ - position: absolute; - top:36px; - left:-20px; - width:100vw; - height:100vh; - /* right:0; - bottom:0; */ - z-index: 999; - background-color: rgba(0, 0, 0, 0.8); -} -.oh{ - overflow: hidden; - height:100vh; -} -.oa{ - overflow:auto; -} -.weui-half-screen-dialog{ - height:75vh; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - padding: 0; -} -.bgAc{ - display: inline-block; - width: 80px; -height: 32px; -background: #f5f6f7; -border-radius: 7px; -font-size: 12px; -color: #666666; -line-height: 32px; -text-align: center; -margin-right:8px; -margin-bottom: 10px; -} -.bgAc.active{ - background: rgba(2,122,255,0.10); - color: #027aff; -} -.btmFix { - position: fixed; - bottom: 0px; - left: 0; - width: 100%; - /* background-color: #ffffff; */ - z-index: 99; -} -.resetBtn{ - height: 44px; - opacity: 1; - background: #fff; - border: 1rpx solid #027AFF; - border-radius: 25px; - font-size: 18px; - font-weight: 601; - color: #027AFF; - padding: 0; - line-height: 44px; - margin-bottom: 40px; -} -.resetBtn:active{ - background-color: #f2f2f2; -} -.loginOut { - width: 100%; - height: 44px; - opacity: 1; - background: #027AFF; - border-radius: 25px; - font-size: 18px; - font-weight: 601; - color: #ffffff; - padding: 0; - line-height: 44px; - margin-bottom: 40px; -} -.loginOut{ - margin-top: 20rpx; -} -.pl10{ - padding-left: 10px; -} -.pr10{ - padding-right: 10px; -} -.spef{ - justify-content: space-between; -} -.spef .flex-1{ - max-width: 52px; - min-width: 52px; -} -.p10100{ - padding: 10px 10px 0; - min-height:100vh; -} -.xgxg{ - padding:0 10px;position: sticky; top: 0;z-index:1000;background-color: #fff; - border-radius: 8px; +/* pages/index/index.wxss */ +#nav { + text-align: center; + background: #eeeeee; + margin: 1em; + padding: 1em; + border-radius: 5px; +} + +#add { + margin: 1em; } \ No newline at end of file diff --git a/pages/index的副本/index.js b/pages/index的副本/index.js new file mode 100644 index 0000000..ff8189b --- /dev/null +++ b/pages/index的副本/index.js @@ -0,0 +1,1684 @@ +const app = getApp(); + +const commonUtil = require("../../utils/commonUtil.js"); + +Page({ + data: { + isScrollTop:false, + background: ['http://matripe.oss-cn-beijing.aliyuncs.com/banner/banner1.jpg'], + pullNum: 0,//下拉次数 + tabs: [], + activeTab: 0, + innerAudioContext:{}, + systemInfo: {}, + getMenuButtonBoundingClientRect: {}, + // 手机基础信息 + tabs2: [], + loadMore: "", + loadContent: [ + "马不停蹄加载更多数据中...", + "-- 已经到底了,加不了咯 --" + ], + activeTab2: 0, + contentIndex: 0, + latestClass: 0, + zoneClass: 0, + jobList: [], + jobSpecialLabelNames: [], + storeJobListSearchForm: { + pageNum: 1, + pageSize: 20, + classify: 1, + sex: -1, + workTypeStr: "", + lat: "", + lng: "", + jobClassify: '', + sortTag: 0, + jobSpecialLabelIds: '', + cityName: '', + brandIds: '', + }, + loading: true, + topJobList: [], + hasLocation: false, + chooseActive: false, + //筛选是否高亮 + labelItems: [], + checkedlabelItems: [], + hasMoreData: true, //下拉是否还有更多数据 + inputShowed: false, + inputVal: "", + wxCode: '', + isCollect: false, + collectTxt: '收藏', + isLogin: false, + hasUserInfo: 0, + searchCityParamStorage: {name: '', shortName: ''}, + iosDialog1: false, + iosDialog2: false, + phoneDialog:false, + triggered: false, + pageShow:false, + getTop:false, + getTopn:false, + siv:'', + activez:'', + activen:'', + dialog1: false, + dialog2: false, + jobSpecialLabelList: [], + brandList: [], + firstMenu:'工价', + tagArray0:[], + tagArray1:[], + tagArray2:[], + tagArray3:[], + }, + PageScroll(e) { + let that = this; + const query = wx.createSelectorQuery().in(this); + query + .select(".xgxg") + .boundingClientRect(function (res) { + // console.log(res.top); + if (res.top > 24) { + that.setData({ + isScrollTop: false, + }); + } else{ + that.setData({ + isScrollTop: true, + }); + + } + }) + .exec(); + }, + // onPullDownRefresh:function(){ + // this.getJobList(); + // console.log(123); + + // wx.stopPullDownRefresh({ + // success() { + // app.refreshSuccess(); + // } + // }); + // }, + closeFix:function(){ + var that = this; + setTimeout(() => { + that.setData({ + getTop:false, + getTopn:false, + }) + }, 1); + + }, + chooseGj:function(){ + var that = this; + that.setData({ + + }) + // setTimeout(() => { + that.setData({ + getTop:true, + getTopn:false, + // siv:'menu', + }) + // }, 301); + + // wx.pageScrollTo({ + // scrollTop: 290, + // duration: 300, + // complete: function(res) { + // console.log(res) + // } + // }) + }, + toSpecialArea: function(e) { + var id = e.currentTarget.dataset.id; + wx.navigateTo({ + url: "../specialArea/index?id=" + id + }) + }, + chooseM:function(e){ + var str = e.currentTarget.dataset.id; + console.log(str); + var that = this; + that.setData({ + activez:str + }) + if(str == 'zuijin') {//距离最近 + wx.getLocation({ + type: 'gcj02', + success(res1) { + console.log("获取位置1"); + 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.setData({ + firstMenu:'最近', + storeJobListSearchForm: that.data.storeJobListSearchForm + }); + that.data.storeJobListSearchForm.pageNum = 1; + that.setData({ + storeJobListSearchForm: that.data.storeJobListSearchForm, + jobList: [], + }); + + // var promise = new Promise(function(resolve,reject){ + // that.getJobList(); + // }); + that.getJobList().then(()=>{ + that.setData({ + siv:'menu', + }) + }) + + }, + 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, + jobList: [], + }); + that.getJobList().then(()=>{ + that.setData({ + siv:'menu', + }) + }) + }, + fail() { + } + }); + } + } + }) + } + }); + } else if(str == 'zuigao') {//工价最高 + that.data.storeJobListSearchForm.sortTag = 0; + that.data.storeJobListSearchForm.pageNum = 1; + that.setData({ + storeJobListSearchForm: that.data.storeJobListSearchForm, + firstMenu:'工价', + jobList: [], + }); + that.getJobList().then(()=>{ + that.setData({ + siv:'menu', + }) + }) + } + + }, + + chooseNl:function(){ + var that = this; + that.setData({ + + }) + // setTimeout(() => { + that.setData({ + getTopn:true, + getTop:false + // siv:'menu' + }) + // }, 301); + // wx.pageScrollTo({ + // scrollTop: 290, + // duration: 300, + // complete: function(res) { + // console.log(res) + // } + // }) + }, + choosen:function(e){ + var str = e.currentTarget.dataset.id; + var ageStr = e.currentTarget.dataset.str; + console.log(str); + var that = this; + if(that.data.activen == str) { + str = ''; + ageStr = ''; + } + that.setData({ + activen:str + }) + that.data.storeJobListSearchForm.pageNum = 1; + that.data.storeJobListSearchForm.ageStr = ageStr; + that.setData({ + storeJobListSearchForm: that.data.storeJobListSearchForm, + jobList: [], + }); + that.getJobList(); + // that.getJobList().then(()=>{ + // that.setData({ + // siv:'menu', + // }) + // }) + }, + onScrollRefresh: function () { + var that=this; + that.data.storeJobListSearchForm.pageNum = 1; + that.setData({ + jobList: [], + }) + that.getJobList(); + + // setTimeout(function(){ + // that.setData({ + // jobList: [],: false, + // }) + // },2000); + }, + open1() { + // wx.pageScrollTo({ + // scrollTop: 290, + // duration: 300, + // complete: function(res) { + // console.log(res) + // } + // }) + this.setData({ + dialog1: true, + getTopn:false, + getTop:false + }); + }, + open2() { + // wx.pageScrollTo({ + // scrollTop: 290, + // duration: 300, + // complete: function(res) { + // console.log(res) + // } + // }) + this.setData({ + dialog2: true, + getTopn:false, + getTop:false + }); + }, + cc:function(){}, + close: function () { + this.setData({ + dialog1: false, + dialog2: false, + iosDialog1: false, + iosDialog2: false, + phoneDialog:false, + }) + }, + openIOS1: function() { + this.setData({ + iosDialog1: true + }); + }, + + openIOS2: function() { + this.setData({ + iosDialog2: true + }); + }, + showphone:function(){ + this.setData({ + phoneDialog: true + }); + }, + searchKey: function(e) { + console.log(e); + this.data.jobList = []; + this.data.storeJobListSearchForm.pageNum = 1; + this.data.storeJobListSearchForm.keys = e.detail.value; + this.getJobList(); + }, + showInput: function() { + this.setData({ + inputShowed: true + }); + }, + hideInput: function() { + this.setData({ + inputVal: "", + inputShowed: false + }); + }, + onShareAppMessage: function () { + var path = commonUtil.getCurrentPageUrlWithArgs(); + if(app.globalData.isLogin && app.globalData.agencyStatus - 0 != 0) {//当前用户是代理人 + path += (path.indexOf('?') >= 0 ? '&' : '?') + 'agencyUserId=' + app.globalData.loginUserInfo.id; + } + console.log(path) + return { + "title":'伯才', + 'path': path, + } + }, + clearInput: function() { + this.setData({ + inputVal: "", + inputShowed: false, + hasMoreData: true, + }); + this.data.jobList = []; + this.data.storeJobListSearchForm.pageNum = 1; + this.data.storeJobListSearchForm.keys = ''; + this.getJobList(); + }, + inputTyping: function(e) { + this.setData({ + inputVal: e.detail.value + }); + }, + clear() { + wx.clearStorage(); + + console.log("清除成功"); + }, + 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); + 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); + } + }) + that.setData({ + tagArray0:that.data.tagArray0, + tagArray1:that.data.tagArray1, + tagArray2:that.data.tagArray2, + tagArray3:that.data.tagArray3, + }) + + 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 + }) + + } + }) + }, + getBrandNameAllList: function () { + var that = this; + wx.request({ + url: app.globalData.ip + '/brand/getBrandNameAllList', + data: { + }, + header: app.globalData.header, + method: "GET", + success: function (res) { + console.log(res); + + var brandIdArray = that.data.storeJobListSearchForm.brandIds.split(','); + + res.data.data.forEach(item => { + item['checked'] = false; + brandIdArray.forEach(item1 => { + if (item.id == item1) { + item['checked'] = true; + } + }); + }); + that.setData({ + brandList:res.data.data + }) + + } + }) + }, + selectJobSpecialLabel: function(e) { + var that = this; + var index = e.currentTarget.dataset.index; + var indexTag = e.currentTarget.dataset.indextag; +// debugger; + if(indexTag=='0'){ + if(that.data.tagArray0[index].checked) { + that.data.tagArray0[index].checked = false; + } else { + that.data.tagArray0[index].checked = true; + } + this.setData({ + tagArray0: that.data.tagArray0 + }); + }else if(indexTag=='1'){ + if(that.data.tagArray1[index].checked) { + that.data.tagArray1[index].checked = false; + } else { + that.data.tagArray1[index].checked = true; + } + this.setData({ + tagArray1: that.data.tagArray1 + }); + }else if(indexTag=='2'){ + if(that.data.tagArray2[index].checked) { + that.data.tagArray2[index].checked = false; + } else { + that.data.tagArray2[index].checked = true; + } + this.setData({ + tagArray2: that.data.tagArray2 + }); + }else if(indexTag=='3'){ + if(that.data.tagArray3[index].checked) { + that.data.tagArray3[index].checked = false; + } else { + that.data.tagArray3[index].checked = true; + } + this.setData({ + tagArray3: that.data.tagArray3 + }); + } + // jobSpecialLabelList + + // if(that.data.jobSpecialLabelList[index].checked) { + // that.data.jobSpecialLabelList[index].checked = false; + // } else { + // that.data.jobSpecialLabelList[index].checked = true; + // } + // this.setData({ + // jobSpecialLabelList: that.data.jobSpecialLabelList + // }); + }, + selectBrand: function(e) { + var that = this; + var index = e.currentTarget.dataset.index; + if(that.data.brandList[index].checked) { + that.data.brandList[index].checked = false; + } else { + that.data.brandList[index].checked = true; + } + this.setData({ + brandList: that.data.brandList + }); + }, + reset:function(e){ + var that = this; + if(e.target.dataset.type == 1) {//特色 + that.data.jobSpecialLabelList.forEach(item => { + if (item.checked) { + item.checked = false; + } + }) + that.setData({ + jobSpecialLabelList: that.data.jobSpecialLabelList, + }); + } else if(e.target.dataset.type == 2) {//品牌 + that.data.brandList.forEach(item => { + if (item.checked) { + item.checked = false; + } + }) + that.setData({ + brandList:that.data.brandList + }); + } + }, + loginOut: function () { + var that = this; + var jobSpecialLabelIdArray = []; + that.data.jobSpecialLabelList.forEach(item => { + if (item.checked) { + jobSpecialLabelIdArray.push(item.id); + } + }); + + if (jobSpecialLabelIdArray.length > 0) { + that.data.storeJobListSearchForm.jobSpecialLabelIds = jobSpecialLabelIdArray.join(','); + } else { + that.data.storeJobListSearchForm.jobSpecialLabelIds = ''; + } + + var brandIdArray = []; + that.data.brandList.forEach(item => { + if (item.checked) { + brandIdArray.push(item.id); + } + }); + + if (brandIdArray.length > 0) { + that.data.storeJobListSearchForm.brandIds = brandIdArray.join(','); + } else { + that.data.storeJobListSearchForm.brandIds = ''; + } + that.data.storeJobListSearchForm.pageNum = 1; + that.setData({ + jobList: [], + dialog2: false, + dialog1: false, + }) + that.getJobList(); + }, + onLoad(options) { + var that = this; + wx.showLoading({ + title: '加载中...', + }) + 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 searchJobListParamStorage = wx.getStorageSync('searchJobListParamStorage') + if (searchJobListParamStorage) { + console.log("searchJobListParamStorage:======", searchJobListParamStorage); + that.data.storeJobListSearchForm.jobSpecialLabelIds = searchJobListParamStorage.jobSpecialLabelIds; + that.data.storeJobListSearchForm.brandIds = searchJobListParamStorage.brandIds; + that.data.storeJobListSearchForm.sortTag = searchJobListParamStorage.sortTag; + if (searchJobListParamStorage.sortTag == 2) { + that.findLocation(); + } + that.setData({ + storeJobListSearchForm: that.data.storeJobListSearchForm + }); + } + } catch (e) { + console.log("获取缓存设置的查询职位列表参数错误:", e); + } + 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); + var sceneJson = commonUtil.sceneToJson(sceneStr); + console.log("sceneJson===", sceneJson); + if (sceneJson.fromType == 1) { + app.globalData.isCommission = 1; + wx.setStorageSync('storageSyncAgencyUserId', sceneJson.userId); + } + + //先设置代理人缓存人再登录 + app.getLoginUserTokenInfo(); + + } else if (app.isNotEmptyCheck(options.fromType)) {//扫小程序普通二维码携带参数-来源ID + console.log("options.fromType========" + options.fromType); + if (options.fromType == 0) { + console.log("options.id========" + options.id); + console.log("options.userId========" + options.userId); + try { + app.globalData.isCommission = 1; + wx.setStorageSync('fromQrCodeChannelContactId', options.id); + that.getAgencyUserId(options.id); + + } catch (e) { + console.log("0-扫描微信二维码,设置参数错误:", e); + } + } else if (options.fromType.indexOf('0&id=') >= 0) {//兼容2021-9-9之前的二维码 + var paramsTempId = options.fromType.replace('0&id=', ''); + console.log("¶msTempId========" + paramsTempId); + try { + app.globalData.isCommission = 1; + wx.setStorageSync('fromQrCodeChannelContactId', paramsTempId); + that.getAgencyUserId(paramsTempId); + } catch (e) { + console.log("0-扫描微信二维码,设置参数错误:", e); + } + } else {//兼容2021-9-9之前的二维码 + var paramsTempId = options.fromType.replace('0,id=', ''); + console.log("=paramsTempId========" + paramsTempId); + try { + app.globalData.isCommission = 1; + wx.setStorageSync('fromQrCodeChannelContactId', paramsTempId); + that.getAgencyUserId(paramsTempId); + } catch (e) { + console.log("0-扫描微信二维码,设置参数错误:", e); + } + } + } else { + console.log("options.fromType===else=====" + options); + } + + + //this.wxLogin(); + let res = wx.getStorageSync('storeJobId'); //详情页返回 + console.log(res); + if (app.isEmptyCheck(res.data)) { + this.setData({ + jobList: [] + }); + } else { + wx.removeStorageSync({ + key: "storeJobId" + }); + } + + console.log("on show"); + + //登录=================================start + if (app.globalData.isLogin) { + this.setData({ + isLogin: app.globalData.isLogin, + hasUserInfo: app.globalData.hasUserInfo, + }); + } else { + // 由于 userLogin 是网络请求,可能会在 Page.onLoad 之后才返回 + // 所以此处加入 callback 以防止这种情况 + app.userLoginCallback = res => { + this.setData({ + isLogin: app.globalData.isLogin, + hasUserInfo: app.globalData.hasUserInfo, + }); + } + } + //登录=================================end + + this.getHopeJobLabels(); + var reset = true; + let agencyUserId = options.agencyUserId; + if(agencyUserId) { + wx.setStorageSync('storageSyncAgencyUserId', agencyUserId); + console.log('agencyUserId', agencyUserId) + app.globalData.isCommission = 1; + } + }, + onTabClick(e) { + const index = e.detail.index + this.setData({ + activeTab: index + }) + }, + + onChange(e) { + const index = e.detail.index + this.setData({ + activeTab: index + }) + }, + + 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() { + }, + play(){ + this.data.innerAudioContext.play() + }, + + onShow() { + let that = this; + this.setData({ + isLogin: app.globalData.isLogin, + iosDialog2: app.globalData.isLogin ? false : that.data.iosDialog2, + }); + if(app.globalData.isLogin) { + this.collectedStoreJobList(); + } else { + this.wxLogin(); + } + console.log(app.globalData.headers) + + + that.data.innerAudioContext = wx.createInnerAudioContext({ + useWebAudioImplement: false // 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项 + }) + that.data.innerAudioContext.src = 'http://bocaiyishoudan.oss-cn-beijing.aliyuncs.com/success.wav' + that.play(); + + // innerAudioContext.play() // 播放 + + // innerAudioContext.pause() // 暂停 + + // innerAudioContext.stop() // 停止 + /*this.wxLogin(); + let res = wx.getStorageSync({ + key: "storeJobId" + }); //详情页返回 + + if (app.isEmptyCheck(res.data)) { + this.setData({ + jobList: [] + }); + } else { + wx.removeStorageSync({ + key: "storeJobId" + }); + } + + console.log("on show"); + this.getHopeJobLabels(); + var reset = true;*/ + + + }, + 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.jobList; + let jobs = that.data.jobList; + 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({ + jobList: 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) { + wx.showToast({ + title: '获取失败', + icon: 'none', + duration: 2000 + }) + } + }); + }, + makePhoneCall() { + var that = this; + wx.makePhoneCall({ + phoneNumber: '18039237825' + }); + }, + goScreen(){ + wx.navigateTo({ + url: '../screen/index', + }) + }, + goCity(){ + 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; + return new Promise(function(resolve,reject){ + if (that.data.storeJobListSearchForm.sortTag == 2) {//如果按照距离排序,拼接上坐标 + that.data.storeJobListSearchForm.lng = app.globalData.lng; + that.data.storeJobListSearchForm.lat = app.globalData.lat; + } + + wx.request({ + url: app.globalData.ip + "/store/job/list", + method: "POST", + header: app.globalData.headers, + data: that.data.storeJobListSearchForm, + success: function(res) { + console.log("职位列表↓↓↓↓"); + console.log(res); + + // that.setData({ + // hasMoreData: false + // }); + + that.setData({ + loading: true, + hasMoreData: true + }); + setTimeout(function(){ + that.setData({ + triggered: false, + }) + },1000); + if (app.isEmptyCheck(res.data.data)) { + that.setData({ + hasMoreData: false + }); + } else if ( + res.data.data.jobList == null || + res.data.data.jobList.length == 0 || + res.data.data.jobList.length < that.data.storeJobListSearchForm.pageSize + ) { + var jobListTemp = that.disposeJobListData(res.data.data.jobList); + that.data.jobList = that.data.jobList.concat(jobListTemp); + + that.setData({ + jobList: that.data.jobList, + hasMoreData: false + }); + } else { + + var jobListTemp = that.disposeJobListData(res.data.data.jobList); + that.data.jobList = that.data.jobList.concat(jobListTemp); + + that.setData({ + jobList: that.data.jobList, + }); + } + wx.hideLoading({ + success: (res) => {}, + }) + that.setData({ + loading: false, + pageShow:true, + storeJobListSearchForm: that.data.storeJobListSearchForm + }); + resolve(); + } + + }); + }) + + + }, + /** + * 处理后台返回的职位列表 + */ + disposeJobListData(jobList) { + var that = this; + jobList.forEach(item => { + item["workType"] = commonUtil.getWorkTypeById( + item.workTypeMulti + ); + + if (app.isNotEmptyCheck(item.distance)) { + item["distanceKm"] = commonUtil.getDistanceName( + item.distance + ); + } + //年龄 + var ageStr = ''; + if (app.isNotEmptyCheck(item.minAge) && app.isNotEmptyCheck(item.maxAge)) { + ageStr = item.minAge + '-' + item.maxAge + '岁'; + } else if (app.isNotEmptyCheck(item.minAge)) { + ageStr = item.minAge + '岁以上'; + } else if (app.isNotEmptyCheck(item.maxAge)) { + ageStr = item.maxAge + '岁以下'; + } + item["age"] = ageStr; + item["salaryClassifyValue"] = commonUtil.getSalaryClassifyValue(item.salaryClassify, item.salaryClassifyValue); + // //时薪 + // var hourlyPayStr = ''; + // var hasHourlyPay = false; + // if (app.isNotEmptyCheck(item.hourlyPay)) { + // hourlyPayStr = item.hourlyPay + '元/小时'; + // hasHourlyPay = true; + // } else if (app.isNotEmptyCheck(item.dayPay)) { + // hourlyPayStr = item.dayPay + '元/日'; + // hasHourlyPay = true; + // } else { + // if (app.isNotEmptyCheck(item.minMonthlyPay) && app.isNotEmptyCheck(item.maxMonthlyPay)) { + // if (item.minMonthlyPay == item.maxMonthlyPay) { + // hourlyPayStr = item.minMonthlyPay; + // } else { + // hourlyPayStr = item.minMonthlyPay + '-' + item.maxMonthlyPay; + // } + // } else if (app.isNotEmptyCheck(item.minMonthlyPay)) { + // hourlyPayStr = item.minMonthlyPay; + // } else if (app.isNotEmptyCheck(item.maxMonthlyPay)) { + // hourlyPayStr = item.maxMonthlyPay; + // } + // } + // item["hourlyPay"] = hourlyPayStr; + //月薪 + var monthlyPayStr = ''; + // if (hasHourlyPay) { + if (app.isNotEmptyCheck(item.minMonthlyPay) && app.isNotEmptyCheck(item.maxMonthlyPay)) { + if (item.minMonthlyPay == item.maxMonthlyPay) { + monthlyPayStr = item.minMonthlyPay; + } else { + monthlyPayStr = item.minMonthlyPay + '-' + item.maxMonthlyPay; + } + } else if (app.isNotEmptyCheck(item.minMonthlyPay)) { + monthlyPayStr = item.minMonthlyPay; + } else if (app.isNotEmptyCheck(item.maxMonthlyPay)) { + monthlyPayStr = item.maxMonthlyPay; + } + // } + item["monthlyPay"] = monthlyPayStr; + //地址深圳丨龙岗区丨 + var districtStr = ''; + if (app.isNotEmptyCheck(item.district)) { + var districtArr = item.district.split(','); + if(districtArr.length < 3) { + districtStr = districtArr[districtArr.length - 1]; + } else { + districtStr = districtArr[1] + '丨' + districtArr[2]; + } + //districtStr = districtArr[1] + '丨' + districtArr[2]; + } + item["district"] = districtStr; + //职位特色 + item['jobSpecialLabelNames'] = that.getJobSpecialLabelNamesArray(item.jobSpecialLabelNames); + + }); + + return jobList; + }, + + // 下拉加载更多 + onScrollToLower() { + var that = this; + if (app.globalData.isLogin) { + that.data.storeJobListSearchForm.pageNum = + that.data.storeJobListSearchForm.pageNum + 1; + that.getJobList(); + // 根据实际数据加载情况设定 loadMore 的值即可,分别为 load 和 over + + this.setData({ + loadMore: "load", + // loading:true + }); + } else { + if (that.data.pullNum == 0) { + + // 通过审核后打开 + + // that.openIOS1(); + } + } + + that.data.pullNum = that.data.pullNum + 1; + + }, + + getJobSpecialLabelNamesArray(jobSpecialLabelNames) { + if (app.isNotEmptyCheck(jobSpecialLabelNames)) { + return jobSpecialLabelNames.split(', '); + } + return []; + }, + handleTabClick(e) { + var that = this; + var index = e.detail.index; + console.log( + e.detail.index + ); + let categoryCurr = that.data.tabs2[index].category; // that.data.tabs2.forEach((item,index2) => { + // if (index == index2) { + // categoryCurr = item.category + // } + // if( index == 0){ + // categoryCurr = -1 + // } + // }) + + this.setData({ + // [tabsName]: index, + contentIndex: index + }); + console.log(categoryCurr); + that.data.storeJobListSearchForm.jobClassify = categoryCurr; + that.data.storeJobListSearchForm.pageNum = 1; + that.setData({ + jobList: [] + }); + that.getJobList(); + }, + + + + + goDetail(e) { + console.log(e); + var that = this; + wx.navigateTo({ + url: "../detail/index?storeJobId=" + e.currentTarget.dataset.id + "&wxCode=" + that.data.wxCode + }); + }, + + + + goEnroll(e) { + // wx.navigateTo({ + // url: "../enroll/index?applyType=0" + // }); + var that = this; + console.log(that.data.jobList[e.currentTarget.dataset.idx]); + wx.setStorageSync('jobDetailStorage', that.data.jobList[e.currentTarget.dataset.idx]); + + wx.navigateTo({ + url: "../enroll/index?applyType=1&tel=" + app.globalData.loginUserInfo.tel + }); + }, + emptyMethod() { + + }, + wxLogin() { + var that = this; + wx.login({ + success(res) { + if (res.code) { + that.setData({ + wxCode: res.code + }); + + } else { + console.log('获取code失败!' + res.errMsg) + } + } + }) + }, + getPhoneNumber(e) { + var that = this; + console.log(e) + console.log(e.detail.errMsg) + /*wx.setStorageSync({ + key: "jobDetailStorage", + data: that.data.jobList[e.currentTarget.dataset.idx] + });*/ + + wx.setStorageSync('jobDetailStorage', that.data.jobList[e.currentTarget.dataset.idx]); + + // 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, + }, + success: function(res) { + console.log(res); + app.globalData.openId = res.data.data.openId; + let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); + var collected = e.currentTarget.dataset.collected; + if (collected) { + promise.then(res => { + that.setData({ + isLogin: app.globalData.isLogin + }); + that.doCollected(collected, e.currentTarget.dataset.jobid); + that.collectedStoreJobList(); + }) + } else { + promise.then(res => { + wx.navigateTo({ + url: "../enroll/index?applyType=1" + //url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber + }); + }) + + } + + }, + 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, + }, + success: function(res) { + console.log(res); + let promise = app.setLoginUserTokenInfo(res.data.data.phoneNumber, null); + var collected = e.currentTarget.dataset.collected; + if (collected) { + promise.then(res => { + that.setData({ + isLogin: app.globalData.isLogin + }); + that.doCollected(collected, e.currentTarget.dataset.jobid); + }) + } else { + promise.then(res => { + wx.navigateTo({ + url: "../enroll/index?applyType=1" + //url: "../enroll/index?applyType=1&tel=" + res.data.data.phoneNumber + }); + }) + } + }, + fail: function(res) { + console.log("获取用户手机号错误"); + } + }) + } else { + console.log('获取手机号失败!' + res.errMsg) + } + } + }) + } + }) + + } else { //拒绝 + var collected = e.currentTarget.dataset.collected; + if (collected) { + try { + wx.setStorageSync('comeFromPage', 'index'); + } catch (e) { + console.log("index-页面跳转,设置参数错误:", e); + } + wx.navigateTo({ + url: '/pages/login/index', + }) + } else { + wx.navigateTo({ + url: "../enroll/index?applyType=1" + }); + } + } + 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, + }, + 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, + }, + 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({ + url: app.globalData.ip + "/channel/contact/getAgencyUserId", + method: "GET", + header: app.globalData.header, + data: { + channelContactId: id + }, + success: function(res) { + console.log("获取来源对应的代理人,来源ID:", id); + console.log(res); + try { + if (app.isNotEmptyCheck(res.data.data)) { + wx.setStorageSync('storageSyncAgencyUserId', res.data.data); + } + //先设置代理人缓存人再登录 + app.getLoginUserTokenInfo(); + } catch (e) { + console.log("0-扫描微信二维码,设置参数错误:", e); + //先设置代理人缓存人再登录 + app.getLoginUserTokenInfo(); + } + }, + fail: function(res0) { + console.log("获取来源对应的代理人错误", id); + } + }); + }, + collectPaste(e) { + var txt; + var that = this; + 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.jobList.length; ++i) { + if (that.data.jobList[i].id - storeJobId == 0) { + that.data.jobList[i].collected = 2; + break; + } + } + txt = '取消收藏'; + } else { //收藏 + for (var i = 0; i != that.data.jobList.length; ++i) { + if (that.data.jobList[i].id - storeJobId == 0) { + that.data.jobList[i].collected = 1; + break; + } + } + txt = '收藏成功'; + } + that.setData({ + jobList: that.data.jobList, + 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) {//搜索 + that.showInput(); + } 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.jobList[_idx]); + wx.navigateTo({ + url: "../enroll/index?applyType=1&tel=" + app.globalData.loginUserInfo.tel + }); + } + } +}); \ No newline at end of file diff --git a/pages/index的副本/index.json b/pages/index的副本/index.json new file mode 100644 index 0000000..3c0a769 --- /dev/null +++ b/pages/index的副本/index.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "好工作" +} diff --git a/pages/index的副本/index.wxml b/pages/index的副本/index.wxml new file mode 100644 index 0000000..0ee60fa --- /dev/null +++ b/pages/index的副本/index.wxml @@ -0,0 +1,384 @@ + + + + + + + + + + + + + + + + + + {{searchCityParamStorage.name == '' ? '全国' : + searchCityParamStorage.shortName}} + + +
+ + + + + + +
+ + + + + 客服 + +
+ + + + + + + + + 今日热推 + + + + 短期工 + + + + 寒假工 + + + + 大龄工 + + + + + + + + + + + + + + + + + {{firstMenu}} + + + 离我最近 + 工价最高 + + + + + 年龄 + + + + 16-18岁 + 18-45岁 + 45-58岁 + 58岁以上 + + + + 特色 + 更多 + + + + + + + + + + + + + + + + + + + + + + + + + {{item.jobName}} + + + {{item.aliasName}} + + + {{item.salaryClassifyValue}} + + + + + + + {{item.district}} + + | + {{item.distanceKm}} + {{item.age}} + {{item.monthlyPay}} + + + + + + + + {{item1}} + + + + + + + + + + + + + + 没有符合条件的职位 + + + + + + + + + 加载中... + + + 暂无更多数据 + + + + + + + + +
+ + + + 暂无记录 + + + + + + + 登录后才能查看全部职位 + + 现在登录吗? + + + + 知道了 + + + + + + + + + + + + 请提供你的手机号 + + 方便客服联系你,帮你推荐工作 + + + + + + + + + + + + + + + + + + + + 孔老师 + 专属客服 + + 18039237825 + + + 取消 + + + + + + +
+ + + + + + + + 薪资福利 + + + {{item.name}} + + + 食宿保障 + + + {{item.name}} + + + 班制特色 + + + {{item.name}} + + + + 其它特色 + + + {{item.name}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + 品牌 + + + {{item.name}} + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/index的副本/index.wxss b/pages/index的副本/index.wxss new file mode 100644 index 0000000..fc9d5b8 --- /dev/null +++ b/pages/index的副本/index.wxss @@ -0,0 +1,529 @@ +/* required by usingComponents */ + +page { + overflow-x: hidden; + /* line-height: 1; */ + background: #f5f5f5; +} + +.demo-steps-class { + margin: 20px 0; + border-bottom: 1px solid #e5e5e5; +} + +.demo-btn-container { + display: flex; + justify-content: space-between; + margin: 20px; +} + +.demo-btn { + width: 47%; +} + +.atd-config-transparent-header { + background-color: #fff; +} + +/*.atd-config-transparent-header .content-top { +background-image: url('https://gw.alipayobjects.com/mdn/rms_7a3c08/afts/img/A*13jpTYrECqYAAAAAAAAAAABjARQnAQ'); +background-repeat: no-repeat; +background-size: 100% 100%; +-moz-background-size: 100% 100%; +width: 100vw; +height: 746rpx; +color: #fff; +}*/ + +/* .atd-config-transparent-header .content-top{ +color: #000; +} */ + +.atd-config-transparent-header .content-top .statusBar { + background-color: transparent; + display: flex; + align-items: center; + justify-content: center; +} + +.atd-config-transparent-header .content-top .titleBar { + /* background-color: #108ee9; */ + display: flex; + align-items: center; + justify-content: left; + padding-left: 32rpx; +} + +.tab-content { + display: flex; + justify-content: center; + align-items: center; + padding: 40rpx; + box-sizing: border-box; + /* 如果 swipeable="{{true}}",需要增加 height */ + /* height: 350px; */ + /* 为了体现 stickyBar 的作用而增加的 tab-content 的高度 */ + height: 100vh; +} + +/*.atd-config-transparent-header .content-bottom { +margin-top: 1000rpx; +background-image: url('https://gw.alipayobjects.com/mdn/rms_7a3c08/afts/img/A*rFctR6myHjcAAAAAAAAAAABjARQnAQ'); +background-repeat: no-repeat; +background-size: 100% 100%; +-moz-background-size: 100% 100%; +width: 100vw; +height: 746rpx; +} +*/ + +.atd-config-transparent-header .content-top .titleBar { + background-color: #fff; +} + +.am-tabs-content-wrap { + height: auto !important; +} + +.atd-config-transparent-header .content-top .titleBar { + padding-left: 0; +} + +.am-tabs-tab-bar-wrap { + width: calc(100vw - 120px); +} + +.latest { + color: rgba(0, 0, 0, 0.65); +} + +.latest .active { + color: rgba(0, 0, 0, 0.85); + font-weight: 601; +} + +.secondSelect { + padding: 8px 20px; +} + +.zoneSelect .dib { + font-size: 14px; + margin-left: 8px; + background-color: rgba(0, 0, 0, 0.06); + color: rgba(0, 0, 0, 0.65); + padding: 4px; +} + +.zoneSelect .dib.active { + background-color: rgba(254, 99, 63, 0.15); + color: #fe633f; +} + +.am-tabs-bar { + padding-left: 20px; +} + +.weui-tabs-swiper { + display: none; +} + +.weui-tabs-bar__item { + margin: 12px 8px; +} + +.weui-tabs-bar__title { + color: rgba(0, 0, 0, 0.65); +} + +.weui-tabs-bar__title.tab-bar-title__selected { + font-weight: bolder; + color: rgba(0, 0, 0, 0.85); + border-bottom-color: #fe633f !important; +} + +.dian { + float: left; + position: relative; + line-height: 36px; + left: 20px; + box-shadow: -30px 0 30px #fff; +} + +.weui-cell_access .weui-cell__ft { + padding-right: 16px; +} + + +.weui-tabs { + padding-left: 12px; +} +.tagsLi { + font-size: 12px; +} +.mt6{ + margin-top: 6px; +} +.mb6{ + margin-bottom: 5px; +} +.logoClass { + width: 48px; + height: 48px; + max-width: 100%; + /* border: 1rpx solid #ddd; */ + margin-bottom: 16px; + border-radius: 4px; +} +.f20.c633.lh1{ + font-weight: 601; +} +.storeName{ + font-size: 18px; + color:rgba(0,0,0,0.85); + /* flex:1; */ + width: 360rpx; + font-weight: 601; + line-height:1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.hourPay{ + /* f18 c633 lh1 flex-1 tr */ + font-size: 18px; + line-height: 1; + flex: 1; + text-align: right; + white-space: nowrap; + color: #ea433a; + font-weight: 601; +} +.weui-btn_primary{ + border-radius: 3px; + font-size: 12px; + margin-top: 2px; + font-weight: 400; + width:48px; + height:18px; + border-radius: 9px; + /* line-height: 18px; */ + background-color: #027AFF; + margin-bottom: 0; +} +.searchbar-result{margin-top:0;font-size:14px}.searchbar-result .weui-cell__bd{padding:2px 0 2px 20px;color:var(--weui-FG-1)}.searchbar-result:before{display:none} +.weui-search-bar { + position: relative; + padding: 8px 16px; + padding-bottom: 10px; +} + .tttg{ + max-width:calc(100vw - 150px);float: left; + } + .tttg .tagsLi{ + display: none; + } + .tttg .tagsLi:nth-child(-n+3){ + display: inline-block; + } + .f12.c045.flex-1.mb4{ + margin-bottom: 7px; + } + .prImg{ + position: relative; + width: 48px; + height: 48px; + margin-right: 10px; + } +button.collect{ + position: absolute; + left: 0; + top: 65px; + bottom: 0; + padding: 0; + width: 48px; + border: 1rpx solid #ddd; + border-radius: 2px; + height: 18px; + text-align: center; + margin: 0; + padding: 0px; + background-color: #fff; + /* opacity: 0.7; */ + line-height: 18px; + /* border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; */ + display: flex; + align-items: center; + justify-content: center; + } + .cf{ + color: #fff; + } + .icon-sousuo{ + position: absolute; + top: 50%; + left: 14px; + margin-top: -7px; + width: 16px; + height: 16px; + color: #cccccc; + } + .weui-search-bar__form{ + border-radius: 20px; + } + .icon-qingchu{ + position: absolute; + top: 50%; + right: 4px; + margin-top: -15px; + padding: 8px; + width: 18px; + height: 18px; + -webkit-mask-size: 16px; + mask-size: 16px; + color: rgba(0, 0, 0, 0.25); + } + .f15{ + font-size: 15px !important; + } + .weui-search-bar__box { + padding-left: 36px; + } + .weui-search-bar{ + background-color: #027AFF; + } + .p1020 { + padding:10px; +} +/* .p1020 .display-flex{ + padding: 16px 10px; + +} */ +#searchBar .cf,#searchBar .cf085{ + color: #FFF; +} +.banner{ + /* background-color: #027AFF; */ + margin-top: 10px; + padding:0 10px; +} +.innerSwiper{ + border-radius: 8px; + overflow: hidden; +} + +.jobCenter{ + height:calc(100vh); + padding: 0px; + margin-top:10px; + border-radius: 8px; + position: relative; + z-index: 999; + background-color: #fff; + box-sizing: border-box; +} +.jobCenterActive{ + height:calc(100vh); + /* padding: 0 10px; + margin-top:10px; */ + /* border-radius: 8px; */ + position: relative; + z-index: 999; + background-color: #f8f8f7; + box-sizing: border-box; +} +.jobOne{ + /* margin-top: 10px; */ + padding: 0 10px; + line-height: 1; + margin-top:-1rpx; +} +.jobIn{ + border-top:1rpx solid #f5f5f5; + padding: 20px 0px; + background-color: #fff; + /* border-radius: 4px; */ +} +.jobOne:nth-of-type(1) .jobIn{ + border-top:0; +} +.jobOne:nth-child(1) .jobIn{ + border-top:0; +} +.icon-weixuanzhong2{ + color:#999; + font-size:6px; + margin-left:2px; + line-height: 36px; + position: relative; + top:-2px; +} +.xgxg .icon-zhankai{ + font-size: 14px; +} +.csbf{ + /* position: relative; */ + /* width:60px; */ + text-align: center; + font-size: 14px; + font-weight: 400; + color: #333333; + line-height: 36px; +} +/* .csbf .icon-baise1{ + font-size:7px; + position: relative; + top: -2px; +} */ +.csbf.active{ + color: #027AFF; +} +/* .csbf.active .icon-baise1{ + color: #027AFF; +} */ +.weui-search-bar__box .weui-search-bar__input { + padding: 6px 0; +} +.topHover,.ahover{ + opacity: 0.8; +} +.c8,.icon-wode-shoucang{ + color: #888; +} +.cred,.icon-shoucang-red{ + color: rgba(234,67,58,1); +} +.collect.collectred{ + /* opacity: 0.5; */ + border: 1rpx solid #ea433a; +} +.opacityBtn{ + position: absolute; + width: calc(100vw - 100px); + z-index: 999; + opacity: 0; +} +.opacityBtn button{ + padding:0 10px; +} +.clickMore{ + width: 120px; +height: 28px; +margin: 16px auto; +opacity: 1; +border: 1px solid #979797; +border-radius: 20px; +color: #8c8c8c; +line-height: 28px; +font-size: 14px; +background-color: #fff; +} +.stm{ + font-size: 13px; + font-weight: 400; + text-align: center; + color: #262626; + line-height: 18px; +} +.gjFixed{ + position: absolute; + top:36px; + left:-20px; + width:100vw; + height:100vh; + /* right:0; + bottom:0; */ + z-index: 999; + background-color: rgba(0, 0, 0, 0.8); +} +.oh{ + overflow: hidden; + height:100vh; +} +.oa{ + overflow:auto; +} +.weui-half-screen-dialog{ + height:75vh; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + padding: 0; +} +.bgAc{ + display: inline-block; + width: 80px; +height: 32px; +background: #f5f6f7; +border-radius: 7px; +font-size: 12px; +color: #666666; +line-height: 32px; +text-align: center; +margin-right:8px; +margin-bottom: 10px; +} +.bgAc.active{ + background: rgba(2,122,255,0.10); + color: #027aff; +} +.btmFix { + position: fixed; + bottom: 0px; + left: 0; + width: 100%; + /* background-color: #ffffff; */ + z-index: 99; +} +.resetBtn{ + height: 44px; + opacity: 1; + background: #fff; + border: 1rpx solid #027AFF; + border-radius: 25px; + font-size: 18px; + font-weight: 601; + color: #027AFF; + padding: 0; + line-height: 44px; + margin-bottom: 40px; +} +.resetBtn:active{ + background-color: #f2f2f2; +} +.loginOut { + width: 100%; + height: 44px; + opacity: 1; + background: #027AFF; + border-radius: 25px; + font-size: 18px; + font-weight: 601; + color: #ffffff; + padding: 0; + line-height: 44px; + margin-bottom: 40px; +} +.loginOut{ + margin-top: 20rpx; +} +.pl10{ + padding-left: 10px; +} +.pr10{ + padding-right: 10px; +} +.spef{ + justify-content: space-between; +} +.spef .flex-1{ + max-width: 52px; + min-width: 52px; +} +.p10100{ + padding: 10px 10px 0; + min-height:100vh; +} +.xgxg{ + padding:0 10px;position: sticky; top: 0;z-index:1000;background-color: #fff; + border-radius: 8px; +} \ No newline at end of file diff --git a/pages/login/index.wxml b/pages/login/index.wxml index 4a0ddc3..f867654 100644 --- a/pages/login/index.wxml +++ b/pages/login/index.wxml @@ -32,6 +32,7 @@ diff --git a/pages/special/index.js b/pages/special/index.js new file mode 100644 index 0000000..8ff1299 --- /dev/null +++ b/pages/special/index.js @@ -0,0 +1,97 @@ +// pages/special/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + id:'' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + console.log(options.id) + this.setData({ + id:options.id + }) + let id = options.id; + if(id == "608"){ + wx.setNavigationBarTitle({ + title: '今日热推' + }) + }else if(id == "602"){ + wx.setNavigationBarTitle({ + title: '实习生' + }) + }else if(id == "610"){ + wx.setNavigationBarTitle({ + title: '寒暑假工' + }) + }else if(id == "603"){ + wx.setNavigationBarTitle({ + title: '社会工' + }) + }else if(id == "604"){ + wx.setNavigationBarTitle({ + title: '大龄工' + }) +} + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + sub_fun: function (e) { + console.log(e.detail) + wx.navigateTo({ + url: '../detail/index?id='+e.detail, + }) + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/special/index.json b/pages/special/index.json new file mode 100644 index 0000000..391a515 --- /dev/null +++ b/pages/special/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "special": "plugin://job-plugin/special" + } +} \ No newline at end of file diff --git a/pages/special/index.wxml b/pages/special/index.wxml new file mode 100644 index 0000000..7af74c6 --- /dev/null +++ b/pages/special/index.wxml @@ -0,0 +1 @@ + diff --git a/pages/special/index.wxss b/pages/special/index.wxss new file mode 100644 index 0000000..ed4847e --- /dev/null +++ b/pages/special/index.wxss @@ -0,0 +1 @@ +/* pages/special/index.wxss */ \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index 63afe39..6a2a030 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -17,5 +17,5 @@ } }, "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "projectname": "goodJob" + "projectname": "yicai" } \ No newline at end of file