| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- import {
- getResume
- } from '../../services/index.js'
- import {
- imgServerUrl
- } from '../../config/config.js'
- import {
- showToast
- } from '../../utils/tips.js'
- import {
- formatTime
- } from '../../utils/util.js'
- const app = getApp();
- Page({
- data: {
- watermark: [],
- imgServerUrl: imgServerUrl,
- hpUserResumeId: '', //是否有简历
- eduList: ["请选择", "小学", "中学", "高中", "大专", "本科", "研究生", "博士", "博士后"],
- eduName: '', //学历
- expYear: "", //工作几年
- hpUserResumeId: '', //用户简历表id
- expectationPosition: ["普工", "客服", "销售", "服务员", "物流仓储", "司机", "才艺技能", "文员助理", "快递配送", "促销导购", "展会演出", "家教培训", "模特", "贸易采购", "厨师", "编辑", "线上推广", "设计", "技工", "保洁", "其它"],
- salaryList: [{
- "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以上'
- }
- ],
- },
- onLoad: function(options) {
- var hpUserResumeId = options.hpUserResumeId;
- this.setData({
- hpUserResumeId
- })
- if (!hpUserResumeId) {
- wx.navigateTo({
- url: '../user-info/index',
- })
- }
- },
- onShow: function(options) {
- this.fetchData();
- },
- //获取用户简历详情
- fetchData() {
- let paramsObj = {
- user_id: app.globalData.userId,
- user_token: app.globalData.userToken,
- member_id: app.globalData.memberId
- }
- Object.assign(paramsObj);
- getResume(paramsObj).then(data => {
- console.log("ghj", data)
- if (!data.data.userResume) {
- wx.navigateTo({
- url: '../user-info/index',
- })
- }
- let {
- userResume
- } = data.data
- var eduName = this.data.eduList[userResume.highestQualification];
- var hpUserResumeId = userResume.hpUserResumeId;
- var expList = userResume.hpResumeWorkExperienceList;
- wx.setStorageSync("expList", expList);
- if (!userResume.headImg) {
- userResume.headImg = `${imgServerUrl}/images/avatar/man.png`;
- }
- if (userResume.expectationSalary) {
- var salaryList = this.data.salaryList;
- for (var i = 0; i < salaryList.length; i++) {
- if (salaryList[i].expectationSalary == userResume.expectationSalary) {
- userResume.expectationSalary = salaryList[i].hightNum
- }
- }
- }
- var year = userResume.birthYear;
- if (year) {
- var date = new Date;
- var year1 = date.getFullYear();
- year = year1 - year + 1;
- }
- this.setData({
- userResume,
- eduName: eduName,
- expList: expList,
- year: year
- },_=>{
- wx.createSelectorQuery().select('.container').fields({
- dataset: true,
- size: true,
- scrollOffset: true,
- properties: ['scrollX', 'scrollY'],
- computedStyle: ['margin', 'backgroundColor'],
- context: true,
- }, (res) => {
- this.setData({
- watermark: app.watermark(res.height)
- })
- }).exec()
- })
- wx.setStorageSync('userResume', userResume)
- })
- },
- // 修改基本信息
- toUserInfo() {
- wx.navigateTo({
- url: '../user-info/user-info?hpUserResumeId=' + this.data.hpUserResumeId,
- })
- },
- // 修改求职意向
- toUserJob(e) {
- wx.navigateTo({
- url: '../user-job/index?hpUserResumeId=' + this.data.hpUserResumeId,
- })
- },
- // 修改工作经验
- toUserWorks(e) {
- let {
- type,
- index
- } = e.currentTarget.dataset
- if (type == "edit") {
- wx.navigateTo({
- url: '../user-works/index?hpUserResumeId=' + this.data.hpUserResumeId + "&index=" + index,
- })
- } else {
- wx.navigateTo({
- url: '../user-works/index?hpUserResumeId=' + this.data.hpUserResumeId
- })
- }
- },
- //修改教育背景
- toUserEdu(e) {
- let {
- type,
- index
- } = e.currentTarget.dataset
- if (type == "edit") {
- wx.navigateTo({
- url: '../user-education/index?hpUserResumeId=' + this.data.hpUserResumeId + "&index=" + index,
- })
- } else {
- wx.navigateTo({
- url: '../user-education/index?hpUserResumeId=' + this.data.hpUserResumeId,
- })
- }
- }
- })
|