| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419 |
- <template>
- <div class="index" style="padding-bottom: 40px;">
- <!-- 搜索 -->
- <el-affix @change="change" :offset="60" style="width: 100%;">
- <div :style="isTop==true?'background:#ffffff;box-shadow: 0 10px 8px rgba(153, 153, 153, 0.1);':''"
- class="search flex align-center justify-center">
- <div class="search-box flex align-center justify-between">
- <div class="search-box-l flex align-center" @click="openCityDialog">
- <el-image style="width: 16px; height: 18px;margin-right: 5px;"
- src="/images/index/addressIcon.png" fit="cover" />
- <el-text style="color: #00DD9A;font-size: 16px;margin-right: 10px;">{{city}}</el-text>
- [切换城市]
- </div>
- <div class="search-box-c flex align-center justify-between">
- <div class="search-box-c-l flex align-center justify-center">
- <el-popover :show-arrow="false" :visible="visible" placement="bottom" title="热门搜索"
- width="calc(55vw - 100px)">
- <template #reference>
- <el-input @focus="Myfocus" @blur="visible = false" @keyup.enter="goSearch()"
- v-model="keyWord" placeholder="搜索职位、公司" />
- </template>
- <div class="searchLabel flex algin-center flex-wrap">
- <div class="searchLabel-item" @click="selectLabel(item.keyWord)"
- v-for="(item,index) in searchList" :key="index">
- {{item.keyWord}}
- </div>
- </div>
- </el-popover>
- </div>
- <div @click="goSearch()" class="search-box-c-r flex align-center justify-center">
- <el-image style="width: 20px; height: 20px;margin-right: 8px;"
- src="/images/index/search.png" fit="cover" />
- 搜索
- </div>
- </div>
- <div class="search-box-r flex align-center justify-center">
- <el-image style="width: 20px; height: 30px;margin-right: 10px;" src="/images/index/phone.png"
- fit="cover" />
- <div class="search-box-r-c">
- <div class="search-box-r-c-t">
- 扫描二维码
- </div>
- <div class="search-box-r-c-b">
- 不错过每条消息
- </div>
- </div>
- <div class="search-box-r-rq">
- <div class="search-box-r-rq-img">
- <img :src="options" style="width: 160px;height: auto;" />
- </div>
- <div class="search-box-r-rq-txt">
- 微信扫描二维码
- </div>
- </div>
- </div>
- </div>
- </div>
- </el-affix>
- <!-- 切换类型 -->
- <div class="tabs flex align-center justify-center">
- <div class="tabs-box">
- <div @click="selectTabs(index)" :class="tabsCurr == index?'tabs-box-item-active':''"
- class="tabs-box-item" v-for="(item,index) in tabs" :key="index">
- {{item.name}}
- </div>
- </div>
- </div>
- <!-- banner/类型 -->
- <div v-if="bannerType.length>0" class="typeBanner flex align-center justify-center">
- <div @mouseleave="mouseLeave" class="typeBanner-box flex align-center justify-center">
- <div class="typeBanner-box-l ">
- <div :class="shotypeCurr == index && isShoType ?'typeBanner-box-l-item-active':''"
- @mouseenter="mouseEnter(index)" class="typeBanner-box-l-item flex align-center justify-between"
- v-for="(item,index) in bannerType" :key="index">
- <div class="typeBanner-box-l-item-l flex align-center">
- {{item?.ruleClassifyName}}
- <div v-if="item.childrens.length>0" v-for="(ite,ind) in item.childrens" :key="ind">
- <div class="typeBanner-box-l-item-l-i" v-if="ind<3">
- <div>
- {{ite.title}}
- </div>
- </div>
- </div>
- </div>
- <div class="typeBanner-box-l-item-r">
- <el-icon :size="15" color="#333333">
- <CaretRight />
- </el-icon>
- </div>
- </div>
- </div>
- <div class="typeBanner-box-r" v-if="isShoType == false">
- <el-carousel :interval="6000" trigger="click" style="height: 470px;" autoplay>
- <el-carousel-item v-for="item in bannerListuser" style="height: 470px;" :key="item">
- <el-image style="width: 100%; height: 470px;border-radius: 0 24px 24px 0;"
- :src="item.imageUrl" fit="fill" />
- </el-carousel-item>
- </el-carousel>
- </div>
- <div class="typeBanner-box-r typeBanner-box-c" v-else>
- <div class="typeBanner-box-c-title">
- {{bannerType[shotypeCurr]?.ruleClassifyName}}
- </div>
- <div class="typeBanner-box-c-item flex justify-between flex-wrap"
- v-for="(ite,ind) in bannerType[shotypeCurr].childrens" :key="ind">
- <div class="typeBanner-box-c-item-l">
- {{ite.title}}
- </div>
- <div v-if="ite.childrens.length>0" class="typeBanner-box-c-item-r flex align-center flex-wrap">
- <div @click="selectLabel(it?.ruleClassifyName)" class="typeBanner-box-c-item-r-i"
- v-for="(it,ins) in ite.childrens" :key="ins">
- {{it?.ruleClassifyName}}
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 推荐 -->
- <div class="tuijian flex align-center justify-center">
- <div class="tuijian-box flex align-center justify-between">
- <div>
- 为你推荐
- <div class="tuijian-box-line"></div>
- </div>
- <div v-if="jobTypeList.citys" class="tuijian-r flex align-center">
- <el-image style="width: 26px; height: 26px;border-radius: 50%;margin-right: 10px;" :src="avatar"
- fit="cover" />
- 根据求职期望匹配:{{jobTypeList.citys}}<el-divider
- direction="vertical" />{{jobTypeList?.ruleClassifyName}}<el-divider
- direction="vertical" />{{jobTypeList.salaryRange}}
- </div>
- </div>
- </div>
- <div class="list flex align-center justify-center">
- <div v-loading="loading" class="list-box flex justify-between flex-wrap">
- <div v-if="recommendList.length!=0" class="list-box-item" @click="goDetails(item)"
- v-for="(item,index) in recommendList" :key="index">
- <div class="list-box-item-title flex align-center justify-between">
- <div class="list-box-item-title-name">
- {{ item?.ruleClassifyName }}
- </div>
- <div class="list-box-item-title-price">
- {{ item.salaryRange }}
- </div>
- </div>
- <!-- 公司名称-公司人数 -->
- <div class="list-box-item-title flex align-center justify-between">
- <div style="margin: 10px 0;">
- <span class="company-name" style="margin-right: 8rpx;">{{ item.company?.companyName || item.company?.companyAllName }}</span>
- <span class="company-people" v-if="item.company">{{ item.company ?
- item.company.companyPeople : '0人' }}</span>
- </div>
- </div>
- <!-- 职位标签 -->
- <div class="gwList-box-item-box-label flex align-center flex-wrap">
- <span class="job-tag">{{ item.education }}</span>
- <span class="job-tag">{{ item.experience }}</span>
- <span class="job-tag" v-for="(ite, ind) in parseWelfareTag(item.welfareTag)" :key="ind">{{ ite
- }}</span>
- </div>
- <!-- 公司简介-位置 -->
- <div class="list-box-item-info flex align-center justify-between">
- <div class="gwList-box-item-box-info-l flex align-center">
- <img :src="item.hr && item.hr.hrImg ? item.hr.hrImg : '/default.jpg'"
- style="width: 40px;height: 40px;border-radius: 50%;" mode="">
- </img>
- <div class="company-info-text">
- {{ item.user && item.user.userName || '未知' }}·{{ item.hr &&
- item.hr.hrPosition || '未知' }}
- </div>
- <div v-if="item.respondTime" class="reply-time">{{ item.respondTime }}
- </div>
- </div>
- <div class="location-text">
- {{ formatDistance(item.distance) }} {{ item.county }}
- </div>
- </div>
- </div>
- <div class="list-box-item" style="height: 0;padding: 0;"></div>
- </div>
- </div>
- <el-empty v-if="recommendList.length==0" description="暂无推荐" />
- <!-- 查看更多 -->
- <div v-if="recommendList.length!=0" class="moreData flex align-center justify-center">
- <div @click="selectLabel('')" class="moreData-box flex align-center justify-center">
- 查看更多
- </div>
- </div>
- <!-- 最新招聘 -->
- <div class="tuijian flex align-center justify-center">
- <div class="tuijian-box flex align-center justify-between">
- <div>
- 最新招聘
- <div class="tuijian-box-line"></div>
- </div>
- </div>
- </div>
- <div class="list flex align-center justify-center">
- <div v-loading="loadings" class="list-box flex justify-between flex-wrap">
- <div v-if="recommendLists.length!=0" @click="goDetails(item)" class="list-box-item"
- v-for="(item,index) in recommendLists" :key="index">
- <div class="list-box-item-title flex align-center justify-between">
- <div class="list-box-item-title-name">
- {{ item?.ruleClassifyName }}
- </div>
- <div class="list-box-item-title-price">
- {{ item.salaryRange }}
- </div>
- </div>
- <!-- 公司名称-公司人数 -->
- <div class="list-box-item-title flex align-center justify-between">
- <div style="margin: 10px 0;">
- <span class="company-name" style="margin-right: 8rpx;">{{ item.company?.companyName || item.company?.companyAllName }}</span>
- <span class="company-people" v-if="item.company">{{ item.company ?
- item.company.companyPeople : '0人' }}</span>
- </div>
- </div>
- <!-- 职位标签 -->
- <div class="gwList-box-item-box-label flex align-center flex-wrap">
- <span class="job-tag">{{ item.education }}</span>
- <span class="job-tag">{{ item.experience }}</span>
- <span class="job-tag" v-for="(ite, ind) in parseWelfareTag(item.welfareTag)" :key="ind">{{ ite
- }}</span>
- </div>
- <!-- 公司简介-位置 -->
- <div class="list-box-item-info flex align-center justify-between">
- <div class="gwList-box-item-box-info-l flex align-center">
- <img :src="item.hr && item.hr.hrImg ? item.hr.hrImg : '/default.jpg'"
- style="width: 40px;height: 40px;border-radius: 50%;" mode="">
- </img>
- <div class="company-info-text">
- {{ item.user && item.user.userName || '未知' }}·{{ item.hr &&
- item.hr.hrPosition || '未知' }}
- </div>
- <div v-if="item.respondTime" class="reply-time">{{ item.respondTime }}
- </div>
- </div>
- <div class="location-text">
- {{ formatDistance(item.distance) }} {{ item.county }}
- </div>
- </div>
- </div>
- <div class="list-box-item" style="height: 0;padding: 0;"></div>
- </div>
- </div>
- <el-empty v-if="recommendLists.length==0" description="暂无推荐" />
- <!-- 查看更多 -->
- <div v-if="recommendLists.length>0" class="moreData flex align-center justify-center">
- <div @click="selectLabel('')" class="moreData-box flex align-center justify-center">
- 查看更多
- </div>
- </div>
- <!-- 暂无简历提示框 -->
- <resumeTipsComp v-if="shoModal" :show="shoModal" @close="shoModal = false" @addResume="addResume" />
- <!-- 切换城市 -->
- <el-dialog v-model="allCitys" :draggable="true" destroy-on-close align-center center>
- <template #header>
- <div class="my-header flex align-center">
- <div class="my-header-title" style="font-weight: bold">
- 城市选择
- </div>
- <div class="my-header-title flex" style="margin-left: 40px; width: 300px">
- <el-input v-model="search" prefix-icon="Search" size="default" placeholder="请输入城市名称"
- @keyup.enter="handleSearch()" class="inputClass">
- </el-input>
- <el-button @click="handleSearch" style="margin-left: 10px" type="primary">搜索</el-button>
- </div>
- </div>
- </template>
- <div class="city flex align-center justify-center">
- <div class="city-box">
- <div class="city-box-city">
- <div class="city-box-cityt flex align-center justify-between">
- 定位城市
- <div @click="getLocation()" class="city-box-cityt-r flex align-center">
- <el-icon :size="14" name="RefreshRight" />
- 重新定位
- </div>
- </div>
- <div @click="selectCity(citys)" class="city-box-citys">{{ citys }}</div>
- </div>
- <div class="city-box-list">
- <ul class="city-box-lists" style="overflow: auto">
- <li class="city-box-lists-title">热门城市</li>
- <li class="city-box-lists-title-cs flex align-center flex-wrap">
- <div @click="selectCity(item)" class="city-box-lists-title-css"
- v-for="(item, index) in rmCity" :key="index">
- {{ item }}
- </div>
- </li>
- <li v-for="(item, index) in cityGroupList" :key="index" class="city-box-lists-item">
- <div v-if="item.city.length > 0">
- <div class="city-box-lists-item-title">
- {{ item.letter }}
- </div>
- <div class="flex align-center flex-wrap">
- <div class="city-box-lists-item-titles flex align-center"
- v-for="(ite, ind) in item.city" :key="ind">
- <div @click="selectCity(ite)">
- {{ ite }}
- </div>
- </div>
- </div>
- </div>
- </li>
- <el-empty v-if="cityGroupList.length == 0" description="暂无城市" />
- </ul>
- </div>
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import cityJs from '../../publicJs/city.js'
- import citySelect from '../../publicJs/citySelect.js'
- import axios from 'axios';
- import jsonp from 'axios-jsonp'
- import VueQrcode from 'vue-qrcode'
- import resumeTipsComp from '../../components/resumeTipsComp/resumeTipsComp.vue'
- export default {
- components: {
- VueQrcode,
- resumeTipsComp
- },
- data() {
- return {
- visible: false, //是否显示热门搜索
- size: 160, //二维码大小
- qrColor: {
- 'background': '#ffffff'
- },
- options: '', //生成二维码的内容
- allCitys: false, //是否显示全部城市弹框
- keyWord: '', //搜索内容
- isTop: false,
- searchBg: 'background:#ffffff',
- tabsCurr: 0,
- tabs: [{ name: '全日制', id: 1 },{ name: '兼职', id: 0 },{ name: '校招', id: 2 }, { name: '社招', id: 3 }],
- bannerType: [], //岗位分类
- recommendList: [], //推荐岗位
- recommendLists: [], //最新岗位
- isShoType: false,
- shotypeCurr: 0,
- isResume: false, //是否有简历
- shoModal: false, //暂无简历提示弹窗
- city: '', //当前选择的城市
- citys: '', //定位的城市
- longitude: '',
- latitude: '',
- cityList: cityJs, //所有的城市
- //城市选择弹框相关
- search: '', //城市搜索关键字
- cityGroupList: [], //按字母分组的城市列表
- rmCity: [], //热门城市列表
- jobTypeList: {}, //求职意向第一个
- loading: false,
- loadings: false,
- bannerListuser: [], //用户端轮播图
- searchList: [], //热门搜索列表
- }
- },
- computed: {
- avatar() {
- return this.$store.state.avatar;
- },
- },
- mounted() {
- if (localStorage.getItem('city')) {
- this.city = localStorage.getItem('city')
- }
- let inviterCode = this.$route.query.inviterCode
- if (inviterCode) {
- localStorage.setItem('inviterCode', inviterCode)
- }
- //app下载地址
- this.getAppDown()
- //获取热门搜索
- this.getMyRecordList();
- //岗位分类
- this.getJobTypeList();
- //banner
- this.getBannerList();
- //所有城市的列表
- // this.getAllCityList();
- if (localStorage.getItem('token')) {
- //求职意向
- this.getJobYx();
- //简历详情
- this.getJlInfo();
- }
- },
- methods: {
- //获取app下载地址
- getAppDown() {
- this.$Request.get('/app/common/type/423').then(res => {
- if (res.code == 0) {
- this.options = res.data.value
- }
- })
- },
- //选择热门搜索并跳转
- selectLabel(item) {
- this.keyWord = item
- this.goSearch()
- },
- //显示热门搜索
- Myfocus() {
- if (this.searchList.length > 0) {
- //有热门搜索才显示
- this.visible = true
- } else {
- //没有热门搜索不显示
- this.visible = false
- }
- },
- //获取热门搜索
- getMyRecordList() {
- let data = {
- userId: localStorage.getItem('userId') ? localStorage.getItem('userId') : '1'
- }
- this.$Request.get('/app/record/getMyRecordList', {
- params: data
- }).then(res => {
- if (res.code == 0 && res.data) {
- this.searchList = res.data.records
- }
- })
- },
- //去搜索页面
- goSearch() {
- this.$router.push({
- name: 'search',
- query: {
- keyWord: this.keyWord
- }
- })
- },
- //获取banner
- getBannerList() {
- this.$Request.get('/app/banner/selectBannerList?classify=1').then(res => {
- if (res.code == 0) {
- this.bannerListuser = res.data
- } else {
- this.bannerListuser = [
- 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fphoto%2F2007-11-7%2F200711072147151187.jpg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1674883340&t=4b9cbb7796600699ac28f75cd138ba04'
- ]
- }
- })
- },
- //获取岗位分类
- getJobTypeList() {
- this.$Request.get('/app/rule/getClassifyList').then(res => {
- if (res.code == 0) {
- if (res.data) {
- this.bannerType = res.data
- }
- }
- })
- },
- //获取简历
- getJlInfo() {
- this.$Request.get("/app/userFirst/getUserResumes").then(res => {
- if (res.code == 0) {
- if (res.data) {
- this.isResume = true
- //缓存简历id
- localStorage.setItem('resumeId', res.data.resumeList.resumesId)
- } else {
- this.isResume = false
- }
- } else {
- this.isResume = false
- }
- })
- },
- //获取职位 type: 1、推荐 2、最新
- getRecommendJob(type) {
- let data = {}
- if (Number(type) === 1) {
- this.loading = true
- data = {
- page: 1,
- limit: 9,
- type: this.tabs[this.tabsCurr].id, //工作性质
- ruleClassifyName: this.jobTypeList?.ruleClassifyName, //岗位名称
- screen: 1, //1推荐 2最新
- city: this.city || '', //城市
- salaryRange: this.formatSalaryRange(this.jobTypeList.salaryRange), //薪资范围
- education: '', //学历
- experience: '', //经验
- industry:'', //行业
- preference: '',//this.jobTypeList.industry || '',//偏好
- companyPeople: '', //公司规模
- lng: this.longitude,
- lat: this.latitude,
- // userId: localStorage.getItem('userId') ? localStorage.getItem('userId') : ''
- }
- } else {
- this.loadings = true
- data = {
- page: 1,
- limit: 9,
- type: this.tabs[this.tabsCurr].id, //工作性质
- ruleClassifyName: '', //岗位名称
- screen: 2, //1推荐 2最新
- city: this.city || '', //城市
- salaryRange: '', //薪资范围
- education: '', //学历
- experience: '', //经验
- industry: '', //行业
- preference: '',//偏好
- companyPeople: '', //公司规模
- lng: this.longitude,
- lat: this.latitude,
- // userId: localStorage.getItem('userId') ? localStorage.getItem('userId') : ''
- }
- }
- this.$Request.get('/app/postPush/userGetPostPushList', {
- params: data
- }).then(res => {
- if (res.code == 0) {
- // recommendList
- res.data.records.map(item => {
- if (item.positionWelfare) {
- item.positionWelfare = item.positionWelfare.split(',')
- } else {
- item.positionWelfare = []
- }
- })
- if (Number(type) == 1) {
- this.recommendList = res.data.records
- this.loading = false
- } else {
- this.recommendLists = res.data.records
- this.loadings = false
- }
- }
- })
- },
- //获取求职意向
- getJobYx() {
- this.$Request.get('/app/intention/getIntentionList').then(res => {
- if (res.code == 0 && res.data.length > 0) {
- res.data.map(item => {
- if (item.isDefault == 1) { //拿出第一意向
- this.jobTypeList = item
- }
- })
- this.getLocation();
- }
- })
- },
- //选择城市
- selectCity(city) {
- this.city = city
- this.allCitys = false
- localStorage.setItem('city', this.city)
- //重新获取岗位
- this.getRecommendJob(1)
- this.getRecommendJob(2)
- },
- //打开城市选择弹框
- openCityDialog() {
- this.allCitys = true;
- },
- //打开城市选择弹框
- openCityDialog() {
- this.allCitys = true;
- this.search = '';
- //获取热门城市列表
- this.getRmCityList();
- //获取按字母分组的城市列表
- this.getCityGroupList();
- },
- //获取热门城市列表
- getRmCityList() {
- let data = {
- limitCount: 10
- };
- this.$Request
- .get('/app/postPush/getHotCity', { params: data })
- .then(res => {
- if (res.code == 0) {
- this.rmCity = res.data;
- }
- });
- },
- //获取按字母分组的城市列表
- getCityGroupList(keyword = '') {
- const grouped = {};
- // 过滤:如果有关键字,就按城市名模糊匹配
- const filtered = keyword
- ? cityJs.filter(item => item.label.includes(keyword))
- : cityJs;
- // 遍历城市数据
- filtered.forEach(item => {
- // 按字母分组
- const letterObj = citySelect.getFirstLetter(item.label);
- const letter = letterObj.firstletter.toUpperCase();
- if (!grouped[letter]) grouped[letter] = [];
- grouped[letter].push(item.label);
- });
- // 生成按字母分组的城市列表
- const sortedLetters = Object.keys(grouped).sort();
- this.cityGroupList = sortedLetters.map(letter => ({
- letter,
- city: grouped[letter]
- }));
- },
- //搜索城市
- handleSearch() {
- this.getCityGroupList(this.search.trim());
- },
- //使用jsonp请求从腾讯地图获取经纬度
- getLocation() {
- let data = {
- key: "ZBABZ-ZWECU-UQTVV-4LYDR-COK3F-5SF75", //申请的密钥
- output: "jsonp",
- };
- let url = "https://apis.map.qq.com/ws/location/v1/ip"
- axios.get(url, {
- params: data,
- adapter: jsonp
- }).then(res => {
- this.longitude = res.data.result.location.lng
- this.latitude = res.data.result.location.lat
- this.citys = res.data.result.ad_info.city
- if (!this.city) {
- this.city = this.citys
- }
- this.getRecommendJob(1)
- this.getRecommendJob(2)
- localStorage.setItem('city', this.city)
- }).catch(err => {
- console.log(err)
- })
- },
- //去添加简历
- addResume() {
- this.shoModal = false
- this.$router.push({
- name: 'addResume'
- })
- },
- /**
- * @param {Object} item 详情参数
- * 去详情
- */
- goDetails(item) {
- if (localStorage.getItem('token')) {
- if (this.isResume) { //有简历
- this.$router.push({
- name: 'postInfo',
- query: {
- postPushId: item.postPushId
- }
- })
- } else { //无简历
- this.shoModal = true
- }
- } else {
- this.$router.push({
- name: 'login'
- })
- }
- },
- //鼠标移入事件
- mouseEnter(index) {
- this.shotypeCurr = index;
- this.isShoType = true
- },
- //鼠标移出事件
- mouseLeave() {
- this.shotypeCurr = 0;
- this.isShoType = false
- },
- /**
- * @param {Number} index 选择的索引
- * 切换类型
- */
- selectTabs(index) {
- this.tabsCurr = index
- //重新获取岗位
- this.getRecommendJob(1)
- this.getRecommendJob(2)
- },
- /**
- * @param {Boolean} e
- * 是否触顶
- */
- change(e) {
- this.isTop = e
- },
- formatSalaryRange(range) {
- if (!range || !range.includes('-')) return range
- const [min, max] = range.split('-').map(v => parseInt(v.trim()))
- if (isNaN(min) || isNaN(max)) return range
- // 除以1000并去掉小数点后多余的0
- const formatNum = num => {
- const val = num / 1000
- return val % 1 === 0 ? val.toFixed(0) + 'k' : val.toFixed(1) + 'k'
- }
- return `${formatNum(min)}-${formatNum(max)}`
- },
- parseWelfareTag(tagStr) {
- return tagStr ? tagStr.split(';').filter(Boolean) : []
- },
- formatDistance(distance) {
- if (distance == null || distance === '') return ''
- const num = parseFloat(distance)
- if (isNaN(num)) return ''
- // 小于1000显示米,否则显示千米
- if (num < 1000) {
- return `${num}m`
- } else {
- const km = num / 1000
- // 去掉多余的小数(保留一位小数)
- const formatted = km % 1 === 0 ? km.toFixed(0) : km.toFixed(1)
- return `${formatted}km`
- }
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- $marginTop-60: 120px;
- :deep(.el-affix--fixed){
- width: 100% !important;
- right: 0;
- left: 0;
- }
- .searchLabel {
- width: 100%;
- .searchLabel-item {
- cursor: pointer;
- margin-right: 10px;
- margin-top: 10px;
- }
- .searchLabel-item:hover {
- color: #00DD9A;
- }
- }
- :deep(.el-input__wrapper) {
- box-shadow: none;
- border: none;
- }
- .my-header {
- padding: 10px 10px 0 10px;
- }
- :deep(.el-dialog) {
- border-radius: 14px !important;
- padding: 0;
- }
- :deep(.el-dialog__body) {
- padding-top: 10px !important;
- }
- :deep(.el-dialog__header) {
- background: linear-gradient(45deg, #f2fffa, #FFFFFF);
- border-radius: 14px 14px 0 0;
- }
- .citys {
- width: calc(100% - 20px);
- height: 300px;
- overflow: hidden;
- overflow-y: scroll;
- padding: 0 10px 10px 10px;
- }
- .citys-item {
- display: flex;
- flex-wrap: wrap;
- .citys-item-citys {
- background-color: #F2F2F7;
- width: fit-content;
- padding: 4px 10px;
- cursor: pointer;
- border-radius: 4px;
- margin-top: 20px;
- margin-right: 20px;
- }
- .citys-item-citys:hover {
- background-color: #00DD9A;
- color: #FFFFFF;
- }
- }
- .citys-top {
- width: 100%;
- .citys-top-cityt {
- font-weight: bold;
- color: #333333;
- }
- .citys-top-cityt-r {
- font-weight: 500;
- color: #999999;
- font-size: 12px;
- cursor: pointer;
- }
- .citys-top-citys {
- background-color: #F2F2F7;
- width: fit-content;
- padding: 4px 10px;
- margin-top: 10px;
- cursor: pointer;
- border-radius: 4px;
- margin-right: 20px;
- margin-bottom: 20px;
- }
- .citys-top-citys:hover {
- background-color: #00DD9A;
- color: #FFFFFF;
- }
- }
- .search {
- width: 100%;
- height: 110px;
- background-color: #F5F5F5;
- .search-box {
- width: calc(1800px - $marginTop-60 * 2);
- height: 50px;
- .search-box-l {
- font-size: 16px;
- color: #333333;
- cursor: pointer;
- flex-shrink: 0;
-
- }
- .search-box-c {
- margin:0 30px;
- flex: 1;
- // width: 70vw;
- height: 100%;
- background-color: #00DD9A;
- border-radius: 12px;
- }
- .search-box-c-l {
- width: calc(100% - 100px);
- height: calc(100% - 2px);
- background-color: #ffffff;
- border-radius: 12px;
- border: 1px solid #00DD9A;
- }
- .search-box-c-r {
- width: 100px;
- height: 100%;
- color: #ffffff;
- font-size: 16px;
- cursor: pointer;
- }
- .search-box-r {
- width: 200px;
- height: 100%;
- background-color: #ffffff;
- border-radius: 12px;
- cursor: pointer;
- position: relative;
- }
- .search-box-r:hover {
- .search-box-r-rq {
- display: inline-block;
- }
- }
- .search-box-r-rq {
- display: none;
- position: absolute;
- width: 200px;
- // height: 280px;
- background-color: #ffffff;
- border-radius: 8px;
- border: 1px solid #F0F0F0;
- top: 55px;
- right: 0px;
- z-index: 999;
- align-content: center;
- padding: 20px 0;
- .search-box-r-rq-img {
- width: 160px;
- height: 160px;
- margin-left: 20px;
- }
- img {
- width: 100%;
- height: 100%;
- }
- .search-box-r-rq-txt {
- width: 100%;
- text-align: center;
- color: #00DD9A;
- font-size: 16px;
- margin-top: 20px;
- }
- }
- .search-box-r-c-t {
- color: #333333;
- font-size: 16px;
- font-weight: 400;
- }
- .search-box-r-c-b {
- color: #999999;
- font-size: 14px;
- font-weight: 400;
- }
- }
- }
- .tabs {
- width: 100%;
- height: 40px;
- .tabs-box {
- width: calc(100% - $marginTop-60 * 2);
- height: 100%;
- overflow-x: auto;
- white-space: nowrap;
- position: relative;
- }
- .tabs-box::-webkit-scrollbar {
- /* Chrome, Safari, Opera */
- height: 0px !important;
- }
- .tabs-box::-webkit-scrollbar-thumb {
- background-color: #cccccc;
- /* 滚动条颜色 */
- }
- .tabs-box::-webkit-scrollbar-track {
- background-color: #ffffff;
- /* 轨道颜色 */
- }
- .tabs-box-item {
- display: inline-block;
- min-width: 80px;
- padding: 0 5px;
- height: 100%;
- text-align: center;
- line-height: 40px;
- font-size: 16px;
- color: #333333;
- font-weight: 400;
- margin-right: 10px;
- border-radius: 6px;
- cursor: pointer;
- position: relative;
- z-index: 1;
- }
- .tabs-box-item:hover {
- color: #06E1AB;
- }
- .tabs-box-item-active {
- color: #FFFFFF !important;
- background-color: #06E1AB !important;
- transition: background-color color 0.5s; // 添加过渡效果
- }
- }
- .typeBanner {
- width: 100%;
- height: auto;
- margin-top: 50px;
- .typeBanner-box {
- width: calc(100% - $marginTop-60 * 2);
- height: 450px;
- background-color: #ffffff;
- border-radius: 24px;
- }
- .typeBanner-box-l {
- width: 550px;
- height: 100%;
- background-color: #ffffff;
- border-radius: 24px 0 0 24px;
- align-content: space-around;
- padding: 10px 0;
- overflow: hidden;
- overflow-y: scroll;
- }
- .typeBanner-box-r {
- width: calc(100% - 550px);
- height: calc(100% + 20px);
- background-color: #ffffff;
- border-radius: 0 24px 24px 0;
- }
- .typeBanner-box-c::-webkit-scrollbar {
- /* Chrome, Safari, Opera */
- width: 0px;
- }
- .typeBanner-box-c::-webkit-scrollbar-thumb {
- background-color: #cccccc;
- /* 滚动条颜色 */
- }
- .typeBanner-box-c::-webkit-scrollbar-track {
- background-color: #ffffff;
- /* 轨道颜色 */
- }
- .typeBanner-box-c {
- // padding: 20px;
- overflow: hidden;
- overflow-y: scroll;
- .typeBanner-box-c-title {
- font-size: 16px;
- padding: 20px;
- }
- .typeBanner-box-c-item {
- padding: 0 20px;
- margin-bottom: 10px;
- }
- .typeBanner-box-c-item-l {
- font-size: 14px;
- color: #666666;
- }
- .typeBanner-box-c-item-r {
- width: 80%;
- border-bottom: 1px solid #F5F5F5;
- }
- .typeBanner-box-c-item-r-i:hover {
- color: #00DD9A;
- cursor: pointer;
- }
- .typeBanner-box-c-item-r-i {
- margin-right: 20px;
- margin-bottom: 20px;
- }
- }
- .typeBanner-box-l-item-active {
- box-shadow: 0 0 10px 0 rgba(153, 153, 153, 0.3);
- .typeBanner-box-l-item-r {
- .el-icon {
- color: #00DD9A;
- }
- }
- }
- .typeBanner-box-l-item-l-i:hover {
- color: #00DD9A;
- }
- .typeBanner-box-l-item-l {
- width: 100%;
- padding-left: 20px;
- font-size: 16px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- -o-text-overflow: ellipsis;
- }
- .typeBanner-box-l-item-l-i {
- font-size: 14px;
- margin-left: 20px;
- color: #666666;
- }
- .typeBanner-box-l-item-r {
- padding-right: 20px;
- }
- .typeBanner-box-l-item {
- width: calc(100% - 10px);
- height: calc(100% / 7);
- border-radius: 14px;
- cursor: pointer;
- }
- }
- .tuijian {
- width: 100%;
- margin-top: 65px;
- .tuijian-box {
- width: calc(100% - $marginTop-60 * 2);
- color: #333333;
- font-size: 18px;
- }
- .tuijian-box-line {
- width: 24px;
- height: 2px;
- background-color: #00DD9A;
- margin-top: 4px;
- position: relative;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- }
- .tuijian-r {
- font-size: 14px;
- color: #666666;
- }
- }
- .list {
- width: 100%;
- min-height: 100px;
- margin-top: 20px;
- .list-box {
- width: calc(100% - $marginTop-60 * 2);
- // height: 100%;
- min-height: 100px;
- border-radius: 10px;
- }
- .list-box-item:hover {
- box-shadow: 0 10px 10px 0 rgba(153, 153, 153, 0.3);
- .list-box-item-title-name {
- color: #00DD9A;
- }
- }
- .list-box-item {
- width: calc((100% - 40px) / 3);
- height: 100%;
- background-color: #ffffff;
- border-radius: 10px;
- padding: 20px 0;
- cursor: pointer;
- margin-bottom: 20px;
- }
- .list-box-item-title {
- font-size: 16px;
- padding: 0 20px;
- .list-box-item-title-name {
- color: #333333;
- }
- .list-box-item-title-price {
- font-size: 18px;
- color: #FF0000;
- }
- }
- .list-box-item-label {
- width: calc(100% - 40px);
- height: 40px;
- padding: 0 20px;
- overflow: hidden;
- .list-box-item-label-item {
- padding: 4px 10px;
- border-radius: 5px;
- background-color: #F5F5F5;
- color: #666666;
- font-size: 14px;
- margin-right: 10px;
- margin-top: 10px;
- }
- }
- .list-box-item-info {
- margin-top: 20px;
- border-top: 1px solid #F5F5F5;
- padding: 0 20px;
- padding-top: 20px;
- .list-box-item-info-name:hover {
- color: #00DD9A;
- }
- .list-box-item-info-name {
- font-size: 16px;
- color: #333333;
- }
- .list-box-item-info-price {
- font-size: 16px;
- color: #999999;
- }
- }
- }
- .moreData {
- width: 100%;
- height: auto;
- margin-top: 10px;
- .moreData-box:hover {
- background-color: #00DD9A;
- color: #ffffff;
- }
- .moreData-box {
- width: 180px;
- height: 40px;
- border-radius: 35px;
- background-color: rgba(0, 221, 154, 0.1);
- color: #00DD9A;
- font-size: 14px;
- cursor: pointer;
- transition: background-color 0.5s;
- }
- }
- .showModal-img {
- width: 100%;
- height: 300px;
- img {
- width: 400px;
- height: 300px;
- }
- }
- .city {
- width: 100%;
- height: 500px;
- .city-box {
- width: 100%;
- padding: 0 20px;
- height: 100%;
- }
- .city-box-city {
- .city-box-cityt {
- width: 100%;
- font-weight: bold;
- .city-box-cityt-r {
- font-weight: 500;
- color: #999999;
- font-size: 12px;
- cursor: pointer;
- }
- }
- .city-box-citys {
- background-color: #F2F2F7;
- width: fit-content;
- padding: 4px 10px;
- margin-top: 10px;
- cursor: pointer;
- border-radius: 4px;
- }
- .city-box-citys:hover {
- background-color: #00DD9A;
- color: #FFFFFF;
- }
- }
- .city-box-list {
- width: 100%;
- height: 420px;
- margin-top: 20px;
- overflow-y: scroll;
- }
- .city-box-lists {
- width: 100%;
- height: 100%;
- list-style: none;
- padding: 0;
- margin: 0;
- }
- .city-box-lists-title {
- font-weight: bold;
- }
- .city-box-lists-title-css {
- background-color: #F2F2F7;
- width: fit-content;
- padding: 4px 10px;
- margin-top: 10px;
- cursor: pointer;
- border-radius: 4px;
- margin-right: 20px;
- margin-bottom: 20px;
- }
- .city-box-lists-title-css:hover {
- background-color: #00DD9A;
- color: #FFFFFF;
- }
- .city-box-lists-item-title {
- font-weight: bold;
- }
- .city-box-lists-item-titles {
- background-color: #F2F2F7;
- width: fit-content;
- padding: 4px 10px;
- margin-top: 10px;
- cursor: pointer;
- border-radius: 4px;
- margin-right: 20px;
- margin-bottom: 20px;
- }
- .city-box-lists-item-titles:hover {
- background-color: #00DD9A;
- color: #FFFFFF;
- }
- }
- .company-name,.company-people{
- font-size: 14px;
- font-weight: 400;
- color: rgba(156, 164, 171, 1);
- }
- .gwList-box-item-box-label{
- padding: 0 20px;
- gap: 12px;
- .job-tag{
- padding: 4px;
- background: rgba(198, 198, 198, 0.1);
- border-radius: 4px;
- font-size: 12px;
- font-weight: 400;
- color: rgba(153, 153, 153, 1);
- }
- }
- .gwList-box-item-box-info-l{
- .company-info-text{
- margin: 0 10px;
- color: rgba(156, 164, 171, 1);
- font-size: 12px;
- font-weight: 400;
- }
- .reply-time{
- border-radius: 4px;
- background: rgba(236, 225, 253, 1);
- padding: 4px;
- color: rgba(106.94, 84.63, 214.02, 0.96);
- font-size: 12px;
- font-weight: 400;
- }
- }
- .location-text{
- color: rgba(156, 164, 171, 1);
- font-size: 12px;
- font-weight: 400;
- }
- </style>
|