search.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122
  1. <template>
  2. <div id="newsList">
  3. <!-- 页面头部 -->
  4. <HomePageHead></HomePageHead>
  5. <!-- 导航栏 -->
  6. <HomePageNavigation></HomePageNavigation>
  7. <!-- 列表页广告一 -->
  8. <HomeAdvertising :imgurl="adImg1" v-if="adImg1"></HomeAdvertising>
  9. <!-- 二级标题-->
  10. <HomeListSecondaryHeadingZgzp v-if="parent_name != ''" :name="parent_name" :nav="secondNav"
  11. :pinyin="parent_pinyin">
  12. </HomeListSecondaryHeadingZgzp>
  13. <main class="index_main">
  14. <!-- 三农资讯网-招工招聘-社会招聘 snzx_society -->
  15. <section class="index_2">
  16. <!-- 职位搜索 -->
  17. <div class="recruit_head_box clearfix phone_none">
  18. <div class="cruit_head_left">
  19. <span class="cruit_head_a cruit_head_only">职位搜索</span>
  20. </div>
  21. <div class="cruit_head_right clearfix">
  22. <!-- <span class="cruit_head_right_a" @click="createResume"
  23. v-if="job_search == 1 && type_id == 1">创建个人简历</span> -->
  24. <span class="cruit_head_right_a" @click="createJob"
  25. v-if="job_search == 1 && type_id == 3">发布招聘信息</span>
  26. </div>
  27. </div>
  28. <form class="phone_form clearfix pc_none" action=" " method=" ">
  29. <div class="phone_form_tip phone_form_tip_1 clearfix">
  30. <el-select v-model="industry_category" placeholder="全部" style="width:32%" clearable
  31. @change="hyChange">
  32. <el-option v-for="item in industry_categoryList" :key="item.hyid"
  33. :label="item.hyname" :value="item.hyid" />
  34. </el-select>
  35. <el-select v-model="position_category" placeholder="全部" style="width:32%" clearable
  36. @change="zwChange">
  37. <el-option v-for="item in position_categoryList" :key="item.zwid"
  38. :label="item.zwname" :value="item.zwid" />
  39. </el-select>
  40. <el-select v-model="position" placeholder="全部" style="width:32%" clearable
  41. no-data-text="请先选择职位类别" @change="jtzwChange">
  42. <el-option v-for="item in positionList" :key="item.zwid" :label="item.zwname"
  43. :value="item.zwid" />
  44. </el-select>
  45. </div>
  46. <div class="phone_form_tip phone_form_tip_2 clearfix">
  47. <el-select v-model="province" placeholder="省" style="width:15%" clearable
  48. @change="provinceChange">
  49. <el-option v-for="item in provinceList" :key="item.id" :label="item.name"
  50. :value="item.id" />
  51. </el-select>
  52. <el-select v-model="city" placeholder="市" style="width:15%" no-data-text="选省"
  53. clearable @change="cityChange">
  54. <el-option v-for="item in cityList" :key="item.id" :label="item.name"
  55. :value="item.id" />
  56. </el-select>
  57. <el-input v-model="keywords"
  58. style="width: 51%"
  59. placeholder="请输入搜索关键词" clearable>
  60. </el-input>
  61. <el-button type="" style="width: 13%" @click="goSearch">搜索</el-button>
  62. </div>
  63. <div class="phone_form_tip clearfix">
  64. </div>
  65. </form>
  66. <form class="cruit_form clearfix phone_none" action=" " method=" ">
  67. <div class="society_form_tip clearfix">
  68. <label class="society_form_label">行业类别:</label>
  69. <div class="society_form_right_a_box clearfix">
  70. <a class="society_form_right_a"
  71. :class="{ society_form_right_a_only: hyid == '' || !hyid || hyid == 0 }" title="全部"
  72. @click="hyChange(0)">
  73. 全部
  74. </a>
  75. <NuxtLink v-for="(item, index) in industry_categoryList" :key="item">
  76. <span class="society_form_right_a"
  77. :class="{ society_form_right_a_only: item.hyid == hyid }" :title="item.hyname"
  78. @click="hyChange(item.hyid)" v-if="index < 20 && hyIndex == 1">{{ item.hyname
  79. }}</span>
  80. <span class="society_form_right_a" v-if="hyIndex == 2" @click="hyChange(item.hyid)"
  81. :class="{ society_form_right_a_only: item.hyid == hyid }" :title="item.hyname">
  82. {{ item.hyname }}
  83. </span>
  84. </NuxtLink>
  85. <span class="society_form_right_btn" @click="hyIndex = 2" v-if="hyIndex == 1">展开</span>
  86. <span class="society_form_right_btn" @click="hyIndex = 1" v-if="hyIndex == 2">收起</span>
  87. </div>
  88. </div>
  89. <div class="society_form_tip clearfix">
  90. <label class="society_form_label">职位类别:</label>
  91. <div class="society_form_right_a_box clearfix">
  92. <a class="society_form_right_a"
  93. :class="{ society_form_right_a_only: zwid == '' || !zwid || zwid == 0 }" title=""
  94. @click="zwChange(0)">全部</a>
  95. <span v-for="(item, index) in position_categoryList" :key="item">
  96. <span class="society_form_right_a" v-if="index < 20 && zwIndex == 1"
  97. @click="zwChange(item.zwid)"
  98. :class="{ society_form_right_a_only: item.zwid == zwid }" :title="item.zwname">
  99. {{ item.zwname }}
  100. </span>
  101. <span class="society_form_right_a" v-if="zwIndex == 2" @click="zwChange(item.zwid)"
  102. :class="{ society_form_right_a_only: item.zwid == zwid }" :title="item.zwname">
  103. {{ item.zwname }}
  104. </span>
  105. </span>
  106. <span class="society_form_right_btn society_form_right_btn_up" @click="zwIndex = 2"
  107. v-if="zwIndex == 1">展开</span>
  108. <span class="society_form_right_btn society_form_right_btn_up" @click="zwIndex = 1"
  109. v-if="zwIndex == 2">收起</span>
  110. </div>
  111. </div>
  112. <div class="society_form_tip clearfix">
  113. <label class="society_form_label">具体职位:</label>
  114. <div class="society_form_right_a_box clearfix">
  115. <a class="society_form_right_a" @click="jtzwChange(0)"
  116. :class="{ society_form_right_a_only: jtzwid == '' || !jtzwid || jtzwid == 0 }"
  117. title="">全部</a>
  118. <span v-for="(item, index) in positionList" :key="item">
  119. <span class="society_form_right_a" v-if="index < 20 && jtzwIndex == 1"
  120. @click="jtzwChange(item.zwid)"
  121. :class="{ society_form_right_a_only: item.zwid == jtzwid }" :title="item.zwname">
  122. {{ item.zwname }}
  123. </span>
  124. <span class="society_form_right_a" v-if="jtzwIndex == 2" @click="jtzwChange(item.zwid)"
  125. :class="{ society_form_right_a_only: item.zwid == jtzwid }" :title="item.zwname">
  126. {{ item.zwname }}
  127. </span>
  128. </span>
  129. <!-- <span class="society_form_right_btn">展开</span> -->
  130. <span class="society_form_right_btn" @click="jtzwIndex = 2" v-if="jtzwIndex == 1">展开</span>
  131. <span class="society_form_right_btn" @click="jtzwIndex = 1" v-if="jtzwIndex == 2">收起</span>
  132. </div>
  133. </div>
  134. <div class="cruit_form_tip clearfix">
  135. <div class="cruit_form_per">
  136. <label class="cruit_form_label">地区选择:</label>
  137. <div class="cruit_form_label_right clearfix">
  138. <el-select v-model="province" placeholder="请选择省" style="width: 140px" clearable
  139. @change="provinceChange">
  140. <el-option v-for="item in provinceList" :key="item.id" :label="item.name"
  141. :value="item.id" />
  142. </el-select>
  143. <el-select v-model="city" placeholder="请选择市" style="width: 140px" no-data-text="请先选择省"
  144. clearable>
  145. <el-option v-for="item in cityList" :key="item.id" :label="item.name"
  146. :value="item.id" />
  147. </el-select>
  148. </div>
  149. </div>
  150. </div>
  151. <div class="cruit_form_tip clearfix">
  152. <div class="cruit_form_per">
  153. <label class="cruit_form_label">关键词:</label>
  154. <div class="cruit_form_label_right clearfix">
  155. <el-input v-model="keywords" style="width: 300px" placeholder="请输入搜索关键词" clearable />
  156. <el-button type="success" @click="goSearch">搜索</el-button>
  157. </div>
  158. </div>
  159. </div>
  160. </form>
  161. <!-- 职位搜索 -->
  162. </section>
  163. </main>
  164. <main class="color_main">
  165. <main class="index_main">
  166. <!-- 选项卡头 -->
  167. <section class="index_3 clearfix">
  168. <div class="recruit_head_box clearfix phone_none">
  169. <div class="cruit_head_left">
  170. <!-- <a class="cruit_head_a" :class="{ cruit_head_only: job_search == 1 }"
  171. @mouseover="job_search = 1" title="">找工作</a> -->
  172. <!-- <a class="cruit_head_a" :class="{ cruit_head_only: job_search == 2 }"
  173. @mouseover="job_search = 2" title="">招人才</a> -->
  174. <a class="cruit_head_a cruit_head_only" title="">招人才</a>
  175. </div>
  176. <div class="society_head_right clearfix">
  177. <!-- <div class="society_head_checkbox_box" v-if="job_search == 1 && type_id == 1">
  178. <el-checkbox v-model="allJob" label="" @change="toggleAllJob" />
  179. </div>
  180. <div class="society_head_right_all_box" v-if="job_search == 1 && type_id == 1">
  181. 全选
  182. </div> -->
  183. <div class="society_head_checkbox_box" v-if="job_search == 2 && type_id == 3">
  184. <el-checkbox v-model="allResume" label="" @change="toggleAllResume" />
  185. </div>
  186. <div class="society_head_right_all_box" v-if="job_search == 2 && type_id == 3">
  187. 全选
  188. </div>
  189. <!-- <div class="society_head_right_a" title="" v-if="job_search == 1 && type_id == 1"
  190. @click="getjob">申请职位</div> -->
  191. <div class="society_head_right_a" v-if="job_search == 2 && type_id == 3"
  192. @click="talkResume">沟通简历</div>
  193. </div>
  194. </div>
  195. <div class="phone_box_1 pc_none">
  196. <div class="phone_box_1_head">
  197. <a title="">招人才</a>
  198. </div>
  199. </div>
  200. <!-- 选项卡头 -->
  201. <!-- 选项卡 -->
  202. <div class=" clearfix">
  203. <!-- 找工作 -->
  204. <!-- <div class=" clearfix" v-show="job_search == 1">
  205. <div class="cruit_ul_2 clearfix" v-if="job_vacancy">
  206. <div class="cruit_li_2 clearfix" v-for="(item, index) in job_vacancy" :key="item.id">
  207. <div class="society_inp_checkbox_box_li_1 hand" v-if="type_id == 1">
  208. <el-checkbox v-model="selectedJobs" :value="item.id" @change="jobChange" />
  209. </div>
  210. <NuxtLink class="cruit_li_2_a" :href="`/${item.pinyin}/${item.id}.html`" title="">
  211. <div class="cruit_li_2_head_box clearfix">
  212. <div class="cruit_li_2_head clearfix dot1">{{ item.title }}</div>
  213. <div class="cruit_li_2_head_name clearfix dot1">
  214. {{ item.business_name }}
  215. </div>
  216. </div>
  217. <div class="cruit_li_2_foot_title_box clearfix">
  218. <span class="cruit_li_2_foot_title">{{ item.jtzw_name }}</span>
  219. </div>
  220. <div class="cruit_li_2_foot clearfix">
  221. <span class="cruit_li_2_foot_tag cruit_li_2_foot_addres">
  222. {{ item.city_name }}
  223. </span>
  224. <span class="cruit_li_2_foot_tag cruit_li_2_foot_exper"
  225. v-if="item.experience_name || item.education_name">
  226. <span class="cruit_li_2_foot_tag_in">{{ item.experience_name }}</span>
  227. <span class="cruit_li_2_foot_tag_in">{{ item.education_name }}</span>
  228. </span>
  229. <span class="cruit_li_2_foot_tag cruit_li_2_foot_time">
  230. {{ getTime(item.updated_at, 'year', 1) }}
  231. </span>
  232. </div>
  233. </NuxtLink>
  234. </div>
  235. </div>
  236. <div class="pagination" v-if="zptotal">
  237. <el-pagination size="small" background layout="prev, pager, next" :total="zptotal"
  238. class="mt-4" prev-text="上一页" next-text="下一页" @change="changePage" />
  239. </div>
  240. <div class="empty" v-if="job_vacancy == false">
  241. <img src="@/public/topic/empty.png" alt="" class="empty_img">
  242. <span class="empty_text">当前暂无数据</span>
  243. </div>
  244. </div> -->
  245. <!-- 找工作 -->
  246. <!-- 招人才 -->
  247. <div class=" clearfix" v-show="job_search == 2">
  248. <div class="society_ul_3 clearfix" v-if="job_resume">
  249. <div class="society_li_3 clearfix" v-for="(item, index) in job_resume" :key="item">
  250. <div class="society_inp_checkbox_box_li_3 hand" v-if="type_id == 3">
  251. <el-checkbox v-model="selectedResume" :value="item.id" @change="jobChange" />
  252. </div>
  253. <NuxtLink class="society_li_3_a" :href="`/${item.pinyin}/${item.id}.html`" title="">
  254. <div class="society_li_3_head_box clearfix">
  255. <div class="society_li_3_head clearfix dot1">
  256. {{ item.name }}
  257. </div>
  258. <div class="society_li_3_head_name clearfix dot1">
  259. {{ item.jtzw_name }}
  260. </div>
  261. </div>
  262. <div class="society_li_3_text_box clearfix">
  263. <div class="society_li_3_text">
  264. {{ item.sexy == 1 ? '男' : '女' }}
  265. <em class="point">·</em>
  266. </div>
  267. <div class="society_li_3_text" v-if="item.experience">
  268. {{ item.experience }}年
  269. <em class="point">·</em>
  270. </div>
  271. <div class="society_li_3_text">
  272. {{ item.origin }}
  273. <em class="point">·</em>
  274. </div>
  275. <div class="society_li_3_text">{{ item.hy_name }}</div>
  276. </div>
  277. <div class="society_li_3_tag_box clearfix">
  278. <span class="society_li_3_tag">{{ item.city_name }}</span>
  279. <span class="society_li_3_tag">
  280. {{ getTime(item.updated_at, 'year', 1) }}
  281. </span>
  282. </div>
  283. </NuxtLink>
  284. </div>
  285. </div>
  286. <div class="pagination pagination_phone_none" v-if="qztotal">
  287. <el-pagination size="small" background layout="prev, pager, next" :total="qztotal"
  288. class="mt-4" prev-text="上一页" next-text="下一页" @change="changePage" />
  289. </div>
  290. <div class="pagination pagination_pc_none" v-if="qztotal">
  291. <el-pagination
  292. pager-count="5"
  293. size="small"
  294. background
  295. layout="pager"
  296. :default-page-size="pageSize"
  297. :total="qztotal"
  298. class="mt-4"
  299. @current-change="changePage"
  300. />
  301. </div>
  302. <div class="empty" v-if="job_resume == false">
  303. <img src="@/public/topic/empty.png" alt="" class="empty_img">
  304. <span class="empty_text">当前暂无数据</span>
  305. </div>
  306. </div>
  307. <!-- 招人才 -->
  308. </div>
  309. <!-- 选项卡 -->
  310. </section>
  311. <!-- 招聘职位 -->
  312. <!-- <div class="cruit_alert_box">投递成功</div> -->
  313. </main>
  314. <!-- 弹框 -->
  315. <section class="cruit_alert_rgb clearfix" v-if="resumeBoo">
  316. <!-- 请选择要沟通的职位1 -->
  317. <!-- <div class="cruit_alert_rgb_box">
  318. <div class="cruit_alert_rgb_head_box">
  319. <div class="cruit_alert_rgb_close hand back100"></div>
  320. <div class="cruit_alert_rgb_head">请选择要沟通的职位</div>
  321. </div>
  322. <form class="cruit_alert_rgb_form clearfix" action=" " method=" ">
  323. <div class="cruit_alert_rgb_form_in clearfix">
  324. <div class="cruit_alert_rgb_li clearfix" v-for="(item, index) in 17" :key="item.id">
  325. <input name="type" type="checkbox" value="" class="cruit_alert_rgb_checkbox hand" />
  326. <label
  327. class="cruit_alert_rgb_label dot1">高级PHP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程师</label>
  328. </div>
  329. </div>
  330. <div class="cruit_alert_rgb_foot clearfix">
  331. <input class="cruit_alert_rgb_foot_sub hand" name="" type="submit" value="沟通职位">
  332. </div>
  333. </form>
  334. </div> -->
  335. <!-- 请选择要沟通的职位2 -->
  336. <!-- 请选择要投递的简历1 -->
  337. <div class="cruit_alert_rgb_box">
  338. <div class="cruit_alert_rgb_head_box">
  339. <div class="cruit_alert_rgb_close hand back100"></div>
  340. <div class="cruit_alert_rgb_head">请选择要沟通的岗位
  341. <span class="close" @click="resumeBoo = false">x</span>
  342. </div>
  343. </div>
  344. <form class="cruit_alert_rgb_form clearfix" action=" " method=" ">
  345. <div class="cruit_alert_rgb_form_in clearfix">
  346. <div class="cruit_alert_rgb_li clearfix" v-for="(item, index) in companyJobList"
  347. :key="item.id">
  348. <el-radio :value="item.id" v-model="company_job" @change="jobChange">
  349. <div class="cruit_alert_rgb_label dot1">
  350. {{ item.title }}
  351. </div>
  352. </el-radio>
  353. </div>
  354. </div>
  355. <div class="cruit_alert_rgb_foot clearfix">
  356. <div class="cruit_alert_rgb_foot_sub hand" @click="getresume">沟通岗位</div>
  357. </div>
  358. </form>
  359. </div>
  360. <!-- 请选择要投递的简历2 -->
  361. </section>
  362. </main>
  363. <!-- 页面底部 -->
  364. <HomeFoot1></HomeFoot1>
  365. </div>
  366. </template>
  367. <script setup>
  368. //1.页面必备依赖 start ---------------------------------------->
  369. import { ElSelect, ElOption, ElInput, ElButton, ElPagination, ElCheckbox, ElRadio, ElMessage } from 'element-plus';
  370. import { ref, onMounted, watch } from 'vue';
  371. import { useRoute } from 'vue-router'
  372. //当前列表名称
  373. const name = ref('')
  374. const selectedJobs = ref([])
  375. const selectedResume = ref([])
  376. const company_job = ref('')
  377. const allJob = ref(false)
  378. const allResume = ref(false)
  379. const job_search = ref(2) // 选项卡
  380. const { $webUrl, $CwebUrl, $BwebUrl } = useNuxtApp()
  381. //格式化跳转路径
  382. const getLinkPathDetail = (item) => {
  383. if (item.islink == 1) {
  384. return `${item.linkurl}`;
  385. } else {
  386. //return `/${item.aLIas_pinyin}/${item.id}`;
  387. //return `/newsDetail/${item.id}`
  388. return `/${item.pinyin}/${item.id}.html`;
  389. }
  390. }
  391. const nuxtApp = useNuxtApp();
  392. const axios = nuxtApp.$axios;
  393. //1.页面必备依赖 end ---------------------------------------->
  394. //1.获得路由id start ---------------------------------------->
  395. const route = useRoute();
  396. const hyid = ref(route.query.hyid);
  397. const zwid = ref(route.query.zwid);
  398. const jtzwid = ref(route.query.jtzwid);
  399. const provinceid = ref(route.query.provinceid);
  400. const cityid = ref(route.query.cityid);
  401. const keyword = route.query.keywords;
  402. let articleId = 0;//路由id
  403. let pageNum = ref(2);
  404. let total = ref(0);
  405. let zptotal = ref(0);
  406. let qztotal = ref(0);
  407. const page = ref(1)
  408. const pageSize = ref(15);
  409. let hyIndex = ref(1);
  410. let zwIndex = ref(1);
  411. let jtzwIndex = ref(1);
  412. //获得当前的完整路径
  413. const fullPath = route.path;
  414. //拆分,取出来中间这一段,然后提取数字部分
  415. const segments = fullPath.split('/');
  416. const targetSegment = segments[2];
  417. const targetRoute = segments[1];
  418. // console.log('111222', targetRoute);
  419. //const numberPart = targetSegment.match(/\d+$/)?.[0];
  420. //let routeId = 20 //排除路径错误可以打开这个
  421. //articleId = numberPart;
  422. //通过导航路径反向查询导航id
  423. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  424. method: 'GET',
  425. query: {
  426. 'pinyin': targetRoute,
  427. },
  428. });
  429. // console.log("111222333", getRouteId);
  430. if (getRouteId.code == 200) {
  431. articleId = getRouteId.data.category_id
  432. } else {
  433. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  434. console.log("错误位置:通过url路径查询导航池id")
  435. console.log("后端错误反馈:", getRouteId.message)
  436. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  437. }
  438. //获得html前的数字
  439. // const pageUrl = segments[3];
  440. // const pageNumber = pageUrl.split('.')[0];
  441. // console.log("当前URL中的页码:")
  442. // console.log(pageNumber)//2
  443. // pageNum.value = parseInt(pageNumber);
  444. pageNum.value = parseInt(route.params.id);
  445. // 创建个人简历
  446. let createResume = () => {
  447. window.open($BwebUrl + '/#/addJobHunting', '_blank');
  448. }
  449. // 发布招聘信息
  450. let createJob = () => {
  451. window.open($BwebUrl + '/#/creatJob', '_blank');
  452. }
  453. //1.获得路由id end ---------------------------------------->
  454. //2.页面数据 start ---------------------------------------->
  455. // 2.1.1 获取省份
  456. const province = ref('') //省
  457. const city = ref('') //市
  458. const provinceList = ref([]) //省列表
  459. const cityList = ref([]) //市列表
  460. const getArea = await requestDataPromise('/web/selectWebsiteArea', {
  461. method: 'GET',
  462. query: {},
  463. });
  464. if (getArea.code == 200) {
  465. provinceList.value = getArea.data;
  466. }
  467. // 2.1.2
  468. // 获取省份和城市
  469. const provinceChange = (val) => {
  470. provinceid.value = val;
  471. city.value = '';
  472. console.log('获取到的省份id', val);
  473. getCity(val)
  474. }
  475. const getCity = async (value) => {
  476. const getCity = await requestDataPromise('/web/selectWebsiteArea', {
  477. method: 'GET',
  478. query: {
  479. 'pid': value,
  480. },
  481. });
  482. if (getCity.code == 200) {
  483. cityList.value = getCity.data;
  484. }
  485. }
  486. // 带参数跳转 省份和城市的回显问题
  487. if (provinceid.value) {
  488. for (let i = 0; i < provinceList.value.length; i++) {
  489. if (provinceList.value[i].id == provinceid.value) {
  490. province.value = provinceList.value[i].id;
  491. }
  492. }
  493. const getCity = await requestDataPromise('/web/selectWebsiteArea', {
  494. method: 'GET',
  495. query: {
  496. 'pid': provinceid.value,
  497. },
  498. });
  499. if (getCity.code == 200) {
  500. cityList.value = getCity.data;
  501. }
  502. if (cityid.value) {
  503. for (let i = 0; i < cityList.value.length; i++) {
  504. if (cityList.value[i].id == cityid.value) {
  505. city.value = cityList.value[i].id;
  506. }
  507. }
  508. }
  509. }
  510. // 2.2.1 行业和职位
  511. const keywords = ref('') //关键词
  512. const industry_categoryList = ref([]) //行业类别列表
  513. const position_categoryList = ref([]) //职位类别列表
  514. const positionList = ref([]) //具体职位列表
  515. const getData = async () => {
  516. const getData = await requestDataPromise('/web/getWebsiteJobSelect', {
  517. method: 'GET',
  518. query: {},
  519. });
  520. if (getData.code == 200) {
  521. // console.log("获取到的分类数据:", getData.data);
  522. industry_categoryList.value = getData.data.hy; //行业
  523. position_categoryList.value = getData.data.zw; //职位
  524. if (zwid.value == 0 || zwid.value == '' || zwid.value == undefined || zwid.value == null) {
  525. positionList.value = getData.data.jtzw; //具体职位
  526. }
  527. }
  528. }
  529. getData()
  530. const job_vacancy = ref('') // 招聘岗位
  531. const job_resume = ref('') // 简历
  532. if (keyword) {
  533. keywords.value = keyword
  534. }
  535. const getJob = async () => {
  536. const getJob = await requestDataPromise('/web/getWebsiteJobList', {
  537. method: 'GET',
  538. query: {
  539. 'catid': articleId,
  540. 'city_id': provinceid.value,
  541. 'hy_id': hyid.value,
  542. 'zw_id': zwid.value,
  543. 'jtzw_id': jtzwid.value,
  544. 'page': page.value,
  545. 'pageSize': pageSize.value,
  546. 'keyword': keywords.value,
  547. },
  548. });
  549. if (getJob.code == 200) {
  550. // console.log("获取到的岗位和简历:", getJob.data);
  551. job_vacancy.value = getJob.data.JobRecruiting; // 招聘岗位
  552. job_resume.value = getJob.data.JobHunting; // 简历
  553. zptotal.value = getJob.data.recruit_count;
  554. qztotal.value = getJob.data.hunt_count;
  555. }
  556. }
  557. getJob()
  558. let hyChange = (val) => {
  559. console.log('hyChange', val)
  560. hyid.value = val;
  561. getJob()
  562. }
  563. let zwChange = async (val) => {
  564. console.log('zwChange', val)
  565. zwid.value = val;
  566. const getPosition = await requestDataPromise('/web/getPositionList', {
  567. method: 'GET',
  568. query: {
  569. 'zwpid': val,
  570. },
  571. })
  572. console.log("11112222", getPosition);
  573. if (getPosition.code == 200) {
  574. positionList.value = getPosition.data; //具体职位
  575. } else {
  576. positionList.value = []; //具体职位
  577. jtzwid.value = 0; //职位id
  578. }
  579. getJob()
  580. }
  581. let jtzwChange = (val) => {
  582. console.log('jtzwChange', val)
  583. jtzwid.value = val;
  584. getJob()
  585. }
  586. // 搜索
  587. const goSearch = async () => {
  588. const getJob = await requestDataPromise('/web/getWebsiteJobList', {
  589. method: 'GET',
  590. query: {
  591. 'catid': articleId,
  592. 'city_id': provinceid.value,
  593. 'hy_id': hyid.value,
  594. 'zw_id': zwid.value,
  595. 'jtzw_id': jtzwid.value,
  596. 'page': page.value,
  597. 'pageSize': pageSize.value,
  598. 'keyword': keywords.value,
  599. },
  600. });
  601. console.log("111获取到的岗位和简历:", getJob.data);
  602. if (getJob.code == 200) {
  603. job_vacancy.value = getJob.data.JobRecruiting; // 招聘岗位
  604. job_resume.value = getJob.data.JobHunting; // 简历
  605. zptotal.value = getJob.data.recruit_count;
  606. qztotal.value = getJob.data.hunt_count;
  607. }
  608. }
  609. //2.2change事件
  610. let jobChange = (val) => {
  611. console.log('jobChange', val)
  612. console.log('jobChange111', selectedJobs.value)
  613. console.log('jobChange111', selectedResume.value)
  614. console.log('jobChange11122', company_job.value) //企业会员的职位
  615. if (selectedJobs.value.length == job_vacancy.value.length) {
  616. allJob.value = true;
  617. } else {
  618. allJob.value = false;
  619. }
  620. if (selectedResume.value.length == job_resume.value.length) {
  621. allResume.value = true;
  622. } else {
  623. allResume.value = false;
  624. }
  625. }
  626. let toggleAllJob = () => {
  627. if (allJob.value) {
  628. selectedJobs.value = job_vacancy.value.map(item => item.id);
  629. } else {
  630. selectedJobs.value = [];
  631. }
  632. }
  633. let toggleAllResume = () => {
  634. if (allResume.value) {
  635. selectedResume.value = job_resume.value.map(item => item.id);
  636. } else {
  637. selectedResume.value = [];
  638. }
  639. }
  640. //分页事件
  641. let changePage = (value) => {
  642. console.log("当前页码", value);
  643. navigateTo(`/${targetSegment}/${value}.html`)
  644. }
  645. //申请职位
  646. let getjob = async () => {
  647. if (selectedJobs.value.length == 0) {
  648. ElMessage({
  649. message: '请选择要申请的职位',
  650. type: 'warning',
  651. });
  652. } else {
  653. // getWebsiteJobApply
  654. const getJobList = await requestDataPromise('/web/getWebsiteJobApply', {
  655. method: 'POST',
  656. body: {
  657. 'website_id': website_id.value,
  658. 'recruit_id': selectedJobs.value,
  659. }
  660. })
  661. if (getJobList.code == 200) {
  662. ElMessage({
  663. message: '投递成功',
  664. type: 'success',
  665. });
  666. } else {
  667. ElMessage({
  668. message: getJobList.message,
  669. type: 'error',
  670. });
  671. }
  672. }
  673. }
  674. //沟通简历
  675. let talkResume = () => {
  676. if (selectedResume.value.length == 0) {
  677. ElMessage({
  678. message: '请选择要沟通的简历',
  679. type: 'warning',
  680. });
  681. return false;
  682. } else {
  683. resumeBoo.value = true;
  684. }
  685. // resumeBoo.value = true;
  686. }
  687. // 沟通简历
  688. let resumeBoo = ref(false)
  689. let getresume = () => {
  690. axios.post('/web/getWebsiteJobResume', {
  691. website_id: website_id.value,
  692. recruit_id: company_job.value,
  693. hunt_id: selectedResume.value,
  694. }).then(res => {
  695. if (res.code == 200) {
  696. ElMessage({
  697. message: '投递成功',
  698. type: 'sussess',
  699. });
  700. resumeBoo.value = false;
  701. } else {
  702. ElMessage({
  703. message: res.message,
  704. type: 'error',
  705. });
  706. resumeBoo.value = false;
  707. }
  708. company_job.value = '';
  709. selectedResume.value = [];
  710. job_search.value = 2;
  711. allResume.value = false;
  712. })
  713. }
  714. // //2.3获得页面名称
  715. // let getPageName = async () => {
  716. // const pageName = await requestDataPromise('/web/getOneWebsiteCategory', {
  717. // method: 'GET',
  718. // query: {
  719. // 'catid': articleId
  720. // },
  721. // });
  722. // console.log('11122233344',pageName);
  723. // if (pageName.code == 200) {
  724. // name.value = pageName.data.alias
  725. // } else {
  726. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  727. // console.log("错误位置:设置页面标题")
  728. // console.log("后端错误反馈:", pageName.message)
  729. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  730. // }
  731. // }
  732. // //获得列表
  733. // getPageName();
  734. //2.页面数据 end ---------------------------------------->
  735. //3.二级栏目 start ---------------------------------------->
  736. //3.1通过id获取一级栏目
  737. const parent_name = ref([]);
  738. const parent_id = ref([]);
  739. const parent_pinyin = ref("");
  740. let getParentNav = async () => {
  741. const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
  742. method: 'GET',
  743. query: {
  744. 'catid': articleId
  745. },
  746. });
  747. // console.log("1112223334455", listData.data);
  748. if (listData.code == 200) {
  749. // console.log(111999)
  750. console.log(listData.data);
  751. parent_name.value = listData.data.alias;
  752. parent_id.value = listData.data.category_id;
  753. parent_pinyin.value = listData.data.aLIas_pinyin;
  754. } else {
  755. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  756. console.log("错误位置:获取新闻列表")
  757. console.log("后端错误反馈:", listData.message)
  758. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  759. }
  760. getSecondNav();
  761. }
  762. //获得父级栏目详情
  763. getParentNav();
  764. // 3.2获取二级栏目
  765. const secondNav = ref([]);
  766. let getSecondNav = async () => {
  767. const listData = await requestDataPromise('/web/getWebsiteModelCategory', {
  768. method: 'GET',
  769. query: {
  770. 'placeid': 1,
  771. 'pid': parent_id.value,
  772. 'num': 8,
  773. },
  774. });
  775. console.log('listData', listData);
  776. if (listData.code == 200) {
  777. secondNav.value = listData.data;
  778. } else {
  779. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  780. console.log("错误位置:获取新闻列表")
  781. console.log("后端错误反馈:", listData.message)
  782. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  783. }
  784. }
  785. //3.二级栏目 end ---------------------------------------->
  786. //4.设置seo信息 start---------------------------------------->
  787. //4.1 设置seo信息
  788. const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
  789. method: 'GET',
  790. query: {
  791. 'catid': articleId
  792. },
  793. });
  794. if (setData.code == 200) {
  795. let seoTitle = setData.data.seo_title;
  796. let seoDescription = setData.data.seo_description;
  797. let seoKeywords = setData.data.seo_keywords;
  798. let seoSuffix = setData.data.suffix;
  799. let seoName = setData.data.website_name;
  800. useSeoMeta({
  801. title: seoTitle + "_" + seoName + "_" + seoSuffix,
  802. meta: [
  803. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  804. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  805. { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no',tagPriority: 10 }
  806. ]
  807. });
  808. } else {
  809. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  810. console.log("错误位置:设置列表页面SEO数据")
  811. console.log("后端错误反馈:", setData.message)
  812. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  813. }
  814. //4.设置seo信息 end---------------------------------------->
  815. //5.广告 start---------------------------------------->
  816. let adImg1 = ref({});
  817. let adImg2 = ref({});
  818. onMounted(async () => {
  819. //从客户端获取行政职能部门 加快打开速度
  820. const { $webUrl, $CwebUrl } = useNuxtApp();
  821. //广告1
  822. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_search_0001`
  823. const responseAd1 = await fetch(url, {
  824. headers: {
  825. 'Content-Type': 'application/json',
  826. 'Userurl': $CwebUrl,
  827. 'Origin': $CwebUrl
  828. }
  829. });
  830. const resultAd1 = await responseAd1.json();
  831. adImg1.value = resultAd1.data[0];
  832. //广告2
  833. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_list_0002`
  834. const responseAd2 = await fetch(url2, {
  835. headers: {
  836. 'Content-Type': 'application/json',
  837. 'Userurl': $CwebUrl,
  838. 'Origin': $CwebUrl
  839. }
  840. });
  841. const resultAd2 = await responseAd2.json();
  842. adImg2.value = resultAd2.data[0];
  843. })
  844. //5.广告 end---------------------------------------->
  845. //获取用户信息
  846. let type_id = ref('')
  847. let website_id = ref('')
  848. let getUserInfo = () => {
  849. axios.get("/user/getUserInfo").then(response => {
  850. console.log("gettypeid", response.data);
  851. console.log("gettypeid_website_id", response.data.website_id);
  852. type_id.value = response.data.type_id
  853. website_id.value = response.data.website_id
  854. companyJOb()
  855. })
  856. }
  857. //获取当前企业会员的职位
  858. const companyJobList = ref([])
  859. let companyJOb = () => {
  860. axios.post("/web/getWebsiteJobRecruiting", {
  861. 'pageSize': pageSize.value,
  862. 'website_id': website_id.value,
  863. }).then(response => {
  864. console.log("gettypeid_获取到的企业会员的职位:", response.data);
  865. companyJobList.value = response.data
  866. })
  867. }
  868. onMounted(() => {
  869. getUserInfo()
  870. })
  871. </script>
  872. <style lang="less" scoped>
  873. @import url('@/assets/css/zgzpsearch.less');
  874. .empty {
  875. width: 100%;
  876. height: 150px;
  877. line-height: 150px;
  878. text-align: center;
  879. }
  880. .empty_img {
  881. vertical-align: -30px;
  882. margin-right: 20px;
  883. }
  884. .empty_text {
  885. font-size: 26px;
  886. color: #999;
  887. }
  888. </style>
  889. <style lang="less" scoped>
  890. @media screen and (min-width:801px){/*pc*/
  891. .pagination_pc_none{display:none;}
  892. .pc_none{display:none;}
  893. }
  894. @media screen and (max-width:800px){/*ipad_phone*/
  895. .index_main{width:100%;margin-top:0px;}
  896. .index_3{margin-top:0px;}
  897. .color_main{margin-bottom:30px;}
  898. .phone_box_1 {
  899. width: 92%;
  900. margin: 0px auto 0px;
  901. .phone_box_1_head {
  902. height: 50px;
  903. line-height: 50px;
  904. background: #fff;
  905. border-bottom: 1px solid #E6E6E6;
  906. width: 100%;
  907. a {
  908. float: left;
  909. height: 50px;
  910. line-height: 50px;
  911. margin: 0;
  912. position: relative;
  913. color: #489d97;
  914. font-size: 18px;
  915. font-weight: bold;
  916. box-sizing: border-box;
  917. position: relative;
  918. padding-left: 8px;
  919. }
  920. a::before {
  921. content: '';
  922. display: block;
  923. position: absolute;
  924. left: 0px;
  925. top: 18px;
  926. background: linear-gradient(to top, #0998A9, #6ADDD6);
  927. width: 3px;
  928. height: 15px;
  929. }
  930. }
  931. }
  932. .phone_form{
  933. width:92%;
  934. margin: 5px auto 0px;
  935. padding-bottom:8px;
  936. }
  937. .phone_form_tip{
  938. }
  939. .phone_form_tip_1 :deep(.el-select){
  940. margin:0px;
  941. }
  942. .phone_form_tip_1 :deep(.el-select:nth-of-type(2)){
  943. margin:0px 2%;
  944. box-sizing:border-box;
  945. }
  946. :deep(.el-select__wrapper){
  947. margin:5px 0px; padding:4px 4px 4px 8px;
  948. font-size:12px;box-sizing:border-box;
  949. }
  950. .phone_form_tip_2 :deep(.el-select){
  951. margin-right:2%;
  952. }
  953. :deep(.el-input){
  954. font-size:12px;
  955. }
  956. :deep(.el-button){
  957. border:solid 1px #ddd;
  958. color:#fff;float:right;margin:5px 0px 0px 0px;
  959. font-size:12px;
  960. }
  961. .phone_form{
  962. width:92%;
  963. margin: 5px auto 0px;
  964. padding-bottom:8px;
  965. }
  966. .phone_form_tip{
  967. }
  968. .phone_form_tip_1 :deep(.el-select){
  969. margin:0px;
  970. }
  971. .phone_form_tip_1 :deep(.el-select:nth-of-type(2)){
  972. margin:0px 2%;
  973. box-sizing:border-box;
  974. }
  975. :deep(.el-select__wrapper){
  976. margin:5px 0px; padding:4px 4px 4px 8px;
  977. font-size:12px;box-sizing:border-box;
  978. }
  979. .phone_form_tip_2 :deep(.el-select){
  980. margin-right:2%;
  981. }
  982. :deep(.el-input){
  983. font-size:12px;
  984. }
  985. :deep(.el-button){
  986. border:solid 1px #ddd;
  987. color:#fff;float:right;margin:5px 0px 0px 0px;
  988. font-size:12px;
  989. }
  990. .phone_form_tip_1:deep(.el-select__placeholder.is-transparent){color:#000;}
  991. :deep(.pagination .el-pagination.is-background .el-pager li){ margin:0px 4px;}
  992. .society_ul_3{ margin-top:11px;}
  993. .society_li_3{float:none;width:92%;margin:0px auto 11px!important; }
  994. .society_li_3_head{font-size:18px;margin-left:0px;}
  995. .society_li_3_text_box{margin-top:10px;margin-left:0px;}
  996. .society_li_3_text{font-size:12px;}
  997. .society_li_3_tag_box{margin:10px auto 15px;}
  998. .society_li_3_tag{ font-size:12px; }
  999. .pagination{width:100%;margin-bottom:0px;}
  1000. .pagination_phone_none{display:none;}
  1001. .phone_none{display:none;}
  1002. }
  1003. </style>