Explorar o código

招聘会职位列表

lifanagju_citu hai 3 meses
pai
achega
a65f5b19c4
Modificáronse 4 ficheiros con 216 adicións e 49 borrados
  1. 6 0
      pages.json
  2. 2 1
      pagesB/jobFair/index.vue
  3. 204 0
      pagesB/jobFair/positionClassification.vue
  4. 4 48
      pagesB/jobFair/positions.vue

+ 6 - 0
pages.json

@@ -318,6 +318,12 @@
 					"style": {
 						"navigationBarTitleText": "招聘会/职位"
 					}
+				},
+				{
+					"path": "jobFair/positionClassification",
+					"style": {
+						"navigationBarTitleText": "招聘会/职位"
+					}
 				}
 			]
 		}

+ 2 - 1
pagesB/jobFair/index.vue

@@ -3,7 +3,7 @@
   <view style="padding-bottom: 30px; ">
     <view v-if="items.length">
       <uni-card v-for="val in items" :key="val.id">
-        <image class="ss-m-t-10" :src="val.headImg" mode="widthFix" style="width: 100%; height: auto; border-radius: 6px;"></image>
+        <image v-if="val?.previewImg" class="ss-m-t-10" :src="val.previewImg" mode="widthFix" style="width: 100%; height: auto; border-radius: 6px;"></image>
         <view class="ss-m-t-20">活动时间:{{ timesTampChange(val.startTime, 'Y-M-D') }}至{{ timesTampChange(val.endTime, 'Y-M-D') }}</view>
         <button class="ss-m-t-20 ss-m-b-10" style="background-color: #00897B; color: #fff;" type="primary" @tap="handleToJobFairEnterprises(val)">查看详情</button>
       </uni-card>
@@ -36,6 +36,7 @@ const handleToJobFairEnterprises = (val) => {
 	text = text ? text.replace(/\s+/g, ' ').trim() : '' // 去掉多余的空格
 	uni.navigateTo({
 		url: `/pagesB/jobFair/enterprises?jobFairId=${val.id}&jobFairName=${text}`
+		// url: `/pagesB/jobFair/positionClassification?jobFairId=${val.id}&jobFairName=${text}`
 	})
 }
 

+ 204 - 0
pagesB/jobFair/positionClassification.vue

@@ -0,0 +1,204 @@
+<!-- 招聘会/企业详情 -->
+<template>
+  <view class="box">
+    <scroll-view class="scrollBox" :scroll-y="true" :scroll-top="scrollTop" @scrolltolower="loadingMore" @scroll="onScroll" style="position:relative;">
+      <view>
+        <!-- 轮播图 -->
+        <SwiperAd v-if="swiperAdList.length" :list="swiperAdList" imgUrlKey="img" margin="0" borderRadius="0" :strType="false" @click="handleToDetails"></SwiperAd>
+        <view class="stick">
+          <!-- tab页签 -->
+          <scroll-view scroll-x="true" class="scroll-container">
+            <view
+              class="scroll-item"
+              :style="`margin-left: ${index ? '24px' : ''};`"
+              v-for="(val, index) in tabList" :key="index+val"
+              @tap="handClickTab(index)"
+            >
+              <view>
+                <view class="text">{{ val }}</view>
+                <view v-if="index === tab" class="choose" style="background-color: #fff;"></view>
+                <view v-else class="choose" style="background-color: #ffffff00;"></view>
+              </view>
+            </view>
+          </scroll-view>
+        </view>
+        <view v-if="listData?.length" class="listDataBox">
+          <PositionList
+            :list="listData"
+            :noMore="false"
+            :showEntInfo="false"
+            :jobFairId="query.jobFairId"
+            updateTimeAlign="left"
+            noDataTextColor="#fff"
+          ></PositionList>
+          <uni-load-more :status="more" />
+        </view>
+        <view v-else class="nodata-img-parent">
+          <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>
+        </view>
+      </view>
+    </scroll-view>
+  </view>
+</template>
+
+<script setup>
+import { onLoad } from '@dcloudio/uni-app'
+import { ref, reactive } from 'vue'
+import { dealDictObjData } from '@/utils/position'
+import { getJobFairEntJobPage } from '@/api/jobFair'
+import PositionList from '@/components/PositionList'
+import { getWebContent } from '@/api/common'
+import SwiperAd from '@/components/SwiperAd'
+
+const more = ref('more')
+const listData = ref([])
+const query = reactive({
+  pageSize: 20, 
+  pageNo: 1,
+  jobFairId: undefined,
+  enterpriseId: undefined,
+})
+
+const entName = ref('')
+
+const tab = ref(0)
+const tabList = ref(['餐饮招聘', '美业招聘', '酒店高层', '酒店中层', '酒店基层', '餐饮招聘', '美业招聘', '酒店高层', '酒店中层', '酒店基层1'])
+const handClickTab = (index) => {
+  tab.value = index
+}
+
+onLoad(async (options) => {
+  entName.value = options.entName
+  if (options?.jobFairId) {
+    query.jobFairId = options.jobFairId
+    query.enterpriseId = options.enterpriseId
+    getData()
+	}
+})
+
+// 获取轮播图
+const swiperAdList = ref([])
+const getSystemWebContent = async () => {
+  const { data } = await getWebContent()
+  swiperAdList.value = data?.appHomeCarousel || []
+}
+getSystemWebContent()
+
+const getData = async () => {
+  if (!query.jobFairId) {
+    uni.showToast({ title: '获取企业岗位失败,请重试!', icon: 'none', duration: 2000 })
+    return
+  }
+  try {
+    const res = await getJobFairEntJobPage(query)
+    const list = res?.data?.list || []
+    list.forEach(e => {
+      e.job = dealDictObjData({}, e)
+    })
+    listData.value = listData.value.concat(list)
+    if (listData.value?.length === +res?.data?.total) {
+      more.value = 'noMore'
+      return
+    }
+  } catch (error) {
+    query.pageNo--
+    more.value = 'more'
+  }
+}
+
+const scrollTop = ref(0)
+const old = ref({
+  scrollTop: 0
+})
+const onScroll = (e) =>{
+  old.value.scrollTop = e.detail.scrollTop
+}
+
+// 加载更多
+const loadingMore = () => {
+  more.value = 'loading'
+  query.pageNo++
+  getData()
+}
+
+// const goBack = () => {
+// 	uni.navigateTo({
+// 		url: '/pagesB/jobFair/index'
+// 	})
+// }
+
+</script>
+
+<style scoped lang="scss">
+.stick {
+  z-index: 1;
+  position: sticky;
+  top: 0;
+  background-color: #7ec04c;
+}
+.box {
+  height: 100vh;
+  overflow: hidden;
+  // padding-bottom: 120rpx;
+  box-sizing: border-box;
+  display: flex;
+  flex-direction: column;
+  background-color: #7ec04c;
+}
+.listDataBox {
+  // padding: 1px 0 120rpx;
+  padding-bottom: 120rpx;
+  margin: 0 5rpx;
+}
+.scrollBox{
+  flex: 1;
+  height: 0 !important;
+  padding-bottom: 24rpx;
+  box-sizing: border-box;
+}
+
+:deep(.uni-load-more__text) {
+  color: #fff !important;
+}
+
+:deep(.uni-card) {
+  padding: 0 !important;
+  .uni-card__content {
+    padding: 0 !important;
+  }
+}
+
+.scroll-container {
+  width: calc(100vw - 20px);
+  padding: 0 20rpx;
+  white-space: nowrap; /* 确保子元素在一行内排列 */
+  .scroll-item {
+    display: inline-block; /* 子元素内联块显示 */
+    color: #fff;
+    font-size: 17px;
+    font-weight: 500;
+    .text {
+      padding: 20px 2px 0;
+    }
+    .choose {
+      width: 28px;
+      height: 2px;
+      border-radius: 8px;
+      margin: 8px auto;
+    }
+  }
+}
+
+.titleBox {
+  text-align: center;
+  padding: 0 20rpx 15px;
+  .title {
+    font-size: 20px;
+    font-weight: 600;
+    margin-bottom: 12px;
+  }
+  .entName {
+    color: #fff;
+  }
+}
+</style>

+ 4 - 48
pagesB/jobFair/positions.vue

@@ -6,26 +6,9 @@
         <!-- 轮播图 -->
         <SwiperAd v-if="swiperAdList.length" :list="swiperAdList" imgUrlKey="img" margin="0" borderRadius="0" :strType="false" @click="handleToDetails"></SwiperAd>
         <view class="stick">
-          <!-- <view class="titleBox">
+          <view class="titleBox">
             <view class="entName">{{ entName }}</view>
-          </view> -->
-          <!-- tab页签 -->
-          <scroll-view scroll-x="true" class="scroll-container">
-            <view
-              class="scroll-item"
-              :style="`margin-left: ${index ? '24px' : ''};`"
-              v-for="(val, index) in tabList" :key="index+val"
-              @tap="handClickTab(index)"
-            >
-              <!-- <view class="text" :style="`border-bottom: 2px solid ${index === tab ? '#fff' : 'red'};`">{{ val }}</view> -->
-              <view>
-                <view class="text">{{ val }}</view>
-                <view v-if="index === tab" class="choose" style="background-color: #fff;"></view>
-                <view v-else class="choose" style="background-color: #ffffff00;"></view>
-              </view>
-            </view>
-          </scroll-view>
-          <view></view>
+          </view>
         </view>
         <view v-if="listData?.length" class="listDataBox">
           <PositionList
@@ -66,12 +49,6 @@ const query = reactive({
 
 const entName = ref('')
 
-const tab = ref(0)
-const tabList = ref(['餐饮招聘', '美业招聘', '酒店高层', '酒店中层', '酒店基层', '餐饮招聘', '美业招聘', '酒店高层', '酒店中层', '酒店基层1'])
-const handClickTab = (index) => {
-  tab.value = index
-}
-
 onLoad(async (options) => {
   entName.value = options.entName
   if (options?.jobFairId) {
@@ -139,6 +116,7 @@ const loadingMore = () => {
   z-index: 1;
   position: sticky;
   top: 0;
+  background-color: #7ec04c;
 }
 .box {
   height: 100vh;
@@ -172,31 +150,9 @@ const loadingMore = () => {
   }
 }
 
-.scroll-container {
-  width: calc(100vw - 20px);
-  padding: 0 20rpx;
-  white-space: nowrap; /* 确保子元素在一行内排列 */
-  background-color: #7ec04c;
-  .scroll-item {
-    display: inline-block; /* 子元素内联块显示 */
-    color: #fff;
-    font-size: 17px;
-    font-weight: 500;
-    .text {
-      padding: 20px 2px 0;
-    }
-    .choose {
-      width: 28px;
-      height: 2px;
-      border-radius: 8px;
-      margin: 8px auto;
-    }
-  }
-}
-
 .titleBox {
   text-align: center;
-  padding: 0 20rpx 15px;
+  padding: 15px 20rpx;
   .title {
     font-size: 20px;
     font-weight: 600;