| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- import {
- resumeIntent,
- getSalaryList
- } from '../../services/index.js'
- import {
- imgServerUrl
- } from '../../config/config.js'
- import {
- showToast
- } from '../../utils/tips.js'
- var app = getApp()
- Page({
- data: {
- imgServerUrl: imgServerUrl,
- salaryList: [{
- "expectationSalary": null,
- "hightNum": '请选择'
- },
- {
- "expectationSalary": -1,
- "hightNum": '不限'
- },
- {
- "expectationSalary": 0,
- "hightNum": '1000~2000'
- },
- {
- "expectationSalary": 1,
- "hightNum": '2001~3000'
- },
- {
- "expectationSalary": 2,
- "hightNum": '3001~4000'
- },
- {
- "expectationSalary": 3,
- "hightNum": '4001~5000'
- },
- {
- "expectationSalary": 4,
- "hightNum": '5001~6000'
- },
- {
- "expectationSalary": 5,
- "hightNum": '6001~7000'
- },
- {
- "expectationSalary": 6,
- "hightNum": '7001~8000'
- },
- {
- "expectationSalary": 7,
- "hightNum": '8001~9000'
- },
- {
- "expectationSalary": 8,
- "hightNum": '9001~10000'
- }, {
- "expectationSalary": 9,
- "hightNum": '10000以上'
- }
- ],
- expectationPosition: ["普工", "客服", "销售", "服务员", "物流仓储", "司机", "才艺技能", "文员助理", "快递配送", "促销导购", "展会演出", "家教培训", "模特", "贸易采购", "厨师", "编辑", "线上推广", "设计", "技工", "保洁", "其它"],
- region: {
- code: [],
- value: []
- }, //省市区
- name: '',
- expectationPositionIndex: 0,
- salaryIndex: 0,
- hpUserIntentionId: '',
- hpUserResumeId: ''
- },
- onLoad: function(options) {
- console.log(options)
- let {
- hpUserResumeId
- } = options
- this.setData({
- hpUserResumeId: hpUserResumeId
- })
- if (hpUserResumeId) {
- let userResume = wx.getStorageSync('userResume')
- 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);
- var arr = userResume.expectationAddress.split("-");
- for(var i=0;i<arr.length;i++){
- this.data.region.value = this.data.region.value.concat(arr[i]);
- }
- var expectationArray = userResume.expectationPosition;
- var lengthSalary = this.data.salaryList.length;
- var salaryIndex;
- for (var i = 0; i < lengthSalary; i++) {
- if (userResume.expectationSalary == this.data.salaryList[i].hightNum) {
- salaryIndex = i;
- }
- }
- console.log("ggg", this.data.region)
- if (userResume.id) {
- this.setData({
- hpUserResumeId: userResume.id,
- expectationPositionIndex: expectationArray,
- salaryIndex: salaryIndex,
- region: this.data.region
- })
- }
- }
- },
- //改变薪资水平
- bindSalaryChange(e) {
- console.log('picker改变薪资水平,携带值为', e.detail)
- this.setData({
- salaryIndex: e.detail.value
- })
- },
- //改变期望岗位
- changeName(e) {
- this.setData({
- expectationPositionIndex: e.detail.value
- })
- },
- //改变期望地点
- bindRegionChange(e) {
- console.log('picker发送选择改变,携带值为', e.detail)
- this.data.region.code = e.detail.code;
- this.data.region.value = e.detail.value;
- this.setData({
- region: this.data.region
- })
- },
- //提交
- submit() {
- let flag = this.check()
- if (!flag) {
- return
- }
- let {
- expectationPositionIndex,
- salaryIndex,
- region,
- hpUserResumeId,
- salaryList
- } = this.data
- let paramsObj = {
- expectationPosition: expectationPositionIndex,
- expectationSalary: salaryList[salaryIndex].expectationSalary,
- expectationProvinceId: region.code[0],
- expectationCityId: region.code[1],
- expectationCountryId: region.code[2],
- expectationAddress: region.value[0] +'-'+ region.value[1] +'-' +region.value[2],
- user_id: app.globalData.userId,
- user_token: app.globalData.userToken,
- member_id: app.globalData.memberId
- }
- Object.assign(paramsObj);
- resumeIntent(paramsObj).then(data => {
- console.log(data)
- showToast('保存成功', 'success')
- wx.navigateBack()
- })
- },
- //验证
- check() {
- let {
- region,
- salaryList,
- salaryIndex
- } = this.data
- if (salaryList[salaryIndex].expectationSalary == null) {
- showToast('请选择期望薪资');
- return false
- }
- if (region.value.length == 0) {
- showToast('请选择期望地点');
- return false
- }
- return true
- }
- })
|