resumeDetail.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <template>
  2. <view class="resume-detail" :style="{ paddingTop: (12 + statusBarHeight + 88 - 60) + 'px' }">
  3. <!-- 固定顶部导航栏 -->
  4. <view class="fixed-nav" :style="{ paddingTop: (12 + statusBarHeight) + 'px' }">
  5. <view class="navbar">
  6. <view class="navbar-content">
  7. <view class="navbar-left" @click="goBack">
  8. <u-icon name="arrow-left" size="36" color="#333"></u-icon>
  9. </view>
  10. <view class="navbar-title">简历详情</view>
  11. <view class="nav-right">
  12. <view class="nav-icon" @click="setCollection">
  13. <image v-if="resumeData.isCollection == 0" src="/static/images/index/guanzhu.svg" class="icon-img"></image>
  14. <image v-else src="/static/images/index/gzActive.svg" style="width: 50rpx;height: 50rpx;"></image>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <view style="margin-top: 20px; border-top: 20rpx solid rgba(241, 245, 248, 1);" v-if="!loading">
  21. <previewResume :resumesId="resumesId" :postPushId="postPushId"></previewResume>
  22. </view>
  23. <!-- 底部操作按钮 -->
  24. <view v-if="postPushId != '' && isShowBtn == 0" class="bottom-actions">
  25. <view class="action-btn contact-btn" @click="contactCandidate">
  26. <text>立即联系</text>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import previewResume from '@/components/resume/preview-resume.vue';
  33. import { debounce } from '@/utils/util'
  34. export default {
  35. components: {
  36. previewResume
  37. },
  38. data() {
  39. return {
  40. statusBarHeight: 0, // 状态栏高度
  41. resumeData: {},
  42. userEntity: "",
  43. eduList: "",
  44. intentions: "",
  45. resumeList: {},
  46. skills: "",
  47. postPushId: "",
  48. workExpList: [],
  49. workExpTimes: "",
  50. resumesStatus: ['离职&随时到岗', '在职&月内到岗', '在职&考虑机会', '在职&暂不考虑'],
  51. isShowBtn:0,
  52. resumesId: '',
  53. postPushId: '',
  54. loading: true
  55. }
  56. },
  57. onLoad(option) {
  58. // 获取状态栏高度
  59. let systemInfo = uni.getSystemInfoSync();
  60. this.statusBarHeight = systemInfo.statusBarHeight || 0;
  61. // 获取邀请码保存到本地
  62. if (option.invitation) {
  63. this.$queue.setData('inviterCode', option.invitation);
  64. }
  65. // #ifdef MP-WEIXIN
  66. if (option.scene) {
  67. const scene = decodeURIComponent(option.scene);
  68. this.$queue.setData('inviterCode', scene.split(',')[0]);
  69. }
  70. // #endif
  71. this.weekMember = uni.getStorageSync('weekMember')
  72. this.userId = uni.getStorageSync('userId') ? uni.getStorageSync('userId') : 0
  73. if (option.postPushId) {
  74. this.postPushId = option.postPushId
  75. }
  76. if (option.resumesId) {
  77. this.resumesId = option.resumesId
  78. this.getDetail()
  79. }
  80. // if (option.resumesId) {
  81. // this.resumesId = option.resumesId
  82. // this.getDetail()
  83. // } else if (option.userId) {
  84. // this.byuserId = option.userId
  85. // this.getDetail()
  86. // }
  87. if(option.isShowBtn){
  88. this.isShowBtn = option.isShowBtn
  89. }
  90. },
  91. onUnload() {
  92. this.$queue.remove('resumeDetailData')
  93. },
  94. methods: {
  95. /**
  96. * 收藏简历
  97. */
  98. setCollection: debounce(function() {
  99. this.$Request.postT("/app/myCollection/saveCollection", {
  100. resumesId: this.resumesId,
  101. type: 2
  102. }).then(res => {
  103. if (res.code == 0) {
  104. uni.showToast({
  105. title: res.msg
  106. })
  107. this.getDetail()
  108. }
  109. })
  110. }, 300),
  111. goBack() {
  112. uni.navigateBack();
  113. },
  114. contactCandidate: debounce(function() {
  115. //去联系
  116. this.getDetail()
  117. this.$Request.postJson('/app/chat/insertChatConversation', {
  118. userId: this.userEntity, //会话对象的id
  119. focusedUserId: uni.getStorageSync('userId'), //当前登录者Id
  120. postPushId: this.postPushId,
  121. resumesId: this.resumesId,
  122. type: 2,
  123. }).then(ret => {
  124. if (ret.code == 0) {
  125. uni.navigateTo({
  126. url: '/pages/msg/im?byUserId=' + this.userEntity
  127. + '&chatConversationId=' + ret.data
  128. .chatConversationId + '&resumesId=' + this.resumesId + '&postPushId=' +
  129. this.postPushId
  130. })
  131. }
  132. })
  133. }, 300),
  134. getDetail() {
  135. uni.showLoading({
  136. title: '加载中'
  137. })
  138. let data = {
  139. resumesId: this.resumesId,
  140. userId: this.userId,
  141. companyId: uni.getStorageSync('companyId'),
  142. }
  143. if (this.postPushId && this.postPushId !== 'null' && this.postPushId !== 'undefined') {
  144. data = {
  145. ...data,
  146. postPushId: this.postPushId
  147. }
  148. }
  149. this.$Request.get('/app/resumes/selectResumesByResumesId', data).then(res => {
  150. if (res.code == 0) {
  151. uni.hideLoading()
  152. var data = res.data;
  153. this.resumeData = res.data;
  154. // this.userEntity = data.userEntity
  155. this.userEntity = data.userId
  156. this.eduList = data.eduList
  157. this.intentions = data.intentionList
  158. this.resumeList = data.resumesListDtoList !=null?data.resumesListDtoList : {}
  159. // this.skills = data.skills
  160. this.skills = data.skillList
  161. this.workExpList = data.workExpList
  162. this.$queue.setData('resumeDetailData', res.data)
  163. } else {
  164. uni.hideLoading()
  165. uni.showModal({
  166. title: '提示',
  167. content: '用户简历不存在',
  168. showCancel: false,
  169. complete(ret) {
  170. uni.navigateBack()
  171. }
  172. })
  173. }
  174. }).finally(() => {
  175. this.loading = false
  176. })
  177. },
  178. //使用岗位名称查询出企业正在招聘的该岗位拿到对应的岗位id
  179. getJobList(ruleClassifyName) {
  180. let data = {
  181. status: 2,
  182. page: 1,
  183. limit: 1,
  184. ruleClassifyName: ruleClassifyName,
  185. companyId: uni.getStorageSync('companyId')
  186. }
  187. this.$Request.getT('/app/postPush/getPostPushList', data).then(res => {
  188. if (res.code == 0) {
  189. this.postPushId = res.data.records[0].postPushId
  190. }
  191. })
  192. },
  193. // 查看图片
  194. saveImg(imgs, index) {
  195. // console.log(imgs)
  196. let that = this;
  197. let imgArr = imgs
  198. // imgArr.push(imgs);
  199. // //预览图片
  200. uni.previewImage({
  201. urls: imgArr,
  202. current: imgArr[index]
  203. });
  204. },
  205. }
  206. }
  207. </script>
  208. <style lang="scss" scoped>
  209. .resume-detail {
  210. min-height: 100vh;
  211. padding-bottom: 120rpx;
  212. // padding-top 已改为动态计算,在模板中通过 :style 设置
  213. }
  214. .fixed-nav {
  215. position: fixed;
  216. top: 0;
  217. left: 0;
  218. right: 0;
  219. z-index: 9999;
  220. background-color: #ffffff;
  221. // padding: 0 4rpx;
  222. // padding-top 已改为动态计算,在模板中通过 :style 设置
  223. }
  224. // 顶部导航栏
  225. .navbar {
  226. background: #fff;
  227. height: 88rpx;
  228. padding: 0 8rpx;
  229. // padding: 80rpx 0 40rpx 0; // 已移除,因为现在是固定导航栏
  230. .navbar-content {
  231. display: flex;
  232. align-items: center;
  233. justify-content: space-between;
  234. padding: 0 30rpx;
  235. height: 60rpx;
  236. .navbar-left {
  237. width: 96rpx;
  238. display: flex;
  239. align-items: center;
  240. }
  241. .navbar-title {
  242. color: rgba(23, 23, 37, 1);
  243. font-family: DM Sans;
  244. font-size: 34rpx;
  245. font-weight: 400;
  246. line-height: 52rpx;
  247. letter-spacing: 0%;
  248. text-align: center;
  249. }
  250. .nav-right {
  251. display: flex;
  252. align-items: center;
  253. justify-content: flex-end;
  254. width: 96rpx;
  255. }
  256. .nav-icon {
  257. display: flex;
  258. align-items: center;
  259. justify-content: center;
  260. // width: 36rpx;
  261. // height: 36rpx;
  262. }
  263. .icon-img {
  264. width: 42rpx;
  265. height: 42rpx;
  266. }
  267. }
  268. }
  269. // 底部操作按钮
  270. .bottom-actions {
  271. position: fixed;
  272. bottom: 0;
  273. left: 0;
  274. right: 0;
  275. background: #fff;
  276. padding: 30rpx;
  277. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
  278. .action-btn {
  279. width: 100%;
  280. height: 88rpx;
  281. border-radius: 44rpx;
  282. display: flex;
  283. align-items: center;
  284. justify-content: center;
  285. font-size: 32rpx;
  286. font-weight: 500;
  287. }
  288. .contact-btn {
  289. background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  290. color: #fff;
  291. }
  292. }
  293. .company-title {
  294. margin-bottom: 8rpx;
  295. color: rgba(23, 23, 37, 1);
  296. font-family: DM Sans;
  297. font-size: 28rpx;
  298. font-weight: 400;
  299. }
  300. </style>