|
|
@@ -1,5 +1,6 @@
|
|
|
import {
|
|
|
- resumeIntent} from '../../services/index.js'
|
|
|
+ resumeIntent
|
|
|
+} from '../../services/index.js'
|
|
|
import {
|
|
|
imgServerUrl
|
|
|
} from '../../config/config.js'
|
|
|
@@ -64,7 +65,7 @@ Page({
|
|
|
value: []
|
|
|
}, //省市区
|
|
|
name: '',
|
|
|
- expectationPositionIndex: 0,
|
|
|
+ expectationPositionIndex: [],
|
|
|
salaryIndex: 0,
|
|
|
hpUserIntentionId: '',
|
|
|
hpUserResumeId: '',
|
|
|
@@ -86,39 +87,56 @@ Page({
|
|
|
|
|
|
if (hpUserResumeId) {
|
|
|
let userResume = wx.getStorageSync('userResume')
|
|
|
+ let region = {
|
|
|
+ code: [],
|
|
|
+ value: []
|
|
|
+ };
|
|
|
|
|
|
- this.data.region.code = this.data.region.code.concat(userResume.expectationProvinceId);
|
|
|
- this.data.region.code = this.data.region.code.concat(userResume.expectationCityId);
|
|
|
- this.data.region.code = this.data.region.code.concat(userResume.expectationCountryId);
|
|
|
+ let salaryIndex = 0;
|
|
|
+ let expectationArray = [];
|
|
|
const expectationPosition = this.data.expectationPosition;
|
|
|
- let arr = userResume.expectationAddress.split("-");
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
- this.data.region.value = this.data.region.value.concat(arr[i]);
|
|
|
- }
|
|
|
- let expectationArray = userResume.expectationPosition;
|
|
|
- let lengthSalary = this.data.salaryList.length;
|
|
|
- let salaryIndex;
|
|
|
- for (let i = 0; i < lengthSalary; i++) {
|
|
|
- if (userResume.expectationSalary == this.data.salaryList[i].hightNum) {
|
|
|
- salaryIndex = i;
|
|
|
+
|
|
|
+ if (userResume && userResume.id) {
|
|
|
+ if (userResume.expectationAddress) {
|
|
|
+ region.code.push(userResume.expectationProvinceId);
|
|
|
+ region.code.push(userResume.expectationCityId);
|
|
|
+ region.code.push(userResume.expectationCountryId);
|
|
|
+ let arr = userResume.expectationAddress.split("-");
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
+ region.value.push(arr[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (userResume.expectationPosition) {
|
|
|
+ expectationArray = userResume.expectationPosition.split(',');
|
|
|
+ let lengthSalary = this.data.salaryList.length;
|
|
|
+ for (let i = 0; i < lengthSalary; i++) {
|
|
|
+ if (userResume.expectationSalary == this.data.salaryList[i].hightNum) {
|
|
|
+ salaryIndex = i;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ expectationArray.forEach(value => {
|
|
|
+ if(value){
|
|
|
+ expectationPosition[value].active = true
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- }
|
|
|
- expectationArray.split(',').forEach(value => {
|
|
|
- expectationPosition[value].active = true
|
|
|
- })
|
|
|
- if (userResume.id) {
|
|
|
this.setData({
|
|
|
hpUserResumeId: userResume.id,
|
|
|
expectationPositionIndex: expectationArray,
|
|
|
salaryIndex: salaryIndex,
|
|
|
- region: this.data.region,
|
|
|
+ region,
|
|
|
expectationPosition
|
|
|
}, _ => {
|
|
|
this.check()
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ },
|
|
|
+ changeSalary() {
|
|
|
+ this.setData({
|
|
|
+ cover: false,
|
|
|
+ salary: false
|
|
|
+ })
|
|
|
},
|
|
|
changeCover(e) {
|
|
|
const { type } = e.currentTarget.dataset;
|
|
|
@@ -148,7 +166,7 @@ Page({
|
|
|
//改变期望岗位
|
|
|
changeName(e) {
|
|
|
const { index } = e.currentTarget.dataset;
|
|
|
- let expectationPositionIndex = this.data.expectationPositionIndex.split(',');
|
|
|
+ let expectationPositionIndex = this.data.expectationPositionIndex;
|
|
|
const expectationPosition = this.data.expectationPosition;
|
|
|
if (expectationPosition[index].active) {
|
|
|
expectationPosition[index].active = false;
|
|
|
@@ -160,8 +178,13 @@ Page({
|
|
|
expectationPosition[index].active = true;
|
|
|
expectationPositionIndex.push(index)
|
|
|
}
|
|
|
+ expectationPositionIndex.forEach((value, index) => {
|
|
|
+ if (!value && value !== 0) {
|
|
|
+ expectationPositionIndex.splice(index, 1)
|
|
|
+ }
|
|
|
+ })
|
|
|
this.setData({
|
|
|
- expectationPositionIndex: expectationPositionIndex.join(','),
|
|
|
+ expectationPositionIndex: expectationPositionIndex,
|
|
|
expectationPosition
|
|
|
}, _ => {
|
|
|
this.check()
|
|
|
@@ -194,7 +217,7 @@ Page({
|
|
|
salaryList
|
|
|
} = this.data
|
|
|
let paramsObj = {
|
|
|
- expectationPosition: expectationPositionIndex,
|
|
|
+ expectationPosition: expectationPositionIndex.join(','),
|
|
|
expectationSalary: salaryList[salaryIndex].expectationSalary,
|
|
|
expectationProvinceId: region.code[0],
|
|
|
expectationCityId: region.code[1],
|