...
|
...
|
@@ -3,21 +3,25 @@ const app = getApp(); |
|
|
var QQMapWX = require('../../utils/qqmap-wx-jssdk.js');
|
|
|
var qqmapsdk;
|
|
|
Page({
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
station_id:'',
|
|
|
education_id: '',
|
|
|
salary_id: '',
|
|
|
order: '',
|
|
|
|
|
|
myResume: false,
|
|
|
|
|
|
eduIndex:0,
|
|
|
edu:[],
|
|
|
education_name:'请选择',
|
|
|
|
|
|
yearIndex:0,
|
|
|
year:['1年','2年','3年','5年','10年','10年以上'],
|
|
|
|
|
|
eduIndex: 0,
|
|
|
edu: [],
|
|
|
education_name: '请选择',
|
|
|
|
|
|
yearIndex: 0,
|
|
|
year: ['1年', '2年', '3年', '5年', '10年', '10年以上'],
|
|
|
|
|
|
gender: true,
|
|
|
status: true,
|
|
|
|
...
|
...
|
@@ -31,10 +35,10 @@ Page({ |
|
|
resume_is_bejob: 1,
|
|
|
resume_home: '',
|
|
|
resume_brief: '',
|
|
|
|
|
|
|
|
|
// 工作年限
|
|
|
yearname:"请选择",
|
|
|
array2: ['1年','2年'],
|
|
|
yearname: "请选择",
|
|
|
array2: ['1年', '2年'],
|
|
|
index2: 0,
|
|
|
|
|
|
|
...
|
...
|
@@ -49,13 +53,13 @@ Page({ |
|
|
education_1: '',
|
|
|
salary_1: '',
|
|
|
categories_id: 5,
|
|
|
categories_name:'',
|
|
|
categories_name: '',
|
|
|
user_id: '',
|
|
|
resume: '',
|
|
|
|
|
|
|
|
|
|
|
|
district:'',
|
|
|
|
|
|
district: '',
|
|
|
// 获取经纬度
|
|
|
latitude: '',
|
|
|
longitude: '',
|
...
|
...
|
@@ -70,7 +74,7 @@ Page({ |
|
|
url: '/img/aicon_07@2x.png'
|
|
|
},
|
|
|
],
|
|
|
indicatorDots: true,
|
|
|
// indicatorDots: true,
|
|
|
autoplay: false,
|
|
|
interval: 1000,
|
|
|
duration: 1000,
|
...
|
...
|
@@ -80,7 +84,7 @@ Page({ |
|
|
// 导航选择
|
|
|
navbar: [{
|
|
|
name: '地区',
|
|
|
img:'../../img/aicon_11@2x.png',
|
|
|
img: '../../img/aicon_11@2x.png',
|
|
|
img1: "../../img/aicon_59@2x.png"
|
|
|
},
|
|
|
{
|
...
|
...
|
@@ -97,38 +101,45 @@ Page({ |
|
|
name: '筛选',
|
|
|
img: '../../img/aicon_12@2x.png',
|
|
|
img1: '../../img/aicon_12@2x.png',
|
|
|
|
|
|
|
|
|
}
|
|
|
],
|
|
|
currentTab: 0,
|
|
|
// 地区选择
|
|
|
|
|
|
areaTab: 0,
|
|
|
|
|
|
area: 0,
|
|
|
//岗位选择(大类别)
|
|
|
|
|
|
|
|
|
jobTab: 0,
|
|
|
//岗位选择(小类别)
|
|
|
|
|
|
|
|
|
proTab: 0,
|
|
|
// 推荐排序
|
|
|
sortbar: [{
|
|
|
id: 1,
|
|
|
sort: '推荐排序'
|
|
|
},
|
|
|
{
|
|
|
id: 4,
|
|
|
sort: '离我最近'
|
|
|
},
|
|
|
{
|
|
|
id: 2,
|
|
|
sort: '工资最高'
|
|
|
},
|
|
|
{
|
|
|
id: 3,
|
|
|
sort: '最新发布'
|
|
|
},
|
|
|
],
|
|
|
sortTab: 0,
|
|
|
// 筛选(学历)
|
|
|
|
|
|
|
|
|
screenTab: 0,
|
|
|
|
|
|
|
|
|
scopeTab: 0,
|
|
|
|
|
|
// 设置隐藏显示功能
|
...
|
...
|
@@ -141,11 +152,15 @@ Page({ |
|
|
|
|
|
// 时间
|
|
|
date: '',
|
|
|
go:''
|
|
|
go: ''
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
swiperChange: function(e) {
|
|
|
this.setData({
|
|
|
currentSwiper: e.detail.current
|
|
|
})
|
|
|
},
|
|
|
//是否填写简历
|
|
|
getjianli() {
|
|
|
let that = this;
|
...
|
...
|
@@ -181,24 +196,24 @@ Page({ |
|
|
},
|
|
|
|
|
|
//工作经验
|
|
|
workexperience(e){
|
|
|
workexperience(e) {
|
|
|
this.setData({
|
|
|
resume_exp:e.detail.value
|
|
|
resume_exp: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
//简介
|
|
|
workbrief(e){
|
|
|
//简介
|
|
|
workbrief(e) {
|
|
|
this.setData({
|
|
|
resume_brief:e.detail.value
|
|
|
resume_brief: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
//点击关闭完善简历层
|
|
|
closeResume(){
|
|
|
closeResume() {
|
|
|
this.setData({
|
|
|
myResume:false
|
|
|
myResume: false
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
// 点击展示筛选mask
|
|
|
mask_show() {
|
|
|
this.setData({
|
...
|
...
|
@@ -212,17 +227,17 @@ Page({ |
|
|
console.log(222242424)
|
|
|
},
|
|
|
// 点击确定后关闭筛选遮罩层
|
|
|
toConfirm(){
|
|
|
this.setData({
|
|
|
mask: false
|
|
|
})
|
|
|
// toConfirm() {
|
|
|
// this.setData({
|
|
|
// mask: false
|
|
|
// })
|
|
|
|
|
|
},
|
|
|
// },
|
|
|
// 跳转岗位信息
|
|
|
toPosition(e) {
|
|
|
console.log(e)
|
|
|
// 绑定id跳转至工作详情
|
|
|
|
|
|
|
|
|
let that = this;
|
|
|
let id = e.currentTarget.dataset.id;
|
|
|
wx.navigateTo({
|
...
|
...
|
@@ -236,7 +251,7 @@ Page({ |
|
|
})
|
|
|
},
|
|
|
// 跳转至搜索页面
|
|
|
toSearch(){
|
|
|
toSearch() {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/index/search_2/search_2',
|
|
|
})
|
...
|
...
|
@@ -260,16 +275,16 @@ Page({ |
|
|
},
|
|
|
|
|
|
// 切换在职状态类型
|
|
|
switch_b(){
|
|
|
switch_b() {
|
|
|
this.setData({
|
|
|
status:!this.data.status,
|
|
|
status: !this.data.status,
|
|
|
})
|
|
|
let status = this.data.status;
|
|
|
if(status == true){
|
|
|
if (status == true) {
|
|
|
this.setData({
|
|
|
resume_is_bejob: 1
|
|
|
})
|
|
|
}else {
|
|
|
} else {
|
|
|
this.setData({
|
|
|
resume_is_bejob: 2
|
|
|
})
|
...
|
...
|
@@ -278,42 +293,42 @@ Page({ |
|
|
|
|
|
|
|
|
// 学历
|
|
|
bindEdu: function (e) {
|
|
|
bindEdu: function(e) {
|
|
|
console.log('picker发送选择改变,携带值为', e.detail.value)
|
|
|
this.setData({
|
|
|
eduIndex: e.detail.value,
|
|
|
education_name: this.data.edu[e.detail.value].education_name,
|
|
|
resume_education_id: this.data.edu[e.detail.value].id
|
|
|
|
|
|
|
|
|
})
|
|
|
},
|
|
|
// 工作年限
|
|
|
bindYear: function (e) {
|
|
|
bindYear: function(e) {
|
|
|
console.log('picker发送选择改变,携带值为', e.detail.value)
|
|
|
this.setData({
|
|
|
yearIndex: e.detail.value,
|
|
|
yearname:this.data.year[e.detail.value]
|
|
|
yearname: this.data.year[e.detail.value]
|
|
|
})
|
|
|
|
|
|
console.log(this.data.yearname)
|
|
|
},
|
|
|
|
|
|
// 获取真实姓名
|
|
|
realName(e){
|
|
|
realName(e) {
|
|
|
let resume_name = e.detail.value
|
|
|
this.setData({
|
|
|
resume_name:resume_name
|
|
|
this.setData({
|
|
|
resume_name: resume_name
|
|
|
})
|
|
|
},
|
|
|
// 获取手机号码
|
|
|
realMobile(e){
|
|
|
realMobile(e) {
|
|
|
let resume_mobile = e.detail.value
|
|
|
this.setData({
|
|
|
resume_mobile: resume_mobile
|
|
|
})
|
|
|
},
|
|
|
// 获取家乡地址
|
|
|
realHome(e){
|
|
|
realHome(e) {
|
|
|
let resume_home = e.detail.value
|
|
|
this.setData({
|
|
|
resume_home: resume_home
|
...
|
...
|
@@ -337,16 +352,17 @@ Page({ |
|
|
this.getJobs()
|
|
|
this.getResume()
|
|
|
this.getEdu()
|
|
|
this.getjianli()
|
|
|
|
|
|
this.getjianli();
|
|
|
|
|
|
// this.selectStation()
|
|
|
},
|
|
|
|
|
|
// 选择时间
|
|
|
bindDateChange: function (e) {
|
|
|
bindDateChange: function(e) {
|
|
|
console.log('picker发送选择改变,携带值为', e.detail.value)
|
|
|
this.setData({
|
|
|
date: e.detail.value,
|
|
|
resume_birthday:e.detail.value
|
|
|
resume_birthday: e.detail.value
|
|
|
})
|
|
|
},
|
|
|
|
...
|
...
|
@@ -355,7 +371,7 @@ Page({ |
|
|
let that = this;
|
|
|
let url = 'index/category/education';
|
|
|
let params = {
|
|
|
|
|
|
|
|
|
}
|
|
|
let header = {
|
|
|
"XX-Token": wx.getStorageSync('token'),
|
...
|
...
|
@@ -365,11 +381,11 @@ Page({ |
|
|
console.log(res);
|
|
|
// 获取值
|
|
|
that.setData({
|
|
|
|
|
|
|
|
|
edu: res.data
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
...
|
...
|
@@ -390,7 +406,7 @@ Page({ |
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
console.log(res.data);
|
|
|
if(res.resume_name!=null){
|
|
|
if (res.resume_name != null) {
|
|
|
// 获取值
|
|
|
that.setData({
|
|
|
resume: res.data,
|
...
|
...
|
@@ -406,14 +422,14 @@ Page({ |
|
|
// industry_id: res.data[0].industry_id
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
getJobs() {
|
|
|
let that = this;
|
|
|
let url = 'index/job/jobs';
|
...
|
...
|
@@ -426,21 +442,22 @@ Page({ |
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
console.log(res);
|
|
|
console.log(res.data[0].industry_id)
|
|
|
// 获取值
|
|
|
that.setData({
|
|
|
// personal: res.data
|
|
|
jobs: res.data,
|
|
|
industry_id:res.data[0].industry_id
|
|
|
// industry_id:res.data[0].industry_id
|
|
|
})
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 在家可做
|
|
|
atHome(e){
|
|
|
atHome(e) {
|
|
|
console.log(e)
|
|
|
let that = this;
|
|
|
let categories_name = e.currentTarget.dataset.cla
|
...
|
...
|
@@ -449,24 +466,24 @@ Page({ |
|
|
console.log(that.categories_name)
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/atHome/atHome?categories_name=' + categories_name + '&categories_id=' + categories_id,
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
},
|
|
|
// 好评工作
|
|
|
goodWord(){
|
|
|
goodWord() {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/goodWord/goodWord',
|
|
|
})
|
|
|
},
|
|
|
// 热门推荐
|
|
|
hotRecommend(){
|
|
|
hotRecommend() {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/hotRecommend/hotRecommend',
|
|
|
})
|
|
|
},
|
|
|
// 轻松兼职
|
|
|
easyPart(){
|
|
|
easyPart() {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/easyPart/easyPart',
|
|
|
})
|
...
|
...
|
@@ -478,15 +495,23 @@ Page({ |
|
|
this.setData({
|
|
|
currentTab: e.currentTarget.dataset.idx,
|
|
|
})
|
|
|
console.log(that.data.industry_id)
|
|
|
that.selectStation()
|
|
|
that.selectIndustry();
|
|
|
|
|
|
},
|
|
|
// 地区选择
|
|
|
area_Tap: function(e) {
|
|
|
console.log(88)
|
|
|
let that = this;
|
|
|
this.setData({
|
|
|
// 区的ID
|
|
|
areaTab: e.currentTarget.dataset.idarea,
|
|
|
// 选择区名字
|
|
|
area: e.currentTarget.dataset.area,
|
|
|
})
|
|
|
console.log('区的id为' + that.data.areaTab)
|
|
|
console.log('区的name为' + that.data.area)
|
|
|
},
|
|
|
// 岗位选择
|
|
|
job_Tap: function(e) {
|
...
|
...
|
@@ -497,58 +522,74 @@ Page({ |
|
|
jobTab: e.currentTarget.dataset.idjob,
|
|
|
industry_id: industry_id
|
|
|
})
|
|
|
that.selectStation()
|
|
|
},
|
|
|
// 行业选择
|
|
|
pro_Tap: function (e) {
|
|
|
pro_Tap: function(e) {
|
|
|
console.log(88)
|
|
|
let that = this;
|
|
|
let station_id = e.currentTarget.dataset.categoryid
|
|
|
this.setData({
|
|
|
proTab: e.currentTarget.dataset.idpro,
|
|
|
station_id:station_id
|
|
|
})
|
|
|
},
|
|
|
// 推荐排序
|
|
|
sort_Tap: function(e) {
|
|
|
console.log(88)
|
|
|
let that = this;
|
|
|
let order = e.currentTarget.dataset.id;
|
|
|
this.setData({
|
|
|
sortTab: e.currentTarget.dataset.idsort,
|
|
|
order: order,
|
|
|
})
|
|
|
console.log(order)
|
|
|
},
|
|
|
// 筛选(学历要求)
|
|
|
screen_Tap: function(e) {
|
|
|
console.log(88)
|
|
|
console.log(e)
|
|
|
let that = this;
|
|
|
let education_id = e.currentTarget.dataset.id
|
|
|
console.log('学历ID为' + education_id)
|
|
|
this.setData({
|
|
|
screenTab: e.currentTarget.dataset.idscreen,
|
|
|
education_id: education_id,
|
|
|
})
|
|
|
console.log('索引id为' + that.data.screenTab)
|
|
|
},
|
|
|
// 筛选(酬薪范围)
|
|
|
scope_Tap: function(e) {
|
|
|
console.log(88)
|
|
|
console.log(e)
|
|
|
let that = this;
|
|
|
let salary_id = e.currentTarget.dataset.id
|
|
|
this.setData({
|
|
|
scopeTab: e.currentTarget.dataset.idscope,
|
|
|
salary_id: salary_id,
|
|
|
// salary_id: e.currentTarget.dataset.id,
|
|
|
})
|
|
|
|
|
|
console.log('酬薪ID为' + salary_id)
|
|
|
console.log('索引ID为' + that.data.scopeTab)
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 去报名
|
|
|
toApply(e) {
|
|
|
let that = this;
|
|
|
let joinid=e.currentTarget.dataset.id
|
|
|
if(that.data.go==false){
|
|
|
wx.showToast({
|
|
|
title: '请先完善简历',
|
|
|
icon:'none'
|
|
|
})
|
|
|
let joinid = e.currentTarget.dataset.id
|
|
|
if (that.data.go == false) {
|
|
|
wx.showToast({
|
|
|
title: '请先完善简历',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
|
|
|
setTimeout(function(){
|
|
|
that.setData({
|
|
|
myResume:true
|
|
|
})
|
|
|
},1500)
|
|
|
setTimeout(function() {
|
|
|
that.setData({
|
|
|
myResume: true
|
|
|
})
|
|
|
}, 1500)
|
|
|
|
|
|
}else{
|
|
|
} else {
|
|
|
let url = 'index/job/job_apply';
|
|
|
|
|
|
// 通过parmas传值给后端
|
...
|
...
|
@@ -562,10 +603,10 @@ Page({ |
|
|
app.post(url, params, header).then((res) => {
|
|
|
|
|
|
console.log(res);
|
|
|
if(res.data==''){
|
|
|
if (res.data == '') {
|
|
|
wx.showToast({
|
|
|
title: res.msg,
|
|
|
icon:'none'
|
|
|
icon: 'none'
|
|
|
})
|
|
|
}
|
|
|
// that.setData({
|
...
|
...
|
@@ -573,10 +614,10 @@ Page({ |
|
|
// })
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
// ----- 更新简历 -----
|
...
|
...
|
@@ -609,44 +650,44 @@ Page({ |
|
|
saveResume() {
|
|
|
|
|
|
let that = this;
|
|
|
if(that.data.resume_name==''){
|
|
|
if (that.data.resume_name == '') {
|
|
|
wx.showToast({
|
|
|
title: '请输入姓名',
|
|
|
icon:'none'
|
|
|
icon: 'none'
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
if (that.data.resume_mobile==''){
|
|
|
if (that.data.resume_mobile == '') {
|
|
|
wx.showToast({
|
|
|
title: '请输入手机号',
|
|
|
icon:'none'
|
|
|
icon: 'none'
|
|
|
})
|
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
let reg = reg = /^[1][3,4,5,7,8][0-9]{9}$/
|
|
|
if (!reg.test(that.data.resume_mobile)){
|
|
|
wx.showToast({
|
|
|
title: '请输入正确的手机号',
|
|
|
icon:'none'
|
|
|
})
|
|
|
if (!reg.test(that.data.resume_mobile)) {
|
|
|
wx.showToast({
|
|
|
title: '请输入正确的手机号',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
if (that.data.resume_birthday=='请选择'){
|
|
|
if (that.data.resume_birthday == '请选择') {
|
|
|
wx.showToast({
|
|
|
title: '请选择出生日期',
|
|
|
icon:'none'
|
|
|
icon: 'none'
|
|
|
})
|
|
|
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
if (that.data.resume_home==''){
|
|
|
if (that.data.resume_home == '') {
|
|
|
wx.showToast({
|
|
|
title: '请输入家乡',
|
|
|
icon: 'none'
|
...
|
...
|
@@ -670,10 +711,10 @@ Page({ |
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
if (that.data.resume_exp==''){
|
|
|
if (that.data.resume_exp == '') {
|
|
|
wx.showToast({
|
|
|
title: '请输入工作经验',
|
|
|
icon:'none'
|
|
|
icon: 'none'
|
|
|
})
|
|
|
|
|
|
return false
|
...
|
...
|
@@ -701,27 +742,27 @@ Page({ |
|
|
app.post(url, params, header).then((res) => {
|
|
|
|
|
|
console.log(res.data);
|
|
|
if(res.data==''){
|
|
|
if (res.data == '') {
|
|
|
wx.showToast({
|
|
|
title: '提交成功',
|
|
|
icon:'none'
|
|
|
icon: 'none'
|
|
|
})
|
|
|
|
|
|
setTimeout(function(){
|
|
|
setTimeout(function() {
|
|
|
that.setData({
|
|
|
myResume:false
|
|
|
myResume: false
|
|
|
|
|
|
})
|
|
|
},1500)
|
|
|
}, 1500)
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
// 提交筛选
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
...
|
...
|
@@ -743,7 +784,7 @@ Page({ |
|
|
|
|
|
let that = this;
|
|
|
let url = 'index/category/county';
|
|
|
|
|
|
|
|
|
// 通过parmas传值给后端
|
|
|
let params = {
|
|
|
city: that.data.city,
|
...
|
...
|
@@ -753,12 +794,13 @@ Page({ |
|
|
"XX-Device-Type": 'wxapp'
|
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
|
|
|
|
|
|
console.log(res);
|
|
|
that.setData({
|
|
|
city_1 : res.data
|
|
|
city_1: res.data,
|
|
|
area: res.data[0].name
|
|
|
})
|
|
|
|
|
|
console.log(that.data.area)
|
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
...
|
...
|
@@ -766,13 +808,13 @@ Page({ |
|
|
|
|
|
//----筛选行业分类功能---- 给后端传categories_id
|
|
|
selectIndustry() {
|
|
|
|
|
|
|
|
|
let that = this;
|
|
|
let url = 'index/category/industry';
|
|
|
console.log(url)
|
|
|
// 通过parmas传值给后端
|
|
|
let params = {
|
|
|
categories_id: that.data.categories_id,
|
|
|
categories_id: '',
|
|
|
}
|
|
|
let header = {
|
|
|
"XX-Token": wx.getStorageSync('token'),
|
...
|
...
|
@@ -781,11 +823,14 @@ Page({ |
|
|
app.post(url, params, header).then((res) => {
|
|
|
console.log(res);
|
|
|
that.setData({
|
|
|
industry_1: res.data
|
|
|
industry_1: res.data,
|
|
|
industry_id: res.data[0].id
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
// that.selectStation()
|
|
|
that.selectStation()
|
|
|
})
|
|
|
},
|
|
|
//----筛选岗位分类功能---- 给后端传industry_id
|
...
|
...
|
@@ -807,9 +852,9 @@ Page({ |
|
|
that.setData({
|
|
|
station_1: res.data
|
|
|
})
|
|
|
|
|
|
console.log(that.data.station_1)
|
|
|
}).catch((err) => {
|
|
|
|
|
|
|
|
|
})
|
|
|
},
|
|
|
|
...
|
...
|
@@ -833,7 +878,7 @@ Page({ |
|
|
console.log(res);
|
|
|
that.setData({
|
|
|
// city_1: res.data
|
|
|
education_1:res.data
|
|
|
education_1: res.data
|
|
|
})
|
|
|
|
|
|
}).catch((err) => {
|
...
|
...
|
@@ -865,30 +910,30 @@ Page({ |
|
|
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -----用户获得经纬度-----
|
|
|
getUserLocation(){
|
|
|
getUserLocation() {
|
|
|
let vm = this;
|
|
|
wx.getSetting({
|
|
|
success:(res) => {
|
|
|
success: (res) => {
|
|
|
console.log(JSON.stringify(res))
|
|
|
if(res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true){
|
|
|
if (res.authSetting['scope.userLocation'] != undefined && res.authSetting['scope.userLocation'] != true) {
|
|
|
wx.showModal({
|
|
|
title: '请授权当前位置',
|
|
|
content: '需要获取您的地址位置,请确认授权',
|
|
|
success(res){
|
|
|
if(res.cancel){
|
|
|
success(res) {
|
|
|
if (res.cancel) {
|
|
|
wx.showToast({
|
|
|
title: '拒绝授权',
|
|
|
icon: 'none',
|
|
|
duration: 1000
|
|
|
})
|
|
|
}else if(res.confirm){
|
|
|
} else if (res.confirm) {
|
|
|
wx.openSetting({
|
|
|
success: function(dataAu){
|
|
|
if(dataAu.authSetting["scope.userLocation"]==true){
|
|
|
success: function(dataAu) {
|
|
|
if (dataAu.authSetting["scope.userLocation"] == true) {
|
|
|
wx.showToast({
|
|
|
title: '授权成功',
|
|
|
icon: 'success',
|
...
|
...
|
@@ -896,7 +941,7 @@ Page({ |
|
|
})
|
|
|
// 再次授权,调用wx.getLocation的API
|
|
|
vm.getLocation();
|
|
|
}else{
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: '授权失败',
|
|
|
icon: 'none',
|
...
|
...
|
@@ -908,10 +953,10 @@ Page({ |
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}else if(res.authSetting['scope.userLocation'] == undefined){
|
|
|
} else if (res.authSetting['scope.userLocation'] == undefined) {
|
|
|
// 调用wx.getLocation的API
|
|
|
vm.getLocation();
|
|
|
}else{
|
|
|
} else {
|
|
|
// 调用wx.getLocation的API
|
|
|
vm.getLocation();
|
|
|
}
|
...
|
...
|
@@ -920,7 +965,7 @@ Page({ |
|
|
},
|
|
|
|
|
|
// -----微信获得经纬度-----
|
|
|
getLocation(){
|
|
|
getLocation() {
|
|
|
let vm = this;
|
|
|
// console.log(vm)
|
|
|
wx.getLocation({
|
...
|
...
|
@@ -930,51 +975,51 @@ Page({ |
|
|
console.log(JSON.stringify(res))
|
|
|
var latitude = res.latitude
|
|
|
var longitude = res.longitude
|
|
|
var speed = res.speed
|
|
|
var speed = res.speed
|
|
|
var accuracy = res.accuracy;
|
|
|
vm.getLocal(latitude,longitude)
|
|
|
vm.getLocal(latitude, longitude)
|
|
|
},
|
|
|
fail: function(res) {
|
|
|
console.log('fail'+JSON.stringify(res))
|
|
|
console.log('fail' + JSON.stringify(res))
|
|
|
},
|
|
|
// complete: function(res) {},
|
|
|
})
|
|
|
},
|
|
|
|
|
|
// -----获取当前地理位置-----
|
|
|
getLocal(latitude,longitude){
|
|
|
getLocal(latitude, longitude) {
|
|
|
let vm = this;
|
|
|
qqmapsdk.reverseGeocoder({
|
|
|
location: {
|
|
|
latitude: latitude,
|
|
|
longitude: longitude
|
|
|
},
|
|
|
|
|
|
success(res){
|
|
|
|
|
|
|
|
|
success(res) {
|
|
|
|
|
|
console.log(res)
|
|
|
// let province = res.result.ad_info.province
|
|
|
let city = res.result.ad_info.city;
|
|
|
console.log(city)
|
|
|
let district = res.result.ad_info.district
|
|
|
|
|
|
console.log('定位的市:'+city,'定位的区:'+district)
|
|
|
|
|
|
console.log('定位的市:' + city, '定位的区:' + district)
|
|
|
vm.setData({
|
|
|
// 转换地区
|
|
|
|
|
|
|
|
|
city: city,
|
|
|
district:district,
|
|
|
district: district,
|
|
|
latitude: latitude,
|
|
|
longitude: longitude
|
|
|
})
|
|
|
vm.selectArea()
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
fail: function(res){
|
|
|
fail: function(res) {
|
|
|
console.log(res);
|
|
|
},
|
|
|
complete:function(res){
|
|
|
complete: function(res) {
|
|
|
|
|
|
}
|
|
|
})
|
...
|
...
|
@@ -987,7 +1032,7 @@ Page({ |
|
|
let url = 'wxapp/public/location';
|
|
|
// 通过parmas传值给后端
|
|
|
let params = {
|
|
|
city : that.data.city,
|
|
|
city: that.data.city,
|
|
|
county: that.data.county,
|
|
|
longitude: that.data.longitude,
|
|
|
latitude: that.data.latitude
|
...
|
...
|
@@ -999,14 +1044,14 @@ Page({ |
|
|
app.post(url, params, header).then((res) => {
|
|
|
console.log('++++++++++++++')
|
|
|
console.log(res);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 获取四大类
|
|
|
getCategories() {
|
|
|
let that = this;
|
...
|
...
|
@@ -1021,17 +1066,17 @@ Page({ |
|
|
app.post(url, params, header).then((res) => {
|
|
|
console.log(res);
|
|
|
console.log(res.data)
|
|
|
|
|
|
|
|
|
// 获取值
|
|
|
that.setData({
|
|
|
category:res.data
|
|
|
category: res.data
|
|
|
})
|
|
|
console.log(that.data.category)
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
},
|
|
|
// 获取幻灯片
|
|
|
getSlide() {
|
|
|
let that = this;
|
...
|
...
|
@@ -1057,17 +1102,70 @@ Page({ |
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
},
|
|
|
// 跳转Url
|
|
|
toUrl(e){
|
|
|
toUrl(e) {
|
|
|
console.log(e)
|
|
|
let that = this;
|
|
|
let url = e.currentTarget.dataset.tourl;
|
|
|
console.log(url)
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/index/url/url?url='+url,
|
|
|
url: '/pages/index/url/url?url=' + url,
|
|
|
})
|
|
|
},
|
|
|
// 点击确认功能
|
|
|
toConfirm() {
|
|
|
|
|
|
let that = this;
|
|
|
let url = 'index/job/jobs';
|
|
|
let params = {
|
|
|
// categories_id: that.data.categories_id,
|
|
|
// 城市(同城)
|
|
|
work_city: that.data.city,
|
|
|
// 区县
|
|
|
work_county: that.data.area,
|
|
|
|
|
|
// 行业
|
|
|
industry_id: that.data.industry_id,
|
|
|
// 岗位
|
|
|
station_id: that.data.station_id,
|
|
|
// 学历
|
|
|
education_id: that.data.education_id,
|
|
|
// 薪资
|
|
|
salary_id: that.data.salary_id,
|
|
|
// 排序方式
|
|
|
order: that.data.order,
|
|
|
// 招聘者姓名
|
|
|
// resume_name : that.data.resume_name
|
|
|
|
|
|
}
|
|
|
let header = {
|
|
|
"XX-Token": wx.getStorageSync('token'),
|
|
|
"XX-Device-Type": 'wxapp'
|
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
// console.log(res);
|
|
|
// console.log(res.data[0].industry_id)
|
|
|
// 获取值
|
|
|
that.setData({
|
|
|
jobs: res.data,
|
|
|
// industry_id:res.data[0].industry_id
|
|
|
})
|
|
|
wx.showToast({
|
|
|
title: '正在检索',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
setTimeout(function() {
|
|
|
that.setData({
|
|
|
mask:false
|
|
|
})
|
|
|
}, 1000)
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
...
|
...
|
|