123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- <template>
- <div id="newsList">
- <!-- 页面头部 -->
- <HomePageHead></HomePageHead>
- <!-- 导航栏 -->
- <HomePageNavigation></HomePageNavigation>
- <!-- 列表页广告一 -->
- <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
- <!-- 搜索框 -->
- <div class="search">
- <div class="inner">
- <input v-model="keywordInput" type="text" placeholder="请输入要搜索的岗位名称">
- <button @click="goSearch">搜索</button>
- </div>
- </div>
- <div class="breadcrumb">
- <div class="inner">
- <span class="location">当前位置:</span>
- <el-breadcrumb :separator-icon="ArrowRight">
- <el-breadcrumb-item>
- <NuxtLink to="/">首页</NuxtLink>
- </el-breadcrumb-item>
- <el-breadcrumb-item>搜索</el-breadcrumb-item>
- <el-breadcrumb-item>求职</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- </div>
- <!-- 求职列表页 -->
- <main class="index_main">
- <section class="table_out clearfix">
- <div class="table_head clearfix phone_none">
- <div class="table_head_name">姓名</div>
- <div class="table_head_job">岗位</div>
- <div class="table_head_sex">性别</div>
- <div class="table_head_experience">工作经验</div>
- <div class="table_head_native">籍贯</div>
- <div class="table_head_industry">所属行业</div>
- <div class="table_head_address">地区</div>
- <div class="table_head_time">时间</div>
- </div>
- <div class="table_ul clearfix">
- <div class="table_li clearfix" v-for="(item, index) in jobList" :key="index">
- <NuxtLink class="table_li_a clearfix" :href="getLinkPathDetail(item)" :title="item.name">
- <div class="table_li_name dot1">
- <label class="table_li_label pc_none">姓名:</label>
- <div class="table_li_name_in dot1">
- {{ item.name }}
- </div>
- </div>
- <div class="table_li_job dot1">
- <label class="table_li_label pc_none">岗位:</label>
- <div class="table_li_text dot1">
- {{ item.jtzw_name }}
- </div>
- </div>
- <div class="table_li_sex dot1">
- <label class="table_li_label pc_none">性别:</label>
- <div class="table_li_text dot1">
- {{ item.sexy ? '男' : '女' }}
- </div>
- </div>
- <div class="table_li_experience dot1">
- <label class="table_li_label pc_none">工作经验:</label>
- <div class="table_li_text dot1">
- {{ item.experience_name }}
- </div>
- </div>
- <div class="table_li_native dot1">
- <label class="table_li_label pc_none">籍贯:</label>
- <div class="table_li_text dot1">
- {{ item.origin }}
- </div>
- </div>
- <div class="table_li_industry dot1">
- <label class="table_li_label pc_none">所属行业:</label>
- <div class="table_li_text dot1">
- {{ item.hy_name }}
- </div>
- </div>
- <div class="table_li_address">
- <label class="table_li_label pc_none">地区:</label>
- <span class="table_li_in dot1">
- {{ item.city_name }}
- </span>
- </div>
- <div class="table_li_time dot1">
- <label class="table_li_label pc_none">时间:</label>
- <span class="table_li_in dot1">
- {{ getTime(item.updated_at, 'year', 1) }}
- </span>
- </div>
- </NuxtLink>
- </div>
- </div>
- <div class="empty" v-if="jobList == false">
- <img src="@/public/search/empty.png" alt="" class="empty_img">
- <span class="empty_text">当前暂无数据</span>
- </div>
- </section>
- </main>
- <!-- 分页器 -->
- <div class="pagination11" v-if="jobList != false">
- <div class="pagination">
- <el-pagination background layout="prev, pager, next" :total="total" :page-size="pageSize"
- prev-text="上一页" next-text="下一页" @current-change="changePage" />
- </div>
- </div>
- <!-- 列表页广告二 -->
- <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
- <!-- 页面底部 -->
- <HomeFoot1></HomeFoot1>
- </div>
- </template>
- <script setup>
- //1.页面依赖 start ---------------------------------------->
- import { ElBreadcrumb, ElBreadcrumbItem, ElPagination } from 'element-plus'
- import { ArrowRight } from '@element-plus/icons-vue'
- import { ref, onMounted } from 'vue';
- //1.页面依赖 end ---------------------------------------->
- //2.获取url中的参数 start ---------------------------------------->
- const route = useRoute();
- const pageCatids = route.query.catids;
- let keywordInput = ref("");
- if (route.params.id == 'search') {
- //该处用于带有文字出入的搜索栏跳转
- console.log("检测到从搜索栏跳转的搜索!")
- console.log(route.query.type)//左侧搜索下拉框的值
- console.log(route.query.keyword)//右侧输入框的值
- //目前route.query.type 1=资讯 2=商城 3=招工招聘
- //但是商城和招工招聘暂没有开发完,所以这里不需要考虑 只给keyword赋值即可
- keywordInput.value = route.query.keyword;
- } else {
- //该处用于搜索栏中含有地区的跳转
- const pageCatids = route.params.id
- }
- const pageDepartment_id = route.query.department_id;
- //2.获取url中的参数 end ---------------------------------------->
- //3.在该页进行搜索 start ---------------------------------------->
- //3.1 分页
- let total = useState("total", () => 0)
- let page = useState("page", () => 1)
- let pageSize = useState("pageSize", () => 10)
- //3.2 获得求职列表
- const jobList = ref()
- const getJobsList = await requestDataPromise('/web/getWebsiteJobList', {
- method: 'GET',
- query: {
- 'page': page.value,
- 'pageSize': pageSize.value,
- 'type': 2
- },
- });
- console.log("获取数据列表job", getJobsList.data.JobHunting);
- if (getJobsList.code == 200) {
- jobList.value = getJobsList.data.JobHunting
- total.value = getJobsList.data.hunt_count
- }
- //3.3 在本页进行搜索的方法
- let goSearch = async () => {
- console.log(page.value)
- console.log(pageSize.value)
- console.log(keywordInput.value)
- console.log(pageCatids)
- console.log(pageDepartment_id)
- const listData = await requestDataPromise('/web/getWebsiteJobList', {
- method: 'GET',
- query: {
- 'page': page.value,
- 'pageSize': pageSize.value,
- 'keyword': keywordInput.value,
- 'type': 2
- },
- });
- if (listData.code == 200) {
- jobList.value = listData.data.JobHunting
- total.value = listData.data.hunt_count
- } else {
- jobList.value = [];
- total.value = 0;
- }
- }
- goSearch();
- //3.4 分页事件
- let changePage = (value) => {
- console.log("当前页码", value);
- page.value = value
- console.log(page.value);
- goSearch()
- }
- //3.在该页进行搜索 end ---------------------------------------->
- //4.广告 start ---------------------------------------->
- let adImg1 = ref([]);
- let adImg2 = ref([]);
- onMounted(async () => {
- //从客户端获取行政职能部门 加快打开速度
- const { $webUrl, $CwebUrl } = useNuxtApp();
- //广告1
- let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_search_0001`
- const responseAd1 = await fetch(url, {
- headers: {
- 'Content-Type': 'application/json',
- 'Userurl': $CwebUrl,
- 'Origin': $CwebUrl
- }
- });
- const resultAd1 = await responseAd1.json();
- adImg1.value = resultAd1.data[0];
- //广告2
- let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_search_0002`
- const responseAd2 = await fetch(url2, {
- headers: {
- 'Content-Type': 'application/json',
- 'Userurl': $CwebUrl,
- 'Origin': $CwebUrl
- }
- });
- const resultAd2 = await responseAd2.json();
- adImg2.value = resultAd2.data[0];
- })
- //4.页面数据 end ---------------------------------------->
- //5.设置seo信息 start---------------------------------------->
- const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
- method: 'GET',
- query: {},
- });
- let seoTitle = setData.data.website_head.title;
- let seoDescription = setData.data.website_head.description;
- let seoKeywords = setData.data.website_head.keywords;
- let seoSuffix = setData.data.website_head.suffix;
- let seoName = setData.data.website_head.website_name;
- useSeoMeta({
- title: seoTitle + "_" + seoSuffix,
- meta: [
- { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
- { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
- ]
- });
- //5.设置seo信息 end---------------------------------------->
- </script>
- <style lang="less" scoped>
- @import url('@/assets/css/search/global.less');
- @import url('@/assets/css/search/jobHunting.less');
- </style>
|