diff --git a/api/model/login.js b/api/model/login.js index 13be1cd..0faaaab 100644 --- a/api/model/login.js +++ b/api/model/login.js @@ -6,7 +6,7 @@ const api = { // 微信登录接口 wxLogin: { url: '/api/login/login', - method: 'GET', + method: 'GET', limit : 500, showLoading : true, }, diff --git a/api/model/work.js b/api/model/work.js index df9f625..65fada2 100644 --- a/api/model/work.js +++ b/api/model/work.js @@ -11,12 +11,12 @@ const api = { }, // 首页-根据Id查看工作详情 employeeQueryJobList: { - url: '/employ/job/queryJobById', + url: '/employ/job/queryJobList', method: 'GET', }, // 首页-查询工作信息列表 employeeQueryJobById: { - url: '/employ/job/queryJobList', + url: '/employ/job/queryJobById', method: 'GET', }, // 会员中心-我的招工 diff --git a/components/checkinScore.vue b/components/checkinScore.vue index 8714550..6b8b459 100644 --- a/components/checkinScore.vue +++ b/components/checkinScore.vue @@ -36,7 +36,7 @@ }, checkin(){ this.$api('addScoreBySign', res => { - if(re.code == 200){ + if(res.code == 200){ uni.showToast({ title: '签到成功' }) diff --git a/components/list/workList/index.vue b/components/list/workList/index.vue index 8a36982..cf8ae0b 100644 --- a/components/list/workList/index.vue +++ b/components/list/workList/index.vue @@ -45,18 +45,18 @@ this.queryParams.token = uni.getStorageSync('token') } - if(!params || params.length == 0){ - this.queryParams = { - pageNo: this.queryParams.pageNo, - pageSize: this.queryParams.pageSize, - } - }else{ - + let queryParams = { + pageNo: this.queryParams.pageNo, + pageSize: this.queryParams.pageSize, } - console.log(params); + if(params && params.length > 0){ + params.forEach(n => { + queryParams[n.name] = n.value + }) + } - this.$api(this.api, this.queryParams, res => { + this.$api(this.api, queryParams, res => { if(res.code == 200){ this.list = res.result.records this.total = res.result.total diff --git a/components/list/workList/workItem.vue b/components/list/workList/workItem.vue index 4635f0a..07b4604 100644 --- a/components/list/workList/workItem.vue +++ b/components/list/workList/workItem.vue @@ -23,7 +23,7 @@ {{ t }} @@ -53,6 +53,23 @@ default : {} } }, + computed : { + lableText(){ + let arr = + this.item.tab ? + this.item.tab.split('、') + : [] + + if(this.item.workAge){ + arr.unshift(this.item.workAge) + } + if(this.item.qulification){ + arr.unshift(this.item.qulification) + } + + return arr + }, + }, data() { return { diff --git a/components/screen/screenWork.vue b/components/screen/screenWork.vue index 02a8ee4..2033e73 100644 --- a/components/screen/screenWork.vue +++ b/components/screen/screenWork.vue @@ -9,21 +9,21 @@ :custom-style="{padding: '0 30rpx'}" @click="selectMenu"> - + + name="typeId" type="2" + :label="dropItem('typeId').label" + :value="dropItem('typeId').value"> + name="natureId" type="2" + :label="dropItem('natureId').label" + :value="dropItem('natureId').value"> { - this.craft.child.push({ + this.typeId.child.push({ label: n.name, value: n.id, }) }) - this.list[0].tag = this.craft.child + this.list[0].tag = this.typeId.child // 工作性质 this.natureList.forEach(n => { - this.nature.child.push({ + this.natureId.child.push({ label: n.name, value: n.id, }) }) - this.list[1].tag = this.nature.child + this.list[1].tag = this.natureId.child + + // if(this.addressList[0]){ + // this.areaId.value = this.addressList[0].id + // this.areaId.label = this.addressList[0].name + + // this.defaultValue[0] = this.addressList[0].id + // this.$forceUpdate() + // } // 地址 this.addressList.forEach(n => { - this.area.child.push({ + this.areaId.child.push({ label: n.adress, value: n.id, }) diff --git a/config.js b/config.js index 290aa53..195406f 100644 --- a/config.js +++ b/config.js @@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools' Vue.use(uvUI); // 当前环境 -const type = 'lzx' +const type = 'dev' // 环境配置 diff --git a/pages/index/index.vue b/pages/index/index.vue index 335515a..2e73560 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,7 +3,7 @@ - + @@ -93,6 +93,9 @@ 'banner', 'jobTypeList' ]), + bannerList(){ + return this.banner.filter(n => n.type == 0) + }, }, data() { return { @@ -126,6 +129,9 @@ this.$utils.navigateTo('/pages_order/work/addResume') } }, + search(){ + + }, } } diff --git a/pages_order/work/jobPosting.vue b/pages_order/work/jobPosting.vue index 8a0a2ba..ecfaf62 100644 --- a/pages_order/work/jobPosting.vue +++ b/pages_order/work/jobPosting.vue @@ -9,9 +9,18 @@ * - + + + + + @@ -92,12 +109,12 @@ 薪资范围 - + ~ - + - + 工作性质 @@ -143,18 +160,29 @@ + placeholder="请输入职位详情"> - + + + + + 发布 @@ -167,16 +195,14 @@ data() { return { form : { - // school : '', - // workYear : '', - // minPrice : '', - // maxPrice : '', - // address : '', - // addId : '', - // company : '', - // gsContext : '', // jobContext : '', + phone : '', + title : '', + workAge : '', natureId : 0, + areaId_dictText : '', + typeId_dictText : '', + qulification : '', }, radiovalue : '', priceList : [ @@ -188,11 +214,11 @@ }, ], picker : { - workYear : [ + workAge : [ '不限经验', ], - school : [ - '不限', + qulification : [ + '不限学历', '初中', '高中', '专科', @@ -200,13 +226,14 @@ '研究生', '博士', ], + jobTypeList : [], }, - pickerKey : 'workYear', + pickerKey : 'workAge', } }, onLoad() { for (var i = 0; i < 30; i++) { - this.picker.workYear.push((i + 1) + '年经验') + this.picker.workAge.push((i + 1) + '年经验') } // this.form.addId = this.cityList[0].id this.form.natureId = this.natureList[0].id @@ -215,15 +242,25 @@ columns(){ return [this.picker[this.pickerKey]] }, - ...mapState(['natureList']), + ...mapState(['natureList', 'jobTypeList', 'addressList']), }, methods: { - openPicker(key){ + openPicker(key, picker){ this.pickerKey = key - this.$refs.picker.open() + if(picker){ + picker.open() + }else{ + this.$refs.picker.open() + } }, pickerConfirm(e){ - this.form[this.pickerKey] = e.value[0] + let data = e.value[0] + if(data && data.id){ + this.form[this.pickerKey] = data.id + this.form[this.pickerKey + '_dictText'] = data.name || data.adress + }else{ + this.form[this.pickerKey] = data + } }, // 提交 submit(){ @@ -237,22 +274,23 @@ if (this.$utils.verificationAll(this.form, { title: '请输入招工标题', - address : '请选择工作地点', - workYear : '请选择工龄要求', - company : '请输入招聘公司', - minPrice : '请输入薪资范围', - iconText: '请输入标签', - userName: '请输入联系人', - userPhone: '请输入联系电话', - jobContext : '请输入职位描述', - school : '请输入岗位要求', - jobDetails: '请输入岗位详细介绍', - gsContext : '请输入公司介绍', + // address : '请选择工作地点', + workAge : '请选择工龄要求', + // company : '请输入招聘公司', + salaryLow : '请输入薪资范围', + salaryUp : '请输入薪资范围', + // iconText: '请输入标签', + // userName: '请输入联系人', + phone: '请输入联系电话', + // jobContext : '请输入职位描述', + qulification : '请选择学历要求', + workDetail: '请输入职位详情', + // gsContext : '请输入公司介绍', })) { return } - this.$api('publishJob', this.form, res => { + this.$api('addJob', this.form, res => { if(res.code == 200){ uni.showToast({ title: '发布成功!', @@ -264,6 +302,33 @@ }) }, + //地图上选择地址 + selectAddr() { + uni.chooseLocation({ + success: (res) => { + this.setAddress(res) + } + }); + }, + + //提取用户选择的地址信息复制给表单数据 + setAddress(res) { + + //经纬度信息 + this.form.latitude = res.latitude + this.form.longitude = res.longitude + + // if (res.name) { //用户直接选择城市的逻辑 + if (!res.address && res.name) { //用户直接选择城市的逻辑 + return this.form.address = res.name + } + if (res.address || res.name) { + return this.form.address = res.address + res.name + } + this.form.address = '' //用户啥都没选就点击勾选 + this.form.latitude = '' + this.form.longitude = '' + }, } } @@ -313,5 +378,10 @@ } } } + + /deep/ .uv-textarea{ + background-color: rgba($uni-color, 0.1) !important; + min-height: 400rpx; + } } diff --git a/store/store.js b/store/store.js index b5ccc22..e674f2d 100644 --- a/store/store.js +++ b/store/store.js @@ -10,7 +10,7 @@ const store = new Vuex.Store({ state: { configList: [], //配置列表 // 角色 true为老板 false为工人 - role : true, + role : false, userInfo : {}, //用户信息 banner : [],//轮播图 jobTypeList : [],//工种 diff --git a/utils/position.js b/utils/position.js index 09513cd..2e101bd 100644 --- a/utils/position.js +++ b/utils/position.js @@ -142,10 +142,8 @@ function getUserAddressByIp(key) { //根据IP获取当前用户位置 } //打开地图让用户选择位置 -function selectAddress(longitude, latitude, successCallback) { +function selectAddress(successCallback) { uni.chooseLocation({ - longitude, //经度 - latitude, //纬度 success: function(res) { successCallback && successCallback(res) }