zhengnaiwen_citu 8 месяцев назад
Родитель
Сommit
f81e766ed7

+ 13 - 0
api/position.js

@@ -94,6 +94,19 @@ export const jobCvRelSend = (data) => {
   })
 }
 
+// 众聘分享-投递简历
+export const jobCvRelHireSend = (data) => {
+  return request({
+    url: '/app-api/menduner/system/job-cv-rel/hire/recommend/send',
+    method: 'POST',
+    data,
+    custom: {
+      auth: true,
+      showLoading: false
+    }
+  })
+}
+
 // 获取众聘职位分页
 export const getJobAdvertisedHire = (params) => {
   return request({

Разница между файлами не показана из-за своего большого размера
+ 40 - 159
package-lock.json


+ 94 - 11
pagesB/positionDetail/index.vue

@@ -144,7 +144,30 @@
 
     <!-- 职位分享 -->
     <uni-popup ref="sharePopup" type="share">
-      <uni-popup-share title="分享到" @select="handleSelect"></uni-popup-share>
+      <uni-popup-share title="分享到">
+        <view class="share-pop">
+            <button class="f-straight" open-type="share">
+                <view class="share-round share-round-1" >
+                    <uni-icons
+                        type="weixin"
+                        color="#FFF"
+                        size="30"
+                    />
+                </view>
+                <view style="font-size:12px;">微信好友</view>
+            </button>
+            <button class="f-straight" @click="createPoster">
+                <view class="share-round share-round-2" >
+                    <uni-icons
+                        type="download-filled"
+                        color="#FFF"
+                        size="30"
+                    />
+                </view>
+                <view style="font-size:12px;">生成海报</view>
+            </button>
+        </view>
+      </uni-popup-share>
     </uni-popup>
   </layout-page>
 </template>
@@ -162,12 +185,13 @@ import {
   jobCvRelCheckSend,
   getPersonJobUnfavorite, // 取消收藏
   getPersonJobFavorite, // 收藏
-  getJobFavoriteCheck
+  getJobFavoriteCheck,
+  jobCvRelHireSend
 } from '@/api/position'
 import { getPersonResumeCv, saveResume } from '@/api/user'
 import { dealDictObjData } from '@/utils/position'
 import { getAccessToken } from '@/utils/request'
-import { onLoad } from '@dcloudio/uni-app';
+import { onLoad,onShareAppMessage,onShareTimeline } from '@dcloudio/uni-app'
 
 const sharePopup = ref()
 const loading = ref(false)
@@ -176,6 +200,9 @@ const loadingText = ref('加载中 . . . ')
 // 职位详情
 const info = ref({})
 const positionInfo = ref({})
+
+const isEmployment = ref(null)
+
 const getPositionDetail = async () => {
   try {
     loading.value = true
@@ -189,7 +216,11 @@ const getPositionDetail = async () => {
 }
 
 let jobId = ''
-onLoad((options) => {
+onLoad((options) => {  
+  // 是否是众聘
+  if (options.userId) {
+    isEmployment.value = options.userId
+  }
   jobId = options?.id || ''
   if (jobId) {
     loading.value = true
@@ -233,10 +264,13 @@ const handleDelivery = async () => {
     uni.showToast({ title: '您已投递过该职位!', icon: 'none', duration: 2000, })
     return
   }
+
   const { data } = await getPersonResumeCv()
   resumeList.value = data
   // 未上传简历
-  if (!resumeList.value?.length) return uploadPopup.value.open()
+  if (!resumeList.value?.length) {
+    return uploadPopup.value.open()
+  }
   popup.value.open()
 }
 const deliverySubmit = async (uploadFile) => {
@@ -246,7 +280,22 @@ const deliverySubmit = async (uploadFile) => {
     uni.showToast({ title: '请选择简历', icon: 'none', duration: 2000, })
     return
   }
-  await jobCvRelSend({ jobId, title: resume.title, url: resume.url, type: info.value.hire ? 1 : 0 })
+
+  if (isEmployment.value) {
+    await jobCvRelHireSend({
+      jobId,
+      url: resume.url,
+      recommendUserId: isEmployment.value
+    })
+  } else {
+    await jobCvRelSend({
+      jobId,
+      title: resume.title,
+      url: resume.url,
+      type: info.value.hire ? 1 : 0
+    })
+  }
+  
   uni.showToast({ title: '投递成功', icon: 'none', duration: 2000, })
   deliveryCheck()
   popup.value.close()
@@ -314,14 +363,48 @@ 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
+  }
+})
 
-const handleSelect = (e) => {
-  console.log(e, 'share')
-  uni.showToast({ title: '正在努力建设中 . . .', icon: 'none', duration: 2000, })
-}
 
 </script>
-
 <style scoped lang="scss">
 @import '../../static/style/position/index.scss';
+.share-pop {
+    width: 100%;
+    // height:300rpx;
+    display: flex;
+    justify-content: center;
+    .f-straight {
+      margin: 40rpx;
+      background: unset;
+      &::after{
+        border:none !important;
+      }
+    }
+    .share-round {
+      border-radius:50%;
+      height:100rpx;
+      width:100rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+    .share-round-1 {
+        background-color:#22a039;
+    }
+    .share-round-2 {
+        background-color:#3693cd;
+    }
+}
 </style>

+ 14 - 12
uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue

@@ -3,10 +3,11 @@
 		<view class="uni-share-title"><text class="uni-share-title-text">{{shareTitleText}}</text></view>
 		<view class="uni-share-content">
 			<view class="uni-share-content-box">
-				<view class="uni-share-content-item" v-for="(item,index) in bottomData" :key="index" @click.stop="select(item,index)">
+				<slot></slot>
+				<!-- <view class="uni-share-content-item" v-for="(item,index) in bottomData" :key="index" @click.stop="select(item,index)">
 					<image class="uni-share-image" :src="item.icon" mode="aspectFill"></image>
 					<text class="uni-share-text">{{item.text}}</text>
-				</view>
+				</view> -->
 
 			</view>
 		</view>
@@ -39,16 +40,17 @@
 		},
 		data() {
 			return {
-				bottomData: [{
-						text: '微信',
-						icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/c2b17470-50be-11eb-b680-7980c8a877b8.png',
-						name: 'wx'
-					},
-					{
-						text: '生成海报',
-						icon: 'https://minio.citupro.com/dev/menduner/down-icon.png',
-						name: 'poster'
-					}
+				bottomData: [
+					// {
+					// 	text: '微信',
+					// 	icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/c2b17470-50be-11eb-b680-7980c8a877b8.png',
+					// 	name: 'wx'
+					// },
+					// {
+					// 	text: '生成海报',
+					// 	icon: 'https://minio.citupro.com/dev/menduner/down-icon.png',
+					// 	name: 'poster'
+					// }
 					// {
 					// 	text: '支付宝',
 					// 	icon: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/d684ae40-50be-11eb-8ff1-d5dcf8779628.png',

Некоторые файлы не были показаны из-за большого количества измененных файлов