Ver código fonte

平台职位分享

Xiao_123 7 meses atrás
pai
commit
4dd8f9ed25
2 arquivos alterados com 35 adições e 7 exclusões
  1. 12 0
      api/position.js
  2. 23 7
      pagesB/positionDetail/index.vue

+ 12 - 0
api/position.js

@@ -146,3 +146,15 @@ export const getRecommendationList = (params) => {
   })
   })
 }
 }
 
 
+// 根据id查询分享的职位id与推荐人id
+export const getShareDetail = (params) => {
+  return request({
+    url: '/app-api/menduner/system/job/advertised/get/share',
+    method: 'GET',
+    params,
+    custom: {
+      showLoading: false,
+      auth: false
+    }
+  })
+}

+ 23 - 7
pagesB/positionDetail/index.vue

@@ -207,7 +207,8 @@ import {
   getPersonJobUnfavorite, // 取消收藏
   getPersonJobUnfavorite, // 取消收藏
   getPersonJobFavorite, // 收藏
   getPersonJobFavorite, // 收藏
   getJobFavoriteCheck,
   getJobFavoriteCheck,
-  jobCvRelHireSend
+  jobCvRelHireSend,
+  getShareDetail
 } from '@/api/position'
 } from '@/api/position'
 import { getPersonResumeCv, saveResume } from '@/api/user'
 import { getPersonResumeCv, saveResume } from '@/api/user'
 import { dealDictObjData } from '@/utils/position'
 import { dealDictObjData } from '@/utils/position'
@@ -230,13 +231,20 @@ const appInfo = ref({})
 const poster = ref()
 const poster = ref()
 
 
 let jobId = ''
 let jobId = ''
-onLoad((options) => {
-  // console.log(options)  
-  // 是否是众聘
-  if (options.sharedById) {
-    isEmployment.value = options.sharedById
+let obj = {}
+onLoad(async (options) => {
+  console.log(options, 'options')
+  // 网站二维码分享
+  if (options.scene) {
+    const scene = decodeURIComponent(options.scene)
+    const str = scene.split('=')
+    const res = await getShareDetail({ id: str[1] })
+    obj = res.data
   }
   }
-  jobId = options?.id || options?.jobId || ''
+
+  // 是否众聘
+  isEmployment.value = options?.sharedById || obj?.sharedById
+  jobId = options?.id || options?.jobId || obj?.jobId || ''
   if (jobId) {
   if (jobId) {
     loading.value = true
     loading.value = true
     loadingText.value = '加载中 . . . '
     loadingText.value = '加载中 . . . '
@@ -440,6 +448,14 @@ const handleUpload = () => {
 
 
 // 分享
 // 分享
 const handleClickShare = () => {
 const handleClickShare = () => {
+  if (!getAccessToken()) {
+    uni.showToast({
+      title:'请先登录',
+      icon: 'none'
+    })
+    showAuthModal()
+    return
+  }
   sharePopup.value.open()
   sharePopup.value.open()
 }
 }
 // 获取设备信息
 // 获取设备信息