index.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. import {
  2. getResume
  3. } from '../../services/index.js'
  4. import {
  5. imgServerUrl
  6. } from '../../config/config.js'
  7. import {
  8. showToast
  9. } from '../../utils/tips.js'
  10. import {
  11. formatTime
  12. } from '../../utils/util.js'
  13. const app = getApp();
  14. Page({
  15. data: {
  16. imgServerUrl: imgServerUrl,
  17. hpUserResumeId: '', //是否有简历
  18. eduList: ["请选择", "小学", "中学", "高中", "大专", "本科", "研究生", "博士", "博士后"],
  19. eduName: '', //学历
  20. expYear: "", //工作几年
  21. hpUserResumeId: '', //用户简历表id
  22. expectationPosition: ["普工", "客服", "销售", "服务员", "物流仓储", "司机", "才艺技能", "文员助理", "快递配送", "促销导购", "展会演出", "家教培训", "模特", "贸易采购", "厨师", "编辑", "线上推广", "设计", "技工", "保洁", "其它"],
  23. salaryList: [{
  24. "expectationSalary": -1,
  25. "hightNum": '不限'
  26. },
  27. {
  28. "expectationSalary": 0,
  29. "hightNum": '1000~2000'
  30. },
  31. {
  32. "expectationSalary": 1,
  33. "hightNum": '2001~3000'
  34. },
  35. {
  36. "expectationSalary": 2,
  37. "hightNum": '3001~4000'
  38. },
  39. {
  40. "expectationSalary": 3,
  41. "hightNum": '4001~5000'
  42. },
  43. {
  44. "expectationSalary": 4,
  45. "hightNum": '5001~6000'
  46. },
  47. {
  48. "expectationSalary": 5,
  49. "hightNum": '6001~7000'
  50. },
  51. {
  52. "expectationSalary": 6,
  53. "hightNum": '7001~8000'
  54. },
  55. {
  56. "expectationSalary": 7,
  57. "hightNum": '8001~9000'
  58. },
  59. {
  60. "expectationSalary": 8,
  61. "hightNum": '9001~10000'
  62. }, {
  63. "expectationSalary": 9,
  64. "hightNum": '10000以上'
  65. }
  66. ],
  67. },
  68. onLoad: function(options) {
  69. var hpUserResumeId = options.hpUserResumeId;
  70. this.setData({
  71. hpUserResumeId
  72. })
  73. if (!hpUserResumeId) {
  74. wx.navigateTo({
  75. url: '../user-info/index',
  76. })
  77. }
  78. },
  79. onShow: function(options) {
  80. this.fetchData()
  81. },
  82. //获取用户简历详情
  83. fetchData() {
  84. let paramsObj = {
  85. user_id: app.globalData.userId,
  86. user_token: app.globalData.userToken,
  87. member_id: app.globalData.memberId
  88. }
  89. Object.assign(paramsObj);
  90. getResume(paramsObj).then(data => {
  91. console.log("ghj",data)
  92. if (!data.data.userResume) {
  93. wx.navigateTo({
  94. url: '../user-info/index',
  95. })
  96. }
  97. let {
  98. userResume
  99. } = data.data
  100. var eduName = this.data.eduList[userResume.highestQualification];
  101. var hpUserResumeId = userResume.hpUserResumeId;
  102. var expList = userResume.hpResumeWorkExperienceList;
  103. wx.setStorageSync("expList", expList);
  104. if (!userResume.headImg) {
  105. userResume.headImg = `${imgServerUrl}/images/avatar/man.png`;
  106. }
  107. if (userResume.expectationSalary) {
  108. var salaryList = this.data.salaryList;
  109. for (var i = 0; i < salaryList.length; i++) {
  110. if (salaryList[i].expectationSalary == userResume.expectationSalary) {
  111. userResume.expectationSalary = salaryList[i].hightNum
  112. }
  113. }
  114. }
  115. var year = userResume.birthYear;
  116. if (year) {
  117. var date = new Date;
  118. var year1 = date.getFullYear();
  119. year = year1 - year + 1;
  120. }
  121. this.setData({
  122. userResume,
  123. eduName: eduName,
  124. expList: expList,
  125. year: year
  126. })
  127. wx.setStorageSync('userResume', userResume)
  128. })
  129. },
  130. // 修改基本信息
  131. toUserInfo() {
  132. wx.navigateTo({
  133. url: '../user-info/user-info?hpUserResumeId=' + this.data.hpUserResumeId,
  134. })
  135. },
  136. // 修改求职意向
  137. toUserJob(e) {
  138. wx.navigateTo({
  139. url: '../user-job/index?hpUserResumeId=' + this.data.hpUserResumeId,
  140. })
  141. },
  142. // 修改工作经验
  143. toUserWorks(e) {
  144. let {
  145. type,
  146. index
  147. } = e.currentTarget.dataset
  148. if (type == "edit") {
  149. wx.navigateTo({
  150. url: '../user-works/index?hpUserResumeId=' + this.data.hpUserResumeId + "&index=" + index,
  151. })
  152. } else {
  153. wx.navigateTo({
  154. url: '../user-works/index?hpUserResumeId=' + this.data.hpUserResumeId
  155. })
  156. }
  157. },
  158. //修改教育背景
  159. toUserEdu(e) {
  160. let {
  161. type,
  162. index
  163. } = e.currentTarget.dataset
  164. if (type == "edit") {
  165. wx.navigateTo({
  166. url: '../user-education/index?hpUserResumeId=' + this.data.hpUserResumeId + "&index=" + index,
  167. })
  168. } else {
  169. wx.navigateTo({
  170. url: '../user-education/index?hpUserResumeId=' + this.data.hpUserResumeId,
  171. })
  172. }
  173. }
  174. })