Explorar el Código

沟通-操作按钮隐藏

Xiao_123 hace 2 meses
padre
commit
b3e0488cd6
Se han modificado 2 ficheros con 69 adiciones y 25 borrados
  1. 68 24
      pagesA/chart/index.vue
  2. 1 1
      pagesB/personnelDetails/index.vue

+ 68 - 24
pagesA/chart/index.vue

@@ -100,10 +100,9 @@
                     我想要一份您的简历,您是否同意
                   </text>
                 </view>
-                <!-- <view class="btn-actions">
+                <view class="btn-actions">
                   <text class="btn" v-if="val.payload.content?.type === 1" @tap="handlePreview(val.payload)">点击预览附件简历</text>
-                  <text class="btn" v-if="val.payload.content?.type === 2" @tap="handleFindResume">点击发送附件简历</text>
-                </view> -->
+                </view>
               </view>
             </view>
             <view v-else-if="val.payload.type === -1" class="message-text" :class="{ active: val.from_uid === IM.uid}">
@@ -117,9 +116,10 @@
       </scroll-view>
       
     <view class="box-bottom" v-if="channelItem?.channelID !== 'system'">
-      <view class="box-bottom-tool" style="display: flex; justify-content: space-between;">
-        <!-- <text class="toolBtn" :class="{ disabled: !isSendResume }" @tap="handleFindResume">{{ isSendResume ? '简历已投递' : '发送简历' }}</text> -->
-      </view>
+      <!-- <view class="box-bottom-tool" style="display: flex; justify-content: start;">
+        <text class="toolBtn" @tap="handleFindResume">求简历</text>
+        <text class="toolBtn ss-m-l-10" @tap="handleInviteInterview">面试邀约</text>
+      </view> -->
       
       <view class="d-flex align-end textBox" v-if="channelItem?.channelID !== 'system'">
         <textarea
@@ -134,6 +134,11 @@
         <text class="submitBtn" @tap="handleSend">发 送</text>
       </view>
     </view>
+
+    <!-- <uni-popup ref="invitePopup" background-color="#fff" type="bottom">
+			<view style="background-color: #fff; height: 70vh;">
+      </view>
+		</uni-popup> -->
   </view>
 </template>
 
@@ -143,11 +148,14 @@ import { onLoad } from '@dcloudio/uni-app'
 import { useIMStore } from '@/store/im'
 import { userStore } from '@/store/user'
 import { initConnect, send, initChart, getMoreMessages, toChannel } from '@/hooks/useIM'
-import { getDict } from '@/hooks/useDictionaries'
 import { timesTampChange } from '@/utils/date'
 import { getUserAvatar } from '@/utils/avatar'
 import { formatName } from '@/utils/getText'
 import { preview } from '@/utils/preview'
+import { getAccessToken } from '@/utils/request'
+import { showAuthModal } from '@/hooks/useModal'
+import { getJobAdvertisedList } from '@/api/new/position'
+
 const useUserStore = userStore()
 const userInfo = computed(() => useUserStore?.userInfo)
 
@@ -160,16 +168,11 @@ const hasMore = ref(false)
 
 const pageSize = ref(1)
 
-// 求职者面试列表
-// 求职端-获取求职者与当前邀请人的面试记录
-const statusList = ref([])
 const inputValue = ref('')
 
 const newsId = ref('') // newsId 需要和聊天列表里面的id对应 永远取最后列表中的最后一个就可以做到发送消息即时滚动到底部
 const scrollAnimation = ref(false)
 
-const isSendResume = ref(false)
-const positionInfo = ref({})
 const isEmployment = ref('-1')
 
 onMounted(() => {
@@ -233,17 +236,6 @@ const setScrollBottom = () => {
   }
 }
 
-const getStatusList = async () => {
-  try {
-    const { data } = await getDict('menduner_interview_invite_status')
-    if (data.data.length) {
-      statusList.value = data.data
-    }
-  } catch (error) {
-
-  }
-}
-
 function handleSend () {
   if (!inputValue.value) {
     uni.showToast({ title: '不能发送空白信息', icon: 'none' })
@@ -252,6 +244,57 @@ function handleSend () {
   send(inputValue.value, channelItem.value)
 }
 
+// 职位列表
+const jobNum = ref(0)
+const jobList = ref([])
+const getJobList = async () => {
+  const { data } = await getJobAdvertisedList({ pageNo: 1, pageSize: 10, hasExpiredData: false, status: 0 })
+  jobNum.value = data?.total || 0
+  jobList.value = data?.list ? data?.list.map(e => {
+    return { text: formatName(e.name), value: e.id, ...e }
+  }) : []
+}
+
+// 求简历
+const handleFindResume = async () => {
+  if (!getAccessToken()) {
+    showAuthModal()
+    return
+  }
+  // 企业必须有招聘中的职位才能发起面试邀请
+  if (jobNum.value === 0) {
+		uni.showToast({
+			title: '请先发布招聘职位',
+			icon: 'none',
+			duration: 2000
+		})
+		return
+	}
+}
+
+// 邀约面试
+const invitePopup = ref()
+const handleInviteInterview = () => {
+  if (!getAccessToken()) {
+    showAuthModal()
+    return
+  }
+  // 企业必须有招聘中的职位才能发起面试邀请
+  if (jobNum.value === 0) {
+		uni.showToast({
+			title: '请先发布招聘职位',
+			icon: 'none',
+			duration: 2000
+		})
+		return
+	}
+  console.log(info.value, '邀请面试', jobList.value, invitePopup.value)
+  invitePopup.value.open()
+	// uni.navigateTo({
+	//   url: `/pagesB/InviteInterview/index?id=${info.value.id}`
+	// })
+}
+
 // 预览简历
 function handlePreview (payload) {
   if (!payload?.content?.query?.src) {
@@ -296,7 +339,8 @@ onLoad(async (options) => {
   }
   await init(info.value.id, info.value.enterpriseId)
 
-  await getStatusList()
+  // await getJobList() // 获取招聘中的职位
+
   // 清除未读消息
   resetUnread(channelItem.value, userInfo.value?.enterpriseId)
   // 更新未读消息

+ 1 - 1
pagesB/personnelDetails/index.vue

@@ -153,7 +153,7 @@ const handleInvite = async () => {
     showAuthModal()
     return
   }
-  // 企业必须有招聘中的职位才能发起沟通
+  // 企业必须有招聘中的职位才能发起面试邀请
   if (jobNum.value === 0) {
 		uni.showToast({
 			title: '请先发布招聘职位',