detail.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. <template>
  2. <section class="index_main">
  3. <!-- 面包屑导航 -->
  4. <div class="breadcrumb phone_none">
  5. <div class="inner">
  6. <span class="location">当前位置:</span>
  7. <el-breadcrumb :separator-icon="ArrowRight">
  8. <el-breadcrumb-item>
  9. <NuxtLink to="/">首页</NuxtLink>
  10. </el-breadcrumb-item>
  11. <el-breadcrumb-item v-if="parent_name != ''">
  12. <NuxtLink :to="`/${parent_pinyin}/index.html`"> {{ parent_name }}</NuxtLink>
  13. </el-breadcrumb-item>
  14. <el-breadcrumb-item v-if="routeName">
  15. <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`"> {{ routeName }}</NuxtLink>
  16. </el-breadcrumb-item>
  17. <el-breadcrumb-item v-if="routeName1">
  18. <NuxtLink :to="`list-1.html`"> {{ routeName1 }}</NuxtLink>
  19. </el-breadcrumb-item>
  20. <el-breadcrumb-item>{{ routeNewsTtitle }}</el-breadcrumb-item>
  21. </el-breadcrumb>
  22. </div>
  23. </div>
  24. <div class="breadcrumb_box pc_none">
  25. <span class=" ">当前位置:</span>
  26. <NuxtLink to="/">首页</NuxtLink>
  27. <span class=" " v-if="parent_name != ''">&gt;</span>
  28. <NuxtLink v-if="parent_name != ''" :to="`/${parent_pinyin}/index.html`" > {{ parent_name }}</NuxtLink>
  29. <span class=" " v-if="routeName">&gt;</span>
  30. <NuxtLink :to="`/${targetSegment}/${targetSegment1}/index.html`" v-if="routeName"> {{ routeName }}</NuxtLink>
  31. <span class="" >&gt;</span>
  32. <span class="" >{{ routeNewsTtitle }}</span>
  33. </div>
  34. <!-- 面包屑 end-->
  35. <div class="info_head_box clearfix phone_none">
  36. <div class="info_head_left">
  37. <a class="info_head_a info_head_only" :title="公司信息">公司信息</a>
  38. </div>
  39. </div>
  40. <div class="phone_box_1 pc_none">
  41. <div class="phone_box_head" >
  42. <NuxtLink class="" >
  43. 公司信息
  44. </NuxtLink>
  45. </div>
  46. </div>
  47. <section class="index_2 clearfix">
  48. <img class="index_2_img" :src="detailImg[0]" :title="routeNewsTtitle" alt="">
  49. <div class="index_2_right">
  50. <h4 class="index_2_h4"> {{ routeNewsTtitle }}</h4>
  51. <div class="index_2_title_box clearfix">
  52. <time class="index_2_title">
  53. 成立日期:
  54. <span v-if="time"> {{ time }}</span>
  55. </time>
  56. <span class="index_2_title">
  57. 所在城市:
  58. <span v-if="newsDetail.city_name">{{ newsDetail.city_name }}</span>
  59. </span>
  60. </div>
  61. <div class="index_2_ul clearfix phone_none">
  62. <div class="index_2_ul_left">
  63. <div class="index_2_li clearfix">
  64. <label class="index_2_li_label">机构性质</label>
  65. <span class="index_2_li_text " v-if="newsDetail.jobnature_name">
  66. {{ newsDetail.jobnature_name }}</span>
  67. </div>
  68. <div class="index_2_li clearfix">
  69. <label class="index_2_li_label">负 责 人</label>
  70. <span class="index_2_li_text" v-if="newsDetail.manager">
  71. {{ newsDetail.manager }}
  72. </span>
  73. </div>
  74. <div class="index_2_li clearfix">
  75. <label class="index_2_li_label">联 系 人</label>
  76. <span class="index_2_li_text " v-if="newsDetail.content_person">
  77. {{ newsDetail.content_person }}
  78. </span>
  79. </div>
  80. <div class="index_2_li clearfix">
  81. <label class="index_2_li_label">联系电话</label>
  82. <span class="index_2_li_text ">{{ newsDetail.telephone }}</span>
  83. </div>
  84. <div class="index_2_li clearfix">
  85. <label class="index_2_li_label">手 &nbsp;&nbsp;&nbsp;&nbsp; 机</label>
  86. <span class="index_2_li_text ">{{ newsDetail.mobile }}</span>
  87. </div>
  88. <div class="index_2_li clearfix">
  89. <label class="index_2_li_label">地 &nbsp;&nbsp;&nbsp;&nbsp; 址</label>
  90. <span class="index_2_li_text ">{{ newsDetail.adress }}</span>
  91. </div>
  92. </div>
  93. <div class="index_2_ul_left">
  94. <div class="index_2_li clearfix">
  95. <label class="index_2_li_label">所属行业</label>
  96. <span class="index_2_li_text ">{{ newsDetail.hy_name }}</span>
  97. </div>
  98. <div class="index_2_li clearfix">
  99. <label class="index_2_li_label">联系QQ</label>
  100. <span class="index_2_li_text ">{{ newsDetail.QQ }}</span>
  101. </div>
  102. <div class="index_2_li clearfix">
  103. <label class="index_2_li_label">网 &nbsp;&nbsp;&nbsp;&nbsp; 址</label>
  104. <span class="index_2_li_text ">{{ newsDetail.company_url }}</span>
  105. </div>
  106. <div class="index_2_li clearfix">
  107. <label class="index_2_li_label">邮政编码</label>
  108. <span class="index_2_li_text ">{{ newsDetail.post_code }}</span>
  109. </div>
  110. <div class="index_2_li clearfix">
  111. <label class="index_2_li_label">传 &nbsp;&nbsp;&nbsp;&nbsp; 真</label>
  112. <span class="index_2_li_text ">{{ newsDetail.fax }}</span>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="index_2_ul clearfix pc_none">
  117. <div class="index_2_ul_left">
  118. <div class="index_2_li clearfix">
  119. <label class="index_2_li_label">机构性质</label>
  120. <span class="index_2_li_text " v-if="newsDetail.jobnature_name">
  121. {{ newsDetail.jobnature_name }}</span>
  122. </div>
  123. <div class="index_2_li clearfix">
  124. <label class="index_2_li_label">所属行业</label>
  125. <span class="index_2_li_text ">{{ newsDetail.hy_name }}</span>
  126. </div>
  127. <div class="index_2_li clearfix">
  128. <label class="index_2_li_label">负 责 人</label>
  129. <span class="index_2_li_text" v-if="newsDetail.manager">
  130. {{ newsDetail.manager }}
  131. </span>
  132. </div>
  133. <div class="index_2_li clearfix">
  134. <label class="index_2_li_label">联 系 人</label>
  135. <span class="index_2_li_text " v-if="newsDetail.content_person">
  136. {{ newsDetail.content_person }}
  137. </span>
  138. </div>
  139. <div class="index_2_li clearfix">
  140. <label class="index_2_li_label">联系电话</label>
  141. <span class="index_2_li_text ">{{ newsDetail.telephone }}</span>
  142. </div>
  143. <div class="index_2_li clearfix">
  144. <label class="index_2_li_label">手 &nbsp;&nbsp;&nbsp;&nbsp; 机</label>
  145. <span class="index_2_li_text ">{{ newsDetail.mobile }}</span>
  146. </div>
  147. <div class="index_2_li clearfix">
  148. <label class="index_2_li_label">联系QQ</label>
  149. <span class="index_2_li_text ">{{ newsDetail.QQ }}</span>
  150. </div>
  151. <div class="index_2_li clearfix">
  152. <label class="index_2_li_label">传 &nbsp;&nbsp;&nbsp;&nbsp; 真</label>
  153. <span class="index_2_li_text ">{{ newsDetail.fax }}</span>
  154. </div>
  155. <div class="index_2_li clearfix">
  156. <label class="index_2_li_label">邮政编码</label>
  157. <span class="index_2_li_text ">{{ newsDetail.post_code }}</span>
  158. </div>
  159. <div class="index_2_li clearfix">
  160. <label class="index_2_li_label">网 &nbsp;&nbsp;&nbsp;&nbsp; 址</label>
  161. <span class="index_2_li_text ">{{ newsDetail.company_url }}</span>
  162. </div>
  163. <div class="index_2_li clearfix">
  164. <label class="index_2_li_label">地 &nbsp;&nbsp;&nbsp;&nbsp; 址</label>
  165. <span class="index_2_li_text ">{{ newsDetail.adress }}</span>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. </section>
  171. <section class="index_3 clearfix">
  172. <div class="info_2_head_box clearfix phone_none">
  173. <div class="info_2_head_left">
  174. <a class="info_2_head_a info_2_head_only" title="">详情信息</a>
  175. </div>
  176. </div>
  177. <div class="phone_box_1 pc_none">
  178. <div class="phone_box_head" >
  179. <NuxtLink class="" >
  180. 详情信息
  181. </NuxtLink>
  182. </div>
  183. </div>
  184. <div class="info_article" v-html="newsDetail.content"></div>
  185. </section>
  186. </section>
  187. </template>
  188. <script setup>
  189. import { ref } from 'vue'
  190. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  191. import { ArrowRight } from '@element-plus/icons-vue'
  192. //2.页面路径 start ---------------------------------------->
  193. const route = useRoute();
  194. const articleId = parseInt(route.params.id);
  195. const targetSegment = getRoutePath(1);
  196. const targetSegment1 = getRoutePath(2);
  197. const targetSegment2 = getRoutePath(3);
  198. // 2.1 查询一级栏目的id
  199. //通过导航路径反向查询导航id
  200. let routeId;
  201. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  202. method: 'GET',
  203. query: {
  204. 'pinyin': targetSegment,
  205. },
  206. });
  207. if (getRouteId.code == 200) {
  208. routeId = getRouteId.data.category_id
  209. } else {
  210. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  211. // console.log("错误位置:通过url路径查询导航池id")
  212. // console.log("后端错误反馈:", getRouteId.message)
  213. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  214. }
  215. // 2.2查询二级栏目的id及名称
  216. let routeName = ref('');
  217. let routeId1 = ref('');
  218. const getRoutePName = await requestDataPromise('/web/getWebsiteRoute', {
  219. method: 'GET',
  220. query: {
  221. 'pinyin': targetSegment + '/' + targetSegment1,
  222. },
  223. });
  224. if (getRoutePName.code == 200) {
  225. routeId1.value = getRoutePName.data.category_id;
  226. routeName.value = getRoutePName.data.alias;
  227. } else {
  228. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  229. // console.log("错误位置:通过url路径查询导航池id")
  230. // console.log("后端错误反馈:", getRouteId.message)
  231. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  232. }
  233. // 2.3 查询三级栏目的id及名称
  234. let routeName1 = ref('');
  235. let routeId11 = ref('');
  236. const getRoutePName1 = await requestDataPromise('/web/getWebsiteRoute', {
  237. method: 'GET',
  238. query: {
  239. 'pinyin': targetSegment + '/' + targetSegment1 + '/' + targetSegment2,
  240. },
  241. });
  242. if (getRoutePName1.code == 200) {
  243. routeId11.value = getRoutePName1.data.category_id;
  244. routeName1.value = getRoutePName1.data.alias;
  245. } else {
  246. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  247. // console.log("错误位置:通过url路径查询导航池id")
  248. // console.log("后端错误反馈:", getRouteId.message)
  249. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  250. }
  251. //2.页面路径 end ---------------------------------------->
  252. //3.面包屑 start ---------------------------------------->
  253. const parent_name = ref("");
  254. const parent_id = ref("");
  255. const parent_pinyin = ref("");
  256. let getParentNav = async () => {
  257. const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
  258. method: 'GET',
  259. query: {
  260. 'catid': routeId
  261. },
  262. });
  263. if (listData.code == 200) {
  264. parent_name.value = listData.data.alias;
  265. parent_id.value = listData.data.parent_id;
  266. parent_pinyin.value = listData.data.aLIas_pinyin;
  267. } else {
  268. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  269. // console.log("错误位置:获取面包屑导航")
  270. // console.log("后端错误反馈:", listData.message)
  271. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  272. }
  273. }
  274. //获得父级栏目详情
  275. getParentNav();
  276. //3.面包屑 end ------------------------------------------->
  277. //4.新闻详情 start ---------------------------------------->
  278. //4.1 资讯详情
  279. const newsDetail = ref({})
  280. const routeNewsTtitle = ref("");
  281. //4.2 发布日期
  282. const time = ref("");
  283. //4.3 路径
  284. const routLevelTitle = ref("");
  285. const routLevelId = ref("");
  286. //4.4 是否展示投票
  287. let detailImg = ref('');
  288. let seoTitle;
  289. let seoDescription;
  290. let seoKeywords;
  291. //4.5 获取详情
  292. const mkdata = await requestDataPromise('/web/getWebsiteCompanyInfo', {
  293. method: 'GET',
  294. query: {
  295. 'id': articleId
  296. },
  297. });
  298. if (mkdata.code == 200) {
  299. //获取内容
  300. newsDetail.value = mkdata.data;
  301. detailImg.value = JSON.parse(mkdata.data.imgurl);
  302. //修正标题长度
  303. if (newsDetail.value.title.length >= 20) {
  304. routeNewsTtitle.value = newsDetail.value.title.substr(0, 20) + "...";
  305. } else {
  306. routeNewsTtitle.value = newsDetail.value.title
  307. }
  308. //获取发布时间
  309. if (newsDetail.value.data) {
  310. time.value = newsDetail.value.data.split(' ')[0];
  311. }
  312. seoTitle = newsDetail.value.title;
  313. seoDescription = newsDetail.value.description;
  314. seoKeywords = newsDetail.value.keyword;
  315. } else {
  316. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  317. // console.log("错误位置:获取详情内容")
  318. // console.log("后端错误反馈:", mkdata.message)
  319. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  320. }
  321. //4.新闻详情 end ---------------------------------------->
  322. //5.设置seo信息 start---------------------------------------->
  323. const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
  324. method: 'GET',
  325. query: {
  326. 'catid': routeId1.value
  327. },
  328. });
  329. if (setData.code == 200) {
  330. let seoSuffix = setData.data.suffix;
  331. let seoName = setData.data.website_name;
  332. useSeoMeta({
  333. title: seoTitle + "_" + seoName + "_" + seoSuffix,
  334. meta: [
  335. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  336. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  337. { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no',tagPriority: 10 }
  338. ]
  339. });
  340. } else {
  341. console.log("设置频道页SEO出错!", setData.message)
  342. }
  343. //5.设置seo信息 end---------------------------------------->
  344. //6.广告 start ---------------------------------------->
  345. let adImg1 = ref([]);
  346. let adImg2 = ref([]);
  347. onMounted(async () => {
  348. const { $webUrl, $CwebUrl } = useNuxtApp();
  349. //广告1
  350. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_detail_0001`
  351. const responseAd1 = await fetch(url, {
  352. headers: {
  353. 'Content-Type': 'application/json',
  354. 'Userurl': $CwebUrl,
  355. 'Origin': $CwebUrl
  356. }
  357. });
  358. const resultAd1 = await responseAd1.json();
  359. adImg1.value = resultAd1.data[0];
  360. //广告2
  361. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nzgxw_detail_0002`
  362. const responseAd2 = await fetch(url2, {
  363. headers: {
  364. 'Content-Type': 'application/json',
  365. 'Userurl': $CwebUrl,
  366. 'Origin': $CwebUrl
  367. }
  368. });
  369. const resultAd2 = await responseAd2.json();
  370. adImg2.value = resultAd2.data[0];
  371. })
  372. //6.广告 end ---------------------------------------->
  373. </script>
  374. <style lang="less" scoped>
  375. @import url(@/assets/css/company/detail.less);
  376. </style>
  377. <style lang="less" scoped>
  378. @media screen and (min-width:801px){/*pc*/
  379. .pc_none{display:none;}
  380. }
  381. @media screen and (max-width:800px){/*ipad_phone*/
  382. .index_main{width:100%;margin:0px auto 30px;}
  383. .breadcrumb_box {
  384. height: 22px;
  385. width: 92%;
  386. margin: 10px auto;
  387. word-break: keep-all;
  388. white-space: nowrap;
  389. overflow: hidden;
  390. text-overflow: ellipsis;
  391. font-size: 14px;
  392. color: #666;
  393. * {
  394. font-size: 14px;
  395. display: inline;
  396. color: #666;
  397. line-height: 22px;
  398. height: 22px;
  399. margin-right: 5px;
  400. }
  401. }
  402. .phone_box_1{
  403. width:92%;margin:0px auto 0px;
  404. .phone_box_head{
  405. height:50px;line-height:50px;background:#fff;border-bottom:1px solid #E6E6E6;
  406. width:100%;
  407. a{
  408. float:left;height:50px;line-height:50px;margin:0;position:relative;
  409. text-indent:10px;
  410. color:#255590;font-size:18px; font-weight:bold;box-sizing:border-box;
  411. }
  412. a::after{
  413. content: '';display: block;
  414. position:absolute;left:0px;top:18px;background:#255590;
  415. width:3px;height:14px;
  416. }
  417. }
  418. }
  419. .phone_box_2{
  420. width:92%;margin:0px auto 0px;
  421. .phone_box_head{
  422. height:50px;line-height:50px;background:#fff;border-bottom:1px solid #E6E6E6;
  423. width:100%;
  424. a{
  425. float:left;height:50px;line-height:50px;margin:0;position:relative;
  426. text-indent:10px;
  427. color:#255590;font-size:18px; font-weight:bold;box-sizing:border-box;
  428. }
  429. a::after{
  430. content: '';display: block;
  431. position:absolute;left:0px;top:18px;background:#255590;
  432. width:3px;height:14px;
  433. }
  434. }
  435. }
  436. .index_2{width:100%;margin:10px auto 0px;}
  437. .index_2_img{max-width:92%;height:302px;width:auto;
  438. margin:0px auto 0px;float:none;display:block;border-radius:8px;}
  439. .index_2_right{width:92%;float:none;margin:0px auto;}
  440. .index_2_h4{font-size:16px;color:#333;line-height:26px; padding:0;border:0px;
  441. white-space:unset;word-break:unset;margin-top:11px;
  442. }
  443. .index_2_title{font-size:14px;margin-right:10px;}
  444. .index_2_ul{ height:auto;}
  445. .index_2_li{margin-bottom:20px;width:49%;}
  446. .index_2_li:nth-of-type(odd){float:left;}
  447. .index_2_li:nth-of-type(even){float:right;}
  448. .index_2_li:nth-last-of-type(1){width:100%; }
  449. .index_2_li:nth-last-of-type(2){width:100%; }
  450. .index_2_li:nth-of-type(1){width:100%; }
  451. .index_2_li:nth-of-type(2){width:100%; }
  452. .index_2_li .index_2_li_label{line-height:18px;height:18px;font-size:14px;min-width:auto;margin-right:8px;}
  453. .index_2_li .index_2_li_text{
  454. line-height:18px;font-size:14px;flex:1;
  455. word-wrap: break-word;
  456. overflow-wrap: break-word;
  457. white-space: pre-wrap;
  458. word-break: break-all;
  459. }
  460. .index_2_ul .index_2_ul_left{width:100%;overflow:hidden;float:none;}
  461. .info_article{ font-size:16px!important;line-height:26px!important;margin:15px auto 0!important;width:92%!important;}
  462. .info_article::v-deep *{ font-size:16px!important;line-height:26px!important; }
  463. .phone_none{display:none;}
  464. }
  465. </style>