index.html.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838
  1. <template>
  2. <div>
  3. <HomePageHead></HomePageHead>
  4. <HomePageNavigation></HomePageNavigation>
  5. <HomeSecondaryHeadingZgzp :titleData="pageDataList" :pinyinid="routeId"></HomeSecondaryHeadingZgzp>
  6. <main class="index_main">
  7. <!-- 三农资讯网-招工招聘 snzx_recruit-->
  8. <section class="index_2">
  9. <!-- 职位搜索 -->
  10. <div class="recruit_head_box clearfix phone_none">
  11. <div class="cruit_head_left">
  12. <a class="cruit_head_a cruit_head_only" href="" title="">职位搜索</a>
  13. </div>
  14. <div class="cruit_head_right clearfix">
  15. <span class="cruit_head_right_a" @click="createResume" v-if="type_id == 1">创建个人简历</span>
  16. <!-- <span class="cruit_head_right_a" @click="createJob" v-if="type_id == 3">发布招聘信息</span> -->
  17. </div>
  18. </div>
  19. <!-- <div class="cruit_ul_1 clearfix">
  20. <NuxtLink class="cruit_ul_1_a" :class="{ cruit_ul_1_a_only: cruit_ul_1_a_only_num == index }"
  21. :href="{ path: '/zhaogongzhaopinnongmingong/search', query: { provinceid: `${item.id}` } }"
  22. title="" v-for="(item, index) in provinceList" :key="item.id">
  23. {{ item.name }}
  24. </NuxtLink>
  25. </div> -->
  26. <form class="phone_form clearfix pc_none" action=" " method=" ">
  27. <div class="phone_form_tip phone_form_tip_1 clearfix">
  28. <el-select v-model="industry_category" placeholder="行业类别" style="width:32%" clearable
  29. @change="hyChange">
  30. <el-option v-for="item in industry_categoryList" :key="item.hyid"
  31. :label="item.hyname" :value="item.hyid" />
  32. </el-select>
  33. <el-select v-model="position_category" placeholder="职位类别" style="width:32%" clearable
  34. @change="zwChange">
  35. <el-option v-for="item in position_categoryList" :key="item.zwid"
  36. :label="item.zwname" :value="item.zwid" />
  37. </el-select>
  38. <el-select v-model="position" placeholder="具体职位" style="width:32%" clearable
  39. no-data-text="请先选择职位类别" @change="jtzwChange">
  40. <el-option v-for="item in positionList" :key="item.zwid" :label="item.zwname"
  41. :value="item.zwid" />
  42. </el-select>
  43. </div>
  44. <div class="phone_form_tip phone_form_tip_2 clearfix">
  45. <el-select v-model="province" placeholder="省" style="width:15%" clearable
  46. @change="provinceChange">
  47. <el-option v-for="item in provinceList" :key="item.id" :label="item.name"
  48. :value="item.id" />
  49. </el-select>
  50. <el-select v-model="city" placeholder="市" style="width:15%" no-data-text="选省"
  51. clearable @change="cityChange">
  52. <el-option v-for="item in cityList" :key="item.id" :label="item.name"
  53. :value="item.id" />
  54. </el-select>
  55. <el-input v-model="keywords"
  56. style="width: 51%"
  57. placeholder="请输入搜索关键词" clearable>
  58. </el-input>
  59. <el-button type="" style="width: 13%" @click="goSearch">搜索</el-button>
  60. </div>
  61. <div class="phone_form_tip clearfix">
  62. </div>
  63. </form>
  64. <form class="cruit_form clearfix phone_none" action=" " method=" ">
  65. <div class="cruit_form_tip clearfix">
  66. <div class="cruit_form_per">
  67. <label class="cruit_form_label">行业类别:</label>
  68. <div class="cruit_form_label_right clearfix">
  69. <el-select v-model="industry_category" placeholder="请选择" style="width: 140px" clearable
  70. @change="hyChange">
  71. <el-option v-for="item in industry_categoryList" :key="item.hyid"
  72. :label="item.hyname" :value="item.hyid" />
  73. </el-select>
  74. </div>
  75. </div>
  76. <div class="cruit_form_per">
  77. <label class="cruit_form_label">职位类别:</label>
  78. <div class="cruit_form_label_right clearfix">
  79. <el-select v-model="position_category" placeholder="请选择" style="width: 140px" clearable
  80. @change="zwChange">
  81. <el-option v-for="item in position_categoryList" :key="item.zwid"
  82. :label="item.zwname" :value="item.zwid" />
  83. </el-select>
  84. </div>
  85. </div>
  86. <div class="cruit_form_per">
  87. <label class="cruit_form_label">具体职位:</label>
  88. <div class="cruit_form_label_right clearfix">
  89. <el-select v-model="position" placeholder="请选择" style="width: 140px" clearable
  90. no-data-text="请先选择职位类别" @change="jtzwChange">
  91. <el-option v-for="item in positionList" :key="item.zwid" :label="item.zwname"
  92. :value="item.zwid" />
  93. </el-select>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="cruit_form_tip clearfix">
  98. <div class="cruit_form_per">
  99. <label class="cruit_form_label">地区选择:</label>
  100. <div class="cruit_form_label_right clearfix">
  101. <el-select v-model="province" placeholder="请选择省" style="width: 140px" clearable
  102. @change="provinceChange">
  103. <el-option v-for="item in provinceList" :key="item.id" :label="item.name"
  104. :value="item.id" />
  105. </el-select>
  106. <el-select v-model="city" placeholder="请选择市" style="width: 140px" no-data-text="请先选择省"
  107. clearable @change="cityChange">
  108. <el-option v-for="item in cityList" :key="item.id" :label="item.name"
  109. :value="item.id" />
  110. </el-select>
  111. </div>
  112. </div>
  113. </div>
  114. <div class="cruit_form_tip clearfix">
  115. <div class="cruit_form_per">
  116. <label class="cruit_form_label">关键词:</label>
  117. <div class="cruit_form_label_right clearfix">
  118. <span>
  119. <el-input v-model="keywords" style="width: 300px" placeholder="请输入搜索关键词"
  120. clearable></el-input>
  121. </span>
  122. <span>
  123. <el-button type="success" @click="goSearch">搜索</el-button>
  124. </span>
  125. </div>
  126. </div>
  127. </div>
  128. </form>
  129. <div class="phone_box_1 pc_none">
  130. <div class="phone_box_1_head">
  131. <a title="">职位搜索</a>
  132. </div>
  133. </div>
  134. <!-- 职位搜索 -->
  135. </section>
  136. </main>
  137. <main class="color_main">
  138. <main class="index_main">
  139. <!-- 招聘职位 -->
  140. <section class="index_3 clearfix">
  141. <div class="recruit_head_box clearfix phone_none">
  142. <div class="cruit_head_left">
  143. <a class="cruit_head_a cruit_head_only" href="" title="">招聘职位</a>
  144. </div>
  145. </div>
  146. <div class="cruit_ul_2 clearfix" v-if="job_vacancy">
  147. <div class="cruit_li_2 clearfix" v-for="(item, index) in job_vacancy" :key="item.id">
  148. <NuxtLink class="cruit_li_2_a" :href="`/${item.pinyin}/${item.id}.html`" title="">
  149. <div class="cruit_li_2_head_box clearfix">
  150. <div class="cruit_li_2_head clearfix dot1">{{ item.title }}</div>
  151. <div class="cruit_li_2_head_name clearfix dot1">{{ item.business_name }}</div>
  152. </div>
  153. <div class="cruit_li_2_foot_title_box clearfix">
  154. <span class="cruit_li_2_foot_title">{{ item.jtzw_name }}</span>
  155. </div>
  156. <div class="cruit_li_2_foot clearfix">
  157. <span class="cruit_li_2_foot_tag cruit_li_2_foot_addres">{{ item.city_name }}</span>
  158. <span class="cruit_li_2_foot_tag cruit_li_2_foot_exper"
  159. v-if="item.experience_name || item.education_name">
  160. <span class="cruit_li_2_foot_tag_in">{{ item.experience_name }}</span>
  161. <span class="cruit_li_2_foot_tag_in">{{ item.education_name }}</span>
  162. </span>
  163. <span class="cruit_li_2_foot_tag cruit_li_2_foot_time">
  164. {{ getTime(item.due_data, 'year', 1) }}
  165. </span>
  166. </div>
  167. </NuxtLink>
  168. </div>
  169. </div>
  170. <div class="empty" v-if="job_vacancy == false">
  171. <img src="@/public/topic/empty.png" alt="" class="empty_img">
  172. <span class="empty_text">当前暂无数据</span>
  173. </div>
  174. <div class="pagination pagination_phone_none" v-if="zptotal">
  175. <el-pagination size="small" background layout="prev, pager, next" :total="zptotal" class="mt-4"
  176. prev-text="上一页" next-text="下一页" @change="changePage" />
  177. </div>
  178. <div class="pagination pagination_pc_none" v-if="zptotal">
  179. <el-pagination
  180. pager-count="5"
  181. size="small"
  182. background
  183. layout="pager"
  184. :default-page-size="pageSize"
  185. :total="zptotal"
  186. class="mt-4"
  187. @current-change="changePage"
  188. />
  189. </div>
  190. </section>
  191. <!-- <section class="index_4 clearfix">
  192. <div class="recruit_head_box clearfix">
  193. <div class="cruit_head_left">
  194. <a class="cruit_head_a cruit_head_only" href="" title="">人才服务</a>
  195. </div>
  196. </div>
  197. <div class="cruit_ul_3 clearfix" v-if="job_resume">
  198. <div class="cruit_li_3 clearfix" v-for="(item, index) in job_resume" :key="item.id">
  199. <NuxtLink class="cruit_li_3_a" :href="`/${item.pinyin}/${item.id}.html`" title="">
  200. <div class="cruit_li_3_head_box clearfix">
  201. <div class="cruit_li_3_head clearfix dot1">{{ item.name }}</div>
  202. <div class="cruit_li_3_head_name clearfix dot1">{{ item.jtzw_name }}</div>
  203. </div>
  204. <div class="cruit_li_3_text_box clearfix">
  205. <div class="cruit_li_3_text">
  206. {{ item.sexy == 1 ? '男' : '女' }}
  207. <em class="point">·</em>
  208. </div>
  209. <div class="cruit_li_3_text" v-if="item.experience">
  210. {{ item.experience }} 年
  211. <em class="point">·</em>
  212. </div>
  213. <div class="cruit_li_3_text">
  214. {{ item.origin }}
  215. <em class="point">·</em>
  216. </div>
  217. <div class="cruit_li_3_text">{{ item.hy_name }}</div>
  218. </div>
  219. <div class="cruit_li_3_tag_box clearfix">
  220. <span class="cruit_li_3_tag">{{ item.city_name }}</span>
  221. <span class="cruit_li_3_tag">
  222. {{ getTime(item.updated_at, 'year', 1) }}
  223. </span>
  224. </div>
  225. </NuxtLink>
  226. </div>
  227. </div>
  228. <div class="empty" v-if="job_resume == false">
  229. <img src="@/public/topic/empty.png" alt="" class="empty_img">
  230. <span class="empty_text">当前暂无数据</span>
  231. </div>
  232. </section> -->
  233. </main>
  234. </main>
  235. <HomeAdvertising :imgurl="adImg1" v-if="adImg1"></HomeAdvertising>
  236. <HomeFoot1></HomeFoot1>
  237. </div>
  238. </template>
  239. <script setup>
  240. //0.加载页面依赖 start ---------------------------------------->
  241. import { ref, onMounted } from 'vue';
  242. import { ElMessage, ElSelect, ElOption, ElInput, ElButton, ElPagination } from 'element-plus';
  243. const { $webUrl, $CwebUrl, $BwebUrl } = useNuxtApp()
  244. const nuxtApp = useNuxtApp();
  245. const axios = nuxtApp.$axios;
  246. //获取用户信息
  247. let type_id = ref('')
  248. let website_id = ref('')
  249. let getUserInfo = () => {
  250. axios.get("/user/getUserInfo").then(response => {
  251. console.log("gettypeid", response.data);
  252. type_id.value = response.data.type_id
  253. website_id.value = response.data.website_id
  254. })
  255. }
  256. onMounted(() => {
  257. getUserInfo()
  258. })
  259. //0.加载页面依赖 end ---------------------------------------->
  260. //1.获得路由id start ---------------------------------------->
  261. const route = useRoute();
  262. //获得当前的完整路径
  263. const fullPath = route.path;
  264. //拆分,取出来中间这一段,然后提取数字部分
  265. const segments = fullPath.split('/');
  266. const targetSegment = segments[1];
  267. //let routeId = 11 //排除路径错误可以打开这个
  268. //const numberPart = targetSegment.match(/\d+$/)?.[0];
  269. //let routeId = numberPart;
  270. let routeId;
  271. //通过导航路径反向查询导航id
  272. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  273. method: 'GET',
  274. query: {
  275. 'pinyin': targetSegment,
  276. },
  277. });
  278. if (getRouteId.code == 200) {
  279. routeId = getRouteId.data.category_id
  280. } else {
  281. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  282. console.log("错误位置:通过url路径查询导航池id")
  283. console.log("后端错误反馈:", getRouteId.message)
  284. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  285. }
  286. //1.获得路由id end ---------------------------------------->
  287. //2.页面交互效果 start ---------------------------------------->
  288. //分页
  289. const page = ref(1) //页码
  290. const pageSize = ref(20) //每页显示条数
  291. const zptotal = ref(0) //总条数
  292. //分页事件
  293. let changePage = (value) => {
  294. console.log("当前页码", value);
  295. // navigateTo(`/${targetSegment}/${value}.html`)
  296. }
  297. // 2.1 下拉列表
  298. // 2.1.1 获取省份
  299. const province = ref('') //省
  300. const provinceid = ref('') //省
  301. const city = ref('') //市
  302. const provinceList = ref([]) //省列表
  303. const cityList = ref([]) //市列表
  304. const getArea = await requestDataPromise('/web/selectWebsiteArea', {
  305. method: 'GET',
  306. query: {},
  307. });
  308. if (getArea.code == 200) {
  309. provinceList.value = getArea.data;
  310. }
  311. // 2.1.2 获取市
  312. const provinceChange = async (val) => {
  313. console.log('获取到的省份id', val);
  314. provinceid.value = val;
  315. city.value = '';
  316. getCity(val)
  317. }
  318. const getCity = async (val) => {
  319. const getCity = await requestDataPromise('/web/selectWebsiteArea', {
  320. method: 'GET',
  321. query: {
  322. 'pid': val,
  323. },
  324. });
  325. if (getCity.code == 200) {
  326. cityList.value = getCity.data;
  327. }
  328. }
  329. // 2.2.1 行业和职位
  330. const industry_category = ref('') //行业类别
  331. const position_category = ref('') //职位类别
  332. const position = ref('') //具体职位
  333. const keywords = ref('') //关键词
  334. const industry_categoryList = ref([]) //行业类别列表
  335. const position_categoryList = ref([]) //职位类别列表
  336. const positionList = ref([]) //具体职位列表
  337. const getData = async () => {
  338. const getData = await requestDataPromise('/web/getWebsiteJobSelect', {
  339. method: 'GET',
  340. query: {},
  341. });
  342. if (getData.code == 200) {
  343. // console.log("获取到的分类数据:", getData.data);
  344. industry_categoryList.value = getData.data.hy; //行业
  345. position_categoryList.value = getData.data.zw; //职位
  346. // positionList.value = getData.data.jtzw; //具体职位
  347. }
  348. }
  349. getData()
  350. //2.2.2 获取岗位和简历
  351. const job_vacancy = ref('') // 招聘岗位
  352. const job_resume = ref('') // 简历
  353. const getJob = async () => {
  354. const getJob = await requestDataPromise('/web/getWebsiteJobList', {
  355. method: 'GET',
  356. query: {
  357. 'page': page.value,
  358. 'pageSize': pageSize.value
  359. },
  360. });
  361. if (getJob.code == 200) {
  362. console.log("获取到的岗位和简历:", getJob.data);
  363. job_vacancy.value = getJob.data.JobRecruiting; // 招聘岗位
  364. job_resume.value = getJob.data.JobHunting; // 简历
  365. zptotal.value = getJob.data.recruit_count;
  366. // qztotal.value = getJob.data.hunt_count;
  367. }
  368. }
  369. getJob()
  370. // 2.3 change事件
  371. const hyid = ref('') //行业
  372. const zwid = ref('') //职位
  373. const jtzwid = ref('') //具体职位
  374. const cityid = ref('') //具体城市
  375. const hyChange = async (val) => {
  376. hyid.value = val;
  377. }
  378. const zwChange = async (val) => {
  379. console.log('111', val);
  380. zwid.value = val;
  381. position.value = '';
  382. const getPosition = await requestDataPromise('/web/getPositionList', {
  383. method: 'GET',
  384. query: {
  385. 'zwpid': val,
  386. },
  387. })
  388. console.log("11112222", getPosition);
  389. if (getPosition.code == 200) {
  390. positionList.value = getPosition.data; //具体职位
  391. } else {
  392. positionList.value = []; //具体职位
  393. }
  394. }
  395. const jtzwChange = async (val) => {
  396. jtzwid.value = val;
  397. }
  398. const cityChange = async (val) => {
  399. cityid.value = val;
  400. }
  401. //2.3 搜索
  402. const router = useRouter();
  403. const goSearch = () => {
  404. router.push({
  405. path: '/zhaogongzhaopin/search',
  406. query: {
  407. 'hyid': hyid.value,
  408. 'zwid': zwid.value,
  409. 'jtzwid': jtzwid.value,
  410. 'provinceid': provinceid.value,
  411. 'cityid': cityid.value,
  412. 'keywords': keywords.value,
  413. }
  414. })
  415. }
  416. // 创建个人简历
  417. let createResume = () => {
  418. window.open($BwebUrl + '/#/addJobHunting', '_blank');
  419. }
  420. // 发布招聘信息
  421. let createJob = () => {
  422. window.open($BwebUrl + '/#/creatJob', '_blank');
  423. }
  424. //2.4 展示广告
  425. let adImg1 = ref({})
  426. let adImg2 = ref({})
  427. let adImg3 = ref({})
  428. let adImg4 = ref({})
  429. onMounted(async () => {
  430. //从客户端获取行政职能部门 加快打开速度
  431. const { $webUrl, $CwebUrl } = useNuxtApp();
  432. //广告1
  433. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_category_0001`
  434. const responseAd1 = await fetch(url, {
  435. headers: {
  436. 'Content-Type': 'application/json',
  437. 'Userurl': $CwebUrl,
  438. 'Origin': $CwebUrl
  439. }
  440. });
  441. const resultAd1 = await responseAd1.json();
  442. adImg1.value = resultAd1.data[0];
  443. //广告2
  444. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_category_0002`
  445. const responseAd2 = await fetch(url2, {
  446. headers: {
  447. 'Content-Type': 'application/json',
  448. 'Userurl': $CwebUrl,
  449. 'Origin': $CwebUrl
  450. }
  451. });
  452. const resultAd2 = await responseAd2.json();
  453. adImg2.value = resultAd2.data[0];
  454. //广告3
  455. let url3 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_category_0003`
  456. const responseAd3 = await fetch(url3, {
  457. headers: {
  458. 'Content-Type': 'application/json',
  459. 'Userurl': $CwebUrl,
  460. 'Origin': $CwebUrl
  461. }
  462. });
  463. const resultAd3 = await responseAd3.json();
  464. adImg3.value = resultAd3.data[0];
  465. //广告4
  466. let url4 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_category_0004`
  467. const responseAd4 = await fetch(url4, {
  468. headers: {
  469. 'Content-Type': 'application/json',
  470. 'Userurl': $CwebUrl,
  471. 'Origin': $CwebUrl
  472. }
  473. });
  474. const resultAd4 = await responseAd4.json();
  475. adImg4.value = resultAd4.data[0];
  476. })
  477. //2.页面交互效果 end ---------------------------------------->
  478. //3.渲染页面数据 start ---------------------------------------->
  479. //3.1 该页面上所有的导航池 转为动态数据
  480. //3.1 该页面上所有的导航池 转为动态数据
  481. const pageCategory = ref([]);
  482. //3.2 该页面上需要渲染的所有数据
  483. const pageData = ref([])
  484. const pageDataList = ref([])
  485. //3.3 获取所有导航
  486. try {
  487. const navigateData = await requestDataPromise('/web/getWebsiteModelCategory', {
  488. method: 'GET',
  489. query: {
  490. 'placeid': 1,
  491. 'pid': routeId,
  492. 'num': 8
  493. },
  494. });
  495. if (navigateData.code == 200) {
  496. // 遍历可用的导航池放到页面中
  497. for (let index in navigateData.data) {
  498. let data = {
  499. title: navigateData.data[index].name,
  500. cid: navigateData.data[index].category_id,
  501. children_count: navigateData.data[index].children_count,
  502. alias: navigateData.data[index].alias,
  503. aLIas_pinyin: targetSegment + "/" + navigateData.data[index].aLIas_pinyin,
  504. data: [],
  505. data1: [],
  506. data2: [],
  507. data3: [],
  508. data4: [],
  509. category_id1: "",
  510. category_id2: "",
  511. category_id3: "",
  512. category_id4: "",
  513. title1: "",
  514. title2: "",
  515. title3: "",
  516. title4: ""
  517. };
  518. console.log("导航池数据:", navigateData.data[index]);
  519. if (navigateData.data[index].type == 1) {
  520. //每个页面最多8个模块
  521. pageData.value.push(data);
  522. }
  523. if (navigateData.data[index].is_url == 1) {
  524. // 处理 URL 的逻辑
  525. } else {
  526. //每个页面最多8个模块
  527. pageDataList.value.push(data);
  528. }
  529. }
  530. console.log("导航池数据11:", pageDataList.value);
  531. //导航池加载完毕,开始申请模块数据
  532. // await getPageData1();
  533. // await getPageData2();
  534. // await getPageData3();
  535. // await getPageData4();
  536. // await getPageData5();
  537. // await getPageData6();
  538. // await getPageData7();
  539. // await getPageData8();
  540. let getJson = [
  541. { "parent": routeId + ",0,0", "child": pageDataList.value[0].cid + ",1,1" },//模块1理论前沿
  542. { "parent": routeId + ",0,0", "child": pageDataList.value[1].cid + ",5,0" },//模块2典型经验
  543. { "parent": routeId + ",0,0", "child": pageDataList.value[2].cid + ",1,6" },//模块3农业天地
  544. { "parent": routeId + ",0,0", "child": pageDataList.value[3].cid + ",1,6" },//模块4美丽乡村
  545. { "parent": routeId + ",0,0", "child": pageDataList.value[4].cid + ",1,6" },//模块5农民之家
  546. { "parent": routeId + ",0,0", "child": pageDataList.value[5].cid + ",6,3" },//模块6农业天地
  547. ]
  548. let jsonString = JSON.stringify(getJson);
  549. // getPageAllData(jsonString);
  550. } else {
  551. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  552. console.log("错误位置:分类页导航池")
  553. console.log("后端错误反馈:", navigateData.message)
  554. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  555. }
  556. } catch (error) {
  557. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  558. console.log("错误位置:分类页导航渲染阶段")
  559. console.log("错误:导航池渲染执行接口出错!请检查首页的14的模块的具体执行方法!")
  560. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  561. }
  562. //获取资讯
  563. async function getPageAllData(jsonString) {
  564. const mkdata = await requestDataPromise('/web/getWebsiteAllArticle', {
  565. method: 'GET',
  566. query: {
  567. 'id': jsonString
  568. },
  569. });
  570. console.log('mkdata', mkdata);
  571. if (mkdata.code == 200) {
  572. console.log(778899)
  573. console.log(mkdata.data)
  574. //模块1理论前沿
  575. if (mkdata.data[0].child.imgnum.length > 0) {
  576. pageData.value[0].data.push(mkdata.data[0].child.imgnum[0]);
  577. }
  578. if (mkdata.data[0].child.imgnum.length > 1) {
  579. pageData.value[0].data2.push(mkdata.data[0].child.imgnum[1]);
  580. }
  581. if (mkdata.data[0].child.imgnum.length > 2) {
  582. pageData.value[0].data2.push(mkdata.data[0].child.imgnum[2]);
  583. }
  584. if (mkdata.data[0].child.imgnum.length > 3) {
  585. pageData.value[0].data2.push(mkdata.data[0].child.imgnum[3]);
  586. }
  587. if (mkdata.data[0].child.imgnum.length > 4) {
  588. pageData.value[0].data2.push(mkdata.data[0].child.imgnum[4]);
  589. }
  590. pageData.value[0].data3 = mkdata.data[0].child.textnum;
  591. //模块2典型经验
  592. pageData.value[1].data = mkdata.data[1].child.imgnum;
  593. //模块3农业天地
  594. pageData.value[2].data = mkdata.data[2].child.imgnum;
  595. pageData.value[2].data2 = mkdata.data[2].child.textnum;
  596. //模块4美丽乡村
  597. pageData.value[3].data = mkdata.data[3].child.imgnum;
  598. pageData.value[3].data2 = mkdata.data[3].child.textnum;
  599. //模块5农民之家
  600. pageData.value[4].data = mkdata.data[4].child.imgnum;
  601. pageData.value[4].data2 = mkdata.data[4].child.textnum;
  602. //模块6农业天地 注意,三农资讯网跟其他行星站不一样,你不需要复制我这个
  603. //因为本来二级分类页有9个模块,但是实际应用中只有8个,所以我把本来是模块7
  604. //的地方和现有的模块6合并成1个了
  605. if (mkdata.data[5].child.imgnum.length > 0) {
  606. pageData.value[5].data.push(mkdata.data[5].child.imgnum[0]);
  607. }
  608. pageData.value[5].data2 = mkdata.data[5].child.textnum;
  609. //把模块6的内容放到模块7中一部分
  610. for (let i = 1; i < mkdata.data[5].child.imgnum.length && i <= 5; i++) {
  611. pageData.value[7].data.push(mkdata.data[5].child.imgnum[i]);
  612. }
  613. //模块7农村建设
  614. pageData.value[6].data = mkdata.data[6].child.imgnum;
  615. pageData.value[6].data2 = mkdata.data[6].child.textnum;
  616. //模块8高端资讯
  617. pageData.value[7].data2 = mkdata.data[7].child.imgnum;
  618. } else {
  619. ElMessage.error(mkdata.message)
  620. }
  621. }
  622. //4.设置seo信息 start---------------------------------------->
  623. const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
  624. method: 'GET',
  625. query: {
  626. 'catid': routeId
  627. },
  628. });
  629. if (setData.code == 200) {
  630. let seoTitle = setData.data.seo_title;
  631. let seoDescription = setData.data.seo_description;
  632. let seoKeywords = setData.data.seo_keywords;
  633. let seoSuffix = setData.data.suffix;
  634. let seoName = setData.data.website_name;
  635. useSeoMeta({
  636. title: seoTitle + "_" + seoName + "_" + seoSuffix,
  637. meta: [
  638. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  639. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  640. { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no',tagPriority: 10 }
  641. ]
  642. });
  643. } else {
  644. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  645. // console.log("错误位置:设置分类页面SEO数据")
  646. // console.log("后端错误反馈:", setData.message)
  647. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  648. }
  649. //4.设置seo信息 end---------------------------------------->
  650. </script>
  651. <style lang="less" scoped>
  652. @import '@/assets/css/zgzpClass.less';
  653. </style>
  654. <style lang="less" scoped>
  655. @media screen and (min-width:801px){/*pc*/
  656. .pagination_pc_none{display:none;}
  657. .pc_none{display:none;}
  658. }
  659. @media screen and (max-width:800px){/*ipad_phone*/
  660. .index_main{width:100%;}
  661. .phone_box_1 {
  662. width: 92%;
  663. margin: 0px auto 0px;
  664. .phone_box_1_head {
  665. height: 50px;
  666. line-height: 50px;
  667. background: #fff;
  668. border-bottom: 1px solid #E6E6E6;
  669. width: 100%;
  670. a {
  671. float: left;
  672. height: 50px;
  673. line-height: 50px;
  674. margin: 0;
  675. position: relative;
  676. color: #489d97;
  677. font-size: 18px;
  678. font-weight: bold;
  679. box-sizing: border-box;
  680. position: relative;
  681. padding-left: 8px;
  682. }
  683. a::before {
  684. content: '';
  685. display: block;
  686. position: absolute;
  687. left: 0px;
  688. top: 18px;
  689. background: linear-gradient(to top, #0998A9, #6ADDD6);
  690. width: 3px;
  691. height: 15px;
  692. }
  693. }
  694. }
  695. .phone_form{
  696. width:92%;
  697. margin: 5px auto 0px;
  698. padding-bottom:8px;
  699. }
  700. .phone_form_tip{
  701. }
  702. .phone_form_tip_1 :deep(.el-select){
  703. margin:0px;
  704. }
  705. .phone_form_tip_1 :deep(.el-select:nth-of-type(2)){
  706. margin:0px 2%;
  707. box-sizing:border-box;
  708. }
  709. :deep(.el-select__wrapper){
  710. margin:5px 0px; padding:4px 4px 4px 8px;
  711. font-size:12px;box-sizing:border-box;
  712. }
  713. .phone_form_tip_2 :deep(.el-select){
  714. margin-right:2%;
  715. }
  716. :deep(.el-input){
  717. font-size:12px;
  718. }
  719. :deep(.el-button){
  720. border:solid 1px #ddd;
  721. color:#fff;float:right;margin:5px 0px 0px 0px;
  722. font-size:12px;
  723. }
  724. .cruit_ul_2{margin-top:0px;min-height:512px;}
  725. .cruit_li_2{
  726. width:92%;float:none!important;margin:0px auto 11px!important;
  727. }
  728. .cruit_li_2_head_box{margin-top:10px;}
  729. .cruit_li_2_foot_title{margin-top:8px;}
  730. .cruit_li_2_foot{margin-top:8px;}
  731. .cruit_li_2_a{padding-bottom:5px;}
  732. .cruit_li_2_foot_tag{
  733. background-size: 16px 70%;
  734. padding-left:18px;margin-bottom:5px;font-size:12px;
  735. margin-right:13px;
  736. }
  737. .cruit_li_2_foot_tag:nth-last-of-type(1){margin-right:0px;}
  738. .cruit_li_2_foot_tag_in{font-size:12px;}
  739. .cruit_li_2_foot_tag_in:nth-of-type(2){padding-left:16px;}
  740. .cruit_li_2_foot_tag_in:nth-of-type(2)::after {
  741. left: 8px;
  742. }
  743. .cruit_li_2_head{font-size:18px;}
  744. .cruit_li_2_head_name{}
  745. .cruit_li_2_foot_title{font-size:12px;}
  746. .pagination .el-pagination.is-background .el-pager li{
  747. margin:0px 4px;
  748. }
  749. .pagination{width:100%; margin-bottom:0px;}
  750. .pagination_phone_none{display:none;}
  751. .phone_none{display:none;}
  752. }
  753. </style>