Procházet zdrojové kódy

众聘参数调整

zhengnaiwen_citu před 7 měsíci
rodič
revize
7e0c7b9c6f
1 změnil soubory, kde provedl 27 přidání a 26 odebrání
  1. 27 26
      pagesB/positionDetail/index.vue

+ 27 - 26
pagesB/positionDetail/index.vue

@@ -229,24 +229,13 @@ const imgSrc = ref('')
 const appInfo = ref({})
 const poster = ref()
 
-const getPositionDetail = async () => {
-  try {
-    loading.value = true
-    const { data } = await getPositionDetails({ id: jobId })
-    info.value = data
-    positionInfo.value = { ...dealDictObjData({}, info.value), ...info.value }
-    loading.value = false
-  } finally {
-  }
-}
-
 let jobId = ''
 onLoad((options) => {  
   // 是否是众聘
-  if (options.userId) {
-    isEmployment.value = options.userId
+  if (options.sharedById) {
+    isEmployment.value = options.sharedById
   }
-  jobId = options?.id || ''
+  jobId = options?.jobId || ''
   if (jobId) {
     loading.value = true
     loadingText.value = '加载中 . . . '
@@ -265,6 +254,30 @@ onShow(() => {
   deliveryCheck()
 })
 
+
+//在点击open-type="share"按钮后会触发以下函数,可以在函数中写需要的逻辑,当然函数的返回值必须是一个对象,用于设置分享卡片的展示形式
+//发送给微信好友  
+onShareAppMessage((res) => {
+  let path = `/pagesB/positionDetail/index?jobId=${info.value.id}`
+  if (info.value.hire) {
+    path += `&sharedById=${info.value.userId}`
+  }
+  return {
+    title: '我发现了一个好职位,快来看看吧', //分享的名称
+    path
+  }
+})
+
+async function getPositionDetail () {
+  try {
+    loading.value = true
+    const { data } = await getPositionDetails({ id: jobId })
+    info.value = data
+    positionInfo.value = { ...dealDictObjData({}, info.value), ...info.value }
+    loading.value = false
+  } finally {
+  }
+}
 // 效验是否有投递过简历
 const delivery = ref(false) // 是否已投递简历
 async function deliveryCheck () {
@@ -428,18 +441,6 @@ const handleUpload = () => {
 const handleClickShare = () => {
   sharePopup.value.open()
 }
-//在点击open-type="share"按钮后会触发以下函数,可以在函数中写需要的逻辑,当然函数的返回值必须是一个对象,用于设置分享卡片的展示形式
-//发送给微信好友  
-onShareAppMessage((res) => {
-  let path = `/pagesB/positionDetail/index?id=${info.value.id}`
-  if (info.value.hire) {
-    path += `&userId=${info.value.userId}`
-  }
-  return {
-    title: '我发现了一个好职位,快来看看吧', //分享的名称
-    path
-  }
-})
 // 获取设备信息
 function getSystemInfo(){
   return new Promise((resolve, reject) =>{