Ver código fonte

企业二维码分享

lifanagju_citu 2 meses atrás
pai
commit
4e3bd40af4

+ 8 - 9
pagesB/jobFair/enterprisesClassification.vue

@@ -102,7 +102,7 @@ const getJobFairDetail = async () => {
   // tab
   if (data?.tag?.length) {
     tabList.value = data.tag
-    tabIndex.value = 0
+    handClickTab(0)
   }
   // 轮播图
   if (data?.headImg?.length) {
@@ -112,7 +112,6 @@ const getJobFairDetail = async () => {
   if (data?.backgroundColour) {
     backgroundColor.value = data.backgroundColour || '#fff'
   }
-  getData()
 }
 getJobFairDetail()
 
@@ -121,17 +120,17 @@ const handClickTab = (index) => {
   tabIndex.value = index
   query.pageNo = 1
   listData.value = []
-  getData()
+  getEnterpriseList()
 }
 
-const getData = async () => {
+const getEnterpriseList = async () => {
   if (!query.jobFairId) return
   try {
     const params = { ...query }
-    const positionIdValue = tabIndex.value !== -1 ? tabList.value[tabIndex.value]?.value : []
-    positionIdValue?.length && positionIdValue.forEach((value, index) => {
-      params[`industryId[${index}]`] = value
-    })
+    // tab对应的职位类型id列表
+    const idList = tabIndex.value !== -1 ? tabList.value[tabIndex.value]?.value : []
+    idList?.length && idList.forEach((value, index) => { params[`industryId[${index}]`] = value })
+    //
     const res = await getJobFairEnterprisePage(params)
     const list = res?.data?.list || []
     listData.value = listData.value.concat(dealDictArrayData([], list))
@@ -157,7 +156,7 @@ const onScroll = (e) =>{
 const loadingMore = () => {
   more.value = 'loading'
   query.pageNo++
-  getData()
+  getEnterpriseList()
 }
 
 const toDetail = (item) =>{

+ 12 - 6
pagesB/jobFair/jobFairEntShare.vue

@@ -29,6 +29,7 @@ onLoad(async (options) => {
   jobFairId = options.jobFairId
   enterpriseId = options.enterpriseId
   await getJobFairDetail()
+  await getEntPositionList()
   // await getJobFairEntDetail()
   const windowInfo = wx.getWindowInfo()
   windowWidth.value = windowInfo.windowWidth
@@ -43,16 +44,21 @@ const getJobFairDetail = async () => {
 }
 
 const getEntPositionList = async () => {
-  if (!query.jobFairId) {
+  if (!jobFairId || enterpriseId) {
     uni.showToast({ title: '获取企业岗位失败,请重试!', icon: 'none', duration: 2000 })
     return
   }
   try {
-    const params = { ...query }
-    const positionIdValue = tabIndex.value !== -1 ? tabList.value[tabIndex.value]?.value : []
-    positionIdValue?.length && positionIdValue.forEach((value, index) => {
-      params[`positionId[${index}]`] = value
-    })
+    const params = {
+      pageSize: 2, 
+      pageNo: 1,
+      jobFairId,
+      enterpriseId,
+    }
+    // tab对应的职位类型id列表
+    const idList = tabIndex.value !== -1 ? tabList.value[tabIndex.value]?.value : []
+    idList?.length && idList.forEach((value, index) => { params[`positionId[${index}]`] = value })
+    //
     const res = await getJobFairEntJobPage(params)
     const list = res?.data?.list || []
     // list.forEach(e => {

+ 8 - 12
pagesB/jobFair/positionClassification.vue

@@ -40,7 +40,7 @@
         </view>
       </view>
     </scroll-view>
-    <view v-if="showShareBtn" class="shareButtonBox" @tap="handleShare">
+    <view class="shareButtonBox" @tap="handleShare">
       <uni-icons type="redo-filled" size="20" color="#fff" />
     </view>
   </view>
@@ -55,7 +55,6 @@ import PositionList from '@/components/PositionList'
 import SwiperAd from '@/components/SwiperAd'
 
 const more = ref('more')
-const showShareBtn = ref(false)
 const listData = ref([])
 const query = reactive({
   pageSize: 20, 
@@ -95,8 +94,8 @@ const getJobFairDetail = async () => {
   const { data } = await getJobFair(query.jobFairId)
   // tab
   if (data?.tag?.length) {
-    tabList.value = data.tag
-    tabIndex.value = 0
+    tabList.value = data?.tag || []
+    if (tabList.value?.length) handClickTab(0)
   }
   // 轮播图
   if (data?.headImg?.length) {
@@ -106,8 +105,6 @@ const getJobFairDetail = async () => {
   if (data?.backgroundColour) {
     backgroundColor.value = data.backgroundColour || '#fff'
   }
-  showShareBtn.value= true
-  getEntPositionList()
 }
 
 // 切换类型
@@ -125,10 +122,10 @@ const getEntPositionList = async () => {
   }
   try {
     const params = { ...query }
-    const positionIdValue = tabIndex.value !== -1 ? tabList.value[tabIndex.value]?.value : []
-    positionIdValue?.length && positionIdValue.forEach((value, index) => {
-      params[`positionId[${index}]`] = value
-    })
+    // tab对应的职位类型id列表
+    const idList = tabIndex.value !== -1 ? tabList.value[tabIndex.value]?.value : []
+    idList?.length && idList.forEach((value, index) => { params[`positionId[${index}]`] = value })
+    //
     const res = await getJobFairEntJobPage(params)
     const list = res?.data?.list || []
     list.forEach(e => {
@@ -136,7 +133,6 @@ const getEntPositionList = async () => {
       e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise)}
     })
     listData.value = listData.value.concat(list)
-    // showShareBtn.value = true
     if (listData.value?.length === +res?.data?.total) {
       more.value = 'noMore'
       return
@@ -171,7 +167,7 @@ const loadingMore = () => {
 const handleShare = () => {
   // 分享招聘会
   let url = `/pagesB/jobFair/${query.enterpriseId ? 'jobFairEntShare' : 'jobFairShare'}?jobFairId=${query.jobFairId}`
-  // 分享招聘会-企业
+  // 分享招聘会企业
   if (query.enterpriseId) url = url + `&enterpriseId=${query.enterpriseId}`
   // 
 	uni.navigateTo({ url })